From 692cdb3dbecebdff7f3c49e9d571829441926fbd Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 18 Feb 2004 12:30:40 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'before-merge-3_4-csl-arm'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/before-merge-3_4-csl-arm@78026 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 61 + MAINTAINERS | 7 +- Makefile.in | 88 +- Makefile.tpl | 10 +- boehm-gc/ChangeLog | 4 + boehm-gc/include/private/gcconfig.h | 11 +- boehm-gc/install-sh | 34 +- boehm-gc/libtool.m4 | 3504 +-- boehm-gc/mkinstalldirs | 81 +- config.sub | 12 +- configure | 71 +- configure.in | 5 +- contrib/ChangeLog | 25 + contrib/gcc_update | 22 +- fastjar/.cvsignore | 3 - fastjar/ChangeLog | 23 + fastjar/Makefile.am | 37 +- fastjar/Makefile.in | 889 +- fastjar/aclocal.m4 | 924 +- fastjar/config.h.in | 103 +- fastjar/configure | 6510 +++-- fastjar/install-sh | 8 - fastjar/missing | 190 - fastjar/mkinstalldirs | 111 - fastjar/stamp-h.in | 1 - gcc/.cvsignore | 7 - gcc/ChangeLog | 4439 +++- gcc/ChangeLog.7 | 2 +- gcc/Makefile.in | 283 +- gcc/README.Portability | 214 +- gcc/aclocal.m4 | 51 +- gcc/ada/.cvsignore | 6 - gcc/ada/35soccon.ads | 158 + gcc/ada/3ssoliop.ads | 2 +- gcc/ada/3vtrasym.adb | 271 +- gcc/ada/45intnam.ads | 136 + gcc/ada/52osinte.ads | 2 + gcc/ada/53osinte.ads | 4 +- gcc/ada/54osinte.ads | 4 +- gcc/ada/55osinte.adb | 108 + gcc/ada/55osinte.ads | 632 + gcc/ada/55system.ads | 4 +- gcc/ada/56osinte.ads | 2 + gcc/ada/56system.ads | 150 + gcc/ada/5aml-tgt.adb | 2 + gcc/ada/5asystem.ads | 4 +- gcc/ada/5bml-tgt.adb | 10 +- gcc/ada/5bosinte.ads | 3 +- gcc/ada/5cosinte.ads | 2 + gcc/ada/5gml-tgt.adb | 2 + gcc/ada/5gsystem.ads | 2 +- gcc/ada/5hml-tgt.adb | 2 + gcc/ada/5hosinte.ads | 1 + gcc/ada/5iosinte.ads | 2 + gcc/ada/5lintman.adb | 401 - gcc/ada/5lml-tgt.adb | 2 + gcc/ada/5losinte.ads | 4 +- gcc/ada/5nsystem.ads | 150 + gcc/ada/5posinte.ads | 6 +- gcc/ada/5sml-tgt.adb | 2 + gcc/ada/5tosinte.ads | 4 +- gcc/ada/5vml-tgt.adb | 117 +- gcc/ada/5vsymbol.adb | 243 +- gcc/ada/5vtraent.adb | 19 +- gcc/ada/5vtraent.ads | 29 +- gcc/ada/5wml-tgt.adb | 2 + gcc/ada/5wosinte.ads | 2 + gcc/ada/5wsystem.ads | 2 +- gcc/ada/5wtaprop.adb | 14 +- gcc/ada/5ytiitho.adb | 66 - gcc/ada/5zinit.adb | 72 +- gcc/ada/5zintman.adb | 65 +- gcc/ada/5zintman.ads | 123 + gcc/ada/5zml-tgt.adb | 2 + gcc/ada/5ztaprop.adb | 15 +- gcc/ada/5zthrini.adb | 113 - gcc/ada/5ztiitho.adb | 52 - gcc/ada/6vcstrea.adb | 18 +- gcc/ada/7sinmaop.adb | 13 +- gcc/ada/7sintman.adb | 15 +- gcc/ada/7sosprim.adb | 6 +- gcc/ada/ChangeLog | 1776 ++ gcc/ada/Make-lang.in | 3873 +-- gcc/ada/Makefile.generic | 6 +- gcc/ada/Makefile.in | 361 +- gcc/ada/Makefile.prolog | 1 + gcc/ada/Makefile.rtl | 5 +- gcc/ada/a-direio.adb | 3 + gcc/ada/a-elchha.adb | 165 + gcc/ada/a-elchha.ads | 46 + gcc/ada/a-except.adb | 2 + gcc/ada/a-exexda.adb | 29 +- gcc/ada/a-exextr.adb | 101 +- gcc/ada/a-sequio.adb | 5 +- gcc/ada/a-ststio.adb | 6 +- gcc/ada/a-textio.adb | 3 + gcc/ada/a-tiinau.adb | 5 + gcc/ada/a-witeio.adb | 5 +- gcc/ada/ada-tree.def | 10 +- gcc/ada/ada-tree.h | 32 +- gcc/ada/adadecode.c | 31 +- gcc/ada/adaint.c | 61 +- gcc/ada/adaint.h | 1 + gcc/ada/argv.c | 20 +- gcc/ada/atree.adb | 58 +- gcc/ada/aux-io.c | 61 +- gcc/ada/back_end.adb | 8 +- gcc/ada/bindgen.adb | 35 +- gcc/ada/bld-io.adb | 16 +- gcc/ada/bld.adb | 31 +- gcc/ada/cal.c | 4 +- gcc/ada/checks.adb | 25 +- gcc/ada/cio.c | 19 +- gcc/ada/comperr.adb | 29 +- gcc/ada/cstand.adb | 319 +- gcc/ada/cstreams.c | 16 +- gcc/ada/ctrl_c.c | 4 +- gcc/ada/cuintp.c | 6 +- gcc/ada/debug.adb | 4 +- gcc/ada/decl.c | 348 +- gcc/ada/einfo.adb | 34 +- gcc/ada/einfo.ads | 42 +- gcc/ada/einfo.h | 1814 -- gcc/ada/errno.c | 7 +- gcc/ada/errout.adb | 6 + gcc/ada/exit.c | 5 +- gcc/ada/exp_aggr.adb | 618 +- gcc/ada/exp_attr.adb | 5 +- gcc/ada/exp_ch3.adb | 64 +- gcc/ada/exp_ch3.ads | 19 +- gcc/ada/exp_ch4.adb | 111 +- gcc/ada/exp_ch5.adb | 176 +- gcc/ada/exp_ch6.adb | 221 +- gcc/ada/exp_ch7.adb | 80 +- gcc/ada/exp_ch9.adb | 215 +- gcc/ada/exp_ch9.ads | 11 +- gcc/ada/exp_disp.adb | 3 +- gcc/ada/exp_util.adb | 2 +- gcc/ada/expect.c | 8 +- gcc/ada/final.c | 2 +- gcc/ada/fmap.adb | 2 +- gcc/ada/freeze.adb | 70 +- gcc/ada/g-awk.adb | 10 +- gcc/ada/g-debpoo.adb | 3 +- gcc/ada/g-debuti.adb | 16 +- gcc/ada/g-dirope.adb | 8 +- gcc/ada/g-memdum.adb | 2 +- gcc/ada/g-os_lib.adb | 107 +- gcc/ada/g-os_lib.ads | 57 +- gcc/ada/g-signal.adb | 71 + gcc/ada/g-signal.ads | 55 + gcc/ada/g-socket.ads | 15 +- gcc/ada/g-spipat.adb | 48 +- gcc/ada/g-table.adb | 4 +- gcc/ada/g-thread.adb | 12 +- gcc/ada/gigi.h | 304 +- gcc/ada/gmem.c | 5 +- gcc/ada/gnat1drv.adb | 2 + gcc/ada/gnat_ug.texi | 2 +- gcc/ada/gnat_ug_unx.texi | 2 +- gcc/ada/gnat_ug_vms.texi | 2 +- gcc/ada/gnat_ug_vxw.texi | 2 +- gcc/ada/gnat_ug_wnt.texi | 2 +- gcc/ada/gnat_wrapper.adb | 121 - gcc/ada/gnatbind.adb | 2 +- gcc/ada/gnatbl.c | 23 +- gcc/ada/gnatchop.adb | 55 +- gcc/ada/gnatlbr.adb | 12 +- gcc/ada/gnatlink.adb | 23 +- gcc/ada/gnatmem.adb | 2 +- gcc/ada/gnatpsta.adb | 373 - gcc/ada/gnatsym.adb | 76 +- gcc/ada/gnatvsn.adb | 9 + gcc/ada/gnatvsn.ads | 29 +- gcc/ada/gnatxref.adb | 13 +- gcc/ada/gprcmd.adb | 52 +- gcc/ada/i-cstrea.adb | 4 +- gcc/ada/i-cstrea.ads | 102 +- gcc/ada/i-vthrea.adb | 386 - gcc/ada/i-vthrea.ads | 93 - gcc/ada/impunit.adb | 1 + gcc/ada/init.c | 366 +- gcc/ada/itypes.adb | 5 +- gcc/ada/lang-specs.h | 1 + gcc/ada/lang.opt | 6 +- gcc/ada/lib-load.adb | 28 +- gcc/ada/lib-writ.adb | 17 +- gcc/ada/lib.adb | 31 +- gcc/ada/lib.ads | 26 +- gcc/ada/link.c | 9 + gcc/ada/make.adb | 223 +- gcc/ada/mdll-utl.adb | 6 +- gcc/ada/misc.c | 138 +- gcc/ada/mkdir.c | 3 +- gcc/ada/mlib-prj.adb | 46 +- gcc/ada/mlib-tgt.adb | 2 + gcc/ada/mlib-tgt.ads | 21 +- gcc/ada/nmake.adb | 2858 --- gcc/ada/nmake.ads | 1347 -- gcc/ada/opt.adb | 7 +- gcc/ada/opt.ads | 5 + gcc/ada/osint.adb | 268 +- gcc/ada/osint.ads | 19 + gcc/ada/output.adb | 10 +- gcc/ada/par-ch10.adb | 13 +- gcc/ada/par-ch12.adb | 8 +- gcc/ada/par-ch13.adb | 4 +- gcc/ada/par-ch2.adb | 4 +- gcc/ada/par-ch3.adb | 24 +- gcc/ada/par-ch4.adb | 53 +- gcc/ada/par-ch5.adb | 4 +- gcc/ada/par-ch6.adb | 14 +- gcc/ada/par-ch9.adb | 20 +- gcc/ada/par-load.adb | 66 +- gcc/ada/par-prag.adb | 1 + gcc/ada/par-util.adb | 87 +- gcc/ada/par.adb | 85 +- gcc/ada/prj-attr.adb | 3 + gcc/ada/prj-dect.adb | 32 + gcc/ada/prj-env.adb | 23 +- gcc/ada/prj-env.ads | 22 +- gcc/ada/prj-nmsc.adb | 367 +- gcc/ada/prj-part.adb | 448 +- gcc/ada/prj-part.ads | 6 +- gcc/ada/prj-pp.adb | 133 +- gcc/ada/prj-proc.adb | 120 +- gcc/ada/prj-tree.adb | 967 +- gcc/ada/prj-tree.ads | 342 +- gcc/ada/prj.adb | 20 +- gcc/ada/prj.ads | 45 +- gcc/ada/raise.c | 105 +- gcc/ada/rtsfind.adb | 5 +- gcc/ada/rtsfind.ads | 13 + gcc/ada/s-crtl.ads | 159 + gcc/ada/s-direio.adb | 6 +- gcc/ada/s-exnint.adb | 6 +- gcc/ada/s-exnint.ads | 5 +- gcc/ada/s-fileio.adb | 7 + gcc/ada/s-geveop.adb | 6 +- gcc/ada/s-interr.adb | 4 +- gcc/ada/s-memcop.ads | 28 +- gcc/ada/s-memory.adb | 21 +- gcc/ada/s-rident.ads | 1 + gcc/ada/s-stache.adb | 23 +- gcc/ada/s-tasdeb.adb | 20 +- gcc/ada/s-taskin.adb | 4 +- gcc/ada/s-tassta.adb | 3 +- gcc/ada/s-thread.adb | 69 +- gcc/ada/s-thread.ads | 93 +- gcc/ada/s-tpae65.adb | 87 - gcc/ada/s-tpae65.ads | 54 - gcc/ada/scans.ads | 18 +- gcc/ada/scn.adb | 24 +- gcc/ada/scng.adb | 29 +- gcc/ada/scng.ads | 6 +- gcc/ada/sem_aggr.adb | 229 +- gcc/ada/sem_attr.adb | 40 +- gcc/ada/sem_cat.adb | 2 +- gcc/ada/sem_ch10.adb | 568 +- gcc/ada/sem_ch12.adb | 142 +- gcc/ada/sem_ch13.adb | 226 +- gcc/ada/sem_ch13.ads | 9 +- gcc/ada/sem_ch3.adb | 97 +- gcc/ada/sem_ch4.adb | 17 +- gcc/ada/sem_ch5.adb | 111 +- gcc/ada/sem_ch6.adb | 142 +- gcc/ada/sem_ch8.adb | 44 +- gcc/ada/sem_ch8.ads | 8 +- gcc/ada/sem_ch9.adb | 1 + gcc/ada/sem_elab.adb | 83 +- gcc/ada/sem_prag.adb | 129 +- gcc/ada/sem_res.adb | 64 +- gcc/ada/sem_type.adb | 19 +- gcc/ada/sem_util.adb | 10 +- gcc/ada/sem_warn.adb | 8 +- gcc/ada/sinfo.adb | 29 + gcc/ada/sinfo.ads | 62 +- gcc/ada/sinfo.h | 840 - gcc/ada/sinput-p.adb | 5 +- gcc/ada/sinput.adb | 20 +- gcc/ada/snames.adb | 8 +- gcc/ada/snames.ads | 1191 +- gcc/ada/snames.h | 25 +- gcc/ada/socket.c | 41 +- gcc/ada/sprint.adb | 29 +- gcc/ada/stamp-xgnatug | 1 + gcc/ada/stringt.h | 12 +- gcc/ada/switch-c.adb | 45 +- gcc/ada/symbols.adb | 14 +- gcc/ada/symbols.ads | 26 +- gcc/ada/sysdep.c | 118 +- gcc/ada/targparm.ads | 6 - gcc/ada/targtyps.c | 45 +- gcc/ada/tb-alvms.c | 293 +- gcc/ada/tb-alvxw.c | 92 +- gcc/ada/tracebak.c | 17 +- gcc/ada/trans.c | 292 +- gcc/ada/treeprs.ads | 796 - gcc/ada/types.ads | 7 +- gcc/ada/usage.adb | 7 +- gcc/ada/utils.c | 337 +- gcc/ada/utils2.c | 178 +- gcc/ada/vms_conv.adb | 1321 +- gcc/ada/vms_conv.ads | 9 +- gcc/ada/vms_data.ads | 53 +- gcc/ada/xref_lib.adb | 35 +- gcc/alias.c | 2 +- gcc/alloc-pool.c | 2 +- gcc/basic-block.h | 57 +- gcc/bb-reorder.c | 22 +- gcc/bitmap.c | 2 +- gcc/bitmap.h | 2 +- gcc/bt-load.c | 27 +- gcc/builtins.c | 67 +- gcc/c-common.c | 96 +- gcc/c-common.h | 21 +- gcc/c-cppbuiltin.c | 18 +- gcc/c-decl.c | 304 +- gcc/c-format.c | 30 +- gcc/c-incpath.c | 4 +- gcc/c-objc-common.c | 38 +- gcc/c-opts.c | 41 +- gcc/c-parse.in | 90 +- gcc/c-pch.c | 33 +- gcc/c-pragma.c | 2 +- gcc/c-pretty-print.c | 10 +- gcc/c-semantics.c | 4 +- gcc/c-tree.h | 29 +- gcc/c-typeck.c | 69 +- gcc/caller-save.c | 18 +- gcc/calls.c | 159 +- gcc/cfg.c | 4 +- gcc/cfganal.c | 26 +- gcc/cfgbuild.c | 21 +- gcc/cfgcleanup.c | 154 +- gcc/cfghooks.h | 2 +- gcc/cfglayout.c | 50 +- gcc/cfglayout.h | 4 +- gcc/cfgloop.c | 43 +- gcc/cfgloop.h | 17 +- gcc/cfgloopanal.c | 375 +- gcc/cfgloopmanip.c | 139 +- gcc/cfgrtl.c | 308 +- gcc/cgraph.c | 85 +- gcc/cgraph.h | 4 +- gcc/cgraphunit.c | 20 +- gcc/collect2.c | 367 +- gcc/combine.c | 77 +- gcc/common.opt | 32 +- gcc/config.gcc | 70 +- gcc/config.guess | 4 - gcc/config.in | 12 +- gcc/config/alpha/alpha-modes.def | 2 +- gcc/config/alpha/alpha-protos.h | 1 - gcc/config/alpha/alpha.c | 78 +- gcc/config/alpha/alpha.h | 6 +- gcc/config/alpha/alpha.md | 30 +- gcc/config/alpha/elf.h | 6 +- gcc/config/alpha/gnu.h | 5 +- gcc/config/alpha/lib1funcs.asm | 2 +- gcc/config/alpha/linux.h | 2 + gcc/config/alpha/openbsd.h | 2 +- gcc/config/alpha/osf.h | 7 + gcc/config/alpha/unicosmk.h | 6 +- gcc/config/alpha/vms-cc.c | 10 +- gcc/config/alpha/vms-crt0-64.c | 2 +- gcc/config/alpha/vms-crt0.c | 2 +- gcc/config/alpha/vms-ld.c | 12 +- gcc/config/alpha/vms-psxcrt0-64.c | 2 +- gcc/config/alpha/vms-psxcrt0.c | 2 +- gcc/config/alpha/vms.h | 6 +- gcc/config/arc/arc-protos.h | 81 +- gcc/config/arc/arc.c | 229 +- gcc/config/arc/arc.h | 1 - gcc/config/arc/initfini.c | 8 +- gcc/config/arm/aof.h | 27 +- gcc/config/arm/aout.h | 27 +- gcc/config/arm/arm-cores.def | 87 + gcc/config/arm/arm-generic.md | 152 + gcc/config/arm/arm-modes.def | 2 +- gcc/config/arm/arm-protos.h | 23 +- gcc/config/arm/arm.c | 1849 +- gcc/config/arm/arm.h | 424 +- gcc/config/arm/arm.md | 1554 +- gcc/config/arm/arm1026ejs.md | 241 + gcc/config/arm/arm1136jfs.md | 377 + gcc/config/arm/arm926ejs.md | 188 + gcc/config/arm/cirrus.md | 88 +- gcc/config/arm/elf.h | 4 +- gcc/config/arm/fpa.md | 172 +- gcc/config/arm/iwmmxt.md | 18 +- gcc/config/arm/lib1funcs.asm | 48 +- gcc/config/arm/linux-elf.h | 14 +- gcc/config/arm/netbsd-elf.h | 13 +- gcc/config/arm/pe.h | 8 +- gcc/config/arm/semi.h | 3 +- gcc/config/arm/vfp.md | 744 + gcc/config/arm/vxworks.h | 2 +- gcc/config/avr/avr.c | 77 +- gcc/config/avr/avr.h | 35 +- gcc/config/avr/avr.md | 4 +- gcc/config/c4x/c4x.c | 2 +- gcc/config/c4x/c4x.md | 8 +- gcc/config/cris/cris.h | 6 +- gcc/config/cris/cris.md | 6 +- gcc/config/cris/linux.h | 8 +- gcc/config/d30v/d30v-protos.h | 177 +- gcc/config/d30v/d30v.c | 25 +- gcc/config/d30v/d30v.h | 7 - gcc/config/darwin-protos.h | 1 + gcc/config/darwin.c | 26 +- gcc/config/darwin.h | 9 +- gcc/config/dsp16xx/dsp16xx-protos.h | 112 +- gcc/config/dsp16xx/dsp16xx.c | 12 +- gcc/config/dsp16xx/dsp16xx.h | 2 - gcc/config/elfos.h | 4 - gcc/config/fr30/fr30-protos.h | 38 +- gcc/config/fr30/fr30.c | 99 +- gcc/config/fr30/fr30.h | 2 +- gcc/config/fr30/fr30.md | 2 +- gcc/config/frv/frv-protos.h | 315 +- gcc/config/frv/frv.c | 1062 +- gcc/config/frv/frv.h | 15 +- gcc/config/frv/frv.md | 52 +- gcc/config/frv/frvbegin.c | 10 +- gcc/config/gnu.h | 12 + gcc/config/h8300/h8300-protos.h | 1 + gcc/config/h8300/h8300.c | 36 +- gcc/config/h8300/h8300.h | 36 +- gcc/config/h8300/h8300.md | 525 +- gcc/config/h8300/lib1funcs.asm | 164 +- gcc/config/h8300/t-h8300 | 3 - gcc/config/i370/i370-protos.h | 40 +- gcc/config/i370/i370.c | 22 +- gcc/config/i370/linux.h | 8 +- gcc/config/i386/athlon.md | 4 +- gcc/config/i386/cygming.h | 4 +- gcc/config/i386/gnu.h | 9 +- gcc/config/i386/i386-interix.h | 14 +- gcc/config/i386/i386-modes.def | 16 +- gcc/config/i386/i386-protos.h | 1 - gcc/config/i386/i386.c | 334 +- gcc/config/i386/i386.h | 123 +- gcc/config/i386/i386.md | 1380 +- gcc/config/i386/i386elf.h | 8 +- gcc/config/i386/linux-aout.h | 5 +- gcc/config/i386/linux.h | 5 +- gcc/config/i386/linux64.h | 5 +- gcc/config/i386/ptx4-i.h | 8 +- gcc/config/i386/sco5.h | 3 +- gcc/config/i386/scodbx.h | 84 - gcc/config/i386/sysv4.h | 8 +- gcc/config/i386/x86-64.h | 1 - gcc/config/i386/xm-dgux.h | 4 - gcc/config/i386/xm-sun.h | 21 - gcc/config/i386/xm-sysv3.h | 3 - gcc/config/i860/i860-protos.h | 4 - gcc/config/i860/i860.c | 8 +- gcc/config/i860/i860.h | 4 - gcc/config/i960/i960-protos.h | 117 +- gcc/config/i960/i960.c | 28 +- gcc/config/i960/i960.h | 4 - gcc/config/ia64/fde-glibc.c | 4 +- gcc/config/ia64/hpux.h | 6 + gcc/config/ia64/ia64.c | 273 +- gcc/config/ia64/ia64.h | 33 +- gcc/config/ia64/ia64.md | 488 +- gcc/config/ia64/linux.h | 103 +- gcc/config/ia64/sysv4.h | 4 +- gcc/config/ia64/t-ia64 | 2 +- gcc/config/ia64/unwind-ia64.c | 150 +- gcc/config/ip2k/ip2k-protos.h | 103 +- gcc/config/ip2k/ip2k.c | 326 +- gcc/config/ip2k/ip2k.md | 2 +- gcc/config/iq2000/iq2000-protos.h | 62 +- gcc/config/iq2000/iq2000.c | 712 +- gcc/config/iq2000/iq2000.h | 497 +- gcc/config/kfreebsdgnu.h | 2 +- gcc/config/linux.h | 10 + gcc/config/m32r/m32r-protos.h | 115 +- gcc/config/m32r/m32r.c | 549 +- gcc/config/m32r/m32r.h | 50 +- gcc/config/m32r/m32r.md | 53 +- gcc/config/m32r/t-m32r | 6 +- gcc/config/m68hc11/m68hc11-protos.h | 186 +- gcc/config/m68hc11/m68hc11.c | 442 +- gcc/config/m68hc11/m68hc11.h | 2 +- gcc/config/m68k/linux.h | 6 +- gcc/config/m68k/m68k.c | 992 +- gcc/config/m68k/m68k.h | 25 +- gcc/config/m68k/m68k.md | 685 +- gcc/config/m68k/m68kelf.h | 9 - gcc/config/m68k/netbsd-elf.h | 3 - gcc/config/m68k/rtemself.h | 2 - gcc/config/m68k/uclinux.h | 4 +- gcc/config/mcore/mcore-elf.h | 3 - gcc/config/mips/_tilib.c | 2 +- gcc/config/mips/iris6.h | 29 +- gcc/config/mips/iris6gld.h | 11 +- gcc/config/mips/irix6-crti.asm | 33 + gcc/config/mips/irix6-crtn.asm | 27 + gcc/config/mips/irix6-libc-compat.c | 82 - gcc/config/mips/linux.h | 5 +- gcc/config/mips/mips-protos.h | 9 +- gcc/config/mips/mips.c | 1745 +- gcc/config/mips/mips.h | 27 +- gcc/config/mips/mips.md | 234 +- gcc/config/mips/t-iris6 | 10 +- gcc/config/mips/t-iris6gld | 9 + gcc/config/mn10300/linux.h | 11 +- gcc/config/mn10300/mn10300-protos.h | 60 +- gcc/config/mn10300/mn10300.c | 135 +- gcc/config/netware.h | 1 - gcc/config/ns32k/ns32k-protos.h | 32 +- gcc/config/ns32k/ns32k.c | 116 +- gcc/config/ns32k/ns32k.h | 9 +- gcc/config/pa/pa-linux.h | 10 +- gcc/config/pa/pa-protos.h | 8 +- gcc/config/pa/pa.c | 685 +- gcc/config/pa/pa.h | 592 +- gcc/config/pa/pa.md | 1910 +- gcc/config/pa/som.h | 6 +- gcc/config/ptx4.h | 1 - gcc/config/rs6000/aix.h | 5 + gcc/config/rs6000/altivec.h | 8 +- gcc/config/rs6000/altivec.md | 90 +- gcc/config/rs6000/darwin.h | 8 +- gcc/config/rs6000/linux64.h | 6 +- gcc/config/rs6000/rs6000-protos.h | 11 +- gcc/config/rs6000/rs6000.c | 1140 +- gcc/config/rs6000/rs6000.h | 168 +- gcc/config/rs6000/rs6000.md | 448 +- gcc/config/rs6000/sysv4.h | 78 +- gcc/config/rs6000/t-darwin | 1 + gcc/config/s390/linux.h | 6 +- gcc/config/s390/s390-protos.h | 11 +- gcc/config/s390/s390.c | 644 +- gcc/config/s390/s390.h | 56 +- gcc/config/s390/s390.md | 581 +- gcc/config/sh/linux.h | 2 + gcc/config/sh/netbsd-elf.h | 2 + gcc/config/sh/sh-protos.h | 6 +- gcc/config/sh/sh.c | 136 +- gcc/config/sh/sh.h | 10 +- gcc/config/sh/sh.md | 75 +- gcc/config/sol2.h | 7 +- gcc/config/sparc/linux.h | 1 + gcc/config/sparc/linux64.h | 5 +- gcc/config/sparc/liteelf.h | 1 - gcc/config/sparc/sol2-bi.h | 20 +- gcc/config/sparc/sol2-gld-bi.h | 25 + gcc/config/sparc/sol2-gld.h | 3 + gcc/config/sparc/sol2.h | 4 + gcc/config/sparc/sol26-sld.h | 7 +- gcc/config/sparc/sp86x-elf.h | 1 - gcc/config/sparc/sparc-protos.h | 14 +- gcc/config/sparc/sparc.c | 408 +- gcc/config/sparc/sparc.h | 8 +- gcc/config/sparc/sparc.md | 4 +- gcc/config/stormy16/stormy16-protos.h | 1 - gcc/config/stormy16/stormy16.c | 7 +- gcc/config/stormy16/stormy16.h | 5 - gcc/config/t-darwin | 2 + gcc/config/t-libunwind | 6 +- gcc/config/t-slibgcc-darwin | 30 + gcc/config/v850/v850.c | 6 +- gcc/config/v850/v850.h | 2 +- gcc/config/v850/v850.md | 14 +- gcc/config/vax/vax.c | 3 +- gcc/config/vax/vax.h | 18 +- gcc/config/vxlib.c | 2 +- gcc/config/vxworks.h | 1 - gcc/config/xtensa/elf.h | 2 +- gcc/config/xtensa/linux.h | 8 +- gcc/config/xtensa/xtensa-protos.h | 3 +- gcc/config/xtensa/xtensa.c | 78 +- gcc/config/xtensa/xtensa.h | 70 +- gcc/configure | 863 +- gcc/configure.in | 110 +- gcc/conflict.c | 6 +- gcc/coverage.c | 52 +- gcc/cp/ChangeLog | 754 +- gcc/cp/ChangeLog.1 | 4 +- gcc/cp/ChangeLog.2 | 6 +- gcc/cp/Make-lang.in | 61 +- gcc/cp/call.c | 154 +- gcc/cp/class.c | 83 +- gcc/cp/cp-lang.c | 14 +- gcc/cp/cp-tree.h | 72 +- gcc/cp/cvt.c | 26 +- gcc/cp/cxx-pretty-print.c | 6 +- gcc/cp/decl.c | 344 +- gcc/cp/decl2.c | 69 +- gcc/cp/dump.c | 5 - gcc/cp/error.c | 14 +- gcc/cp/except.c | 11 +- gcc/cp/expr.c | 4 +- gcc/cp/friend.c | 102 +- gcc/cp/g++spec.c | 7 - gcc/cp/init.c | 89 +- gcc/cp/lex.c | 35 +- gcc/cp/mangle.c | 205 +- gcc/cp/method.c | 26 +- gcc/cp/name-lookup.c | 183 +- gcc/cp/name-lookup.h | 4 +- gcc/cp/optimize.c | 1 + gcc/cp/parser.c | 1507 +- gcc/cp/pt.c | 301 +- gcc/cp/ptree.c | 2 + gcc/cp/repo.c | 14 +- gcc/cp/rtti.c | 2 +- gcc/cp/search.c | 14 +- gcc/cp/semantics.c | 79 +- gcc/cp/tree.c | 99 +- gcc/cp/typeck.c | 149 +- gcc/cp/typeck2.c | 23 +- gcc/cppcharset.c | 58 +- gcc/cpperror.c | 20 +- gcc/cppexp.c | 61 +- gcc/cppfiles.c | 84 +- gcc/cpphash.h | 2 +- gcc/cppinit.c | 17 +- gcc/cpplex.c | 36 +- gcc/cpplib.c | 129 +- gcc/cpplib.h | 22 +- gcc/cppmacro.c | 50 +- gcc/cpppch.c | 19 +- gcc/cpptrad.c | 24 +- gcc/crtstuff.c | 14 +- gcc/cse.c | 14 + gcc/dbxout.c | 27 +- gcc/dbxstclass.h | 17 - gcc/defaults.h | 17 +- gcc/df.c | 46 +- gcc/diagnostic.c | 2 +- gcc/doc/.cvsignore | 7 - gcc/doc/c-tree.texi | 23 +- gcc/doc/contrib.texi | 15 +- gcc/doc/cpp.texi | 2 +- gcc/doc/cppopts.texi | 2 - gcc/doc/extend.texi | 104 +- gcc/doc/gcov.texi | 32 +- gcc/doc/gty.texi | 29 +- gcc/doc/include/gcc-common.texi | 4 +- gcc/doc/install-old.texi | 523 +- gcc/doc/install.texi | 137 +- gcc/doc/invoke.texi | 465 +- gcc/doc/makefile.texi | 5 +- gcc/doc/md.texi | 56 +- gcc/doc/passes.texi | 51 - gcc/doc/sourcebuild.texi | 45 +- gcc/doc/tm.texi | 68 +- gcc/dojump.c | 15 +- gcc/dominance.c | 346 +- gcc/doschk.c | 360 - gcc/dwarf2out.c | 221 +- gcc/dwarfout.c | 6396 ----- gcc/emit-rtl.c | 333 +- gcc/et-forest.c | 1090 +- gcc/et-forest.h | 44 +- gcc/except.c | 6 +- gcc/explow.c | 2 +- gcc/expmed.c | 28 +- gcc/expr.c | 191 +- gcc/expr.h | 1 + gcc/f/.cvsignore | 2 - gcc/f/ChangeLog | 63 + gcc/f/Make-lang.in | 67 +- gcc/f/com.c | 34 +- gcc/f/expr.c | 18 - gcc/f/intdoc.in | 4 +- gcc/f/intdoc.texi | 4 +- gcc/final.c | 39 +- gcc/fix-header.c | 2 +- gcc/fixinc/fixincl.x | 100 +- gcc/fixinc/inclhack.def | 38 +- gcc/fixinc/tests/base/wchar.h | 15 + gcc/flags.h | 4 - gcc/flow.c | 232 +- gcc/fold-const.c | 40 +- gcc/function.c | 239 +- gcc/function.h | 20 +- gcc/future.options | 40 - gcc/gcc.c | 57 +- gcc/gcov.c | 2 +- gcc/gcse.c | 313 +- gcc/genattrtab.c | 552 +- gcc/genautomata.c | 2 +- gcc/genemit.c | 16 +- gcc/gengtype-lex.l | 4 +- gcc/gengtype.c | 8 +- gcc/genmodes.c | 74 +- gcc/genmultilib | 7 + gcc/genrecog.c | 20 +- gcc/gensupport.c | 4 +- gcc/ggc-common.c | 8 +- gcc/ggc-page.c | 51 +- gcc/ggc-simple.c | 14 + gcc/ggc-zone.c | 203 +- gcc/ggc.h | 13 +- gcc/ginclude/stddef.h | 21 +- gcc/global.c | 56 +- gcc/graph.c | 35 +- gcc/haifa-sched.c | 25 +- gcc/ifcvt.c | 248 +- gcc/integrate.c | 3 + gcc/java/.cvsignore | 10 - gcc/java/ChangeLog | 254 +- gcc/java/Make-lang.in | 143 +- gcc/java/class.c | 6 +- gcc/java/constants.c | 20 +- gcc/java/decl.c | 59 +- gcc/java/except.c | 20 +- gcc/java/expr.c | 7 +- gcc/java/gjavah.c | 8 +- gcc/java/java-tree.h | 20 +- gcc/java/jcf-dump.c | 2 +- gcc/java/jcf-io.c | 4 +- gcc/java/jcf-parse.c | 18 +- gcc/java/jcf-write.c | 10 +- gcc/java/keyword.h | 10 +- gcc/java/lang.c | 31 +- gcc/java/lex.h | 2 +- gcc/java/parse.y | 428 +- gcc/java/resource.c | 6 +- gcc/java/typeck.c | 6 +- gcc/java/verify.c | 5 +- gcc/langhooks-def.h | 2 +- gcc/langhooks.c | 4 +- gcc/langhooks.h | 2 +- gcc/lcm.c | 14 +- gcc/libgcc-darwin.ver | 213 + gcc/libgcc2.c | 223 +- gcc/libgcc2.h | 6 +- gcc/line-map.c | 6 +- gcc/line-map.h | 14 +- gcc/local-alloc.c | 28 +- gcc/longlong.h | 2 +- gcc/loop-init.c | 5 +- gcc/loop-unroll.c | 80 +- gcc/loop-unswitch.c | 31 +- gcc/loop.c | 91 +- gcc/machmode.def | 12 +- gcc/machmode.h | 12 +- gcc/mklibgcc.in | 11 +- gcc/objc/.cvsignore | 2 - gcc/objc/Make-lang.in | 8 +- gcc/objc/objc-act.c | 2 +- gcc/optabs.c | 2 +- gcc/opts.c | 70 +- gcc/params.def | 23 +- gcc/po/ChangeLog | 13 + gcc/po/de.po | 875 +- gcc/po/exgettext | 2 + gcc/po/gcc.pot | 4016 ++-- gcc/postreload.c | 30 +- gcc/predict.c | 94 +- gcc/predict.def | 5 +- gcc/predict.h | 5 +- gcc/pretty-print.c | 3 +- gcc/pretty-print.h | 2 +- gcc/print-rtl.c | 2 +- gcc/profile.c | 20 +- gcc/ra-build.c | 12 +- gcc/ra-colorize.c | 8 +- gcc/ra-debug.c | 11 +- gcc/ra-rewrite.c | 20 +- gcc/ra.c | 4 +- gcc/real.c | 5 +- gcc/recog.c | 227 +- gcc/recog.h | 2 +- gcc/reg-stack.c | 119 +- gcc/regclass.c | 55 +- gcc/regmove.c | 18 +- gcc/regrename.c | 37 +- gcc/regs.h | 7 +- gcc/reload.c | 53 +- gcc/reload1.c | 92 +- gcc/reorg.c | 2 - gcc/resource.c | 29 +- gcc/resource.h | 3 +- gcc/rtl.c | 52 +- gcc/rtl.def | 32 +- gcc/rtl.h | 14 +- gcc/rtlanal.c | 6 +- gcc/sbitmap.c | 13 +- gcc/sched-ebb.c | 30 +- gcc/sched-rgn.c | 49 +- gcc/sched-vis.c | 2 +- gcc/sibcall.c | 4 +- gcc/simplify-rtx.c | 60 +- gcc/ssa-ccp.c | 1206 - gcc/ssa-dce.c | 713 - gcc/ssa.c | 2214 -- gcc/ssa.h | 70 - gcc/stmt.c | 159 +- gcc/stor-layout.c | 20 +- gcc/system.h | 33 +- gcc/target-def.h | 5 + gcc/target.h | 11 +- gcc/targhooks.c | 13 +- gcc/targhooks.h | 1 + gcc/testsuite/ChangeLog | 1065 +- gcc/testsuite/g++.dg/abi/bitfield5.C | 2 +- gcc/testsuite/g++.dg/abi/bitfield7.C | 2 +- gcc/testsuite/g++.dg/abi/covariant2.C | 32 + gcc/testsuite/g++.dg/abi/covariant3.C | 85 + gcc/testsuite/g++.dg/abi/dtor2.C | 2 +- gcc/testsuite/g++.dg/abi/macro0.C | 5 + gcc/testsuite/g++.dg/abi/macro1.C | 5 + gcc/testsuite/g++.dg/abi/macro2.C | 5 + gcc/testsuite/g++.dg/abi/mangle11.C | 2 +- gcc/testsuite/g++.dg/abi/mangle12.C | 2 +- gcc/testsuite/g++.dg/abi/mangle14.C | 2 +- gcc/testsuite/g++.dg/abi/mangle17.C | 2 +- gcc/testsuite/g++.dg/abi/mangle18-1.C | 23 + gcc/testsuite/g++.dg/abi/mangle18-2.C | 23 + gcc/testsuite/g++.dg/abi/mangle19-1.C | 13 + gcc/testsuite/g++.dg/abi/mangle19-2.C | 13 + gcc/testsuite/g++.dg/abi/mangle20-1.C | 19 + gcc/testsuite/g++.dg/abi/mangle20-2.C | 16 + gcc/testsuite/g++.dg/abi/mangle4.C | 4 +- gcc/testsuite/g++.dg/abi/vbase10.C | 7 +- gcc/testsuite/g++.dg/abi/vbase14.C | 2 +- gcc/testsuite/g++.dg/bprob/bprob.exp | 5 +- gcc/testsuite/g++.dg/compat/compat.exp | 11 +- gcc/testsuite/g++.dg/eh/dtor2.C | 30 + gcc/testsuite/g++.dg/eh/ia64-1.C | 50 + gcc/testsuite/g++.dg/eh/simd-1.C | 1 + gcc/testsuite/g++.dg/eh/simd-2.C | 1 + gcc/testsuite/g++.dg/expr/assign1.C | 34 + gcc/testsuite/g++.dg/expr/sizeof1.C | 7 + gcc/testsuite/g++.dg/ext/attrib10.C | 7 + gcc/testsuite/g++.dg/ext/attrib11.C | 17 + gcc/testsuite/g++.dg/ext/attrib9.C | 5 + gcc/testsuite/g++.dg/ext/complit2.C | 25 +- gcc/testsuite/g++.dg/ext/cond1.C | 4 + gcc/testsuite/g++.dg/ext/visibility-1.C | 8 + gcc/testsuite/g++.dg/ext/visibility-2.C | 7 + gcc/testsuite/g++.dg/ext/visibility-3.C | 7 + gcc/testsuite/g++.dg/ext/visibility-4.C | 8 + gcc/testsuite/g++.dg/ext/visibility-5.C | 11 + gcc/testsuite/g++.dg/ext/visibility-6.C | 10 + gcc/testsuite/g++.dg/ext/visibility-7.C | 11 + gcc/testsuite/g++.dg/inherit/operator2.C | 22 + gcc/testsuite/g++.dg/init/array12.C | 28 + gcc/testsuite/g++.dg/init/assign1.C | 30 + gcc/testsuite/g++.dg/init/bitfield2.C | 33 + gcc/testsuite/g++.dg/init/cleanup1.C | 16 + gcc/testsuite/g++.dg/init/cleanup2.C | 19 + gcc/testsuite/g++.dg/init/error1.C | 7 + gcc/testsuite/g++.dg/init/placement1.C | 10 + gcc/testsuite/g++.dg/init/placement2.C | 22 + gcc/testsuite/g++.dg/init/pm3.C | 10 + gcc/testsuite/g++.dg/lookup/java1.C | 68 + gcc/testsuite/g++.dg/lookup/java2.C | 47 + gcc/testsuite/g++.dg/lookup/ns1.C | 22 + .../g++.dg/lookup/used-before-declaration.C | 5 + gcc/testsuite/g++.dg/lookup/using5.C | 2 +- gcc/testsuite/g++.dg/lookup/using9.C | 30 + gcc/testsuite/g++.dg/opt/const3.C | 44 + gcc/testsuite/g++.dg/opt/expect1.C | 17 + gcc/testsuite/g++.dg/opt/inline6.C | 14 + gcc/testsuite/g++.dg/opt/noreturn-1.C | 87 + gcc/testsuite/g++.dg/opt/reg-stack4.C | 29 + gcc/testsuite/g++.dg/other/error2.C | 2 +- gcc/testsuite/g++.dg/other/java1.C | 22 + gcc/testsuite/g++.dg/other/offsetof2.C | 4 +- gcc/testsuite/g++.dg/other/stdarg2.C | 12 + gcc/testsuite/g++.dg/other/struct-va_list.C | 8 + gcc/testsuite/g++.dg/parse/crash10.C | 2 - gcc/testsuite/g++.dg/parse/dce1.C | 13 + gcc/testsuite/g++.dg/parse/defarg6.C | 11 + gcc/testsuite/g++.dg/parse/error3.C | 6 + gcc/testsuite/g++.dg/parse/error4.C | 7 + gcc/testsuite/g++.dg/parse/error5.C | 4 + gcc/testsuite/g++.dg/parse/error6.C | 6 + gcc/testsuite/g++.dg/parse/error7.C | 4 + gcc/testsuite/g++.dg/parse/error8.C | 4 + gcc/testsuite/g++.dg/parse/error9.C | 5 + gcc/testsuite/g++.dg/parse/explicit1.C | 11 + gcc/testsuite/g++.dg/parse/nontype1.C | 9 + gcc/testsuite/g++.dg/parse/offsetof1.C | 11 + gcc/testsuite/g++.dg/parse/offsetof2.C | 12 + gcc/testsuite/g++.dg/parse/semicolon1.C | 4 + gcc/testsuite/g++.dg/parse/semicolon1.h | 2 + gcc/testsuite/g++.dg/parse/typename5.C | 2 +- gcc/testsuite/g++.dg/parse/undefined1.C | 2 +- gcc/testsuite/g++.dg/template/access13.C | 16 + gcc/testsuite/g++.dg/template/arg2.C | 2 +- gcc/testsuite/g++.dg/template/array1-1.C | 32 + gcc/testsuite/g++.dg/template/array1-2.C | 32 + gcc/testsuite/g++.dg/template/array2-1.C | 14 + gcc/testsuite/g++.dg/template/array2-2.C | 14 + gcc/testsuite/g++.dg/template/crash13.C | 4 +- gcc/testsuite/g++.dg/template/crash14.C | 3 + gcc/testsuite/g++.dg/template/crash15.C | 9 + gcc/testsuite/g++.dg/template/dependent-expr3.C | 14 + gcc/testsuite/g++.dg/template/eh1.C | 6 + gcc/testsuite/g++.dg/template/error10.C | 70 + gcc/testsuite/g++.dg/template/error3.C | 5 + gcc/testsuite/g++.dg/template/error4.C | 8 + gcc/testsuite/g++.dg/template/error5.C | 6 + gcc/testsuite/g++.dg/template/error6.C | 13 + gcc/testsuite/g++.dg/template/error7.C | 6 + gcc/testsuite/g++.dg/template/error8.C | 7 + gcc/testsuite/g++.dg/template/error9.C | 7 + gcc/testsuite/g++.dg/template/instantiate5.C | 24 + gcc/testsuite/g++.dg/template/lookup3.C | 16 + gcc/testsuite/g++.dg/template/memfriend1.C | 54 + gcc/testsuite/g++.dg/template/memfriend2.C | 61 + gcc/testsuite/g++.dg/template/memfriend3.C | 55 + gcc/testsuite/g++.dg/template/memfriend4.C | 63 + gcc/testsuite/g++.dg/template/memfriend5.C | 31 + gcc/testsuite/g++.dg/template/memfriend6.C | 23 + gcc/testsuite/g++.dg/template/memfriend7.C | 133 + gcc/testsuite/g++.dg/template/memfriend8.C | 25 + gcc/testsuite/g++.dg/template/nested3.C | 8 +- gcc/testsuite/g++.dg/template/nontype3.C | 37 + gcc/testsuite/g++.dg/template/ptrmem7.C | 29 + gcc/testsuite/g++.dg/template/ptrmem8.C | 20 + gcc/testsuite/g++.dg/template/qualttp17.C | 2 +- gcc/testsuite/g++.dg/template/recurse1.C | 16 + gcc/testsuite/g++.dg/template/static2.C | 2 +- gcc/testsuite/g++.dg/template/static5.C | 17 + gcc/testsuite/g++.dg/template/template-id-2.C | 22 + gcc/testsuite/g++.dg/template/ttp3.C | 2 +- gcc/testsuite/g++.dg/template/type1.C | 2 +- gcc/testsuite/g++.dg/template/using8.C | 22 + gcc/testsuite/g++.dg/warn/ctor-init-1.C | 9 + gcc/testsuite/g++.dg/warn/format3.C | 12 + gcc/testsuite/g++.dg/warn/noreturn-3.C | 13 + gcc/testsuite/g++.old-deja/g++.brendan/ns1.C | 6 +- gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 20 +- gcc/testsuite/g++.old-deja/g++.jason/template18.C | 18 - gcc/testsuite/g++.old-deja/g++.jason/template37.C | 40 - gcc/testsuite/g++.old-deja/g++.jason/thunk2.C | 2 +- gcc/testsuite/g++.old-deja/g++.jason/thunk3.C | 2 +- gcc/testsuite/g++.old-deja/g++.law/profile1.C | 3 +- gcc/testsuite/g++.old-deja/g++.other/access11.C | 4 +- gcc/testsuite/g++.old-deja/g++.other/crash32.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/asm1.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/defarg8.C | 6 +- gcc/testsuite/g++.old-deja/g++.pt/explicit71.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/friend44.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/static11.C | 9 +- gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C | 2 +- gcc/testsuite/g++.old-deja/g++.robertl/eb42.C | 19 - gcc/testsuite/g77.dg/12632.f | 6 + gcc/testsuite/g77.dg/bprob/bprob.exp | 5 +- gcc/testsuite/g77.f-torture/compile/13060.f | 13 + gcc/testsuite/g77.f-torture/execute/10197.x | 13 + gcc/testsuite/g77.f-torture/execute/13037.f | 58 + gcc/testsuite/g77.f-torture/execute/20001201.x | 3 + gcc/testsuite/g77.f-torture/execute/6367.x | 3 + gcc/testsuite/g77.f-torture/execute/io0.x | 3 + gcc/testsuite/g77.f-torture/execute/io1.x | 3 + gcc/testsuite/g77.f-torture/execute/u77-test.x | 3 + gcc/testsuite/gcc.c-torture/compile/200031109-1.c | 11 + gcc/testsuite/gcc.c-torture/compile/20020604-1.c | 2 +- gcc/testsuite/gcc.c-torture/compile/20020910-1.c | 7 +- gcc/testsuite/gcc.c-torture/compile/20031023-1.c | 66 + gcc/testsuite/gcc.c-torture/compile/20031023-2.c | 2 + gcc/testsuite/gcc.c-torture/compile/20031023-3.c | 2 + gcc/testsuite/gcc.c-torture/compile/20031023-4.c | 2 + gcc/testsuite/gcc.c-torture/compile/20031031-1.c | 36 + gcc/testsuite/gcc.c-torture/compile/20031031-2.c | 36 + gcc/testsuite/gcc.c-torture/compile/20031102-1.c | 12 + gcc/testsuite/gcc.c-torture/compile/20031112-1.c | 2 + gcc/testsuite/gcc.c-torture/compile/20031113-1.c | 21 + gcc/testsuite/gcc.c-torture/compile/20031208-1.c | 6 + gcc/testsuite/gcc.c-torture/compile/20031220-1.c | 21 + gcc/testsuite/gcc.c-torture/compile/20031220-2.c | 44 + gcc/testsuite/gcc.c-torture/compile/20031227-1.c | 17 + gcc/testsuite/gcc.c-torture/compile/920625-1.c | 6 +- gcc/testsuite/gcc.c-torture/compile/930217-1.c | 6 + gcc/testsuite/gcc.c-torture/compile/930513-1.c | 6 + gcc/testsuite/gcc.c-torture/compile/961203-1.c | 2 +- gcc/testsuite/gcc.c-torture/compile/980506-1.c | 2 +- gcc/testsuite/gcc.c-torture/compile/981006-1.c | 2 +- gcc/testsuite/gcc.c-torture/compile/981223-1.c | 8 +- gcc/testsuite/gcc.c-torture/compile/libcall-1.c | 14 + gcc/testsuite/gcc.c-torture/compile/simd-5.c | 8 +- gcc/testsuite/gcc.c-torture/execute/20020227-1.x | 4 +- gcc/testsuite/gcc.c-torture/execute/20020720-1.x | 2 +- gcc/testsuite/gcc.c-torture/execute/20031201-1.c | 76 + gcc/testsuite/gcc.c-torture/execute/20031204-1.c | 49 + gcc/testsuite/gcc.c-torture/execute/20031214-1.c | 32 + gcc/testsuite/gcc.c-torture/execute/20031215-1.c | 38 + gcc/testsuite/gcc.c-torture/execute/20031216-1.c | 23 + gcc/testsuite/gcc.c-torture/execute/920908-2.c | 10 + gcc/testsuite/gcc.c-torture/execute/921204-1.c | 10 + gcc/testsuite/gcc.c-torture/execute/930621-1.c | 10 + gcc/testsuite/gcc.c-torture/execute/930630-1.c | 10 + gcc/testsuite/gcc.c-torture/execute/931031-1.c | 10 + gcc/testsuite/gcc.c-torture/execute/980602-2.c | 10 + gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c | 7 +- gcc/testsuite/gcc.c-torture/execute/compndlit-1.c | 10 + gcc/testsuite/gcc.c-torture/execute/extzvsi.c | 10 + gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c | 29 + gcc/testsuite/gcc.c-torture/execute/loop-2e.x | 7 - gcc/testsuite/gcc.c-torture/execute/loop-2f.x | 9 - gcc/testsuite/gcc.c-torture/execute/loop-2g.x | 9 - gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c | 36 + gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c | 29 + gcc/testsuite/gcc.c-torture/execute/simd-4.x | 13 + gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x | 7 - gcc/testsuite/gcc.c-torture/execute/va-arg-25.c | 3 + gcc/testsuite/gcc.c-torture/execute/va-arg-25.x | 13 + gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c | 8 +- gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x | 3 - gcc/testsuite/gcc.c-torture/unsorted/ext.c | 10 + gcc/testsuite/gcc.dg/20020201-2.c | 30 - gcc/testsuite/gcc.dg/20020201-4.c | 16 - gcc/testsuite/gcc.dg/20020304-1.c | 37 - gcc/testsuite/gcc.dg/20020312-2.c | 6 - gcc/testsuite/gcc.dg/20021014-1.c | 3 +- gcc/testsuite/gcc.dg/20030926-1.c | 3 +- gcc/testsuite/gcc.dg/20031102-1.c | 37 + gcc/testsuite/gcc.dg/20031108-1.c | 35 + gcc/testsuite/gcc.dg/20031111-1.c | 13 + gcc/testsuite/gcc.dg/20031201-1.c | 20 + gcc/testsuite/gcc.dg/20031201-2.c | 41 + gcc/testsuite/gcc.dg/20031202-1.c | 44 + gcc/testsuite/gcc.dg/20031216-1.c | 37 + gcc/testsuite/gcc.dg/20031218-1.c | 19 + gcc/testsuite/gcc.dg/20031218-2.c | 12 + gcc/testsuite/gcc.dg/20031218-3.c | 12 + gcc/testsuite/gcc.dg/20031222-1.c | 18 + gcc/testsuite/gcc.dg/20031223-1.c | 11 + gcc/testsuite/gcc.dg/altivec-10.c | 86 + gcc/testsuite/gcc.dg/altivec-varargs-1.c | 90 + gcc/testsuite/gcc.dg/arm-g2.c | 19 + gcc/testsuite/gcc.dg/arm-scd42-1.c | 15 + gcc/testsuite/gcc.dg/arm-scd42-2.c | 17 + gcc/testsuite/gcc.dg/arm-scd42-3.c | 15 + gcc/testsuite/gcc.dg/bitfld-1.c | 3 +- gcc/testsuite/gcc.dg/bitfld-7.c | 8 + gcc/testsuite/gcc.dg/bitfld-8.c | 7 + gcc/testsuite/gcc.dg/builtin-apply2.c | 30 + gcc/testsuite/gcc.dg/builtin-apply3.c | 31 + gcc/testsuite/gcc.dg/builtin-return-1.c | 26 + gcc/testsuite/gcc.dg/builtins-18.c | 8 +- gcc/testsuite/gcc.dg/builtins-20.c | 6 +- gcc/testsuite/gcc.dg/builtins-config.h | 29 + gcc/testsuite/gcc.dg/c90-const-expr-2.c | 8 +- gcc/testsuite/gcc.dg/c99-const-expr-2.c | 8 +- gcc/testsuite/gcc.dg/cast-function-1.c | 49 + gcc/testsuite/gcc.dg/cleanup-10.c | 114 + gcc/testsuite/gcc.dg/cleanup-11.c | 114 + gcc/testsuite/gcc.dg/compat/vector-1_x.c | 1 + gcc/testsuite/gcc.dg/compat/vector-1_y.c | 1 + gcc/testsuite/gcc.dg/compat/vector-2_x.c | 1 + gcc/testsuite/gcc.dg/compat/vector-2_y.c | 1 + gcc/testsuite/gcc.dg/compat/vector-check.h | 2 +- gcc/testsuite/gcc.dg/complex-1.c | 31 + gcc/testsuite/gcc.dg/compound-lvalue-1.c | 12 + gcc/testsuite/gcc.dg/cond-lvalue-1.c | 12 + gcc/testsuite/gcc.dg/const-elim-1.c | 5 +- gcc/testsuite/gcc.dg/cpp/assert4.c | 436 + gcc/testsuite/gcc.dg/cpp/lexident.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/macro.c | 11 + gcc/testsuite/gcc.dg/cpp/trad/xwin1.c | 13 + gcc/testsuite/gcc.dg/darwin-abi-1.c | 2 +- gcc/testsuite/gcc.dg/darwin-misaligned.c | 32 + gcc/testsuite/gcc.dg/debug/debug-1.c | 4 +- gcc/testsuite/gcc.dg/debug/debug-2.c | 4 +- gcc/testsuite/gcc.dg/debug/debug-7.c | 16 + gcc/testsuite/gcc.dg/format/c90-strftime-1.c | 2 +- gcc/testsuite/gcc.dg/format/c90-strftime-2.c | 2 +- gcc/testsuite/gcc.dg/format/c99-strftime-1.c | 2 +- gcc/testsuite/gcc.dg/format/ext-1.c | 14 +- gcc/testsuite/gcc.dg/format/ext-3.c | 2 +- gcc/testsuite/gcc.dg/format/no-y2k-1.c | 4 +- gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c | 3 +- gcc/testsuite/gcc.dg/intermod-1.c | 2 +- gcc/testsuite/gcc.dg/macho-lo-sum.c | 29 + gcc/testsuite/gcc.dg/nest.c | 3 +- gcc/testsuite/gcc.dg/nested-func-1.c | 35 + gcc/testsuite/gcc.dg/noreturn-7.c | 42 + gcc/testsuite/gcc.dg/null-pointer-1.c | 20 + gcc/testsuite/gcc.dg/overflow-1.c | 25 + gcc/testsuite/gcc.dg/pch/warn-1.c | 2 +- gcc/testsuite/gcc.dg/ppc-stackalign-1.c | 34 + gcc/testsuite/gcc.dg/tls/asm-1.c | 7 + gcc/testsuite/gcc.dg/trampoline-1.c | 50 + gcc/testsuite/gcc.dg/unaligned-1.c | 49 + gcc/testsuite/gcc.dg/uninit-C.c | 2 +- gcc/testsuite/gcc.dg/unused-4.c | 2 +- gcc/testsuite/gcc.dg/visibility-1.c | 9 + gcc/testsuite/gcc.dg/visibility-2.c | 10 + gcc/testsuite/gcc.dg/visibility-3.c | 8 + gcc/testsuite/gcc.dg/visibility-4.c | 10 + gcc/testsuite/gcc.dg/visibility-5.c | 12 + gcc/testsuite/gcc.dg/visibility-6.c | 11 + gcc/testsuite/gcc.dg/visibility-7.c | 12 + gcc/testsuite/gcc.dg/warn-1.c | 6 +- gcc/testsuite/gcc.misc-tests/bprob.exp | 6 +- gcc/testsuite/lib/compat.exp | 28 +- gcc/testsuite/lib/g++.exp | 19 +- gcc/testsuite/lib/g77.exp | 3 +- gcc/testsuite/lib/gcc-dg.exp | 63 +- gcc/testsuite/lib/gcc.exp | 2 +- gcc/testsuite/lib/objc.exp | 3 +- gcc/testsuite/lib/target-supports.exp | 48 + gcc/testsuite/objc.dg/proto-lossage-3.m | 25 + gcc/timevar.def | 4 - gcc/tlink.c | 13 +- gcc/toplev.c | 208 +- gcc/toplev.h | 3 - gcc/tracer.c | 11 +- gcc/tree-dump.c | 2 + gcc/tree-inline.c | 84 +- gcc/tree-optimize.c | 15 - gcc/tree.c | 24 +- gcc/tree.def | 14 +- gcc/tree.h | 41 +- gcc/treelang/.cvsignore | 5 - gcc/treelang/ChangeLog | 34 + gcc/treelang/Make-lang.in | 35 +- gcc/treelang/lex.l | 2 +- gcc/treelang/treelang.texi | 84 +- gcc/tsystem.h | 4 + gcc/unroll.c | 20 +- gcc/unwind-dw2-fde-darwin.c | 50 +- gcc/unwind-dw2-fde-glibc.c | 8 +- gcc/unwind-dw2-fde.c | 86 +- gcc/unwind-dw2-fde.h | 28 +- gcc/unwind-dw2.c | 15 +- gcc/unwind-libunwind.c | 26 +- gcc/unwind-pe.h | 8 +- gcc/unwind-sjlj.c | 6 +- gcc/value-prof.c | 8 +- gcc/varasm.c | 68 +- gcc/version.c | 4 +- gcc/web.c | 49 +- gcc/xcoff.h | 17 + gcc/xcoffout.c | 2 +- include/ChangeLog | 24 + include/fibheap.h | 5 + include/libiberty.h | 59 +- libffi/ChangeLog | 202 +- libffi/Makefile.in | 134 +- libffi/acinclude.m4 | 89 + libffi/aclocal.m4 | 105 +- libffi/configure | 323 +- libffi/configure.in | 13 + libffi/fficonfig.h.in | 9 + libffi/include/Makefile.am | 5 +- libffi/include/Makefile.in | 83 +- libffi/src/prep_cif.c | 6 +- libffi/src/x86/ffi.c | 8 +- libffi/testsuite/Makefile.in | 2 + libffi/testsuite/lib/libffi-dg.exp | 14 +- libffi/testsuite/libffi.call/closure_fn0.c | 19 +- libffi/testsuite/libffi.call/closure_fn1.c | 20 +- libffi/testsuite/libffi.call/closure_fn2.c | 19 +- libffi/testsuite/libffi.call/closure_fn3.c | 18 +- libffi/testsuite/libffi.call/closure_fn4.c | 96 + libffi/testsuite/libffi.call/closure_fn5.c | 99 + libffi/testsuite/libffi.call/cls_12byte.c | 20 +- libffi/testsuite/libffi.call/cls_16byte.c | 20 +- libffi/testsuite/libffi.call/cls_18byte.c | 103 + libffi/testsuite/libffi.call/cls_19byte.c | 109 + libffi/testsuite/libffi.call/cls_1_1byte.c | 16 +- libffi/testsuite/libffi.call/cls_20byte.c | 20 +- libffi/testsuite/libffi.call/cls_20byte1.c | 98 + libffi/testsuite/libffi.call/cls_24byte.c | 29 +- libffi/testsuite/libffi.call/cls_2byte.c | 18 +- libffi/testsuite/libffi.call/cls_3_1byte.c | 22 +- libffi/testsuite/libffi.call/cls_3byte1.c | 18 +- libffi/testsuite/libffi.call/cls_3byte2.c | 18 +- libffi/testsuite/libffi.call/cls_4_1byte.c | 22 +- libffi/testsuite/libffi.call/cls_4byte.c | 18 +- libffi/testsuite/libffi.call/cls_5byte.c | 20 +- libffi/testsuite/libffi.call/cls_64byte.c | 131 + libffi/testsuite/libffi.call/cls_6byte.c | 23 +- libffi/testsuite/libffi.call/cls_7byte.c | 22 +- libffi/testsuite/libffi.call/cls_8byte.c | 19 +- libffi/testsuite/libffi.call/cls_9byte1.c | 98 + libffi/testsuite/libffi.call/cls_9byte2.c | 99 + libffi/testsuite/libffi.call/cls_align_double.c | 98 + libffi/testsuite/libffi.call/cls_align_float.c | 98 + .../testsuite/libffi.call/cls_align_longdouble.c | 98 + libffi/testsuite/libffi.call/cls_align_pointer.c | 98 + libffi/testsuite/libffi.call/cls_align_sint16.c | 98 + libffi/testsuite/libffi.call/cls_align_sint32.c | 98 + libffi/testsuite/libffi.call/cls_align_sint64.c | 98 + libffi/testsuite/libffi.call/cls_align_uint16.c | 98 + libffi/testsuite/libffi.call/cls_align_uint32.c | 98 + libffi/testsuite/libffi.call/cls_align_uint64.c | 98 + libffi/testsuite/libffi.call/cls_double.c | 15 +- libffi/testsuite/libffi.call/cls_float.c | 18 +- libffi/testsuite/libffi.call/cls_multi_schar.c | 81 + libffi/testsuite/libffi.call/cls_multi_sshort.c | 81 + .../testsuite/libffi.call/cls_multi_sshortchar.c | 93 + libffi/testsuite/libffi.call/cls_multi_uchar.c | 96 + libffi/testsuite/libffi.call/cls_multi_ushort.c | 81 + .../testsuite/libffi.call/cls_multi_ushortchar.c | 93 + libffi/testsuite/libffi.call/cls_schar.c | 50 + libffi/testsuite/libffi.call/cls_sint.c | 50 + libffi/testsuite/libffi.call/cls_sshort.c | 50 + libffi/testsuite/libffi.call/cls_uchar.c | 14 +- libffi/testsuite/libffi.call/cls_uint.c | 14 +- libffi/testsuite/libffi.call/cls_ulonglong.c | 20 +- libffi/testsuite/libffi.call/cls_ushort.c | 14 +- libffi/testsuite/libffi.call/ffitest.h | 72 +- libffi/testsuite/libffi.call/many_win32.c | 3 +- libffi/testsuite/libffi.call/nested_struct.c | 10 +- libffi/testsuite/libffi.call/nested_struct1.c | 10 +- libffi/testsuite/libffi.call/nested_struct2.c | 127 + libffi/testsuite/libffi.call/nested_struct3.c | 118 + libffi/testsuite/libffi.call/problem1.c | 112 +- libffi/testsuite/libffi.call/return_sc.c | 8 +- libffi/testsuite/libffi.special/ffitestcxx.h | 69 + libffi/testsuite/libffi.special/unwindtest.cc | 20 +- libiberty/ChangeLog | 300 + libiberty/Makefile.in | 5 +- libiberty/cp-demangle.c | 6861 +++--- libiberty/floatformat.c | 187 +- libiberty/hashtab.c | 4 +- libiberty/lbasename.c | 20 +- libiberty/make-relative-prefix.c | 15 +- libiberty/pex-common.h | 3 + libiberty/pex-unix.c | 254 +- libiberty/pex-win32.c | 515 +- libiberty/testsuite/Makefile.in | 2 +- libiberty/testsuite/demangle-expected | 114 +- libiberty/testsuite/test-demangle.c | 2 +- libiberty/vasprintf.c | 17 +- libjava/ChangeLog | 2196 +- libjava/Makefile.am | 74 +- libjava/Makefile.in | 167 +- libjava/aclocal.m4 | 16 +- libjava/boehm.cc | 2 +- libjava/configure | 735 +- libjava/configure.in | 34 +- libjava/gcj/javaprims.h | 1 + libjava/gnu/awt/gtk/GtkButtonPeer.java | 61 - libjava/gnu/awt/gtk/GtkComponentPeer.java | 269 - libjava/gnu/awt/gtk/GtkContainerPeer.java | 55 - libjava/gnu/awt/gtk/GtkFramePeer.java | 42 - libjava/gnu/awt/gtk/GtkLabelPeer.java | 37 - libjava/gnu/awt/gtk/GtkMainThread.java | 36 - libjava/gnu/awt/gtk/GtkToolkit.java | 314 - libjava/gnu/awt/gtk/GtkWindowPeer.java | 39 - libjava/gnu/awt/gtk/gtkcommon.cc | 14 - libjava/gnu/awt/gtk/gtkcommon.h | 85 - libjava/gnu/awt/gtk/natGtkButtonPeer.cc | 52 - libjava/gnu/awt/gtk/natGtkComponentPeer.cc | 265 - libjava/gnu/awt/gtk/natGtkContainerPeer.cc | 15 - libjava/gnu/awt/gtk/natGtkFramePeer.cc | 51 - libjava/gnu/awt/gtk/natGtkLabelPeer.cc | 59 - libjava/gnu/awt/gtk/natGtkMainThread.cc | 22 - libjava/gnu/awt/gtk/natGtkToolkit.cc | 75 - libjava/gnu/awt/gtk/natGtkWindowPeer.cc | 40 - libjava/gnu/gcj/convert/natIconv.cc | 4 +- libjava/gnu/gcj/runtime/FirstThread.java | 10 +- libjava/gnu/gcj/runtime/natNameFinder.cc | 4 +- libjava/gnu/gcj/xlib/GC.java | 10 +- libjava/gnu/gcj/xlib/XAnyEvent.java | 2 +- libjava/gnu/gcj/xlib/natGC.cc | 24 +- libjava/gnu/java/awt/image/ImageDecoder.java | 34 +- libjava/gnu/java/awt/image/XBMDecoder.java | 2 +- .../java/awt/peer/gtk/GdkClasspathFontPeer.java | 64 +- .../awt/peer/gtk/GdkClasspathFontPeerMetrics.java | 116 + libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java | 21 +- libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java | 444 +- .../gnu/java/awt/peer/gtk/GdkPixbufDecoder.java | 12 +- libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java | 2 + libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java | 29 +- libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java | 6 +- .../gnu/java/awt/peer/gtk/GtkComponentPeer.java | 11 +- .../gnu/java/awt/peer/gtk/GtkContainerPeer.java | 5 + .../gnu/java/awt/peer/gtk/GtkFileDialogPeer.java | 2 +- libjava/gnu/java/awt/peer/gtk/GtkImage.java | 62 +- libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java | 29 +- libjava/gnu/java/awt/peer/gtk/GtkListPeer.java | 43 +- libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java | 3 +- .../gnu/java/awt/peer/gtk/GtkScrollbarPeer.java | 3 +- .../java/awt/peer/gtk/GtkTextComponentPeer.java | 2 +- libjava/gnu/java/awt/peer/gtk/GtkToolkit.java | 52 +- libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java | 3 +- libjava/gnu/java/beans/IntrospectionIncubator.java | 2 +- libjava/gnu/java/lang/reflect/TypeSignature.java | 25 +- libjava/gnu/java/net/HeaderFieldHelper.java | 138 + libjava/gnu/java/net/PlainDatagramSocketImpl.java | 17 +- libjava/gnu/java/net/URLParseError.java | 57 + .../java/net/natPlainDatagramSocketImplPosix.cc | 31 +- .../java/net/natPlainDatagramSocketImplWin32.cc | 24 +- libjava/gnu/java/net/natPlainSocketImplPosix.cc | 21 +- libjava/gnu/java/net/natPlainSocketImplWin32.cc | 83 +- libjava/gnu/java/net/protocol/file/Connection.java | 119 +- libjava/gnu/java/net/protocol/file/Handler.java | 16 + libjava/gnu/java/net/protocol/http/Connection.java | 494 +- libjava/gnu/java/net/protocol/jar/Connection.java | 262 +- libjava/gnu/java/net/protocol/jar/Handler.java | 115 +- libjava/gnu/java/nio/ChannelInputStream.java | 79 + libjava/gnu/java/nio/ChannelOutputStream.java | 67 + libjava/gnu/java/nio/DatagramChannelImpl.java | 4 +- libjava/gnu/java/nio/FileLockImpl.java | 10 + libjava/gnu/java/nio/InputStreamChannel.java | 88 + libjava/gnu/java/nio/NIODatagramSocket.java | 2 +- libjava/gnu/java/nio/NIOSocket.java | 4 +- libjava/gnu/java/nio/OutputStreamChannel.java | 87 + libjava/gnu/java/nio/SelectorImpl.java | 301 +- libjava/gnu/java/nio/ServerSocketChannelImpl.java | 6 +- libjava/gnu/java/nio/SocketChannelImpl.java | 10 +- libjava/gnu/java/nio/natPipeImpl.cc | 38 - libjava/gnu/java/nio/natPipeImplEcos.cc | 25 + libjava/gnu/java/nio/natPipeImplPosix.cc | 38 + libjava/gnu/java/nio/natPipeImplWin32.cc | 38 + libjava/gnu/java/nio/natSelectorImpl.cc | 91 - libjava/gnu/java/nio/natSelectorImplEcos.cc | 25 + libjava/gnu/java/nio/natSelectorImplPosix.cc | 127 + libjava/gnu/java/nio/natSelectorImplWin32.cc | 93 + libjava/gnu/java/rmi/server/RMIVoidValue.java | 51 + .../java/rmi/server/UnicastConnectionManager.java | 3 + libjava/gnu/java/rmi/server/UnicastRemoteCall.java | 99 +- libjava/gnu/java/rmi/server/UnicastServer.java | 2 +- libjava/gnu/java/rmi/server/UnicastServerRef.java | 7 +- libjava/include/config.h.in | 3 + libjava/include/jni.h | 33 +- libjava/include/win32.h | 92 +- libjava/java/awt/Choice.java | 50 +- libjava/java/awt/Component.java | 42 +- libjava/java/awt/FlowLayout.java | 3 +- libjava/java/awt/Font.java | 3 - libjava/java/awt/GridBagLayout.java | 20 +- libjava/java/awt/List.java | 19 +- libjava/java/awt/MediaTracker.java | 4 +- libjava/java/awt/MenuComponent.java | 5 +- libjava/java/awt/MenuItem.java | 6 +- libjava/java/awt/Polygon.java | 2 +- libjava/java/awt/TextComponent.java | 10 +- libjava/java/awt/datatransfer/DataFlavor.java | 5 +- libjava/java/awt/datatransfer/StringSelection.java | 12 +- libjava/java/awt/font/TextLayout.java | 160 +- libjava/java/awt/geom/CubicCurve2D.java | 1019 +- libjava/java/awt/geom/FlatteningPathIterator.java | 526 +- libjava/java/awt/geom/QuadCurve2D.java | 202 +- libjava/java/awt/geom/doc-files/CubicCurve2D-1.png | Bin 0 -> 6280 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-2.png | Bin 0 -> 5791 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-3.png | Bin 0 -> 13168 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-4.png | Bin 0 -> 7839 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-5.png | Bin 0 -> 5112 bytes .../geom/doc-files/FlatteningPathIterator-1.html | 481 + libjava/java/awt/geom/doc-files/QuadCurve2D-4.png | Bin 0 -> 7797 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-5.png | Bin 0 -> 4757 bytes libjava/java/awt/image/ImageConsumer.java | 46 +- libjava/java/awt/image/ImagingOpException.java | 4 +- libjava/java/awt/image/PixelGrabber.java | 948 +- libjava/java/beans/BeanDescriptor.java | 2 - libjava/java/beans/EventSetDescriptor.java | 7 +- libjava/java/beans/FeatureDescriptor.java | 3 +- libjava/java/beans/IndexedPropertyDescriptor.java | 4 +- libjava/java/beans/Introspector.java | 10 +- libjava/java/beans/MethodDescriptor.java | 2 +- libjava/java/beans/PropertyDescriptor.java | 4 +- libjava/java/beans/SimpleBeanInfo.java | 3 +- .../beancontext/BeanContextServicesSupport.java | 2 + libjava/java/io/BufferedReader.java | 34 +- libjava/java/io/ByteArrayOutputStream.java | 2 +- libjava/java/io/CharArrayReader.java | 2 +- libjava/java/io/FileInputStream.java | 15 +- libjava/java/io/FilePermission.java | 3 +- libjava/java/io/LineNumberReader.java | 138 +- libjava/java/io/ObjectInputStream.java | 1293 +- libjava/java/io/ObjectOutputStream.java | 679 +- libjava/java/io/ObjectStreamClass.java | 819 +- libjava/java/io/ObjectStreamField.java | 171 +- libjava/java/io/PrintStream.java | 197 +- libjava/java/io/StreamTokenizer.java | 22 +- libjava/java/io/natFileDescriptorWin32.cc | 16 +- libjava/java/io/natFileWin32.cc | 72 +- libjava/java/lang/Class.h | 2 +- libjava/java/lang/Float.java | 15 +- libjava/java/lang/Win32Process.java | 16 +- libjava/java/lang/natClass.cc | 17 +- libjava/java/lang/natDouble.cc | 2 +- libjava/java/lang/natPosixProcess.cc | 4 +- libjava/java/lang/natRuntime.cc | 4 +- libjava/java/lang/natWin32Process.cc | 219 +- libjava/java/lang/reflect/natMethod.cc | 6 +- libjava/java/math/BigInteger.java | 2 +- libjava/java/net/DatagramPacket.java | 98 +- libjava/java/net/DatagramSocket.java | 407 +- libjava/java/net/Inet4Address.java | 4 +- libjava/java/net/Inet6Address.java | 2 +- libjava/java/net/InetAddress.java | 5 +- libjava/java/net/InetSocketAddress.java | 33 +- libjava/java/net/JarURLConnection.java | 228 - libjava/java/net/MulticastSocket.java | 113 +- libjava/java/net/ServerSocket.java | 108 +- libjava/java/net/Socket.java | 328 +- libjava/java/net/SocketPermission.java | 3 - libjava/java/net/URL.java | 71 +- libjava/java/net/URLStreamHandler.java | 73 +- libjava/java/net/natNetworkInterfaceWin32.cc | 10 +- libjava/java/nio/ByteBuffer.java | 3 +- libjava/java/nio/channels/Channels.java | 22 +- libjava/java/nio/channels/FileChannelImpl.java | 4 +- .../channels/spi/AbstractInterruptibleChannel.java | 11 +- .../java/nio/channels/spi/AbstractSelector.java | 11 +- libjava/java/rmi/MarshalledObject.java | 2 +- libjava/java/rmi/Naming.java | 33 +- libjava/java/rmi/server/RMIClassLoader.java | 3 +- libjava/java/security/DigestInputStream.java | 4 +- libjava/java/security/Security.java | 2 +- libjava/java/security/cert/CertStore.java | 3 +- libjava/java/sql/Timestamp.java | 38 +- libjava/java/text/DateFormat.java | 105 +- libjava/java/text/DecimalFormat.java | 26 + libjava/java/text/DecimalFormatSymbols.java | 40 +- libjava/java/text/FieldPosition.java | 78 +- libjava/java/text/Format.java | 23 +- libjava/java/text/FormatCharacterIterator.java | 469 + libjava/java/text/MessageFormat.java | 20 +- libjava/java/text/NumberFormat.java | 208 +- libjava/java/text/SimpleDateFormat.java | 7 +- libjava/java/util/Calendar.java | 6 +- libjava/java/util/Currency.java | 189 + libjava/java/util/GregorianCalendar.java | 10 +- libjava/java/util/HashMap.java | 17 +- libjava/java/util/Hashtable.java | 52 +- libjava/java/util/IdentityHashMap.java | 5 +- libjava/java/util/SimpleTimeZone.java | 32 +- libjava/java/util/TimeZone.java | 18 +- libjava/java/util/jar/JarInputStream.java | 1 - libjava/java/util/logging/logging.properties | 8 + libjava/java/util/prefs/AbstractPreferences.java | 10 + libjava/java/util/prefs/Preferences.java | 2 +- libjava/java/util/zip/DeflaterOutputStream.java | 30 +- libjava/java/util/zip/ZipFile.java | 6 +- libjava/javax/naming/CompoundName.java | 2 +- libjava/javax/naming/InitialContext.java | 23 +- libjava/javax/naming/directory/Attribute.java | 5 +- libjava/javax/naming/directory/Attributes.java | 4 +- libjava/javax/naming/directory/DirContext.java | 5 +- .../javax/naming/directory/InitialDirContext.java | 8 +- libjava/javax/naming/directory/SearchResult.java | 3 +- libjava/javax/naming/event/EventContext.java | 5 +- libjava/javax/naming/event/EventDirContext.java | 38 +- libjava/javax/naming/event/NamingEvent.java | 3 +- .../javax/naming/event/NamingExceptionEvent.java | 5 +- libjava/javax/naming/ldap/ControlFactory.java | 5 +- libjava/javax/naming/ldap/ExtendedRequest.java | 3 +- libjava/javax/naming/ldap/HasControls.java | 3 +- libjava/javax/naming/ldap/InitialLdapContext.java | 7 +- libjava/javax/naming/ldap/LdapContext.java | 5 +- .../javax/naming/ldap/LdapReferralException.java | 5 +- .../javax/naming/ldap/UnsolicitedNotification.java | 3 +- .../ldap/UnsolicitedNotificationListener.java | 3 +- libjava/javax/naming/spi/DirObjectFactory.java | 6 +- libjava/javax/naming/spi/DirStateFactory.java | 7 +- libjava/javax/naming/spi/DirectoryManager.java | 14 +- libjava/javax/naming/spi/NamingManager.java | 23 +- libjava/javax/naming/spi/ObjectFactoryBuilder.java | 3 +- libjava/javax/naming/spi/ResolveResult.java | 7 +- libjava/javax/naming/spi/Resolver.java | 4 +- libjava/javax/naming/spi/StateFactory.java | 5 +- .../print/attribute/AttributeSetUtilities.java | 445 + libjava/javax/print/attribute/DateTimeSyntax.java | 101 + libjava/javax/print/attribute/DocAttribute.java | 45 + libjava/javax/print/attribute/DocAttributeSet.java | 55 + libjava/javax/print/attribute/EnumSyntax.java | 146 + .../javax/print/attribute/HashAttributeSet.java | 366 + .../javax/print/attribute/HashDocAttributeSet.java | 94 + .../print/attribute/HashPrintJobAttributeSet.java | 94 + .../attribute/HashPrintRequestAttributeSet.java | 94 + .../attribute/HashPrintServiceAttributeSet.java | 94 + libjava/javax/print/attribute/IntegerSyntax.java | 122 + .../javax/print/attribute/PrintJobAttribute.java | 45 + .../print/attribute/PrintJobAttributeSet.java | 55 + .../print/attribute/PrintRequestAttribute.java | 45 + .../print/attribute/PrintServiceAttribute.java | 45 + .../print/attribute/PrintServiceAttributeSet.java | 55 + .../javax/print/attribute/ResolutionSyntax.java | 220 + .../javax/print/attribute/SetOfIntegerSyntax.java | 253 + libjava/javax/print/attribute/Size2DSyntax.java | 225 + .../print/attribute/SupportedValuesAttribute.java | 45 + libjava/javax/print/attribute/TextSyntax.java | 118 + libjava/javax/print/attribute/URISyntax.java | 112 + .../print/attribute/UnmodifiableSetException.java | 65 + libjava/javax/swing/BoxLayout.java | 318 +- libjava/javax/swing/JFrame.java | 2 +- libjava/javax/swing/JLayeredPane.java | 343 +- libjava/javax/swing/JRootPane.java | 2 +- libjava/javax/swing/UIDefaults.java | 303 +- libjava/javax/swing/UIManager.java | 20 +- libjava/javax/swing/plaf/basic/BasicDefaults.java | 43 +- libjava/javax/swing/undo/AbstractUndoableEdit.java | 323 +- libjava/javax/swing/undo/CannotRedoException.java | 32 +- libjava/javax/swing/undo/CannotUndoException.java | 33 +- libjava/javax/swing/undo/CompoundEdit.java | 590 +- libjava/javax/swing/undo/StateEdit.java | 160 +- libjava/javax/swing/undo/StateEditable.java | 73 +- libjava/jni.cc | 14 +- libjava/jni/gtk-peer/gdkfont.h | 93 + .../gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c | 9 +- ...java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c | 93 + .../gnu_java_awt_peer_gtk_GdkFontMetrics.c | 78 +- .../gnu_java_awt_peer_gtk_GdkGlyphVector.c | 173 +- .../gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c | 153 +- .../gnu_java_awt_peer_gtk_GdkPixbufDecoder.c | 2 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c | 38 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c | 5 + ...gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c | 5 + .../gnu_java_awt_peer_gtk_GtkCheckboxPeer.c | 26 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c | 62 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c | 6 +- .../gnu_java_awt_peer_gtk_GtkComponentPeer.c | 85 +- .../gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c | 5 +- .../jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c | 623 +- .../gnu_java_awt_peer_gtk_GtkFileDialogPeer.c | 9 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c | 62 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c | 141 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c | 9 +- .../gnu_java_awt_peer_gtk_GtkMenuBarPeer.c | 5 + .../gnu_java_awt_peer_gtk_GtkMenuItemPeer.c | 28 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c | 7 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c | 39 +- .../gnu_java_awt_peer_gtk_GtkScrollBarPeer.c | 43 +- .../gnu_java_awt_peer_gtk_GtkScrollPanePeer.c | 5 + .../gnu_java_awt_peer_gtk_GtkTextAreaPeer.c | 12 +- .../gnu_java_awt_peer_gtk_GtkTextComponentPeer.c | 64 +- .../gnu_java_awt_peer_gtk_GtkTextFieldPeer.c | 5 + .../gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c | 41 +- libjava/jni/gtk-peer/gtkpeer.h | 26 +- libjava/libltdl/.cvsignore | 1 + libjava/libltdl/Makefile.am | 8 +- libjava/libltdl/Makefile.in | 714 +- libjava/libltdl/README | 1 + libjava/libltdl/acconfig.h | 15 - libjava/libltdl/acinclude.m4 | 7016 +++++- libjava/libltdl/aclocal.m4 | 7930 +++++- libjava/libltdl/config-h.in | 193 + libjava/libltdl/config.guess | 1415 ++ libjava/libltdl/config.h.in | 98 - libjava/libltdl/config.sub | 1510 ++ libjava/libltdl/configure | 23978 ++++++++++++++++--- libjava/libltdl/configure.ac | 80 + libjava/libltdl/configure.in | 63 - libjava/libltdl/install-sh | 294 + libjava/libltdl/ltdl.c | 5836 +++-- libjava/libltdl/ltdl.h | 425 +- libjava/libltdl/ltmain.sh | 6322 +++++ libjava/libltdl/missing | 336 + libjava/libltdl/mkinstalldirs | 111 + libjava/libltdl/stamp-h.in | 1 - libjava/mauve-libgcj | 6 - libjava/sysdep/sparc/locks.h | 4 +- libjava/testsuite/ChangeLog | 59 + libjava/testsuite/lib/libjava.exp | 32 +- libjava/testsuite/libjava.compile/InnerExcept.java | 19 + libjava/testsuite/libjava.compile/PR12374.java | 27 + libjava/testsuite/libjava.compile/PR12857.java | 4 + libjava/testsuite/libjava.compile/PR13024.java | 18 + libjava/testsuite/libjava.compile/PR13237.java | 3 + libjava/testsuite/libjava.jacks/jacks.exp | 1 + libjava/testsuite/libjava.jacks/jacks.xfail | 30 +- libjava/testsuite/libjava.jni/jniutf.c | 10 + libjava/testsuite/libjava.jni/jniutf.java | 16 + libjava/testsuite/libjava.jni/jniutf.out | 0 libjava/testsuite/libjava.lang/PR12915.java | 6 + libjava/testsuite/libjava.lang/PR12915.out | 1 + libjava/testsuite/libjava.mauve/xfails | 68 +- libjava/verify.cc | 13 +- libjava/win32-threads.cc | 21 +- libjava/win32.cc | 282 +- libobjc/ChangeLog | 15 +- libobjc/Protocol.m | 22 +- libstdc++-v3/ChangeLog | 1633 +- libstdc++-v3/Makefile.am | 4 + libstdc++-v3/Makefile.in | 69 +- libstdc++-v3/acconfig.h | 6 +- libstdc++-v3/acinclude.m4 | 50 +- libstdc++-v3/aclocal.m4 | 54 +- libstdc++-v3/config.h.in | 9 +- libstdc++-v3/config/cpu/alpha/atomicity.h | 6 +- libstdc++-v3/config/cpu/cris/atomicity.h | 13 +- libstdc++-v3/config/cpu/generic/atomicity.h | 14 +- libstdc++-v3/config/cpu/hppa/atomicity.h | 4 +- libstdc++-v3/config/cpu/i386/atomicity.h | 23 +- libstdc++-v3/config/cpu/i486/atomicity.h | 13 +- libstdc++-v3/config/cpu/ia64/atomicity.h | 10 +- libstdc++-v3/config/cpu/m68k/atomicity.h | 27 +- libstdc++-v3/config/cpu/mips/atomicity.h | 10 +- libstdc++-v3/config/cpu/powerpc/atomicity.h | 30 +- libstdc++-v3/config/cpu/s390/atomicity.h | 18 +- libstdc++-v3/config/cpu/sparc/atomicity.h | 44 +- libstdc++-v3/config/io/basic_file_stdio.cc | 17 +- libstdc++-v3/config/io/basic_file_stdio.h | 4 +- libstdc++-v3/config/linker-map.gnu | 25 +- libstdc++-v3/config/locale/generic/c_locale.cc | 85 +- .../config/locale/generic/codecvt_members.cc | 57 +- .../config/locale/generic/ctype_members.cc | 79 +- libstdc++-v3/config/locale/gnu/c_locale.cc | 86 +- libstdc++-v3/config/locale/gnu/codecvt_members.cc | 204 +- libstdc++-v3/config/locale/gnu/ctype_members.cc | 106 +- libstdc++-v3/config/locale/gnu/monetary_members.cc | 67 +- libstdc++-v3/config/os/aix/ctype_noninline.h | 14 +- .../config/os/bsd/freebsd/ctype_noninline.h | 14 +- .../config/os/bsd/netbsd/ctype_noninline.h | 14 +- libstdc++-v3/config/os/djgpp/ctype_noninline.h | 14 +- libstdc++-v3/config/os/generic/ctype_noninline.h | 14 +- libstdc++-v3/config/os/gnu-linux/ctype_noninline.h | 16 + libstdc++-v3/config/os/hpux/ctype_noninline.h | 14 +- .../config/os/irix/irix5.2/ctype_noninline.h | 14 +- .../config/os/irix/irix6.5/ctype_noninline.h | 14 +- libstdc++-v3/config/os/mingw32/ctype_noninline.h | 14 +- libstdc++-v3/config/os/newlib/ctype_noninline.h | 14 +- .../config/os/qnx/qnx6.1/ctype_noninline.h | 14 +- .../config/os/solaris/solaris2.5/ctype_noninline.h | 14 +- .../config/os/solaris/solaris2.6/ctype_noninline.h | 14 +- .../config/os/solaris/solaris2.7/ctype_noninline.h | 14 +- libstdc++-v3/config/os/vxworks/ctype_noninline.h | 14 +- libstdc++-v3/config/os/windiss/ctype_noninline.h | 14 +- libstdc++-v3/configure | 445 +- libstdc++-v3/configure.ac | 9 +- libstdc++-v3/configure.host | 2 +- libstdc++-v3/crossconfig.m4 | 4 +- libstdc++-v3/docs/doxygen/TODO | 2 +- libstdc++-v3/docs/html/17_intro/C++STYLE | 20 +- libstdc++-v3/docs/html/17_intro/TODO | 30 +- libstdc++-v3/docs/html/17_intro/configury.html | 7 +- libstdc++-v3/docs/html/17_intro/contribute.html | 6 +- libstdc++-v3/docs/html/17_intro/howto.html | 22 +- libstdc++-v3/docs/html/17_intro/license.html | 4 +- libstdc++-v3/docs/html/18_support/howto.html | 12 +- libstdc++-v3/docs/html/19_diagnostics/howto.html | 12 +- libstdc++-v3/docs/html/20_util/howto.html | 12 +- libstdc++-v3/docs/html/21_strings/howto.html | 32 +- libstdc++-v3/docs/html/22_locale/codecvt.html | 7 +- libstdc++-v3/docs/html/22_locale/ctype.html | 7 +- libstdc++-v3/docs/html/22_locale/howto.html | 20 +- libstdc++-v3/docs/html/22_locale/locale.html | 7 +- libstdc++-v3/docs/html/22_locale/messages.html | 7 +- libstdc++-v3/docs/html/23_containers/howto.html | 12 +- libstdc++-v3/docs/html/24_iterators/howto.html | 12 +- libstdc++-v3/docs/html/25_algorithms/howto.html | 12 +- libstdc++-v3/docs/html/26_numerics/howto.html | 12 +- libstdc++-v3/docs/html/27_io/howto.html | 14 +- libstdc++-v3/docs/html/configopts.html | 3 +- libstdc++-v3/docs/html/debug.html | 287 +- libstdc++-v3/docs/html/debug_mode.html | 590 + libstdc++-v3/docs/html/documentation.html | 5 +- libstdc++-v3/docs/html/explanations.html | 3 +- libstdc++-v3/docs/html/ext/howto.html | 69 +- libstdc++-v3/docs/html/ext/lwg-active.html | 7854 +++--- libstdc++-v3/docs/html/ext/lwg-defects.html | 4734 +++- libstdc++-v3/docs/html/ext/sgiexts.html | 9 +- libstdc++-v3/docs/html/faq/index.html | 22 + libstdc++-v3/docs/html/faq/index.txt | 693 +- libstdc++-v3/docs/html/install.html | 3 +- libstdc++-v3/docs/html/test.html | 20 + libstdc++-v3/include/Makefile.am | 44 +- libstdc++-v3/include/Makefile.in | 55 +- libstdc++-v3/include/backward/algo.h | 118 +- libstdc++-v3/include/backward/algobase.h | 26 +- libstdc++-v3/include/backward/alloc.h | 14 +- libstdc++-v3/include/backward/complex.h | 6 +- libstdc++-v3/include/backward/defalloc.h | 22 +- libstdc++-v3/include/backward/function.h | 114 +- libstdc++-v3/include/backward/iterator.h | 4 +- libstdc++-v3/include/backward/new.h | 6 +- libstdc++-v3/include/backward/ostream.h | 2 +- libstdc++-v3/include/backward/queue.h | 2 +- libstdc++-v3/include/backward/rope.h | 12 +- libstdc++-v3/include/backward/stream.h | 2 +- libstdc++-v3/include/backward/streambuf.h | 2 +- libstdc++-v3/include/backward/strstream | 10 +- libstdc++-v3/include/backward/tempbuf.h | 6 +- libstdc++-v3/include/backward/tree.h | 2 +- libstdc++-v3/include/backward/vector.h | 2 +- libstdc++-v3/include/bits/allocator.h | 8 +- libstdc++-v3/include/bits/allocator_traits.h | 6 +- libstdc++-v3/include/bits/basic_ios.h | 18 +- libstdc++-v3/include/bits/basic_ios.tcc | 2 +- libstdc++-v3/include/bits/basic_string.h | 149 +- libstdc++-v3/include/bits/basic_string.tcc | 46 +- libstdc++-v3/include/bits/c++config | 26 +- libstdc++-v3/include/bits/concurrence.h | 54 + libstdc++-v3/include/bits/demangle.h | 843 +- libstdc++-v3/include/bits/deque.tcc | 4 +- libstdc++-v3/include/bits/fstream.tcc | 325 +- libstdc++-v3/include/bits/ios_base.h | 10 +- libstdc++-v3/include/bits/istream.tcc | 604 +- libstdc++-v3/include/bits/list.tcc | 103 +- libstdc++-v3/include/bits/locale_classes.h | 197 +- libstdc++-v3/include/bits/locale_facets.h | 1126 +- libstdc++-v3/include/bits/locale_facets.tcc | 1102 +- libstdc++-v3/include/bits/ostream.tcc | 399 +- libstdc++-v3/include/bits/postypes.h | 4 +- libstdc++-v3/include/bits/sstream.tcc | 10 +- libstdc++-v3/include/bits/stl_algo.h | 142 +- libstdc++-v3/include/bits/stl_algobase.h | 21 + libstdc++-v3/include/bits/stl_bvector.h | 94 +- libstdc++-v3/include/bits/stl_construct.h | 26 +- libstdc++-v3/include/bits/stl_deque.h | 215 +- libstdc++-v3/include/bits/stl_heap.h | 61 +- libstdc++-v3/include/bits/stl_list.h | 1767 +- libstdc++-v3/include/bits/stl_map.h | 4 +- libstdc++-v3/include/bits/stl_multimap.h | 4 +- libstdc++-v3/include/bits/stl_multiset.h | 12 +- libstdc++-v3/include/bits/stl_numeric.h | 10 + libstdc++-v3/include/bits/stl_queue.h | 540 +- libstdc++-v3/include/bits/stl_set.h | 93 +- libstdc++-v3/include/bits/stl_stack.h | 244 +- libstdc++-v3/include/bits/stl_tree.h | 111 +- libstdc++-v3/include/bits/stl_vector.h | 101 +- libstdc++-v3/include/bits/stream_iterator.h | 24 +- libstdc++-v3/include/bits/streambuf.tcc | 55 +- libstdc++-v3/include/bits/streambuf_iterator.h | 36 +- libstdc++-v3/include/bits/vector.tcc | 7 +- libstdc++-v3/include/c/std_cctype.h | 2 +- libstdc++-v3/include/c/std_cmath.h | 16 +- libstdc++-v3/include/c/std_cstdlib.h | 2 +- libstdc++-v3/include/c/std_cwchar.h | 6 +- libstdc++-v3/include/c/std_cwctype.h | 2 +- libstdc++-v3/include/c_compatibility/iso646.h | 2 +- libstdc++-v3/include/c_compatibility/limits.h | 2 +- libstdc++-v3/include/c_compatibility/locale.h | 2 +- libstdc++-v3/include/c_compatibility/stdio.h | 2 +- libstdc++-v3/include/c_compatibility/string.h | 2 +- libstdc++-v3/include/c_compatibility/time.h | 2 +- libstdc++-v3/include/c_compatibility/wchar.h | 8 +- libstdc++-v3/include/c_compatibility/wctype.h | 2 +- libstdc++-v3/include/c_std/cmath.tcc | 2 +- libstdc++-v3/include/c_std/std_cassert.h | 2 +- libstdc++-v3/include/c_std/std_cctype.h | 2 +- libstdc++-v3/include/c_std/std_cmath.h | 592 +- libstdc++-v3/include/c_std/std_cstddef.h | 2 +- libstdc++-v3/include/c_std/std_cstdio.h | 4 +- libstdc++-v3/include/c_std/std_cstdlib.h | 28 +- libstdc++-v3/include/c_std/std_cstring.h | 2 +- libstdc++-v3/include/c_std/std_cwchar.h | 24 +- libstdc++-v3/include/c_std/std_cwctype.h | 10 +- libstdc++-v3/include/debug/bitset | 298 + libstdc++-v3/include/debug/debug.h | 531 + libstdc++-v3/include/debug/deque | 386 + libstdc++-v3/include/debug/formatter.h | 389 + libstdc++-v3/include/debug/hash_map | 38 + libstdc++-v3/include/debug/hash_map.h | 270 + libstdc++-v3/include/debug/hash_multimap.h | 261 + libstdc++-v3/include/debug/hash_multiset.h | 236 + libstdc++-v3/include/debug/hash_set | 38 + libstdc++-v3/include/debug/hash_set.h | 245 + libstdc++-v3/include/debug/list | 505 + libstdc++-v3/include/debug/map | 38 + libstdc++-v3/include/debug/map.h | 323 + libstdc++-v3/include/debug/multimap.h | 314 + libstdc++-v3/include/debug/multiset.h | 320 + libstdc++-v3/include/debug/safe_base.h | 201 + libstdc++-v3/include/debug/safe_iterator.h | 607 + libstdc++-v3/include/debug/safe_iterator.tcc | 140 + libstdc++-v3/include/debug/safe_sequence.h | 179 + libstdc++-v3/include/debug/set | 38 + libstdc++-v3/include/debug/set.h | 325 + libstdc++-v3/include/debug/string | 1001 + libstdc++-v3/include/debug/vector | 412 + libstdc++-v3/include/ext/algorithm | 77 +- libstdc++-v3/include/ext/debug_allocator.h | 96 +- libstdc++-v3/include/ext/enc_filebuf.h | 26 +- libstdc++-v3/include/ext/functional | 28 +- libstdc++-v3/include/ext/hash_fun.h | 32 +- libstdc++-v3/include/ext/hash_map | 40 +- libstdc++-v3/include/ext/hash_set | 60 +- libstdc++-v3/include/ext/hashtable.h | 100 +- libstdc++-v3/include/ext/iterator | 6 +- libstdc++-v3/include/ext/malloc_allocator.h | 177 +- libstdc++-v3/include/ext/memory | 18 +- libstdc++-v3/include/ext/mt_allocator.h | 336 +- libstdc++-v3/include/ext/new_allocator.h | 79 +- libstdc++-v3/include/ext/numeric | 4 +- libstdc++-v3/include/ext/pod_char_traits.h | 78 +- libstdc++-v3/include/ext/pool_allocator.h | 41 +- libstdc++-v3/include/ext/rb_tree | 8 +- libstdc++-v3/include/ext/rope | 146 +- libstdc++-v3/include/ext/ropeimpl.h | 122 +- libstdc++-v3/include/ext/slist | 169 +- libstdc++-v3/include/ext/stdio_filebuf.h | 39 +- libstdc++-v3/include/ext/stdio_sync_filebuf.h | 34 +- libstdc++-v3/include/std/std_algorithm.h | 4 - libstdc++-v3/include/std/std_bitset.h | 93 +- libstdc++-v3/include/std/std_deque.h | 4 + libstdc++-v3/include/std/std_fstream.h | 63 +- libstdc++-v3/include/std/std_functional.h | 6 +- libstdc++-v3/include/std/std_iterator.h | 5 +- libstdc++-v3/include/std/std_list.h | 4 + libstdc++-v3/include/std/std_map.h | 8 +- libstdc++-v3/include/std/std_memory.h | 13 +- libstdc++-v3/include/std/std_numeric.h | 5 +- libstdc++-v3/include/std/std_queue.h | 10 +- libstdc++-v3/include/std/std_set.h | 8 +- libstdc++-v3/include/std/std_stack.h | 6 +- libstdc++-v3/include/std/std_streambuf.h | 20 +- libstdc++-v3/include/std/std_utility.h | 5 +- libstdc++-v3/include/std/std_valarray.h | 31 +- libstdc++-v3/include/std/std_vector.h | 4 + libstdc++-v3/libmath/Makefile.in | 15 +- libstdc++-v3/libmath/stubs.c | 195 +- libstdc++-v3/libsupc++/Makefile.in | 17 +- libstdc++-v3/libsupc++/vec.cc | 12 +- libstdc++-v3/linkage.m4 | 2 - libstdc++-v3/po/Makefile.in | 16 +- libstdc++-v3/scripts/testsuite_flags.in | 10 +- libstdc++-v3/src/Makefile.am | 4 +- libstdc++-v3/src/Makefile.in | 11 +- libstdc++-v3/src/ctype.cc | 13 +- libstdc++-v3/src/debug.cc | 660 + libstdc++-v3/src/demangle.cc | 2 +- libstdc++-v3/src/ios.cc | 2 +- libstdc++-v3/src/ios_init.cc | 13 +- libstdc++-v3/src/locale-inst.cc | 47 +- libstdc++-v3/src/locale.cc | 6 +- libstdc++-v3/src/locale_facets.cc | 2 +- libstdc++-v3/src/locale_init.cc | 46 +- libstdc++-v3/src/localename.cc | 2 +- libstdc++-v3/src/misc-inst.cc | 8 +- libstdc++-v3/src/streambuf-inst.cc | 4 +- libstdc++-v3/src/string-inst.cc | 19 +- .../testsuite/18_support/numeric_limits.cc | 2 +- .../testsuite/20_util/allocator_members.cc | 89 - libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc | 4 +- .../21_strings/basic_string/capacity/1.cc | 2 +- .../21_strings/basic_string/capacity/char/1.cc | 2 +- .../21_strings/basic_string/capacity/wchar_t/1.cc | 2 +- .../testsuite/22_locale/locale/cons/12352.cc | 3 +- .../testsuite/22_locale/locale/cons/12438.cc | 4 +- .../testsuite/22_locale/money_get/get/char/1.cc | 2 +- .../testsuite/22_locale/money_get/get/wchar_t/1.cc | 2 +- .../22_locale/money_put/put/char/12971.cc | 50 + .../22_locale/money_put/put/wchar_t/12971.cc | 50 + .../testsuite/22_locale/num_get/get/char/10.cc | 72 + .../testsuite/22_locale/num_get/get/char/11.cc | 69 + .../testsuite/22_locale/num_get/get/char/12.cc | 160 + .../testsuite/22_locale/num_get/get/char/13.cc | 79 + .../testsuite/22_locale/num_get/get/char/7.cc | 58 + .../testsuite/22_locale/num_get/get/char/8.cc | 70 + .../testsuite/22_locale/num_get/get/char/9.cc | 65 + .../testsuite/22_locale/num_get/get/wchar_t/10.cc | 72 + .../testsuite/22_locale/num_get/get/wchar_t/11.cc | 69 + .../testsuite/22_locale/num_get/get/wchar_t/12.cc | 160 + .../testsuite/22_locale/num_get/get/wchar_t/13.cc | 79 + .../testsuite/22_locale/num_get/get/wchar_t/7.cc | 58 + .../testsuite/22_locale/num_get/get/wchar_t/8.cc | 70 + .../testsuite/22_locale/num_get/get/wchar_t/9.cc | 65 + .../testsuite/22_locale/num_put/put/char/8.cc | 68 + .../testsuite/22_locale/num_put/put/wchar_t/8.cc | 68 + .../22_locale/time_get/get_date/char/12750.cc | 79 + .../22_locale/time_get/get_date/char/12791.cc | 65 + .../22_locale/time_get/get_date/wchar_t/1.cc | 4 +- .../22_locale/time_get/get_date/wchar_t/12750.cc | 79 + .../22_locale/time_get/get_date/wchar_t/12791.cc | 65 + .../22_locale/time_get/get_date/wchar_t/4.cc | 63 + .../22_locale/time_get/get_monthname/wchar_t/1.cc | 8 +- .../22_locale/time_get/get_time/wchar_t/1.cc | 2 +- .../22_locale/time_get/get_weekday/wchar_t/1.cc | 8 +- .../22_locale/time_get/get_year/wchar_t/1.cc | 6 +- .../testsuite/23_containers/list/operators/4.cc | 4 + .../testsuite/23_containers/vector/resize/1.cc | 2 +- .../testsuite/24_iterators/istreambuf_iterator.cc | 181 - .../testsuite/24_iterators/ostreambuf_iterator.cc | 118 - .../testsuite/24_iterators/reverse_iterator/1.cc | 7 +- libstdc++-v3/testsuite/25_algorithms/heap.cc | 8 + .../testsuite/26_numerics/complex_value.cc | 2 +- libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc | 4 +- .../testsuite/27_io/basic_filebuf/close/12790-1.cc | 78 + .../27_io/basic_filebuf/close/char/12790-1.cc | 79 + .../27_io/basic_filebuf/close/char/12790-2.cc | 81 + .../27_io/basic_filebuf/close/char/12790-3.cc | 80 + .../27_io/basic_filebuf/close/char/12790-4.cc | 80 + .../27_io/basic_filebuf/close/char/4879.cc | 7 +- .../27_io/basic_filebuf/close/char/9964.cc | 7 + .../27_io/basic_filebuf/imbue/char/13007.cc | 61 + .../27_io/basic_filebuf/imbue/char/13171-1.cc | 45 + .../27_io/basic_filebuf/imbue/char/13171-2.cc | 78 + .../27_io/basic_filebuf/imbue/char/13171-4.cc | 54 + .../testsuite/27_io/basic_filebuf/imbue/char/2.cc | 4 +- .../testsuite/27_io/basic_filebuf/imbue/char/3.cc | 3 +- .../27_io/basic_filebuf/imbue/wchar_t/12868.cc | 60 + .../27_io/basic_filebuf/imbue/wchar_t/13007.cc | 61 + .../27_io/basic_filebuf/imbue/wchar_t/13171-3.cc | 56 + .../27_io/basic_filebuf/imbue/wchar_t/2.cc | 4 +- .../27_io/basic_filebuf/imbue/wchar_t/3.cc | 3 +- .../testsuite/27_io/basic_filebuf/open/12790-1.cc | 60 + .../27_io/basic_filebuf/open/char/9507.cc | 7 +- .../basic_filebuf/overflow/wchar_t/11305-1.cc | 2 +- .../basic_filebuf/overflow/wchar_t/11305-2.cc | 4 +- .../basic_filebuf/overflow/wchar_t/11305-3.cc | 2 +- .../basic_filebuf/overflow/wchar_t/11305-4.cc | 4 +- .../27_io/basic_filebuf/seekoff/10132-2.cc | 4 +- .../27_io/basic_filebuf/seekoff/12790-1.cc | 82 + .../27_io/basic_filebuf/seekoff/12790-2.cc | 85 + .../27_io/basic_filebuf/seekoff/12790-3.cc | 80 + .../27_io/basic_filebuf/seekoff/12790-4.cc | 71 + .../27_io/basic_filebuf/seekoff/char/12790-1.cc | 79 + .../27_io/basic_filebuf/seekoff/char/12790-2.cc | 80 + .../27_io/basic_filebuf/seekoff/char/12790-3.cc | 79 + .../27_io/basic_filebuf/seekoff/char/12790-4.cc | 80 + .../27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc | 79 + .../27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc | 80 + .../27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc | 79 + .../27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc | 80 + .../27_io/basic_filebuf/seekoff/wchar_t/3.cc | 46 + .../27_io/basic_filebuf/seekpos/10132-3.cc | 4 +- .../27_io/basic_filebuf/seekpos/12790-1.cc | 66 + .../27_io/basic_filebuf/seekpos/12790-2.cc | 81 + .../27_io/basic_filebuf/seekpos/12790-3.cc | 79 + .../27_io/basic_filebuf/seekpos/char/1-io.cc | 2 +- .../27_io/basic_filebuf/seekpos/char/1-out.cc | 2 +- .../27_io/basic_filebuf/seekpos/char/12790-1.cc | 80 + .../27_io/basic_filebuf/seekpos/char/12790-2.cc | 81 + .../27_io/basic_filebuf/seekpos/char/12790-3.cc | 80 + .../27_io/basic_filebuf/seekpos/char/12790-4.cc | 81 + .../27_io/basic_filebuf/seekpos/wchar_t/1.cc | 46 + .../27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc | 80 + .../27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc | 81 + .../27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc | 80 + .../27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc | 81 + .../27_io/basic_filebuf/setbuf/char/12875-1.cc | 57 + .../27_io/basic_filebuf/setbuf/char/12875-2.cc | 55 + .../testsuite/27_io/basic_filebuf/setbuf/char/2.cc | 2 +- .../testsuite/27_io/basic_filebuf/setbuf/char/3.cc | 8 +- .../27_io/basic_filebuf/sgetn/char/1-in.cc | 4 + .../27_io/basic_filebuf/sgetn/char/1-io.cc | 4 + .../27_io/basic_filebuf/sgetn/char/2-in.cc | 4 + .../27_io/basic_filebuf/sgetn/char/2-io.cc | 4 + .../27_io/basic_filebuf/showmanyc/char/9533-1.cc | 6 + .../testsuite/27_io/basic_filebuf/sync/char/1.cc | 52 + .../27_io/basic_filebuf/underflow/char/10097.cc | 7 + .../basic_filebuf/underflow/wchar_t/11544-1.cc | 185 + .../basic_filebuf/underflow/wchar_t/11544-2.cc | 185 + .../27_io/basic_filebuf/underflow/wchar_t/11603.cc | 200 + libstdc++-v3/testsuite/27_io/basic_fstream/3.cc | 4 +- libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc | 4 +- .../testsuite/27_io/basic_ios/exceptions/char/2.cc | 59 + .../27_io/basic_istream/exceptions/char/9561.cc | 44 +- .../basic_istream/extractors_arithmetic/char/10.cc | 6 +- .../char/exceptions_badbit_throw.cc | 76 + .../char/exceptions_failbit.cc | 75 + .../char/exceptions_failbit_throw.cc | 78 + .../extractors_character/char/9555-ic.cc | 3 +- .../extractors_other/char/error_failbit.cc | 67 + .../char/exceptions_badbit_throw.cc | 79 + .../char/exceptions_failbit_throw.cc | 89 + .../extractors_other/char/exceptions_null.cc | 68 + .../27_io/basic_istream/readsome/char/6746-2.cc | 4 + .../seekg/char/exceptions_badbit_throw.cc | 96 + .../27_io/basic_istream/sentry/char/12297.cc | 50 + .../tellg/char/exceptions_badbit_throw.cc | 66 + libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc | 4 +- .../testsuite/27_io/basic_ostream/flush/char/2.cc | 66 + .../flush/char/exceptions_badbit_throw.cc | 66 + .../char/exceptions_badbit_throw.cc | 74 + .../char/exceptions_failbit_throw.cc | 76 + .../27_io/basic_ostream/inserters_other/char/5.cc | 99 + .../inserters_other/char/error_failbit.cc | 67 + .../char/exceptions_badbit_throw.cc | 79 + .../char/exceptions_failbit_throw.cc | 89 + .../inserters_other/char/exceptions_null.cc | 68 + .../tellp/char/exceptions_badbit_throw.cc | 66 + .../27_io/basic_streambuf/imbue/char/13007-1.cc | 49 + .../27_io/basic_streambuf/imbue/char/13007-2.cc | 61 + .../testsuite/27_io/ios_base/cons/assign_neg.cc | 2 +- .../testsuite/27_io/ios_base/cons/copy_neg.cc | 2 +- libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc | 2 +- libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc | 2 +- libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc | 2 +- .../27_io/manipulators/standard/char/2.cc | 4 +- libstdc++-v3/testsuite/27_io/objects/char/5.cc | 1 + libstdc++-v3/testsuite/27_io/objects/char/7.cc | 7 + libstdc++-v3/testsuite/27_io/objects/char/9.cc | 4 + .../testsuite/27_io/objects/char/9661-1.cc | 7 + libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc | 1 + libstdc++-v3/testsuite/Makefile.am | 5 +- libstdc++-v3/testsuite/Makefile.in | 21 +- libstdc++-v3/testsuite/backward/11460.cc | 3 +- .../testsuite/backward/strstream_members.cc | 3 +- libstdc++-v3/testsuite/demangle/abi_examples/10.cc | 2 +- libstdc++-v3/testsuite/demangle/abi_text/01.cc | 2 +- .../testsuite/demangle/regression/3111-2.cc | 2 +- .../testsuite/demangle/regression/7986-01.cc | 2 +- .../testsuite/demangle/regression/7986-07.cc | 2 +- .../testsuite/demangle/regression/cw-16.cc | 53 + libstdc++-v3/testsuite/ext/allocators.cc | 50 +- libstdc++-v3/testsuite/ext/stdio_filebuf.cc | 36 - libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc | 59 - .../testsuite/ext/stdio_sync_filebuf_char.cc | 140 - .../testsuite/ext/stdio_sync_filebuf_wchar_t.cc | 142 - libstdc++-v3/testsuite/lib/libstdc++.exp | 39 +- libstdc++-v3/testsuite/libstdc++-dg/normal.exp | 31 +- libstdc++-v3/testsuite/performance/allocator.cc | 6 +- .../testsuite/performance/container_benchmark.cc | 175 + .../testsuite/performance/ifstream_extract_int.cc | 57 + libstdc++-v3/testsuite/performance/is_wchar_t.cc | 87 + .../testsuite/performance/list_create_fill_sort.cc | 2 +- .../testsuite/performance/narrow_widen_char.cc | 76 + .../testsuite/performance/narrow_widen_wchar_t.cc | 76 + libstdc++-v3/testsuite/performance/wchar_t_in.cc | 84 + .../testsuite/performance/wchar_t_length.cc | 62 + libstdc++-v3/testsuite/performance/wchar_t_out.cc | 84 + libstdc++-v3/testsuite/testsuite_character.h | 415 + libstdc++-v3/testsuite/testsuite_io.h | 186 + libstdc++-v3/testsuite/testsuite_performance.h | 23 +- libtool.m4 | 5 +- ltcf-c.sh | 59 +- ltcf-cxx.sh | 47 +- ltcf-gcj.sh | 49 + ltconfig | 23 +- ltmain.sh | 59 +- maintainer-scripts/ChangeLog | 4 + maintainer-scripts/maintainer-addresses | 25 + 2014 files changed, 178026 insertions(+), 87057 deletions(-) delete mode 100644 fastjar/.cvsignore delete mode 100755 fastjar/install-sh delete mode 100755 fastjar/missing delete mode 100755 fastjar/mkinstalldirs delete mode 100644 fastjar/stamp-h.in delete mode 100644 gcc/ada/.cvsignore create mode 100644 gcc/ada/35soccon.ads create mode 100644 gcc/ada/45intnam.ads create mode 100644 gcc/ada/55osinte.adb create mode 100644 gcc/ada/55osinte.ads create mode 100644 gcc/ada/56system.ads delete mode 100644 gcc/ada/5lintman.adb create mode 100644 gcc/ada/5nsystem.ads delete mode 100644 gcc/ada/5ytiitho.adb create mode 100644 gcc/ada/5zintman.ads delete mode 100644 gcc/ada/5zthrini.adb delete mode 100644 gcc/ada/5ztiitho.adb create mode 100644 gcc/ada/a-elchha.adb create mode 100644 gcc/ada/a-elchha.ads delete mode 100644 gcc/ada/einfo.h create mode 100644 gcc/ada/g-signal.adb create mode 100644 gcc/ada/g-signal.ads delete mode 100644 gcc/ada/gnat_wrapper.adb delete mode 100644 gcc/ada/gnatpsta.adb delete mode 100644 gcc/ada/i-vthrea.adb delete mode 100644 gcc/ada/i-vthrea.ads delete mode 100644 gcc/ada/nmake.adb delete mode 100644 gcc/ada/nmake.ads create mode 100644 gcc/ada/s-crtl.ads delete mode 100644 gcc/ada/s-tpae65.adb delete mode 100644 gcc/ada/s-tpae65.ads delete mode 100644 gcc/ada/sinfo.h create mode 100644 gcc/ada/stamp-xgnatug delete mode 100644 gcc/ada/treeprs.ads delete mode 100755 gcc/config.guess create mode 100644 gcc/config/arm/arm-cores.def create mode 100644 gcc/config/arm/arm-generic.md create mode 100644 gcc/config/arm/arm1026ejs.md create mode 100644 gcc/config/arm/arm1136jfs.md create mode 100644 gcc/config/arm/arm926ejs.md create mode 100644 gcc/config/arm/vfp.md delete mode 100644 gcc/config/i386/scodbx.h delete mode 100644 gcc/config/i386/xm-dgux.h delete mode 100644 gcc/config/i386/xm-sun.h delete mode 100644 gcc/config/i386/xm-sysv3.h create mode 100644 gcc/config/mips/irix6-crti.asm create mode 100644 gcc/config/mips/irix6-crtn.asm delete mode 100644 gcc/config/mips/irix6-libc-compat.c create mode 100644 gcc/config/mips/t-iris6gld create mode 100644 gcc/config/t-slibgcc-darwin delete mode 100644 gcc/dbxstclass.h delete mode 100644 gcc/doc/.cvsignore delete mode 100644 gcc/doschk.c delete mode 100644 gcc/dwarfout.c delete mode 100644 gcc/f/.cvsignore create mode 100644 gcc/fixinc/tests/base/wchar.h delete mode 100644 gcc/future.options delete mode 100644 gcc/java/.cvsignore create mode 100644 gcc/libgcc-darwin.ver delete mode 100644 gcc/objc/.cvsignore delete mode 100644 gcc/ssa-ccp.c delete mode 100644 gcc/ssa-dce.c delete mode 100644 gcc/ssa.c delete mode 100644 gcc/ssa.h create mode 100644 gcc/testsuite/g++.dg/abi/covariant2.C create mode 100644 gcc/testsuite/g++.dg/abi/covariant3.C create mode 100644 gcc/testsuite/g++.dg/abi/macro0.C create mode 100644 gcc/testsuite/g++.dg/abi/macro1.C create mode 100644 gcc/testsuite/g++.dg/abi/macro2.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle18-1.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle18-2.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle19-1.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle19-2.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle20-1.C create mode 100644 gcc/testsuite/g++.dg/abi/mangle20-2.C create mode 100644 gcc/testsuite/g++.dg/eh/dtor2.C create mode 100644 gcc/testsuite/g++.dg/eh/ia64-1.C create mode 100644 gcc/testsuite/g++.dg/expr/assign1.C create mode 100644 gcc/testsuite/g++.dg/expr/sizeof1.C create mode 100644 gcc/testsuite/g++.dg/ext/attrib10.C create mode 100644 gcc/testsuite/g++.dg/ext/attrib11.C create mode 100644 gcc/testsuite/g++.dg/ext/attrib9.C create mode 100644 gcc/testsuite/g++.dg/ext/cond1.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-1.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-2.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-3.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-4.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-5.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-6.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility-7.C create mode 100644 gcc/testsuite/g++.dg/inherit/operator2.C create mode 100644 gcc/testsuite/g++.dg/init/array12.C create mode 100644 gcc/testsuite/g++.dg/init/assign1.C create mode 100644 gcc/testsuite/g++.dg/init/bitfield2.C create mode 100644 gcc/testsuite/g++.dg/init/cleanup1.C create mode 100644 gcc/testsuite/g++.dg/init/cleanup2.C create mode 100644 gcc/testsuite/g++.dg/init/error1.C create mode 100644 gcc/testsuite/g++.dg/init/placement1.C create mode 100644 gcc/testsuite/g++.dg/init/placement2.C create mode 100644 gcc/testsuite/g++.dg/init/pm3.C create mode 100644 gcc/testsuite/g++.dg/lookup/java1.C create mode 100644 gcc/testsuite/g++.dg/lookup/java2.C create mode 100644 gcc/testsuite/g++.dg/lookup/ns1.C create mode 100644 gcc/testsuite/g++.dg/lookup/used-before-declaration.C create mode 100644 gcc/testsuite/g++.dg/lookup/using9.C create mode 100644 gcc/testsuite/g++.dg/opt/const3.C create mode 100644 gcc/testsuite/g++.dg/opt/expect1.C create mode 100644 gcc/testsuite/g++.dg/opt/inline6.C create mode 100644 gcc/testsuite/g++.dg/opt/noreturn-1.C create mode 100644 gcc/testsuite/g++.dg/opt/reg-stack4.C create mode 100644 gcc/testsuite/g++.dg/other/java1.C create mode 100644 gcc/testsuite/g++.dg/other/stdarg2.C create mode 100644 gcc/testsuite/g++.dg/other/struct-va_list.C create mode 100644 gcc/testsuite/g++.dg/parse/dce1.C create mode 100644 gcc/testsuite/g++.dg/parse/defarg6.C create mode 100644 gcc/testsuite/g++.dg/parse/error3.C create mode 100644 gcc/testsuite/g++.dg/parse/error4.C create mode 100644 gcc/testsuite/g++.dg/parse/error5.C create mode 100644 gcc/testsuite/g++.dg/parse/error6.C create mode 100644 gcc/testsuite/g++.dg/parse/error7.C create mode 100644 gcc/testsuite/g++.dg/parse/error8.C create mode 100644 gcc/testsuite/g++.dg/parse/error9.C create mode 100644 gcc/testsuite/g++.dg/parse/explicit1.C create mode 100644 gcc/testsuite/g++.dg/parse/nontype1.C create mode 100644 gcc/testsuite/g++.dg/parse/offsetof1.C create mode 100644 gcc/testsuite/g++.dg/parse/offsetof2.C create mode 100644 gcc/testsuite/g++.dg/parse/semicolon1.C create mode 100644 gcc/testsuite/g++.dg/parse/semicolon1.h create mode 100644 gcc/testsuite/g++.dg/template/access13.C create mode 100644 gcc/testsuite/g++.dg/template/array1-1.C create mode 100644 gcc/testsuite/g++.dg/template/array1-2.C create mode 100644 gcc/testsuite/g++.dg/template/array2-1.C create mode 100644 gcc/testsuite/g++.dg/template/array2-2.C create mode 100644 gcc/testsuite/g++.dg/template/crash14.C create mode 100644 gcc/testsuite/g++.dg/template/crash15.C create mode 100644 gcc/testsuite/g++.dg/template/dependent-expr3.C create mode 100644 gcc/testsuite/g++.dg/template/eh1.C create mode 100644 gcc/testsuite/g++.dg/template/error10.C create mode 100644 gcc/testsuite/g++.dg/template/error3.C create mode 100644 gcc/testsuite/g++.dg/template/error4.C create mode 100644 gcc/testsuite/g++.dg/template/error5.C create mode 100644 gcc/testsuite/g++.dg/template/error6.C create mode 100644 gcc/testsuite/g++.dg/template/error7.C create mode 100644 gcc/testsuite/g++.dg/template/error8.C create mode 100644 gcc/testsuite/g++.dg/template/error9.C create mode 100644 gcc/testsuite/g++.dg/template/instantiate5.C create mode 100644 gcc/testsuite/g++.dg/template/lookup3.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend1.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend2.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend3.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend4.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend5.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend6.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend7.C create mode 100644 gcc/testsuite/g++.dg/template/memfriend8.C create mode 100644 gcc/testsuite/g++.dg/template/nontype3.C create mode 100644 gcc/testsuite/g++.dg/template/ptrmem7.C create mode 100644 gcc/testsuite/g++.dg/template/ptrmem8.C create mode 100644 gcc/testsuite/g++.dg/template/recurse1.C create mode 100644 gcc/testsuite/g++.dg/template/static5.C create mode 100644 gcc/testsuite/g++.dg/template/template-id-2.C create mode 100644 gcc/testsuite/g++.dg/template/using8.C create mode 100644 gcc/testsuite/g++.dg/warn/ctor-init-1.C create mode 100644 gcc/testsuite/g++.dg/warn/format3.C create mode 100644 gcc/testsuite/g++.dg/warn/noreturn-3.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.jason/template18.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.jason/template37.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb42.C create mode 100644 gcc/testsuite/g77.dg/12632.f create mode 100644 gcc/testsuite/g77.f-torture/compile/13060.f create mode 100644 gcc/testsuite/g77.f-torture/execute/10197.x create mode 100644 gcc/testsuite/g77.f-torture/execute/13037.f create mode 100644 gcc/testsuite/gcc.c-torture/compile/200031109-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031023-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031023-2.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031023-3.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031023-4.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031031-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031031-2.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031102-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031112-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031113-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031208-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031220-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031220-2.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031227-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/libcall-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20031201-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20031204-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20031214-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20031215-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20031216-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/loop-2f.x delete mode 100644 gcc/testsuite/gcc.c-torture/execute/loop-2g.x create mode 100644 gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/simd-4.x delete mode 100644 gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x create mode 100644 gcc/testsuite/gcc.c-torture/execute/va-arg-25.x delete mode 100644 gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x delete mode 100644 gcc/testsuite/gcc.dg/20020201-2.c delete mode 100644 gcc/testsuite/gcc.dg/20020201-4.c delete mode 100644 gcc/testsuite/gcc.dg/20020304-1.c create mode 100644 gcc/testsuite/gcc.dg/20031102-1.c create mode 100644 gcc/testsuite/gcc.dg/20031108-1.c create mode 100644 gcc/testsuite/gcc.dg/20031111-1.c create mode 100644 gcc/testsuite/gcc.dg/20031201-1.c create mode 100644 gcc/testsuite/gcc.dg/20031201-2.c create mode 100644 gcc/testsuite/gcc.dg/20031202-1.c create mode 100644 gcc/testsuite/gcc.dg/20031216-1.c create mode 100644 gcc/testsuite/gcc.dg/20031218-1.c create mode 100644 gcc/testsuite/gcc.dg/20031218-2.c create mode 100644 gcc/testsuite/gcc.dg/20031218-3.c create mode 100644 gcc/testsuite/gcc.dg/20031222-1.c create mode 100644 gcc/testsuite/gcc.dg/20031223-1.c create mode 100644 gcc/testsuite/gcc.dg/altivec-10.c create mode 100644 gcc/testsuite/gcc.dg/altivec-varargs-1.c create mode 100644 gcc/testsuite/gcc.dg/arm-g2.c create mode 100644 gcc/testsuite/gcc.dg/arm-scd42-1.c create mode 100644 gcc/testsuite/gcc.dg/arm-scd42-2.c create mode 100644 gcc/testsuite/gcc.dg/arm-scd42-3.c create mode 100644 gcc/testsuite/gcc.dg/bitfld-7.c create mode 100644 gcc/testsuite/gcc.dg/bitfld-8.c create mode 100644 gcc/testsuite/gcc.dg/builtin-apply2.c create mode 100644 gcc/testsuite/gcc.dg/builtin-apply3.c create mode 100644 gcc/testsuite/gcc.dg/builtin-return-1.c create mode 100644 gcc/testsuite/gcc.dg/builtins-config.h create mode 100644 gcc/testsuite/gcc.dg/cast-function-1.c create mode 100644 gcc/testsuite/gcc.dg/cleanup-10.c create mode 100644 gcc/testsuite/gcc.dg/cleanup-11.c create mode 100644 gcc/testsuite/gcc.dg/complex-1.c create mode 100644 gcc/testsuite/gcc.dg/compound-lvalue-1.c create mode 100644 gcc/testsuite/gcc.dg/cond-lvalue-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/assert4.c create mode 100644 gcc/testsuite/gcc.dg/cpp/trad/macro.c create mode 100644 gcc/testsuite/gcc.dg/cpp/trad/xwin1.c create mode 100644 gcc/testsuite/gcc.dg/darwin-misaligned.c create mode 100644 gcc/testsuite/gcc.dg/debug/debug-7.c create mode 100644 gcc/testsuite/gcc.dg/macho-lo-sum.c create mode 100644 gcc/testsuite/gcc.dg/nested-func-1.c create mode 100644 gcc/testsuite/gcc.dg/noreturn-7.c create mode 100644 gcc/testsuite/gcc.dg/null-pointer-1.c create mode 100644 gcc/testsuite/gcc.dg/overflow-1.c create mode 100644 gcc/testsuite/gcc.dg/ppc-stackalign-1.c create mode 100644 gcc/testsuite/gcc.dg/tls/asm-1.c create mode 100644 gcc/testsuite/gcc.dg/trampoline-1.c create mode 100644 gcc/testsuite/gcc.dg/unaligned-1.c create mode 100644 gcc/testsuite/gcc.dg/visibility-1.c create mode 100644 gcc/testsuite/gcc.dg/visibility-2.c create mode 100644 gcc/testsuite/gcc.dg/visibility-3.c create mode 100644 gcc/testsuite/gcc.dg/visibility-4.c create mode 100644 gcc/testsuite/gcc.dg/visibility-5.c create mode 100644 gcc/testsuite/gcc.dg/visibility-6.c create mode 100644 gcc/testsuite/gcc.dg/visibility-7.c create mode 100644 gcc/testsuite/objc.dg/proto-lossage-3.m delete mode 100644 gcc/treelang/.cvsignore create mode 100644 gcc/xcoff.h create mode 100644 libffi/testsuite/libffi.call/closure_fn4.c create mode 100644 libffi/testsuite/libffi.call/closure_fn5.c create mode 100644 libffi/testsuite/libffi.call/cls_18byte.c create mode 100644 libffi/testsuite/libffi.call/cls_19byte.c create mode 100644 libffi/testsuite/libffi.call/cls_20byte1.c create mode 100644 libffi/testsuite/libffi.call/cls_64byte.c create mode 100644 libffi/testsuite/libffi.call/cls_9byte1.c create mode 100644 libffi/testsuite/libffi.call/cls_9byte2.c create mode 100644 libffi/testsuite/libffi.call/cls_align_double.c create mode 100644 libffi/testsuite/libffi.call/cls_align_float.c create mode 100644 libffi/testsuite/libffi.call/cls_align_longdouble.c create mode 100644 libffi/testsuite/libffi.call/cls_align_pointer.c create mode 100644 libffi/testsuite/libffi.call/cls_align_sint16.c create mode 100644 libffi/testsuite/libffi.call/cls_align_sint32.c create mode 100644 libffi/testsuite/libffi.call/cls_align_sint64.c create mode 100644 libffi/testsuite/libffi.call/cls_align_uint16.c create mode 100644 libffi/testsuite/libffi.call/cls_align_uint32.c create mode 100644 libffi/testsuite/libffi.call/cls_align_uint64.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_schar.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_sshort.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_sshortchar.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_uchar.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_ushort.c create mode 100644 libffi/testsuite/libffi.call/cls_multi_ushortchar.c create mode 100644 libffi/testsuite/libffi.call/cls_schar.c create mode 100644 libffi/testsuite/libffi.call/cls_sint.c create mode 100644 libffi/testsuite/libffi.call/cls_sshort.c create mode 100644 libffi/testsuite/libffi.call/nested_struct2.c create mode 100644 libffi/testsuite/libffi.call/nested_struct3.c delete mode 100644 libjava/gnu/awt/gtk/GtkButtonPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkComponentPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkContainerPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkFramePeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkLabelPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkMainThread.java delete mode 100644 libjava/gnu/awt/gtk/GtkToolkit.java delete mode 100644 libjava/gnu/awt/gtk/GtkWindowPeer.java delete mode 100644 libjava/gnu/awt/gtk/gtkcommon.cc delete mode 100644 libjava/gnu/awt/gtk/gtkcommon.h delete mode 100644 libjava/gnu/awt/gtk/natGtkButtonPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkComponentPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkContainerPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkFramePeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkLabelPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkMainThread.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkToolkit.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkWindowPeer.cc create mode 100644 libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java create mode 100644 libjava/gnu/java/net/HeaderFieldHelper.java create mode 100644 libjava/gnu/java/net/URLParseError.java create mode 100644 libjava/gnu/java/nio/ChannelInputStream.java create mode 100644 libjava/gnu/java/nio/ChannelOutputStream.java create mode 100644 libjava/gnu/java/nio/InputStreamChannel.java create mode 100644 libjava/gnu/java/nio/OutputStreamChannel.java delete mode 100644 libjava/gnu/java/nio/natPipeImpl.cc create mode 100644 libjava/gnu/java/nio/natPipeImplEcos.cc create mode 100644 libjava/gnu/java/nio/natPipeImplPosix.cc create mode 100644 libjava/gnu/java/nio/natPipeImplWin32.cc delete mode 100644 libjava/gnu/java/nio/natSelectorImpl.cc create mode 100644 libjava/gnu/java/nio/natSelectorImplEcos.cc create mode 100644 libjava/gnu/java/nio/natSelectorImplPosix.cc create mode 100644 libjava/gnu/java/nio/natSelectorImplWin32.cc create mode 100644 libjava/gnu/java/rmi/server/RMIVoidValue.java create mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-1.png create mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-2.png create mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-3.png create mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-4.png create mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-5.png create mode 100644 libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html create mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-4.png create mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-5.png create mode 100644 libjava/java/text/FormatCharacterIterator.java create mode 100644 libjava/java/util/Currency.java create mode 100644 libjava/java/util/logging/logging.properties create mode 100644 libjava/javax/print/attribute/AttributeSetUtilities.java create mode 100644 libjava/javax/print/attribute/DateTimeSyntax.java create mode 100644 libjava/javax/print/attribute/DocAttribute.java create mode 100644 libjava/javax/print/attribute/DocAttributeSet.java create mode 100644 libjava/javax/print/attribute/EnumSyntax.java create mode 100644 libjava/javax/print/attribute/HashAttributeSet.java create mode 100644 libjava/javax/print/attribute/HashDocAttributeSet.java create mode 100644 libjava/javax/print/attribute/HashPrintJobAttributeSet.java create mode 100644 libjava/javax/print/attribute/HashPrintRequestAttributeSet.java create mode 100644 libjava/javax/print/attribute/HashPrintServiceAttributeSet.java create mode 100644 libjava/javax/print/attribute/IntegerSyntax.java create mode 100644 libjava/javax/print/attribute/PrintJobAttribute.java create mode 100644 libjava/javax/print/attribute/PrintJobAttributeSet.java create mode 100644 libjava/javax/print/attribute/PrintRequestAttribute.java create mode 100644 libjava/javax/print/attribute/PrintServiceAttribute.java create mode 100644 libjava/javax/print/attribute/PrintServiceAttributeSet.java create mode 100644 libjava/javax/print/attribute/ResolutionSyntax.java create mode 100644 libjava/javax/print/attribute/SetOfIntegerSyntax.java create mode 100644 libjava/javax/print/attribute/Size2DSyntax.java create mode 100644 libjava/javax/print/attribute/SupportedValuesAttribute.java create mode 100644 libjava/javax/print/attribute/TextSyntax.java create mode 100644 libjava/javax/print/attribute/URISyntax.java create mode 100644 libjava/javax/print/attribute/UnmodifiableSetException.java create mode 100644 libjava/jni/gtk-peer/gdkfont.h create mode 100644 libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c delete mode 100644 libjava/libltdl/acconfig.h create mode 100644 libjava/libltdl/config-h.in create mode 100755 libjava/libltdl/config.guess delete mode 100644 libjava/libltdl/config.h.in create mode 100755 libjava/libltdl/config.sub create mode 100644 libjava/libltdl/configure.ac delete mode 100644 libjava/libltdl/configure.in create mode 100755 libjava/libltdl/install-sh create mode 100644 libjava/libltdl/ltmain.sh create mode 100755 libjava/libltdl/missing create mode 100755 libjava/libltdl/mkinstalldirs delete mode 100644 libjava/libltdl/stamp-h.in create mode 100644 libjava/testsuite/libjava.compile/InnerExcept.java create mode 100644 libjava/testsuite/libjava.compile/PR12374.java create mode 100644 libjava/testsuite/libjava.compile/PR12857.java create mode 100644 libjava/testsuite/libjava.compile/PR13024.java create mode 100644 libjava/testsuite/libjava.compile/PR13237.java create mode 100644 libjava/testsuite/libjava.jni/jniutf.c create mode 100644 libjava/testsuite/libjava.jni/jniutf.java create mode 100644 libjava/testsuite/libjava.jni/jniutf.out create mode 100644 libjava/testsuite/libjava.lang/PR12915.java create mode 100644 libjava/testsuite/libjava.lang/PR12915.out create mode 100644 libstdc++-v3/docs/html/debug_mode.html create mode 100644 libstdc++-v3/include/bits/concurrence.h create mode 100644 libstdc++-v3/include/debug/bitset create mode 100644 libstdc++-v3/include/debug/debug.h create mode 100644 libstdc++-v3/include/debug/deque create mode 100644 libstdc++-v3/include/debug/formatter.h create mode 100644 libstdc++-v3/include/debug/hash_map create mode 100644 libstdc++-v3/include/debug/hash_map.h create mode 100644 libstdc++-v3/include/debug/hash_multimap.h create mode 100644 libstdc++-v3/include/debug/hash_multiset.h create mode 100644 libstdc++-v3/include/debug/hash_set create mode 100644 libstdc++-v3/include/debug/hash_set.h create mode 100644 libstdc++-v3/include/debug/list create mode 100644 libstdc++-v3/include/debug/map create mode 100644 libstdc++-v3/include/debug/map.h create mode 100644 libstdc++-v3/include/debug/multimap.h create mode 100644 libstdc++-v3/include/debug/multiset.h create mode 100644 libstdc++-v3/include/debug/safe_base.h create mode 100644 libstdc++-v3/include/debug/safe_iterator.h create mode 100644 libstdc++-v3/include/debug/safe_iterator.tcc create mode 100644 libstdc++-v3/include/debug/safe_sequence.h create mode 100644 libstdc++-v3/include/debug/set create mode 100644 libstdc++-v3/include/debug/set.h create mode 100644 libstdc++-v3/include/debug/string create mode 100644 libstdc++-v3/include/debug/vector create mode 100644 libstdc++-v3/src/debug.cc delete mode 100644 libstdc++-v3/testsuite/20_util/allocator_members.cc create mode 100644 libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc create mode 100644 libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc create mode 100644 libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc create mode 100644 libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc create mode 100644 libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc create mode 100644 libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc create mode 100644 libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc delete mode 100644 libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc delete mode 100644 libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc create mode 100644 libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc create mode 100644 libstdc++-v3/testsuite/demangle/regression/cw-16.cc delete mode 100644 libstdc++-v3/testsuite/ext/stdio_filebuf.cc delete mode 100644 libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc delete mode 100644 libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc delete mode 100644 libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc create mode 100644 libstdc++-v3/testsuite/performance/container_benchmark.cc create mode 100644 libstdc++-v3/testsuite/performance/ifstream_extract_int.cc create mode 100644 libstdc++-v3/testsuite/performance/is_wchar_t.cc create mode 100644 libstdc++-v3/testsuite/performance/narrow_widen_char.cc create mode 100644 libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc create mode 100644 libstdc++-v3/testsuite/performance/wchar_t_in.cc create mode 100644 libstdc++-v3/testsuite/performance/wchar_t_length.cc create mode 100644 libstdc++-v3/testsuite/performance/wchar_t_out.cc create mode 100644 libstdc++-v3/testsuite/testsuite_character.h create mode 100755 maintainer-scripts/maintainer-addresses diff --git a/ChangeLog b/ChangeLog index 2273b43846d..5f1d9cfa967 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,64 @@ +2003-12-23 Kazu Hirata + + * MAINTAINERS: Remove the mn10200 maintainer. + +2003-12-21 Bernardo Innocenti + + * configure.in (*-*-uclinux): Exclude newlib, libgloss and rda. + * configure: Regenerated. + +2003-12-16 Jan Hubicka + + * MAINTAINERS: Add myself as callgraph maintainer. + +2003-12-08 Thomas Fitzsimmons + + * configure.in (raw_libstdcxx_flags): Remove the leading space. + * configure: Regenerate. + +2003-12-01 Giovanni Bajo + + * MAINTAINERS: Move myself from 'Bug database only accounts' to + 'Write After Approval' section. Update email. + +2003-12-01 James Lemke + + * MAINTAINERS (Write After Approval): Add myself. + +2003-11-20 Matt Thomas + + * MAINTAINERS: Add myself as a vax port maintainer. + +2003-11-20 Kelley Cook + + * Makefile.tpl (BASE_FLAGS_TO_PASS): Pass along CONFIG_SHELL. + (configure-build-[+module+], configure-[+module+]): Likewise. + (configure-target-[+module+], configure-gcc, config.status): Likewise. + * Makefile.in: Regenerate. + +2003-11-19 Andreas Tobler + + * libtool.m4: Sync darwin bits from libtool cvs to build a gcc with + shared/dylibed libraries. + * ltmain.sh: Likewise. + * ltcf-c.sh: Likewise, disable shared library build for OS-X < 10.3. + * ltcf-cxx.sh: Likewise. + * ltcf-gcj.sh: Likewise. + * ltconfig: Likewise. + +2003-11-17 Stan Cox + + * MAINTAINERS: Add myself as iq2000 port maintainer. + +2003-11-14 Arnaud Charlet + + * Makefile.tpl (EXTRA_GCC_FLAGS): Pass BOOT_ADAFLAGS. + * Makefile.in: Regenerate. + +2003-11-03 Ulrich Weigand + + * config.sub: Update to 2003-11-03 version. + 2003-10-20 Phil Edwards * configure.in (*-*-vxworks): Add target-libiberty to noconfdirs. diff --git a/MAINTAINERS b/MAINTAINERS index 9fcc8636ddd..db62e1f8e2f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -53,6 +53,7 @@ i860 port Jason Eckhardt jle@rice.edu i960 port Jim Wilson wilson@specifixinc.com ia64 port Jim Wilson wilson@specifixinc.com ip2k port Denis Chertykov denisc@overta.ru +iq2000 port Stan Cox scox@redhat.com m32r port Nick Clifton nickc@redhat.com m68hc11 port Stephane Carrez stcarrez@nerim.fr m68k port (?) Jeff Law law@redhat.com @@ -60,7 +61,6 @@ m68k-motorola-sysv port Philippe De Muyter phdm@macqel.be mcore port Nick Clifton nickc@redhat.com mips port Eric Christopher echristo@redhat.com mmix port Hans-Peter Nilsson hp@bitrange.com -mn10200 port Jeff Law law@redhat.com mn10300 port Jeff Law law@redhat.com mn10300 port Alexandre Oliva aoliva@redhat.com ns32k port Ian Dall ian@beware.dropbear.id.au @@ -77,6 +77,7 @@ sparc port David S. Miller davem@redhat.com sparc port Jakub Jelinek jakub@redhat.com v850 port Nick Clifton nickc@redhat.com vax port Dave Anglin dave.anglin@nrc.ca +vax port Matt Thomas matt@3am-software.com x86-64 port Jan Hubicka jh@suse.cz xstormy16 port Geoffrey Keating geoffk@geoffk.org xtensa port Bob Wilson bob.wilson@acm.org @@ -123,6 +124,7 @@ scheduler (+ haifa) Michael Meissner gnu@the-meissners.org scheduler (+ haifa) Jeff Law law@redhat.com reorg Jeff Law law@redhat.com caller-save.c Jeff Law law@redhat.com +callgraph Jan Hubicka jh@suse.cz debugging code Jim Wilson wilson@specifixinc.com dwarf debugging code Jason Merrill jason@redhat.com c++ runtime libs Paolo Carlini pcarlini@unitus.it @@ -172,6 +174,7 @@ in changes outside of the parts of the compiler they maintain. Write After Approval (last name alphabetical order) Matt Austern austern@apple.com +Giovanni Bajo giovannibajo@gcc.gnu.org Scott Bambrough scottb@netwinder.org Wolfgang Bangerth bangerth@dealii.org Daniel Berlin dan@dberlin.org @@ -219,6 +222,7 @@ Jeff Knaggs jknaggs@redhat.com Matt Kraai kraai@alumni.cmu.edu Marc Lehmann pcg@goof.com Alan Lehotsky apl@alum.mit.edu +James Lemke jim@wasabisystems.com Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net Warren Levy warrenl@cruzio.com Don Lindsay dlindsay@redhat.com @@ -278,7 +282,6 @@ Josef Zlomek zlomekj@suse.cz Bug database only accounts -Giovanni Bajo giovannibajo@libero.it James Dennett jdennett@acm.org Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de Dara Hazeghi dhazeghi@yahoo.com diff --git a/Makefile.in b/Makefile.in index fc0fcc98e58..8fe85ff369f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -446,6 +446,7 @@ BASE_FLAGS_TO_PASS = \ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ + "CONFIG_SHELL=$(SHELL)" \ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" # For any flags above that may contain shell code that varies from one @@ -522,7 +523,8 @@ EXTRA_GCC_FLAGS = \ "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ - "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" + "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`" GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) @@ -17607,6 +17609,7 @@ configure-build-libiberty: AS="$(AS_FOR_BUILD)"; export AS; \ CC="$(CC_FOR_BUILD)"; export CC; \ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX_FOR_BUILD)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ @@ -17678,6 +17681,7 @@ configure-ash: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -17744,6 +17748,7 @@ configure-autoconf: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -17810,6 +17815,7 @@ configure-automake: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -17876,6 +17882,7 @@ configure-bash: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -17942,6 +17949,7 @@ configure-bfd: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18008,6 +18016,7 @@ configure-opcodes: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18074,6 +18083,7 @@ configure-binutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18140,6 +18150,7 @@ configure-bison: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18209,6 +18220,7 @@ configure-byacc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18278,6 +18290,7 @@ configure-bzip2: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18344,6 +18357,7 @@ configure-dejagnu: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18410,6 +18424,7 @@ configure-diff: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18476,6 +18491,7 @@ configure-dosutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18538,6 +18554,7 @@ configure-etc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18604,6 +18621,7 @@ configure-fastjar: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18673,6 +18691,7 @@ configure-fileutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18739,6 +18758,7 @@ configure-findutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18805,6 +18825,7 @@ configure-find: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18871,6 +18892,7 @@ configure-flex: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -18940,6 +18962,7 @@ configure-gas: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19006,6 +19029,7 @@ configure-gawk: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19072,6 +19096,7 @@ configure-gettext: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19138,6 +19163,7 @@ configure-gnuserv: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19204,6 +19230,7 @@ configure-gprof: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19270,6 +19297,7 @@ configure-gzip: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19336,6 +19364,7 @@ configure-hello: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19402,6 +19431,7 @@ configure-indent: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19468,6 +19498,7 @@ configure-intl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19534,6 +19565,7 @@ configure-tcl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19600,6 +19632,7 @@ configure-itcl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19666,6 +19699,7 @@ configure-ld: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19732,6 +19766,7 @@ configure-libgui: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19798,6 +19833,7 @@ configure-libiberty: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19864,6 +19900,7 @@ configure-libtool: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19930,6 +19967,7 @@ configure-m4: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -19996,6 +20034,7 @@ configure-make: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20062,6 +20101,7 @@ configure-mmalloc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20124,6 +20164,7 @@ configure-patch: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20190,6 +20231,7 @@ configure-perl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20256,6 +20298,7 @@ configure-prms: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20322,6 +20365,7 @@ configure-rcs: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20388,6 +20432,7 @@ configure-readline: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20454,6 +20499,7 @@ configure-release: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20512,6 +20558,7 @@ configure-recode: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20578,6 +20625,7 @@ configure-sed: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20644,6 +20692,7 @@ configure-send-pr: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20710,6 +20759,7 @@ configure-shellutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20776,6 +20826,7 @@ configure-sid: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20842,6 +20893,7 @@ configure-sim: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20908,6 +20960,7 @@ configure-tar: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -20974,6 +21027,7 @@ configure-texinfo: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21036,6 +21090,7 @@ configure-textutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21102,6 +21157,7 @@ configure-time: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21168,6 +21224,7 @@ configure-uudecode: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21234,6 +21291,7 @@ configure-wdiff: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21300,6 +21358,7 @@ configure-zip: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21369,6 +21428,7 @@ configure-zlib: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21427,6 +21487,7 @@ configure-gdb: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21493,6 +21554,7 @@ configure-expect: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21559,6 +21621,7 @@ configure-guile: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21625,6 +21688,7 @@ configure-tk: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21691,6 +21755,7 @@ configure-tix: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21757,6 +21822,7 @@ configure-libtermcap: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21819,6 +21885,7 @@ configure-utils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -21896,6 +21963,7 @@ configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ @@ -21998,6 +22066,7 @@ configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22099,6 +22168,7 @@ configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22200,6 +22270,7 @@ configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22301,6 +22372,7 @@ configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22398,6 +22470,7 @@ configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22499,6 +22572,7 @@ configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22596,6 +22670,7 @@ configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22697,6 +22772,7 @@ configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22798,6 +22874,7 @@ configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22891,6 +22968,7 @@ configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -22992,6 +23070,7 @@ configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ @@ -23094,6 +23173,7 @@ configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -23195,6 +23275,7 @@ configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -23296,6 +23377,7 @@ configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -23397,6 +23479,7 @@ configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ CXX="$(CXX_FOR_TARGET)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ @@ -23498,6 +23581,7 @@ configure-gcc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ @@ -23831,7 +23915,7 @@ Makefile: $(srcdir)/Makefile.in config.status CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status config.status: configure $(gcc_version_trigger) - $(SHELL) ./config.status --recheck + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck # Rebuilding configure. AUTOCONF = autoconf diff --git a/Makefile.tpl b/Makefile.tpl index 6f1f9df6636..3b545c46095 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -389,6 +389,7 @@ all: all.normal # Flags to pass down to all sub-makes. BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\ + "CONFIG_SHELL=$(SHELL)" \ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" # For any flags above that may contain shell code that varies from one @@ -465,7 +466,8 @@ EXTRA_GCC_FLAGS = \ "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ - "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" + "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`" GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) @@ -776,6 +778,7 @@ configure-build-[+module+]: AS="$(AS_FOR_BUILD)"; export AS; \ CC="$(CC_FOR_BUILD)"; export CC; \ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX_FOR_BUILD)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ @@ -847,6 +850,7 @@ configure-[+module+]: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ AR="$(AR)"; export AR; \ @@ -953,6 +957,7 @@ configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ IF raw_cxx +] CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ @@ -1073,6 +1078,7 @@ configure-gcc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ @@ -1406,7 +1412,7 @@ Makefile: $(srcdir)/Makefile.in config.status CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status config.status: configure $(gcc_version_trigger) - $(SHELL) ./config.status --recheck + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck # Rebuilding configure. AUTOCONF = autoconf diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 5f5c2c0a2c4..347a310d82c 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,7 @@ +2003-10-31 Richard Earnshaw + + * include/private/gcconfig.h: Re-install change of 2003-04-16. + 2003-10-20 Rainer Orth * mips_sgi_mach_dep.s: Use _ABIO32 instead of external diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index fceba8fa205..65e71479892 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -62,7 +62,7 @@ /* Determine the machine type: */ # if defined(__arm__) || defined(__thumb__) # define ARM32 -# if !defined(LINUX) +# if !defined(LINUX) && !defined(NETBSD) # define NOSYS # define mach_type_known # endif @@ -1688,8 +1688,13 @@ # ifdef NETBSD # define OS_TYPE "NETBSD" # define HEURISTIC2 - extern char etext[]; -# define DATASTART ((ptr_t)(etext)) +# ifdef __ELF__ +# define DATASTART GC_data_start +# define DYNAMIC_LOADING +# else + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) +# endif # define USE_GENERIC_PUSH_REGS # endif # ifdef LINUX diff --git a/boehm-gc/install-sh b/boehm-gc/install-sh index 398a88e1421..e9de23842dc 100755 --- a/boehm-gc/install-sh +++ b/boehm-gc/install-sh @@ -109,7 +109,7 @@ then echo "install: no input file specified" exit 1 else - : + true fi if [ x"$dir_arg" != x ]; then @@ -120,7 +120,7 @@ if [ x"$dir_arg" != x ]; then instcmd=: chmodcmd="" else - instcmd=$mkdirprog + instcmd=mkdir fi else @@ -130,7 +130,7 @@ else if [ -f $src -o -d $src ] then - : + true else echo "install: $src does not exist" exit 1 @@ -141,7 +141,7 @@ else echo "install: no destination specified" exit 1 else - : + true fi # If destination is a directory, append the input filename; if your system @@ -151,7 +151,7 @@ else then dst="$dst"/`basename $src` else - : + true fi fi @@ -163,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' +defaultIFS=' +' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" @@ -183,7 +183,7 @@ while [ $# -ne 0 ] ; do then $mkdirprog "${pathcomp}" else - : + true fi pathcomp="${pathcomp}/" @@ -194,10 +194,10 @@ if [ x"$dir_arg" != x ] then $doit $instcmd $dst && - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. @@ -216,7 +216,7 @@ else then dstfile=`basename $dst` else - : + true fi # Make a temp file name in the proper directory. @@ -235,10 +235,10 @@ else # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. diff --git a/boehm-gc/libtool.m4 b/boehm-gc/libtool.m4 index 066bf6a5ce6..c857149a9d6 100644 --- a/boehm-gc/libtool.m4 +++ b/boehm-gc/libtool.m4 @@ -1,6 +1,5 @@ -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. +## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- +## Copyright (C) 1996-1999 Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This program is free software; you can redistribute it and/or modify @@ -22,2981 +21,139 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 46 AC_PROG_LIBTOOL - -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -]) - -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -_LT_AC_PROG_ECHO_BACKSLASH -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - ]) -esac - -_LT_AC_LTCONFIG_HACK - -]) - -# AC_LIBTOOL_HEADER_ASSERT -# ------------------------ -AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], -[AC_CACHE_CHECK([whether $CC supports assert without backlinking], - [lt_cv_func_assert_works], - [case $host in - *-*-solaris*) - if test "$GCC" = yes && test "$with_gnu_ld" != yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) lt_cv_func_assert_works=no ;; - *) lt_cv_func_assert_works=yes ;; - esac - fi - ;; - esac]) - -if test "x$lt_cv_func_assert_works" = xyes; then - AC_CHECK_HEADERS(assert.h) -fi -])# AC_LIBTOOL_HEADER_ASSERT - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h) -])# _LT_AC_CHECK_DLFCN - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix*) - symcode='[[BCDEGRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[[ABCDGISTW]]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[[]] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $nlist" >&AC_FD_CC - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= - global_symbol_to_c_name_address= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" - global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; -then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], -[# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[if test "$cross_compiling" = yes; then : - [$4] -else - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - -AC_DEFUN([_LT_AC_LTCONFIG_HACK], -[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([for objdir]) -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -AC_MSG_RESULT($objdir) -## -## END FIXME - - -## FIXME: this should be a separate macro -## -AC_ARG_WITH(pic, -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], -pic_mode="$withval", pic_mode=default) -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -AC_MSG_CHECKING([for $compiler option to produce PIC]) -AC_CACHE_VAL(lt_cv_prog_cc_pic, -[ lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - lt_cv_prog_cc_wl='-Wl,' - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi -]) -if test -z "$lt_cv_prog_cc_pic"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([$lt_cv_prog_cc_pic]) - - # Check to make sure the pic_flag actually works. - AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) - AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - AC_TRY_COMPILE([], [], [dnl - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - ], [dnl - lt_cv_prog_cc_pic_works=no - ]) - CFLAGS="$save_CFLAGS" - ]) - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) -fi -## -## END FIXME - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) - lt_cv_prog_cc_can_build_shared=no - fi -fi - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) -AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) - LDFLAGS="$save_LDFLAGS" -]) - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" -## -## END FIXME - - -## FIXME: this should be a separate macro -## -# Check to see if options -o and -c are simultaneously supported by compiler -AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) -AC_CACHE_VAL([lt_cv_compiler_c_o], [ -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&AC_FD_CC - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null -]) -compiler_c_o=$lt_cv_compiler_c_o -AC_MSG_RESULT([$compiler_c_o]) - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) - AC_CACHE_VAL([lt_cv_compiler_o_lo], [ - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - save_objext="$ac_objext" - ac_objext=lo - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - ]) - ac_objext="$save_objext" - CFLAGS="$save_CFLAGS" - ]) - compiler_o_lo=$lt_cv_compiler_o_lo - AC_MSG_RESULT([$compiler_o_lo]) -else - compiler_o_lo=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT([$compiler_rtti_exceptions]) - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# See if the linker supports building shared libraries. -AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; -openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - hardcode_direct=yes - archive_cmds='' - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case "$host_os" in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - export_dynamic_flag_spec='${wl}-Bexport' - ;; - - solaris*) - # gcc --version < 3.0 without binutils cannot create self contained - # shared libraries reliably, requiring libgcc.a to resolve some of - # the object symbols generated in some cases. Libraries that use - # assert need libgcc.a to resolve __eprintf, for example. Linking - # a copy of libgcc.a into every shared library to guarantee resolving - # such symbols causes other problems: According to Tim Van Holder - # , C++ libraries end up with a separate - # (to the application) exception stack for one thing. - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) - cat <&2 - -*** Warning: Releases of GCC earlier than version 3.0 cannot reliably -*** create self contained shared libraries on Solaris systems, without -*** introducing a dependency on libgcc.a. Therefore, libtool is disabling -*** -no-undefined support, which will at least allow you to build shared -*** libraries. However, you may find that when you link such libraries -*** into an application without using GCC, you have to manually add -*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to -*** upgrade to a newer version of GCC. Another option is to rebuild your -*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. - -EOF - no_undefined_flag= - ;; - esac - fi - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -AC_MSG_RESULT([$ld_shlibs]) -test "$ld_shlibs" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check hardcoding attributes. -AC_MSG_CHECKING([how to hardcode library paths into programs]) -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -AC_MSG_RESULT([$hardcode_action]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -## -## END FIXME - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -## FIXME: this should be a separate macro -## -# PORTME Fill in your ld.so characteristics -AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can - # not hardcode correct soname into executable. Probably we can - # add versioning support to collect2, so additional links can - # be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case "$host_os" in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Report the final consequences. -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) -## -## END FIXME - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -AC_LIBTOOL_DLOPEN_SELF - -## FIXME: this should be a separate macro -## -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], - [$rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile); then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi]) - AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} -## -## END FIXME - -## FIXME: this should be a separate macro -## -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - global_symbol_to_c_name_address \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" -# ### END LIBTOOL CONFIG +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl -__EOF__ +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; +# Check for any special flags to pass to ltconfig. # -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# the following will cause an existing older ltconfig to fail, so +# we ignore this at the expense of the cache file... Checking this +# will just take longer ... bummer! +#libtool_flags="--cache-file=$cache_file" # -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi -## -## END FIXME +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; -])# _LT_AC_LTCONFIG_HACK +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) # AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -3015,22 +172,21 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -3049,8 +205,7 @@ enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) @@ -3058,14 +213,14 @@ AC_ENABLE_STATIC(no)]) # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -3083,120 +238,29 @@ esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -]) - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) - else - MAGIC_CMD=: - fi -fi -]) - - # AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], +AC_DEFUN(AC_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl ac_prog=ld -if test "$GCC" = yes; then +if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in # Accept absolute paths. - [[\\/]]* | [[A-Za-z]]:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do @@ -3218,17 +282,17 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(lt_cv_path_LD, +AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -3237,9 +301,9 @@ AC_CACHE_VAL(lt_cv_path_LD, done IFS="$ac_save_ifs" else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) -LD="$lt_cv_path_LD" +LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else @@ -3249,252 +313,56 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) -# AC_PROG_LD_GNU - -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes + ac_cv_prog_gnu_ld=yes else - lt_cv_prog_gnu_ld=no + ac_cv_prog_gnu_ld=no fi]) -with_gnu_ld=$lt_cv_prog_gnu_ld -]) - -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[[012]]) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[[78]]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method ]) - # AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl -AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + ac_cv_path_NM="$NM" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" break else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi]) -NM="$lt_cv_path_NM" +NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], +AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) +case "$lt_target" in +*-*-beos* | *-*-cygwin*) # These system don't have libm ;; *-ncr-sysv4.3*) @@ -3508,39 +376,33 @@ esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then @@ -3551,8 +413,8 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" @@ -3560,14 +422,14 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], fi ]) -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl diff --git a/boehm-gc/mkinstalldirs b/boehm-gc/mkinstalldirs index f9c37afd1b8..cc8783edce3 100755 --- a/boehm-gc/mkinstalldirs +++ b/boehm-gc/mkinstalldirs @@ -2,90 +2,29 @@ # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 +# Last modified: 1994-03-25 # Public domain -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ - errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case "${1}" in - -h | --help | --h* ) # -h for help - echo "${usage}" 1>&2; exit 0 ;; - -m ) # -m PERM arg - shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - dirmode="${1}" - shift ;; - -- ) shift; break ;; # stop option processing - -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option - * ) break ;; # first non-opt arg - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in -0) exit 0 ;; -esac -case $dirmode in -'') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi ;; -*) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi ;; -esac - -for file -do +for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= - for d - do + for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi + if test ! -d "$pathcomp"; then + errstatus=$lasterr fi pathcomp="$pathcomp/" @@ -94,8 +33,4 @@ done exit $errstatus -# Local Variables: -# mode: shell-script -# sh-indentation: 3 -# End: # mkinstalldirs ends here diff --git a/config.sub b/config.sub index a2734b3355f..e1e455b776e 100755 --- a/config.sub +++ b/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-10-16' +timestamp='2003-11-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -968,6 +968,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1233,6 +1237,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1487,6 +1494,9 @@ case $basic_machine in -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; diff --git a/configure b/configure index b49d8b16bfe..0c88cf501a3 100755 --- a/configure +++ b/configure @@ -1130,6 +1130,9 @@ case "${target}" in *) ;; esac ;; + *-*-uclinux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}" + ;; *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}" ;; @@ -2724,7 +2727,7 @@ GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' -raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then @@ -2823,7 +2826,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2827: checking for $ac_word" >&5 +echo "configure:2830: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2856,7 +2859,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2860: checking for $ac_word" >&5 +echo "configure:2863: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2895,7 +2898,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2899: checking for $ac_word" >&5 +echo "configure:2902: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2928,7 +2931,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2932: checking for $ac_word" >&5 +echo "configure:2935: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2967,7 +2970,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2971: checking for $ac_word" >&5 +echo "configure:2974: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3000,7 +3003,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3004: checking for $ac_word" >&5 +echo "configure:3007: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3039,7 +3042,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3043: checking for $ac_word" >&5 +echo "configure:3046: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3072,7 +3075,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3076: checking for $ac_word" >&5 +echo "configure:3079: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3111,7 +3114,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3115: checking for $ac_word" >&5 +echo "configure:3118: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3144,7 +3147,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3148: checking for $ac_word" >&5 +echo "configure:3151: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3183,7 +3186,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3187: checking for $ac_word" >&5 +echo "configure:3190: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3216,7 +3219,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3220: checking for $ac_word" >&5 +echo "configure:3223: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3255,7 +3258,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3259: checking for $ac_word" >&5 +echo "configure:3262: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3288,7 +3291,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3292: checking for $ac_word" >&5 +echo "configure:3295: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3327,7 +3330,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3331: checking for $ac_word" >&5 +echo "configure:3334: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3360,7 +3363,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3364: checking for $ac_word" >&5 +echo "configure:3367: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3399,7 +3402,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3403: checking for $ac_word" >&5 +echo "configure:3406: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3432,7 +3435,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3436: checking for $ac_word" >&5 +echo "configure:3439: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3481,7 +3484,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3485: checking for $ac_word" >&5 +echo "configure:3488: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3514,7 +3517,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3518: checking for $ac_word" >&5 +echo "configure:3521: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3553,7 +3556,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3557: checking for $ac_word" >&5 +echo "configure:3560: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3586,7 +3589,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3590: checking for $ac_word" >&5 +echo "configure:3593: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3625,7 +3628,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3629: checking for $ac_word" >&5 +echo "configure:3632: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3658,7 +3661,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3662: checking for $ac_word" >&5 +echo "configure:3665: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3697,7 +3700,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3701: checking for $ac_word" >&5 +echo "configure:3704: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3730,7 +3733,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3734: checking for $ac_word" >&5 +echo "configure:3737: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3769,7 +3772,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3773: checking for $ac_word" >&5 +echo "configure:3776: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3802,7 +3805,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3806: checking for $ac_word" >&5 +echo "configure:3809: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3841,7 +3844,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3845: checking for $ac_word" >&5 +echo "configure:3848: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3874,7 +3877,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3878: checking for $ac_word" >&5 +echo "configure:3881: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3913,7 +3916,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3917: checking for $ac_word" >&5 +echo "configure:3920: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3946,7 +3949,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3950: checking for $ac_word" >&5 +echo "configure:3953: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4013,7 +4016,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4017: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4020: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" diff --git a/configure.in b/configure.in index f849e26ccff..256748764fb 100644 --- a/configure.in +++ b/configure.in @@ -369,6 +369,9 @@ case "${target}" in *) ;; esac ;; + *-*-uclinux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}" + ;; *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}" ;; @@ -1962,7 +1965,7 @@ GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' -raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then diff --git a/contrib/ChangeLog b/contrib/ChangeLog index f072f106af1..6832e3d2539 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,28 @@ +2003-12-19 Andreas Tobler + + * gcc_update (files_and_dependencies): For libjava/libltdl directory, + remove acconfig.h. No longer used. + +2003-12-18 Kelley Cook + + * gcc_update (files_generated): Add in gcc/ada/stamp-xgnatug and update + gcc/ada/gnat_ug_* to use it. + +2003-12-16 James E Wilson + + * gcc_update (files_and_dependencies): For libjava/libltdl directory, + rename configure.in to configure.ac, and stamp-h.in to config-h.in. + +2003-12-11 Kelley Cook + + * gcc_update (files_and_dependencies): Correct typo in the filename + gnat_ug_wnt.texi. + +2003-12-08 Arnaud Charlet * gennews (files): Add GCC 3.3 files. diff --git a/contrib/gcc_update b/contrib/gcc_update index 3792807c285..f6596fd721a 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -79,15 +79,11 @@ gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def gcc/f/intdoc.texi: gcc/f/intdoc.in gcc/f/intdoc.c gcc/f/intrin.h gcc/f/intrin.def gcc/cp/cfns.h: gcc/cp/cfns.gperf gcc/java/keyword.h: gcc/java/keyword.gperf -gcc/ada/treeprs.ads: gcc/ada/treeprs.adt gcc/ada/sinfo.ads gcc/ada/xtreeprs.adb -gcc/ada/einfo.h: gcc/ada/einfo.ads gcc/ada/einfo.adb gcc/ada/xeinfo.adb -gcc/ada/sinfo.h: gcc/ada/sinfo.ads gcc/ada/xsinfo.adb -gcc/ada/nmake.adb: gcc/ada/sinfo.ads gcc/ada/nmake.adt gcc/ada/xnmake.adb -gcc/ada/nmake.ads: gcc/ada/sinfo.ads gcc/ada/nmake.adt gcc/ada/xnmake.adb -gcc/ada/gnat_ug_unx.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words -gcc/ada/gnat_ug_vms.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words -gcc/ada/gnat_ug_vxw.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words -gcc/ada/gnat_ug_w32.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words +gcc/ada/stamp-xgnatug: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words +gcc/ada/gnat_ug_unx.texi: gcc/ada/stamp-xgnatug +gcc/ada/gnat_ug_vms.texi: gcc/ada/stamp-xgnatug +gcc/ada/gnat_ug_vxw.texi: gcc/ada/stamp-xgnatug +gcc/ada/gnat_ug_wnt.texi: gcc/ada/stamp-xgnatug # testsuite # Without this, _Pragma3.c can have a false negative. gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h @@ -111,10 +107,10 @@ boehm-gc/configure: boehm-gc/configure.in boehm-gc/aclocal.m4 libjava/aclocal.m4: libjava/configure.in libjava/acinclude.m4 libjava/Makefile.in: libjava/Makefile.am libjava/configure.in libjava/aclocal.m4 libjava/configure: libjava/configure.in libjava/aclocal.m4 -libjava/libltdl/aclocal.m4: libjava/libltdl/configure.in libjava/libltdl/acinclude.m4 -libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.in libjava/libltdl/aclocal.m4 -libjava/libltdl/configure: libjava/libltdl/configure.in libjava/libltdl/aclocal.m4 -libjava/libltdl/stamp-h.in: libjava/libltdl/configure.in libjava/libltdl/aclocal.m4 libjava/libltdl/acconfig.h +libjava/libltdl/aclocal.m4: libjava/libltdl/configure.ac libjava/libltdl/acinclude.m4 +libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4 +libjava/libltdl/configure: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4 +libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4 # Top level Makefile.in: Makefile.tpl Makefile.def configure: configure.in config/acx.m4 diff --git a/fastjar/.cvsignore b/fastjar/.cvsignore deleted file mode 100644 index 67c7a2e782d..00000000000 --- a/fastjar/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -fastjar.info -grepjar.1 -jar.1 diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog index 2653d1725e3..648a9b6f75f 100644 --- a/fastjar/ChangeLog +++ b/fastjar/ChangeLog @@ -1,3 +1,26 @@ +2003-12-01 Kelley Cook + + * Makefile.am: Define AM_MAKINFOFLAGS. Remove Automake 1.4 hack. + * Makefile.in: Regenerate with automake 1.7.6 & autoconf 2.57 tools. + * aclocal.m4, config.h.in, configure: Likewise. + * install-sh, missing, mkinstalldirs, stamp-h.in: Remove. + +2003-11-21 Kelley Cook + + * .cvsignore: Delete. + +2003-10-30 Kelley Cook + + * Makefile.am (my_make_i_flags): Add $(srcdir) and update comment + to match. + (fastjar.info): Update target to write to build directory. + (%.1): New implicit rule from a .pod file. + (jar.1): Delete. + (grepjar.1): Delete. + (jar.pod): New intermediate rule. + (grepjar.pod): Likewise. + * Makefile.in: Regenerate. + 2003-08-13 Matthias Klose * fastjar.texi: License manual under the GPL. diff --git a/fastjar/Makefile.am b/fastjar/Makefile.am index fa31b9235fb..3d4ea36c232 100644 --- a/fastjar/Makefile.am +++ b/fastjar/Makefile.am @@ -57,6 +57,7 @@ grepjar_LDADD = $(ZLIBS) $(LIBIBERTY) grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY) AM_CFLAGS = @fastjar_warn_cflags@ +AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include TEXINFO_TEX = ../gcc/doc/include/texinfo.tex info_TEXINFOS = fastjar.texi @@ -66,32 +67,18 @@ fastjar_TEXINFOS = \ man_MANS = jar.1 grepjar.1 EXTRA_DIST = $(man_MANS) -## This is a hack. We can't set AM_MAKEINFOFLAGS, since that isn't -## available in 1.4. Nor can we override or append to MAKEINFO or -## MAKEINFOFLAGS, since these are overridden by the top-level -## Makefile. So, we just duplicate the rules. FIXME: remove this -## when we upgrade automake. Note that we don't include $(srcdir) in -## my_makei_flags; makeinfo is run in srcdir. -my_makei_flags += -I ../gcc/doc/include -fastjar.info: fastjar.texi $(fastjar_TEXINFOS) - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'` - - TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@" -$(srcdir)/jar.1: $(srcdir)/fastjar.texi - -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod - -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \ - mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \ - (rm -f jar.1.T$$$$ && exit 1) - -rm -f fastjar.pod +%.1: %.pod + -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ + mv -f $(@).T$$$$ $@) || \ + (rm -f $(@).T$$$$ && exit 1) + +.INTERMEDIATE: jar.pod grepjar.pod + +jar.pod: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D jar $< > $@ -$(srcdir)/grepjar.1: $(srcdir)/fastjar.texi - -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod - -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \ - mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \ - (rm -f grepjar.1.T$$$$ && exit 1) - -rm -f grepjar.pod +grepjar.pod: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D grepjar $< > $@ diff --git a/fastjar/Makefile.in b/fastjar/Makefile.in index b79a3ade06e..6268072a05e 100644 --- a/fastjar/Makefile.in +++ b/fastjar/Makefile.in @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am +# Makefile.in generated by automake 1.7.6 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,77 +12,150 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Process this with automake to create Makefile.in - +@SET_MAKE@ -SHELL = @SHELL@ +# Process this with automake to create Makefile.in srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CP = @CP@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ RM = @RM@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ZDEPS = @ZDEPS@ ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ fastjar_warn_cflags = @fastjar_warn_cflags@ gcc_version = @gcc_version@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ AUTOMAKE_OPTIONS = no-dependencies # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and # friends when we are called from the top level Makefile. -AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "JC1FLAGS=$(JC1FLAGS)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "prefix=$(prefix)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "NM=$(NM)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "DESTDIR=$(DESTDIR)" +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "JC1FLAGS=$(JC1FLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "prefix=$(prefix)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ + "PICFLAG=$(PICFLAG)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" INCLUDES = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include @@ -88,291 +163,232 @@ INCLUDES = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include LIBIBERTY = ../libiberty/libiberty.a bin_PROGRAMS = jar grepjar -jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h +jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h \ +zipfile.h dostime.h compress.h pushback.h jar_LDADD = $(ZLIBS) $(LIBIBERTY) jar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY) -grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h +grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h \ +zipfile.h dostime.h compress.h pushback.h grepjar_LDADD = $(ZLIBS) $(LIBIBERTY) grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY) AM_CFLAGS = @fastjar_warn_cflags@ +AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include TEXINFO_TEX = ../gcc/doc/include/texinfo.tex info_TEXINFOS = fastjar.texi -fastjar_TEXINFOS = ../gcc/doc/include/gcc-common.texi ../gcc/doc/include/gpl.texi +fastjar_TEXINFOS = \ + ../gcc/doc/include/gcc-common.texi \ + ../gcc/doc/include/gpl.texi man_MANS = jar.1 grepjar.1 EXTRA_DIST = $(man_MANS) -my_makei_flags = -I ../gcc/doc/include - TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@" +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = install-defs.sh -bin_PROGRAMS = jar$(EXEEXT) grepjar$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -jar_OBJECTS = jartool.o dostime.o compress.o pushback.o -jar_LDFLAGS = -grepjar_OBJECTS = jargrep.o dostime.o compress.o pushback.o -grepjar_LDFLAGS = -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CONFIG_CLEAN_FILES = install-defs.sh +bin_PROGRAMS = jar$(EXEEXT) grepjar$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_grepjar_OBJECTS = jargrep.$(OBJEXT) dostime.$(OBJEXT) \ + compress.$(OBJEXT) pushback.$(OBJEXT) +grepjar_OBJECTS = $(am_grepjar_OBJECTS) +grepjar_LDFLAGS = +am_jar_OBJECTS = jartool.$(OBJEXT) dostime.$(OBJEXT) compress.$(OBJEXT) \ + pushback.$(OBJEXT) +jar_OBJECTS = $(am_jar_OBJECTS) +jar_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -TEXI2DVI = texi2dvi +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(grepjar_SOURCES) $(jar_SOURCES) +am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include INFO_DEPS = fastjar.info DVIS = fastjar.dvi +PDFS = fastjar.pdf +PSS = fastjar.ps TEXINFOS = fastjar.texi -man1dir = $(mandir)/man1 -MANS = $(man_MANS) NROFF = nroff -DIST_COMMON = README $(fastjar_TEXINFOS) ./stamp-h.in AUTHORS COPYING \ -ChangeLog INSTALL Makefile.am Makefile.in NEWS acinclude.m4 aclocal.m4 \ -config.h.in configure configure.in install-defs.sh.in install-sh \ -missing mkinstalldirs - +MANS = $(man_MANS) +DIST_COMMON = README $(fastjar_TEXINFOS) ../install-sh ../missing \ + ../mkinstalldirs AUTHORS COPYING ChangeLog INSTALL Makefile.am \ + Makefile.in NEWS acinclude.m4 aclocal.m4 config.h.in configure \ + configure.in install-defs.sh.in +SOURCES = $(grepjar_SOURCES) $(jar_SOURCES) -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am -TAR = tar -GZIP_ENV = --best -SOURCES = $(jar_SOURCES) $(grepjar_SOURCES) -OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS) - -all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +.SUFFIXES: .c .dvi .info .o .obj .pdf .ps .texi -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -config.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null -mostlyclean-hdr: +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h -clean-hdr: +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: + -rm -f config.h stamp-h1 install-defs.sh: $(top_builddir)/config.status install-defs.sh.in - cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-binPROGRAMS: - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -distclean-binPROGRAMS: - -maintainer-clean-binPROGRAMS: - + cd $(top_builddir) && $(SHELL) ./config.status $@ +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ done -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES) + @rm -f grepjar$(EXEEXT) + $(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS) +jar$(EXEEXT): $(jar_OBJECTS) $(jar_DEPENDENCIES) + @rm -f jar$(EXEEXT) + $(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c -maintainer-clean-compile: +.c.o: + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< -jar$(EXEEXT): $(jar_OBJECTS) $(jar_DEPENDENCIES) - @rm -f jar$(EXEEXT) - $(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS) +.c.obj: + $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` -grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES) - @rm -f grepjar$(EXEEXT) - $(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS) +.texi.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9] + $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +.texi.dvi: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$< + +.texi.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$< fastjar.info: fastjar.texi $(fastjar_TEXINFOS) fastjar.dvi: fastjar.texi $(fastjar_TEXINFOS) +fastjar.pdf: fastjar.texi $(fastjar_TEXINFOS) +TEXI2DVI = texi2dvi - +TEXI2PDF = $(TEXI2DVI) --pdf --batch DVIPS = dvips - -.texi.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texi.dvi: - TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo.dvi: - TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.txi.dvi: - TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: - $(DVIPS) $< -o $@ + $(DVIPS) -o $@ $< -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - d=$(srcdir); \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ +uninstall-info-am: + $(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \ + install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done + else :; fi @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ + @list='$(INFO_DEPS)'; \ for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd $(DESTDIR)$(infodir); then \ + echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ done dist-info: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for base in $$list; do \ - d=$(srcdir); \ - for file in `cd $$d && eval echo $$base*`; do \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + for file in $$d/$$base*; do \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: - -rm -f fastjar.aux fastjar.cp fastjar.cps fastjar.dvi fastjar.fn \ - fastjar.fns fastjar.ky fastjar.kys fastjar.ps fastjar.log \ - fastjar.pg fastjar.toc fastjar.tp fastjar.tps fastjar.vr \ - fastjar.vrs fastjar.op fastjar.tr fastjar.cv fastjar.cn - -clean-aminfo: - -distclean-aminfo: + -rm -f fastjar.aux fastjar.cp fastjar.cps fastjar.fn fastjar.fns fastjar.ky \ + fastjar.kys fastjar.log fastjar.pg fastjar.pgs fastjar.tmp \ + fastjar.toc fastjar.tp fastjar.tps fastjar.vr fastjar.vrs \ + fastjar.dvi fastjar.pdf fastjar.ps maintainer-clean-aminfo: - cd $(srcdir) && for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done -install-man1: +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ @@ -381,213 +397,340 @@ install-man1: if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done - uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = tags: TAGS -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique -mostlyclean-tags: +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique -clean-tags: +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +top_distdir = . distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/. $(distdir)/.. $(distdir)/../gcc/doc/include + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info -info-am: $(INFO_DEPS) -info: info-am -dvi-am: $(DVIS) -dvi: dvi-am + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 check-am: all-am check: check-am -installcheck-am: -installcheck: installcheck-am -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive +all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h -install-exec-am: install-binPROGRAMS +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir) +install: install-am install-exec: install-exec-am - -install-data-am: install-info-am install-man install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man -uninstall: uninstall-am -all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \ - $(DESTDIR)$(mandir)/man1 - +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ - mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \ - mostlyclean-generic + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am -clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo \ - clean-tags clean-generic mostlyclean-am +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ + distclean-tags -clean: clean-am +dvi: dvi-am -distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ - distclean-aminfo distclean-tags distclean-generic \ - clean-am +dvi-am: $(DVIS) -distclean: distclean-am - -rm -f config.status +info: info-am -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-aminfo \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info-am: $(INFO_DEPS) + +install-data-am: install-info-am install-man + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ + $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-info-am uninstall-info \ -mostlyclean-aminfo distclean-aminfo clean-aminfo \ -maintainer-clean-aminfo install-man1 uninstall-man1 install-man \ -uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic -fastjar.info: fastjar.texi $(fastjar_TEXINFOS) - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'` - -$(srcdir)/jar.1: $(srcdir)/fastjar.texi - -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod - -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \ - mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \ - (rm -f jar.1.T$$$$ && exit 1) - -rm -f fastjar.pod - -$(srcdir)/grepjar.1: $(srcdir)/fastjar.texi - -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod - -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \ - mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \ - (rm -f grepjar.1.T$$$$ && exit 1) - -rm -f grepjar.pod +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ + mostlyclean-generic + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags dist dist-all dist-gzip dist-info distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-man1 \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic mostlyclean mostlyclean-aminfo \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-info-am uninstall-man uninstall-man1 + + +%.1: %.pod + -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ + mv -f $(@).T$$$$ $@) || \ + (rm -f $(@).T$$$$ && exit 1) + +.INTERMEDIATE: jar.pod grepjar.pod + +jar.pod: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D jar $< > $@ +grepjar.pod: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D grepjar $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/fastjar/aclocal.m4 b/fastjar/aclocal.m4 index d84a6631e71..cde83941aad 100644 --- a/fastjar/aclocal.m4 +++ b/fastjar/aclocal.m4 @@ -1,14 +1,15 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 +# generated automatically by aclocal 1.7.6 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. sinclude(../config/accross.m4) @@ -34,61 +35,248 @@ single argument.]) fi ]) -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. +# Do all the work for Automake. -*- Autoconf -*- -# serial 1 +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 10 -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) +AC_PREREQ([2.54]) +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.7.6])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -98,7 +286,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -107,52 +295,615 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " else - $1="$3/missing $2" - AC_MSG_RESULT(missing) + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) fi -AC_SUBST($1)]) +]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# serial 5 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering -# serial 1 +# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) @@ -162,23 +913,12 @@ AC_DEFUN([AM_MAINTAINER_MODE], (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) diff --git a/fastjar/config.h.in b/fastjar/config.h.in index 61fcc9da7bd..b6f06b3d238 100644 --- a/fastjar/config.h.in +++ b/fastjar/config.h.in @@ -1,57 +1,87 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ +/* config.h.in. Generated from configure.in by autoheader. */ -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if your declares struct tm. */ -#undef TM_IN_SYS_TIME +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#undef BYTEORDER -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_DIRENT_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_DIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_NDIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define if the host machine stores words of multi-word integers in + big-endian order. */ +#undef HOST_WORDS_BIG_ENDIAN + +/* Define if host mkdir takes a single argument. */ +#undef MKDIR_TAKES_ONE_ARG + /* Name of package */ #undef PACKAGE -/* Version number of package */ -#undef VERSION +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* Define if host mkdir takes a -single argument. */ -#undef MKDIR_TAKES_ONE_ARG +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION /* The number of bytes in type char */ #undef SIZEOF_CHAR -/* The number of bytes in type short */ -#undef SIZEOF_SHORT - /* The number of bytes in type int */ #undef SIZEOF_INT @@ -61,13 +91,20 @@ single argument. */ /* The number of bytes in type long long */ #undef SIZEOF_LONG_LONG -/* whether byteorder is bigendian */ -#undef WORDS_BIGENDIAN +/* The number of bytes in type short */ +#undef SIZEOF_SHORT -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME +/* Version number of package */ +#undef VERSION + +/* whether byteorder is bigendian */ +#undef WORDS_BIGENDIAN + +/* Define to `long' if does not define. */ +#undef off_t diff --git a/fastjar/configure b/fastjar/configure index 9931c0d4647..b4417364cb0 100755 --- a/fastjar/configure +++ b/fastjar/configure @@ -1,31 +1,324 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.57. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} -# Defaults: -ac_help= + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --with-system-zlib use installed libz" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="jartool.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RM CP CHMOD MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT fastjar_warn_cflags CPP EGREP ZLIBS ZDEPS ZINCS gcc_version LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -34,10 +327,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -51,17 +349,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -69,59 +359,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -130,95 +420,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -227,19 +469,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -253,26 +495,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -289,7 +531,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -299,7 +541,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -310,58 +552,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -372,99 +613,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=jartool.h # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -474,13 +726,440 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-system-zlib use installed libz + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -491,41 +1170,106 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + +am__api_version="1.7" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -536,14 +1280,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -552,444 +1302,1012 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:561: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:614: checking whether build environment is sane" >&5 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } fi - test "$2" = conftestfile + test "$2" = conftest.file ) then # Ok. : else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," + test -n "$AWK" && break +done -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:671: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftestmake <<\EOF + cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi -rm -f conftestmake +rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null -PACKAGE=fastjar - -VERSION=0.92-gcc + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define VERSION "$VERSION" -EOF +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:717: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:730: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:743: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:756: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:769: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 + STRIP=$ac_ct_STRIP else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 + STRIP="$ac_cv_prog_STRIP" fi +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -# Extract the first word of "gcc", so it can be a program name with args. +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:789: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:819: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:870: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:902: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -cat > conftest.$ac_ext << EOF +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -#line 913 "configure" -#include "confdefs.h" + test -n "$ac_ct_CC" && break +done -main(){return(0);} -EOF -if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:944: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:949: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - ac_cv_prog_gcc=no -fi + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 -if test $ac_cv_prog_gcc = yes; then - GCC=yes +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - GCC= + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:977: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -1003,6 +2321,390 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1011,315 +2713,254 @@ fi # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1020: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1075: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$RM" in - /*) + case $RM in + [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_RM="$RM" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_RM="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" ;; esac fi -RM="$ac_cv_path_RM" +RM=$ac_cv_path_RM + if test -n "$RM"; then - echo "$ac_t""$RM" 1>&6 + echo "$as_me:$LINENO: result: $RM" >&5 +echo "${ECHO_T}$RM" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1111: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$CP" in - /*) + case $CP in + [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_CP="$CP" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_CP="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_CP" && ac_cv_path_CP="/bin/cp" ;; esac fi -CP="$ac_cv_path_CP" +CP=$ac_cv_path_CP + if test -n "$CP"; then - echo "$ac_t""$CP" 1>&6 + echo "$as_me:$LINENO: result: $CP" >&5 +echo "${ECHO_T}$CP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1147: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$STRIP" in - /*) + case $STRIP in + [\\/]* | ?:[\\/]*) ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_STRIP="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_STRIP" && ac_cv_path_STRIP="/usr/bin/strip" ;; esac fi -STRIP="$ac_cv_path_STRIP" +STRIP=$ac_cv_path_STRIP + if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1183: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CHMOD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$CHMOD" in - /*) + case $CHMOD in + [\\/]* | ?:[\\/]*) ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_CHMOD="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_CHMOD" && ac_cv_path_CHMOD="/bin/chmod" ;; esac fi -CHMOD="$ac_cv_path_CHMOD" -if test -n "$CHMOD"; then - echo "$ac_t""$CHMOD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1217: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1250: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes +CHMOD=$ac_cv_path_CHMOD - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1281: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe +if test -n "$CHMOD"; then + echo "$as_me:$LINENO: result: $CHMOD" >&5 +echo "${ECHO_T}$CHMOD" >&6 else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1313: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= @@ -1328,260 +2969,610 @@ else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi + MAINT=$MAINTAINER_MODE_TRUE - -if test "$GCC" = yes; then - fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings' -fi + +if test "$GCC" = yes; then + fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings' +fi + + + + + + ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1346: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:1359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break fi + done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1384: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + fi else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1425: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:1444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + fi fi -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1467: checking how to run the C preprocessor" >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi - CPP="$ac_cv_prog_CPP" +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - ac_cv_prog_CPP="$CPP" + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$CPP" 1>&6 -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1547: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext </dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -1590,16 +3581,20 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -1608,196 +3603,463 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 -EOF +_ACEOF fi -echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1651: checking whether struct tm is in sys/time.h or time.h" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { + +int +main () +{ struct tm *tp; tp->tm_sec; -; return 0; } -EOF -if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_struct_tm=sys/time.h + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_struct_tm" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 -EOF +_ACEOF fi -for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h limits.h +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1688: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + +for ac_header in fcntl.h unistd.h sys/param.h stdlib.h limits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=$ac_header_preproc" fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + done -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1726: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_off_t=yes else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define off_t long -EOF +_ACEOF fi -echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1759: checking whether struct tm is in sys/time.h or time.h" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { + +int +main () +{ struct tm *tp; tp->tm_sec; -; return 0; } -EOF -if { (eval echo configure:1772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_struct_tm=sys/time.h + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_struct_tm" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 -EOF +_ACEOF fi # mkdir takes a single argument on some systems. -echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6 -echo "configure:1795: checking if mkdir takes one argument" >&5 -if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking if mkdir takes one argument" >&5 +echo $ECHO_N "checking if mkdir takes one argument... $ECHO_C" >&6 +if test "${gcc_cv_mkdir_takes_one_arg+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_SYS_STAT_H @@ -1809,283 +4071,454 @@ else #ifdef HAVE_DIRECT_H # include #endif -int main() { +int +main () +{ mkdir ("foo", 0); -; return 0; } -EOF -if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gcc_cv_mkdir_takes_one_arg=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gcc_cv_mkdir_takes_one_arg=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_mkdir_takes_one_arg=yes fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6 +echo "$as_me:$LINENO: result: $gcc_cv_mkdir_takes_one_arg" >&5 +echo "${ECHO_T}$gcc_cv_mkdir_takes_one_arg" >&6 if test $gcc_cv_mkdir_takes_one_arg = yes ; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define MKDIR_TAKES_ONE_ARG 1 -EOF +_ACEOF fi -echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:1839: checking size of char" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "confdefs.h" #include -int main() { +int +main () +{ switch (0) case 0: case (sizeof (char) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:1855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sizeof_char=$ac_size else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_char != x ; then break; fi done fi if test x$ac_cv_sizeof_char = x ; then - { echo "configure: error: cannot determine a size for char" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot determine a size for char" >&5 +echo "$as_me: error: cannot determine a size for char" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_sizeof_char" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 + +cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char -EOF +_ACEOF -echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1878: checking size of short" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "confdefs.h" #include -int main() { +int +main () +{ switch (0) case 0: case (sizeof (short) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:1894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sizeof_short=$ac_size else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_short != x ; then break; fi done fi if test x$ac_cv_sizeof_short = x ; then - { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot determine a size for short" >&5 +echo "$as_me: error: cannot determine a size for short" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_sizeof_short" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 + +cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short -EOF +_ACEOF -echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1917: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "confdefs.h" #include -int main() { +int +main () +{ switch (0) case 0: case (sizeof (int) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sizeof_int=$ac_size else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_int != x ; then break; fi done fi if test x$ac_cv_sizeof_int = x ; then - { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot determine a size for int" >&5 +echo "$as_me: error: cannot determine a size for int" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 + +cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int -EOF +_ACEOF -echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1956: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "confdefs.h" #include -int main() { +int +main () +{ switch (0) case 0: case (sizeof (long) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sizeof_long=$ac_size else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_long != x ; then break; fi done fi if test x$ac_cv_sizeof_long = x ; then - { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot determine a size for long" >&5 +echo "$as_me: error: cannot determine a size for long" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 + +cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long -EOF +_ACEOF -echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1995: checking size of long long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "confdefs.h" #include -int main() { +int +main () +{ switch (0) case 0: case (sizeof (long long) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:2011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sizeof_long_long=$ac_size else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_long_long != x ; then break; fi done fi if test x$ac_cv_sizeof_long_long = x ; then - { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot determine a size for long long" >&5 +echo "$as_me: error: cannot determine a size for long long" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 + +cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -EOF +_ACEOF -echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2035: checking whether byte ordering is bigendian" >&5 -if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { +int +main () +{ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif -; return 0; } -EOF -if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { +int +main () +{ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif -; return 0; } -EOF -if { (eval echo configure:2068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_bigendian=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 + echo $ac_n "cross-compiling... " 2>&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ main () { /* Are we little or big endian? From Harbison&Steele. */ union @@ -2096,26 +4529,36 @@ main () { u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } -EOF -if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_bigendian=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes fi -rm -fr conftest* +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 if test $ac_cv_c_bigendian = unknown; then -echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 -echo "configure:2119: checking to probe for byte ordering" >&5 +echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 +echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 cat >conftest.c <&6 fi fi -echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 fi if test $ac_cv_c_bigendian = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 -EOF +_ACEOF - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HOST_WORDS_BIG_ENDIAN 1 -EOF +_ACEOF BYTEORDER=4321 else BYTEORDER=1234 fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define BYTEORDER $BYTEORDER -EOF +_ACEOF if test $ac_cv_c_bigendian = unknown; then - { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 +echo "$as_me: error: unknown endianess - sorry" >&2;} + { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; } fi + # Check whether --with-system-zlib or --without-system-zlib was given. if test "${with_system_zlib+set}" = set; then withval="$with_system_zlib" - : -fi +fi; ZLIBS= ZDEPS= ZINCS= use_zlib=maybe if test "$with_system_zlib" = yes; then - echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:2184: checking for deflate in -lz" >&5 -ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for deflate in -lz" >&5 +echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_deflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char deflate(); - -int main() { -deflate() -; return 0; } -EOF -if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char deflate (); +int +main () +{ +deflate (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_deflate=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_z_deflate=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 +if test $ac_cv_lib_z_deflate = yes; then ZLIBS=-lz else - echo "$ac_t""no" 1>&6 -use_zlib=no + use_zlib=no fi else @@ -2244,383 +4712,1327 @@ gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^ gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` -trap '' 1 2 15 -cat > confcache <<\EOF + ac_config_files="$ac_config_files Makefile install-defs.sh" +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - DEFS=-DHAVE_CONFIG_H -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi done -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi -trap 'rm -fr `echo "Makefile install-defs.sh config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS </dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@RM@%$RM%g -s%@CP@%$CP%g -s%@STRIP@%$STRIP%g -s%@CHMOD@%$CHMOD%g -s%@EXEEXT@%$EXEEXT%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@fastjar_warn_cflags@%$fastjar_warn_cflags%g -s%@CPP@%$CPP%g -s%@ZLIBS@%$ZLIBS%g -s%@ZDEPS@%$ZDEPS%g -s%@ZINCS@%$ZINCS%g -s%@gcc_version@%$gcc_version%g -CEOF -EOF + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + as_ln_s='ln -s' fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "install-defs.sh" ) CONFIG_FILES="$CONFIG_FILES install-defs.sh" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac +done - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@RM@,$RM,;t t +s,@CP@,$CP,;t t +s,@CHMOD@,$CHMOD,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@fastjar_warn_cflags@,$fastjar_warn_cflags,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@ZLIBS@,$ZLIBS,;t t +s,@ZDEPS@,$ZDEPS,;t t +s,@ZINCS@,$ZINCS,;t t +s,@gcc_version@,$gcc_version,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi +fi # test -n "$CONFIG_FILES" - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.undefs >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -EOF -cat >> $CONFIG_STATUS </dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h +cat >>$CONFIG_STATUS <<\_ACEOF -exit 0 -EOF +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/fastjar/install-sh b/fastjar/install-sh deleted file mode 100755 index c719342656f..00000000000 --- a/fastjar/install-sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash - -. install-defs.sh - -$CP fastjar ${BINDIR} -$STRIP ${BINDIR}/fastjar -$CHMOD 755 ${BINDIR}/fastjar - diff --git a/fastjar/missing b/fastjar/missing deleted file mode 100755 index 7789652e877..00000000000 --- a/fastjar/missing +++ /dev/null @@ -1,190 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`configure.in'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/fastjar/mkinstalldirs b/fastjar/mkinstalldirs deleted file mode 100755 index d2d5f21b611..00000000000 --- a/fastjar/mkinstalldirs +++ /dev/null @@ -1,111 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" 1>&2 - exit 0 - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -case $dirmode in - '') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi - ;; - *) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi - ;; -esac - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# End: -# mkinstalldirs ends here diff --git a/fastjar/stamp-h.in b/fastjar/stamp-h.in deleted file mode 100644 index 9788f70238c..00000000000 --- a/fastjar/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/gcc/.cvsignore b/gcc/.cvsignore index 4e3c335065a..3f4ee4b6f48 100644 --- a/gcc/.cvsignore +++ b/gcc/.cvsignore @@ -1,11 +1,4 @@ -c-parse.y -c-parse.h -c-parse.c -tradcif.c cscope.files cscope.out cscope.in.out cscope.po.out -gengtype-lex.c -gengtype-yacc.c -gengtype-yacc.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e62f2451f43..3308196ed66 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,4429 @@ +2004-02-18 Paul Brook + + * rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX + +2004-02-18 Paul Brook + + PR debug/12934 + * dwarf2out.c (loc_descriptor_from_tree): Handle + EXPR_WITH_FILE_LOCATION. + +2004-02-11 Mark Mitchell + + * gcc.c (set_collect_gcc_options): Use double quotes instead of + single quotes on Windows. + * tlink.c (recompile_files): Do not assume that "rename" can + overwrite an existing file. Use "&&" as the command separator + rather than ";". + + * collect2.c (collect_wait): Check return code from pwait. + (collect_execute): Pass third argument to open. Check return code + from open. Redirect both stdout and stderr when redirecting. + + * system.h (WIFSIGNALED, WTERMSIG, WIFEXITED, WEXITSTATUS, + WSTOPSIG, SCOREDUMP, WCOREFLG): Remove definitions. + +2004-01-30 Paul Brook + + * aof.h (REGISTER_NAMES): Add vfp reg names + (ADDITIONAL_REGISTER_NAMES): Ditto. + * aout.h (REGISTER_NAMES): Ditto. + (ADDITIONAL_REGISTER_NAMES): Ditto. + * arm-protos.h: Update/Add Prototypes. + * arm.c (init_fp_table): Rename from init_fpa_table. Update users. + Only allow 0.0 for VFP. + (fp_consts_inited): Rename from fpa_consts_inited. Update users. + (values_fp): Rename from values_fpa. Update Users. + (arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa. + Update users. Only check valid constants for this hardware. + (arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users. + Only allow consts for FPA. + (arm_float_add_operand): Rename from fpa_add_operand. Update users. + Only allow consts for FPA. + (use_return_insn): Check for saved VFP regs. + (arm_legitimate_address_p): Handle VFP DFmode addressing. + (arm_legitimize_address): Ditto. + (arm_general_register_operand): New function. + (vfp_mem_operand): New function. + (vfp_compare_operand): New function. + (vfp_secondary_reload_class): New function. + (arm_float_compare_operand): New function. + (vfp_print_multi): New function. + (vfp_output_fstmx): New function. + (vfp_emit_fstm): New function. + (arm_output_epilogue): Output VPF reg restore code. + (arm_expand_prologue): Output VFP reg save code. + (arm_print_operand): Add 'P'. + (arm_hard_regno_mode_ok): Return modes for VFP regs. + (arm_regno_class): Return classes for VFP regs. + (arm_compute_initial_elimination_offset): Include space for VFP regs. + (arm_get_frame_size): Ditto. + * arm.h (FIXED_REGISTERS): Add VFP regs. + (CALL_USED_REGISTERS): Ditto. + (CONDITIONAL_REGISTER_USAGE): Enable VFP regs. + (FIRST_VFP_REGNUM): Define. + (LAST_VFP_REGNUM): Define. + (IS_VFP_REGNUM): Define. + (FIRST_PSEUDO_REGISTER): Include VFP regs. + (HARD_REGNO_NREGS): Handle VFP regs. + (REG_ALLOC_ORDER): Add VFP regs. + (enum reg_class): Add VFP_REGS. + (REG_CLASS_NAMES): Ditto. + (REG_CLASS_CONTENTS): Ditto. + (CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs. + (REG_CLASS_FROM_LETTER): Add 'w'. + (EXTRA_CONSTRAINT_ARM): Add 'U'. + (EXTRA_MEMORY_CONSTRAINT): Define. + (SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs. + (SECONDARY_INPUT_RELOAD_CLASS): Ditto. + (REGISTER_MOVE_COST): Ditto. + (PREDICATE_CODES): Add arm_general_register_operand, + arm_float_compare_operand and vfp_compare_operand. + * arm.md (various): Rename as above. + (divsf3): Enable when TARGET_VFP. + (divdf3): Ditto. + (movdfcc): Ditto. + (sqrtsf2): Ditto. + (sqrtdf2): Ditto. + (arm_movdi): Disable when TARGET_VFP. + (arm_movsi_insn): Ditto. + (movsi): Only split with general regs. + (cmpsf): Use arm_float_compare_operand. + (push_fp_multi): Restrict to TARGET_FPA. + (vfp.md): Include. + * vfp.md: New file. + * fpa.md (various): Rename as above. + * doc/md.texi: Document ARM w and U constraints. + +2004-01-15 Paul Brook + + * config.gcc: Add with_fpu. Allow with-float=softfp. + * config/arm/arm.c (arm_override_options): Rename *-s to *s. + Break out of loop when we find a float-abi. Fix typo. + * config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu". + Set -mfloat-abi=. + * doc/install.texi: Document --with-fpu. + +2003-01-14 Paul Brook + + * config.gcc (with_arch): Add armv6. + * config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s. + * config/arm/arm.c (arm_overrride_options): Ditto. + +2004-01-08 Richard Earnshaw + + * arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT. + (FL_ARCH6): Renamed from FL_ARCH6J. + (arm_arch3m): Renamed from arm_fast_multiply. + (arm_arch6): Renamed from arm_arch6j. + * arm.h: Update all uses of above. + * arm-cores.def: Likewise. + * arm.md: Likewise. + + * arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j, + not arm6j. Add entry for arch armv6. + +2004-01-07 Richard Earnshaw + + * arm.c (arm_emit_extendsi): Delete. + * arm-protos.h (arm_emit_extendsi): Delete. + * arm.md (zero_extendhisi2): Also handle zero-extension of + non-subregs. + (zero_extendqisi2, extendhisi2, extendqisi2): Likewise. + (thumb_zero_extendhisi2): Only match if not v6. + (arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2) + (thumb_extendhisi2, arm_extendhisi2, arm_extendqisi) + (thumb_extendqisi2): Likewise. + (thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns. + (thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns. + (thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns. + (thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns. + (arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete. + (arm_extendhisi2_reg, arm_extendqisi2_reg): Delete. + (arm_zero_extendhisi2addsi): Remove subreg. Add attributes. + (arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise. + (arm_extendqisi2addsi): Likewise. + +2003-12-31 Mark Mitchell + + * diagnostic.c (bug_report_request): Use email form. + * gcc.c (execute): Likewise. + * version.c (version_string): Modify. + (bug_report_url): Likewise. + + Revert this change: + * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG + + REG addressing modes. + + * regrename.c (find_oldest_value_reg): Handle HARD_REGNO_NREGS > 1 + correctly. + + * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG + + REG addressing modes. + +2003-12-30 Mark Mitchell + + * config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept + CONSTANT_P_RTX. + +2003-30-12 Paul Brook + + * longlong.h: protect arm inlines with !defined (__thumb__) + +2003-30-12 Paul Brook + + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__. + +2003-12-30 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Fix typo in previous + change. + +2003-12-29 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Add pretend args size + to the virtual incoming args pointer for downward stacks. + +2003-12-29 Paul Brook + + * config/arm/arm-cores.def: Add cost function. + * config/arm/arm.c (arm_*_rtx_costs): New functions. + (arm_rtx_costs): Remove + (struct processors): Add rtx_costs field. + (all_cores, all_architectures): Ditto. + (arm_override_options): Set targetm.rtx_costs. + (thumb_rtx_costs): New function. + (arm_rtx_costs_1): Remove cases handled elsewhere. + * config/arm/arm.h (processor_type): Add COSTS parameter. + +2003-12-29 Nathan Sidwell + + * config/arm/arm.md (generic_sched): arm926 has its own scheduler. + (arm926ejs.md): Include it. + * config/arm/arm926ejs.md: New pipeline description. + +2003-12-24 Paul Brook + + * config/arm/arm.c (arm_arch6j): New variable. + (arm_override_options): Set it. + (arm_emit_extendsi): New function. + * config/arm/arm-protos.h (arm_emit_extendsi): Add prototype. + * config/arm/arm.h (arm_arch6j): Declare. + * config/arm/arm.md: Add sign/zero extend insns. + +2003-12-23 Mark Mitchell + + * calls.c (expand_call): Recognize calls to "sqrt" and create + corresponding notes. + +2003-12-23 Paul Brook + + * config/arm/arm.c (all_architectures): Add armv6. + * doc/invoke.texi: Document it. + +2003-12-23 Zack Weinberg + Nathan Sidwell + Mark Mitchell + + * collect2.c (windows.h): Include. + (dup2): Remove. + (handler): Change prototype. + (unhandled_filter): New funciton. + (install_handlers): Likewise. + (disable_break): Likewise. + (enable_break): Likewise. + (main): Call install_handlers rather than signal directly. + (collect_execute): Use pexec. + (scan_prog_file): Likewise. + (scan_libraries): Likewise. + +2003-12-19 Paul Brook + + * config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify + insn patterns to match. + * config/arm/arm-generic.md: Ditto. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/amm/iwmmxt.md: Ditto. + * config/arm/arm1026ejs.md: Ditto. + * config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses + for 11_loadb. + +2003-12-18 Nathan Sidwell + + * config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare. + * config/arm/arm.c (arm_adjust_cost): Check shift cost for + TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG. + (arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep, + arm_no_early_mul_dep): Correctly deal with conditional execution, + parallels and single shift operations. + (arm_no_early_alu_shift_value_dep): Define. + * arm.md (attr type): Replace 'normal' with 'alu', + 'alu_shift' and 'alu_shift_reg'. + (attr core_cycles): Adjust. + (*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3, + *shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0, + *not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp, + *cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0, + *arith_shiftsi_compare0_scratch, *sub_shiftsi, + *sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch, + *if_shift_move, *if_move_shift, *if_shift_shift): Set type + attribute appropriately. + * config/arm/arm1026ejs.md (alu_op): Adjust. + (alu_shift_op, alu_shift_reg_op): New. + * config/arm/arm1136.md: Add better bypasses for early + registers. Remove load[234] and store[234] bypasses. + (11_alu_op): Adjust. + (11_alu_shift_op, 11_alu_shift_reg_op): New. + +2003-12-15 Nathan Sidwell + + * config/arm/arm-protos.h (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare. + * config/arm/arm.c (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define. + * config/arm/arm1026ejs.md: Add load-store bypass. + * config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles. + Add bypasses between instructions. + +2003-12-10 Paul Brook + + * config/arm/arm.c (arm_fpu_model): New variable. + (arm_fload_abi): New variable. + (target_fpe_name): Rename from target_fp_name. + (target_fpu_name): New variable. + (arm_is_cirrus): Remove. + (fpu_desc): New struct. + (all_fpus): Define. + (pf_model_for_fpu): Define. + (all_loat_abis): Define. + (arm_override_options): Set fp arch flags based on -mfpu= + and -float-abi=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (*): Use new TARGET_* flags. + * config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove. + (TARGET_HARD_FLOAT): No longer implies TARGET_FPA. + (TARGET_SOFT_FLOAT): Ditto. + (TARGET_SOFT_FLOAT_ABI): New. + (TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies + TARGET_HARD_FLOAT. + (TARGET_VFP): No longer implies TARGET_HARD_FLOAT. + (TARGET_OPTIONS): Add -mfpu=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (arm_pf_model): Define. + (arm_float_abi_type): Define. + (fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE + * config/arm/arm.md: Use new TARGET_* flags. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=. + * config/arm/semi.h (ASM_SPEC): Ditto. + * config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp. + (FPUTYPE_DEFAULT): Set to VFP. + * doc/invoke.texi: Document -mfpu= and -mfloat-abi=. + +2003-11-22 Phil Edwards + + PR target/12476 + * config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use + 'bx' instead of 'b' to avoid branch range restrictions. Output + the thunk immediately before the thunked-to function. + * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit + .thumb_func if a thunk is being generated. Emit .code 16 along + with .thumb_func if a thunk is not being generated. + +2003-11-15 Nicolas Pitre + + * config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3, + arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns. + * config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3. + (lshrdi3_iwmmxt): Renamed from lshrdi3. + * config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly. + +2003-11-12 Steve Woodford + Ian Lance Taylor + + * config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new + code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__). + +2003-11-05 Phil Edwards + + * config/arm/arm.md (insn): Add new V6 instruction names. + (generic_sched): New attr. + * config/arm/arm-generic.md: Use generic_sched here. + * config/arm/arm1026ejs.md: Do not model fetch/issue/decode + stages of pipeline. Adjust latency counts accordingly. + * config/arm/arm1136jfs.md: New file. + +2003-11-05 Mark Mitchell + + * calls.c (initialize_argument_information): Add CALL_FROM_THUNK_P + parameter. Use it instead of current_function_is_thunk. + * function.h (struct function): Update documentation for is_thunk. + * tree.h (CALL_FROM_THUNK_P): New macro. + * config/alpha/alpha.c (alpha_sa_mask): Do not check + no_new_pseudos when testing current_function_is_thunk. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likeiwse. + +2003-10-28 Mark Mitchell + + * config/arm/arm.h (processor_type): New enumeration type. + (CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S, + ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores. + (CPP_CPU_ARCH_SPEC): Likewise. + * config/arm/arm.c (arm_tune): New variable. + (all_cores): Use cores.def. + (all_architectures): Add representative processor. + (arm_override_options): Restructure way in which tuning + information is deduced. + * arm.md: Update "insn" and "type" attributes throughout. + (insn): New attribute. + (type): Compute "mult" from "insn" attribute. Add load2, + load3, load4 alternatives. + (arm automaton): Move to arm-generic.md. + * config/arm/arm-cores.def: New file. + * config/arm/arm-generic.md: Likewise. + * config/arm/arm1026ejs.md: Likewise. + +2003-12-30 Mark Mitchell + + * stor-layout.c (layout_decl): Turn bitfields into ordinary + fields, even if they are the first field in a structure. + +2003-12-30 Roger Sayle + + * fold-const.c (fold) : Don't require strict type + equality, instead just prevent replacing a COND_EXPR of non-void + type by one of its operands of void type. + +2003-12-30 Andreas Schwab + + * doc/c-tree.texi: Fix @item vs. @itemx. + * doc/cpp.texi: Likewise. + * doc/install.texi: Likewise. + * doc/invoke.texi: Likewise. + +2003-12-30 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Fix typo in previous + change. + +2003-12-30 Jan Hubicka + + PR ice/11936 + * i386.h (CLASS_LIKELY_SPILLED_P): Return true for + FP_TOP_REG/FP_SECOND_REG. + +2003-12-30 Steven Bosscher + + Backport from tree-ssa (relevant changes only): + 2003-12-18 Zdenek Dvorak + + * et-forest.h (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons): Declarations removed. + (struct et_node): New. + (et_new_tree, et_free_tree, et_set_father, et_split, et_nca, + et_below): Declare. + * et-forest.c (struct et_forest_occurrence, struct et_forest, + struct et_forest_node): Removed. + (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons, splay, remove_all_occurrences, + find_leftmost_node, find_rightmost_node, calculate_value): Removed. + (struct et_occ): New. + (et_nodes, et_occurences): New. + (set_depth, set_depth_add, set_prev, set_next, et_recomp_min, + et_check_occ_sanity, et_check_sanity, et_check_tree_sanity, + record_path_before_1, record_path_before, check_path_after_1, + check_path_after, et_splay, et_new_occ, et_new_tree, + et_free_tree, et_set_father, et_split, et_nca, et_below): New. + * basic-block.h (struct basic_block_def): New field dom. + (struct dominance_info): Type removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators): Declarations + changed. + (enum dom_state): New. + (dom_computed): New variable. + (first_dom_son, next_dom_son): Declare. + * dominance.c (struct dominance_info): Removed. + (BB_NODE, SET_BB_NODE): Removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators, + debug_dominance_info): Work over new datastructure. Access + dominance datastructures through CFG. + (assign_dfs_numbers, compute_dom_fast_query, first_dom_son, + next_dom_son): New. + * bt-load.c (dom): Variable removed. + (augment_live_range, combine_btr_defs, migrate_btr_def, + migrate_btr_defs, branch_target_load_optimize): Updated for the + new interface for dominance information. + * cfg.c {exit_entry_blocks): Update initializer. + * cfglayout.c (copy_bbs): Removed loops argument. Updated for + the new interface for dominance information. + * cfglayout.h (copy_bbs): Declaration changed. + * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump, + flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated + for the new interface for dominance information. + (flow_loop_scan): Loops argument removed. + (flow_loops_free): Don't release dominators. + * cfgloop.h (struct cfg): Dom field removed. + (flow_loop_scan, loop_split_edge_with, simple_loop_p, + just_once_each_iteration_p, split_loop_bb): Declaration changed. + * cfgloopanal.c (simple_loop_exit_p, simple_increment, + just_once_each_iteration_p, simple_loop_p): Remove loops argument. + Updated for the new interface for dominance information. + * cfgloopmanip.c (remove_bbs, find_path, create_preheader, + split_loop_bb, loopify, duplicate_loop_to_header_edge, + force_single_succ_latches, loop_split_edge_with): Ditto. + * gcse.c (dominators): Variable removed. + (free_code_hoist_mem, compute_code_hoist_data, hoist_code): + Updated for the new interface for dominance information. + * ifcvt.c (post_dominators): Variable removed. + (mark_loop_exit_edges, merge_if_block, find_if_header, + find_cond_trap, find_if_case_1, find_if_case_2, if_convert): + Updated for the new interface for dominance information. + * loop-init.c (rtl_loop_optimizer_init, + rtl_loop_optimizer_finalize): Ditto. + * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling, + decide_peel_completely, decide_unroll_stupid, + decide_unroll_constant_iterations, + decide_unroll_runtime_iterations): Loops argument removed. + Updated for the new interface for dominance information. + (unroll_and_peel_loops, peel_loops_completely, + unroll_loop_runtime_iterations): Updated for the new interface for + dominance information. + * loop-unswitch.c (may_unswitch_on_p, unswitch_loops, + unswitch_single_loop, unswitch_loop): Updated for the new + interface for dominance information. + * predict.c (process_note_predictions, process_note_prediction, + estimate_probability, note_prediction_to_br_prob): Ditto. + * sched-rgn.c (find_rgns, init_regions): Ditto. + * toplev.c (rest_of_handle_branch_prob): Free the dominators. + +2003-12-30 Jan Hubicka + + PR target/13456 + * i386.md (allocate_stack_worker): Use different pattern for pre and + post reload expansion. + (allocate_stack_worker_1, allocate_stack_worker_rex64): Use + match_scratch. + (allocate_stack_worder_1_postreload, + allocate_stack_worker_rex64_postreload): New. + +2003-12-29 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Add pretend args size + to the virtual incoming args pointer for downward stacks. + +2003-12-29 Roger Sayle + + PR fortran/12632 + * fold-const.c (fold) : Don't fold a constant condition, + if the type of the selected branch doesn't match its' parent. + +2003-12-29 Jan Hubicka + + * coverage.c (read_counts_file): Better error messages; cause corrupted + profiles to produce hard errors, not just warnings + (get_coverage_counts): Similarly. + + * toplev.c (rest_of_handle_loop_optimize): Enable LOOP_AUTO_UNROLL. + +2003-12-29 Phil Edwards + + * doc/cppopts.texi: Use of -idirafter, -iprefix, -iwithprefix, and + -iwithprefixbefore is not discouraged. + +2003-12-28 Mostafa Hagog + + * sbitmap.c (sbitmap_union_of_diff_cg, sbitmap_a_and_b_cg, + sbitmap_a_xor_b_cg): Accumulate "changed" properly. + (sbitmap_not): Zero all bits past n_bit. + +2003-12-27 Zdenek Dvorak + + PR opt/13159 + * cfgloopanal.c (mark_irreducible_loops): Fix the strongly connected + components detection. + * loop-unswitch.c (unswitch_loop): Preserve simple preheaders. + +2003-12-27 Bernardo Innocenti + + * config/m68k/uclinux.h (LIB_SPEC): Add elf2flt magic required for + correct linking of executables using id-based shared libraries. + +2003-12-27 Kazu Hirata + + * config/i386/i386-interix.h: Remove uses of "register" + specifier in declarations of arguments and local variables. + * config/i386/i386.c: Likewise. + * config/i386/i386elf.h: Likewise. + * config/i386/ptx4-i.h: Likewise. + * config/i386/sysv4.h: Likewise. + +2003-12-26 Fariborz Jahanian + Geoffrey Keating + David Edelsohn + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Do not + restrict DFmode and TFmode to word alignment. + * config/rs6000/rs6000.md (movdf_hardfloat64): Use 'o' constraint + for ld/std and order before mr. + +2003-12-26 Andrew Pinski + + * config/darwin.h (LINK_COMMAND_SPEC): Arrange + -fprofile-generate to imply -lgcov. + +2003-12-26 Kazu Hirata + + * config/h8300/h8300.md (ldm_h8300s_2_normal): Use HImode for + addresses. + +2003-12-25 Kazu Hirata + + * config/m32r/m32r.md: Remove a constraint from a splitter. + +2003-12-25 Andrew Pinski + + PR C++/13429, C/11944 + * c-common.c (c_build_qualified_type): Return early when type is + error_mark_node. + (c_apply_type_quals_to_decl): Likewise. + +2003-12-25 Kazu Hirata + + * config/alpha/alpha-modes.def: Fix comment formatting. + * config/alpha/alpha.c: Likewise. + * config/alpha/alpha.h: Likewise. + * config/alpha/elf.h: Likewise. + * config/alpha/lib1funcs.asm: Likewise. + * config/alpha/openbsd.h: Likewise. + * config/alpha/vms-cc.c: Likewise. + * config/alpha/vms-crt0-64.c: Likewise. + * config/alpha/vms-crt0.c: Likewise. + * config/alpha/vms-ld.c: Likewise. + * config/alpha/vms-psxcrt0-64.c: Likewise. + * config/alpha/vms-psxcrt0.c: Likewise. + * config/alpha/vms.h: Likewise. + * config/arc/arc.c: Likewise. + * config/arm/aof.h: Likewise. + * config/arm/arm-modes.def: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/linux-elf.h: Likewise. + * config/arm/vxworks.h: Likewise. + * config/avr/avr.c: Likewise. + * config/avr/avr.h: Likewise. + +2003-12-24 Kazu Hirata + + * config/xtensa/elf.h: Fix comment formatting. + * config/xtensa/xtensa-protos.h: Likewise. + * config/xtensa/xtensa.c: Likewise. + * config/xtensa/xtensa.h: Likewise. + +2003-12-24 Kazu Hirata + + * config/avr/avr.c: Fix comment formatting. + * config/avr/avr.md: Likewise. + +2003-12-24 Kazu Hirata + + PR target/12721. + * config/avr/avr.c: Include ggc.h. + (tmp_reg_rtx): Declare with GTY. + (zero_reg_rtx): Likewise. + (ldi_reg_rtx): Remove. + (avr_override_options): Initialize zero_reg_rtx and + ldi_reg_rtx. + (avr_init): Remove. + Include gt-avr.h. + * config/avr/avr.h (LDI_REG_REGNO): Remove. + Remove externs for tmp_reg_rtx, zero_reg_rtx, and ldi_reg_rtx. + +2003-12-24 David Edelsohn + + * doc/md.texi: Document PowerPC vector register constraint letter. + +2003-12-23 Mark Mitchell + + * calls.c (expand_call): Recognize calls to "sqrt" and create + corresponding notes. + +2003-12-23 Kaveh R. Ghazi + + * config/mips/mips.c (override_options): Use `inform' instead + of `warning' for -g -mabi=32 and native assembler. + + * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS): + Don't pass -Wno-error. + +2003-12-23 David Edelsohn + + * function.c (assign_parms): Update max_parm_reg and + parm_reg_stack_loc when adding new parm reg. + +2003-12-23 Kazu Hirata + + * config/ns32k/ns32k.c: Convert to ISO-C. + +2003-12-23 Zack Weinberg + + * config/ia64/ia64.c (ia64_va_arg): Pass pointer for + variable-sized type through convert_memory_address. + (ia64_in_small_data_p): Always return false for FUNCTION_DECLs. + +2003-12-23 Jan Hubicka + + * common.opt (fprofile-generate,fprofile-use): Add. + * gcc.c (LINK_COMMAND_SPEC): Arrange -fprofile-generate to imply -lgcov + * opts.c (profile_arc_flag_set, flag_profile_values_set, + flag_unroll_loops_set, flag_tracer_set, + flag_value_profile_transformations_set, + flag_peel_loops_set): New static variables. + (common_handle_option): Deal with -fprofile-generate/-fprofile-use + * invoke.texi (-fprofile-generate, -fprofile-use): Describe. + +2003-12-23 Mark Mitchell + + * Makefile.in (OBJS-common): Remove dwarfout.o. + (dwarfout.o): Remove. + * common.opt: Remove -gdwarf, -gdwarf+. + * defaults.h (PREFERRED_DEBUGGING_TYPE): Do not check for + DWARF_DEBUGGING_INFO. + * dwarf2out.c: Fix typo in comment. + * dwarfout.c: Remove. + * opts.c (common_handle_option): Remove OPT_gdwarf, OPT_gdwarf_. + * toplev.c (process_options): Remove check for + DWARF_DEBUGGING_INFO. + * config/elfos.h (DWARF_DEBUGGING_INFO): Do not #define it or + #undef it. + * config/netware.h (DWARF_DEBUGGING_INFO): Likewise. + * config/ptx4.h (DWARF_DEBUGGING_INFO): Likewise. + * config/vxworks.h (DWARF_DEBUGGING_INFO): Likewise. + * config/alpha/unicosmk.h (DWARF_DEBUGGING_INFO): Likewise. + * config/arc/arc.h (DWARF_DEBUGGING_INFO): Likewise. + * config/i386/sco5.h (DWARF_DEBUGGING_INFO): Likewise. + * config/i386/x86-64.h (DWARF_DEBUGGING_INFO): Likewise. + * config/m32r/m32r.h (DWARF_DEBUGGING_INFO): Likewise. + * config/mcore/mcore-elf.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/linux64.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/liteelf.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/sol26-sld.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/sp86x-elf.h (DWARF_DEBUGGING_INFO): Likewise. + * doc/invoke.texi: Do not mention -gdwarf, -gdwarf-1, -gdwarf-1+, + or -gdwarf+. + * doc/tm.texi: Likewise. + + * c-common.c (flag_abi_version): Default to 2. + * c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION + uniformly for versions above 2. + * doc/invoke.texi: Update documentation for -fabi-version. + +2003-12-22 Geoffrey Keating + + * config/rs6000/rs6000.md: Change many instances of '! + TARGET_POWERPC64' to 'TARGET_32BIT' when the pattern being guarded + was guarded only because it changed CR0 or the carry bit in XER. + +2003-12-23 Eric Botcazou + + PR optimization/13394 + * toplev.c (rest_of_compilation): Move call to + check_function_return_warnings right after the sibcall + optimization pass. + +2003-12-23 Eric Botcazou + + PR c/13382 + * c-typeck.c (convert_for_assignment): When converting from + integral type to pointer type, always call convert. + +2003-12-22 Mark Mitchell + + * doc/invoke.texi: Deprecate -fwritable-strings. + + * c-common.c (flag_external_templates): Remove. + (flag_alt_external_templates): Likewise. + * c-common.h (flag_external_templates): Remove. + (flag_alt_external_templates): Likewise. + * c-opts.c (c_common_handle_option): Unsupport + -falt-external-templates and -ftemplates. + * doc/invoke.texi: Remove mention of -fexternal-templates and + -falt-external-templates. + +2003-12-22 Andrew Pinski + + PR target/13466 + * config.gcc (powerpc-*-darwin): Remove overridden value of need_64bit_hwint. + + * emit-rtl.c (copy_rtx_if_shared): Add comment about its use of + copy_rtx_if_shared_1. + (copy_rtx_if_shared_1): Add comment about what the function does. + + * c-decl.c (finish_function): Change order of checks. + (c_expand_body): Likewise. + +2003-12-22 Fariborz Jahanian + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Correct + check for the legitimate offset when memory of + DImode/DFmode/TFmode/TImode mode is being referenced and target + is TARGET_POWERPC64. + +2003-12-22 Dale Johannesen + + * reload1.c: Add reg_reloaded_call_part_clobbered. + (reload_as_needed): Use it. + (forget_old_reloads_1): Ditto. + (emit_reload_insns): Ditto. + +2003-12-22 Dale Johannesen + + PR optimization/12828 + * loop.c: Add find_regs_nested to look inside CLOBBER(MEM). + (scan_loop): Call it. + * regclass.c (reg_scan_mark_regs): Look inside CLOBBER(MEM). + +2003-12-22 Andrew Pinski + + PR c/9163 + * c-decl.c (poplevel): Only set DECL_INITIAL of a current function + if it is non-null. + (finish_function): Check for error_mark_node or null on DECL_RESULT and + DECL_RESULT of fndecl. + (c_expand_body): Only expand when DECL_INITIAL of fndecl is not + error_mark_node and not null. + +2003-12-21 Dan Nicolaescu + + * rtl.h (dump_rtx_statistics): Declare it. + * rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts, + rtx_alloc_sizes): New static vars. + (rtx_alloc, rtvec_alloc): Update them. + (dump_rtx_statistics): New function. + * toplev.c (finalize): Call it. + * ggc-page.c (struct globals): Fix comments. Add new member + total_allocated_per_order. + (ggc_alloc): Keep track of the total allocated memory. + (ggc_print_statistics): Clarify message. Print total allocated + memory stats. + * configure.in (gather-detailed-mem-stats): New flag. + * configure: Regenerate. + * config.in: Regenerate. + * doc/install.texi (Configuration): Document + --enable-gather-detailed-mem-stats. + +2003-12-22 Kazu Hirata + + * system.h (CONVERT_HARD_REGISTER_TO_SSA_P): Poison. + * config/i386/i386.h (CONVERT_HARD_REGISTER_TO_SSA_P): Remove. + +2003-12-21 Roger Sayle + + * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define _ILP32 + when compiling in ILP32 mode. + +2003-12-21 Andrew Pinski + + * config/rs6000/rs6000.c (rs6000_tls_referenced_p): Return early if + TARGET_HAVE_TLS is false. + +2003-12-21 Kazu Hirata + + * config/ip2k/ip2k-protos.h: Remove the prototype for + asm_output_section_name. + * config/ip2k/ip2k.c (asm_output_section_name): Remove. + +2003-12-21 Kazu Hirata + + * alias.c: Fix comment formatting. + * alloc-pool.c: Likewise. + * bitmap.c: Likewise. + * bitmap.h: Likewise. + * bt-load.c: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * c-opts.c: Likewise. + * c-pretty-print.c: Likewise. + * caller-save.c: Likewise. + * cfghooks.h: Likewise. + * cgraph.c: Likewise. + * collect2.c: Likewise. + * cppfiles.c: Likewise. + * cpplib.h: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * final.c: Likewise. + * function.c: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * genemit.c: Likewise. + * ggc.h: Likewise. + * haifa-sched.c: Likewise. + * ifcvt.c: Likewise. + * libgcc2.h: Likewise. + * loop.c: Likewise. + * predict.h: Likewise. + * unwind-libunwind.c: Likewise. + * varasm.c: Likewise. + +2003-12-21 Kazu Hirata + + * config/mn10300/mn10300.c (mn10300_encode_section_info): Fix + a warning. + +2003-12-21 Kazu Hirata + + * config/arm/arm.c: Convert to ISO-C. + * config/avr/avr.h: Likewise. + * config/fr30/fr30.c: Likewise. + * config/ip2k/ip2k.c: Likewise. + * config/mn10300/mn10300.c: Likewise. + +2003-12-20 Andrew Pinski + Matt Thomas + + PR target/12749 + * config/i386/i386.c (print_operand): Print only the first + 8 characters of the float in hex. + +2003-12-20 John David Anglin + + * pa.h (TRAMPOLINE_TEMPLATE): Shorten sequence when generating PA + 2.0 code. + (TRAMPOLINE_CODE_SIZE, MIN_CACHELINE_SIZE): New defines. + (INITIALIZE_TRAMPOLINE): Rework to pass line length, and aligned start + and end addresses to I and D cache instruction patterns. + * pa.md (anddi3, iordi3): Change predicates of operands 1 and 2 to + and_operand and ior_operand, respectively. When generating 64-bit + code, only one operand needs to be a register operand. + (xordi3): Change predicates of operands 1 and 2 to register_operand. + (one_cmpldi2): Change predicate of operand 1 to register_operand. + (dcacheflush, icacheflush): Revise to flush an arbitrary number of + cache lines. + +2003-12-20 Josef Zlomek + + PR optimization/13430, PR optimization/12322 + * bb-reorder.c (copy_bb_p): Do not allow block with many successors to + be copied. + (find_traces_1_round): Surround check for fake edges by + #ifdef ENABLE_CHECKING #endif. + +2003-12-20 Eric Botcazou + + PR other/7956 + * genmultilib: New variable disable_multilib. Set it to 'yes' + if enable_multilib was set to 'no'. Emit DISABLE_MULTILIB + if disable_multilib was set to 'yes'. + * gcc.c: Include multilib.h before tm.h. + * config/sparc/sol2-bi.h (LINK_ARCH_SPEC): Emit an error + message for multiarch options if DISABLE_MULTILIB is set. + * config/sparc/sol2-gld-bi.h (LINK_ARCH_SPEC): Likewise. + +2003-12-20 Eric Botcazou + + PR c/12085 + * c-typeck.c (build_function_call): Issue a warning if a + function is called through an incompatible prototype and + replace the call by a trap in this case. + +2003-12-19 James E Wilson + + * install.texi (ia64-*-linux): Document minimum libunwind version + number. + +2003-12-19 Per Bothner + + * langhooks.c (lhd_print_error_function): Fix for PR c/13110. + Don't do pp_newline; it causes an extra blank line. + * pretty-print.c (pp_base_flush): Clear pp_needs_newline. + +2003-12-19 Jason Merrill + + * tree.c (get_unwidened): Decide whether to narrow a bitfield + reference based on TYPE_SIZE, not TYPE_PRECISION. + + * stmt.c (parse_output_constraint): Warn about in-out constraint + that doesn't allow a register. + (parse_input_constraint): Warn about matching constraint that + doesn't allow a register. + +2003-12-19 James E Wilson + + * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards. + Add case for ASM_OPERANDS. + * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered + registers. + +2003-12-19 Kazu Hirata + + * expr.c (check_max_integer_computation_mode): Remove. + * dojump.c (do_jump): Don't use MAX_INTEGER_COMPUTATION_MODE. + * fold-const.c (fold): Likewise. + * system.h (MAX_INTEGER_COMPUTATION_MODE): Poison. + * doc/tm.texi (MAX_INTEGER_COMPUTATION_MODE): Remove. + +2003-12-19 James E Wilson + + * configure.in: Delete libunwind_has_eh_support test. + * configure: Regenerate. + * config.gcc (ia64*-*-linux*): Delete reference to t-libunwind-no-eh + and libunwind_has_eh_support check. + * config/t-libunwind-no-eh: Delete. + +2003-12-19 Joseph S. Myers + + * c-format.c (print_char_table): Allow 'I' flag on floating point + decimal formats. + +2003-12-19 Stuart Hastings + + * gcc/config/i386/i386.c (ix86_expand_call, x86_output_mi_thunk): + Trivial fixes for i386.c on Darwin/x86. + +2003-12-19 Fariborz Jahanian + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Add code to + recognize macho-style lo_sum adrress patterns. + +2003-12-19 Kazu Hirata + + * dwarfout.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * gensupport.c: Likewise. + * local-alloc.c: Likewise. + * regclass.c: Likewise. + +2003-12-19 Kelley Cook + + * config.guess: Remove. + +2003-12-19 Jakub Jelinek + + * config/ia64/unwind-ia64.c (ia64_copy_rbs): New function. + (unw_access_gr): Only call ia64_rse_rnat_addr if addr is above + regstk_top. + (uw_frame_state_for): Handle locations inside bundles. + (uw_init_context_1): Initialize context->rnat. + Set context->regstk_top to lowest rbs address which has nat collection + in context->rnat. + (uw_install_context): Fix rnat restoring. + Restore ar.rsc to previous state. + * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR, + MD_HANDLE_UNWABI): Handle unwinding through SA_ONSTACK frames. + +2003-12-19 Jakub Jelinek + + PR c++/13239 + * builtins.c (expand_builtin_expect_jump): Update + TREE_VALUE (arglist) if unsave_expr_now langhook + created a new tree. + +2003-12-19 Richard Earnshaw + + * arm.c (thumb_base_register_rtx_p): Use regno in comparison against + FIRST_PSEUDO_REGISTER. + +2003-12-18 Hartmut Penner + + * gcc/config/rs6000/rs6000.c (USE_ALTIVEC_FOR_ARG_P): Don't check + for SVR4 ABI. + +2003-12-18 Geoffrey Keating + + * config/rs6000/aix.h (OS_MISSING_POWERPC64): Define. + (OS_MISSING_ALTIVEC): Define. + * config/rs6000/darwin.h (ASM_SPEC): Be generous about supplying + -force_cpusubtype_ALL. + * config/rs6000/rs6000.c (rs6000_override_options): Rearrange + CPU information table; now always set all CPU-specific values. + Also, use Altivec and powerpc64 when chip and OS supports them. + +2003-12-18 Geoffrey Keating + + * fixinc/inclhack.def (darwin_macho_dyldh): New. + * fixinc/fixincl.x: Regenerate. + +2003-12-18 Dara Hazeghi + + * version.c (version_string): Renumber as 3.4.0 + * doc/include/gcc-common.texi: Likewise + +2003-12-18 Richard Henderson + + * genrecog.c (print_host_wide_int): New. + (write_switch, write_cond): Use it. + +2003-12-18 Richard Henderson + + * c-decl.c (check_bitfield_type_and_width): Remove enum special + case suppression of pedwarn. + * system.h (ENUM_BITFIELD): Use __extension__. + (CHAR_BITFIELD): Likewise. + +2003-12-18 Ulrich Weigand + Mark Dettinger + + * config/s390/s390.md (UNSPEC_SRST): New constant. + ("strlendi", "strlensi"): New expanders. + ("*strlendi", "*strlensi"): New insns. + +2003-12-18 Mark Mitchell + + * config/sol2.h (LINK_ARCH32_SPEC): Define in terms of ... + (LINK_ARCH32_SPEC_BASE): ... this new macro. + * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC): Define in terms of + ... + (LINK_ARCH64_SPEC_BASE): ... this new macro. + * config/sparc/sol2-gld-bi.h (LINK_ARCH32_SPEC): New macro. + (LINK_ARCH64_SPEC): Likewise. + +2003-12-18 Jason Merrill + + PR middle-end/13234 + * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code + classes. + +2003-12-18 Steven Bosscher + + * Makefile.in (tracer.o, bb-reorder.o): Depend on timevar.h + * toplev.c (rest_of_handle_reorder_blocks, rest_of_handle_tracer): + Don't push and pop TV_REORDER_BLOCKS timevars, do it... + * bb-reorder.c (reorder_basic_blocks): ...here, and... + * tracer.c (tracer): here. + +2003-12-18 Ulrich Weigand + + * loop.c (move_movables): Handle combination of m->consec, + m->move_insn_first, and m->insert_temp all nonzero correctly. + +2003-12-18 Kazu Hirata + + * calls.c (load_register_parameters): Don't use + LOAD_ARGS_REVERSED. + * system.h (LOAD_ARGS_REVERSED): Poison. + * doc/tm.texi (LOAD_ARGS_REVERSED): Remove. + +2003-12-17 Per Bothner + + * emit-rtl.c (set_new_first_and_last_label_num): Remove function. + * rtl.h (set_new_first_and_last_label_num): Remove declaration. + +2003-12-17 Alexandre Oliva + + * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone + scratch insns of the then branch that clobber regs needed by the + else branch. + +2003-12-17 Kazu Hirata + + * calls.c (expand_call): Update comments. + * system.h (PRETEND_OUTGOING_VARARGS_NAMED): Poison. + * targhooks.c: Do not refer to PRETEND_OUTGOING_VARARGS_NAMED. + +2003-12-17 James E Wilson + Roger Sayle + + * Makefile.in (gcse.o): Add $(TREE_H) to dependencies. + * gcse.c: Include tree.h. + (implicit_set_cond_p): New. + (find_implicit_sets): Call it. + +2003-12-17 Santiago Vila + + * config/kfreebsdgnu.h (TARGET_OS_CPP_BUILTINS): Rename from + TARET_OS_CPP_BUILTINS. + +2003-12-16 Kazu Hirata + + * emit-rtl.c: Fix signed/unsigned comparison warnings. + +2003-12-17 Joseph S. Myers + + * predict.c (struct block_info_def, struct edge_info_def): Change + bit-fields of width 1 to unsigned int. + +2003-12-16 Geoffrey Keating + + PR 12480 + * c-pch.c (pch_init): Improve error message when precompiled + header can't be written. + + PR 12606 + * c-pch.c (pch_init): Make a PCH file appear invalid while it's + being written. + (c_common_write_pch): Make it valid once it's done. + +2003-12-17 Ulrich Weigand + + PR target/11992 + * config/s390/s390.md ("*cmpmem_long_64"): Use CLCLE instruction + instead of CLCL. + ("*cmpmem_long_31"): Likewise. + +2003-12-17 Vladimir Makarov + + * config/ia64/ia64.c: Add more comments about insn bundling. + +2003-12-17 Richard Earnshaw + + PR optimization/10592 + * caller-save.c (mark_referenced_regs): Don't short-circuit a reg + or subreg in SET_DEST if it isn't a hard register. + +2003-12-17 David Edelsohn + + * collect2.c (main): Add -fno-profile-arcs -fno-test-coverage + -fno-branch-probabilities to arguments when compiling ctors and + dtors. + +2003-12-17 Eric Botcazou + + * config/sparc/sol2.h: Set SUPPORTS_INIT_PRIORITY to 0. + * config/sparc/sol2-gld.h: Set SUPPORTS_INIT_PRIORITY to 1. + +2003-12-17 Richard Earnshaw + + * arm.c (thumb_base_register_rtx_p): Don't allow virtual registers + as base registers for sub-word operations. + (thumb_legitimate_address_p): Simplify REG+REG test. + +2003-12-17 Segher Boessenkool + + * opts.c (wrap_help): Fix overflow. + +2003-12-17 Fred Fish + + * configure.in: Remove code to examine linker scripts and set + HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES. + * configure, config.in: Regenerate. + +2003-12-16 Mark Mitchell + + PR c++/12218 + * varasm.c (initializer_constant_valid_p): Allow a conversion from + an integral constant to an OFFSET_TYPE. + +2003-12-16 Kazu Hirata + + PR target/11012 + * config/m32r/m32r.c (gen_compare): Call gen_addsi3 instead of + gen_cmp_ne_small_const_insn. + * config/m32r/m32r.md (cmp_ne_small_const_insn): Remove. + +2003-12-17 Neil Booth + Joseph S. Myers + + PR c/3347 + * c-decl.c (enum_decl_context): Remove BITFIELD. + (grokdeclarator): Take bit-field width as an input. + Perform bit-field width validation with + check_bitfield_type_and_width rather than waiting for + finish_struct. + (groktypename, groktypename_in_parm_context, start_decl, + push_parm_decl, grokfield, start_function): Update calls to + grokdeclarator. + (check_bitfield_type_and_width): New function. + (finish_struct): Move bit-field validation to grokdeclarator + and check_bitfield_type_and_width. + +2003-12-16 John David Anglin + + PR bootstrap/13386 + * configure.in (gcc_cv_ld_hidden): Set to yes on hppa64*-*-hpux* when + using HP native linker. + * configure: Rebuilt. + +2003-12-16 Mark Mitchell + + PR c++/13275 + * c-common.h (enum rid): Add RID_OFFSETOF. + * c-parser.in (rid_to_yy): Ignore RID_OFFSETOF. + * ginclude/stddef.h (offsetof): Reimplement for C++, using + __offsetof__. + * doc/extend.texi: Document __offsetof__. + +2003-12-16 Stan Cox + + * config/iq2000/iq2000.h: Formatting. + (MAX_INT_TYPE_SIZE, MAX_INT_TYPE_SIZE, CONST_COSTS, RTX_COSTS) + (ADDRESS_COST, ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL) + (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR, SLOW_ZERO_EXTEND): Remove + * config/iq2000/iq2000.c: Formatting. + (iq2000_rtx_costs): New. + +2003-12-16 Richard Earnshaw + + * arm.md (addsi3_carryin_shift): Add missing register constraints. + +2003-12-16 Loren James Rittle + + * testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to + pass with -pthread on FreeBSD systems. + +2003-12-16 Richard Sandiford + + * config/mips/mips.c (mips_file_end): Only write symbols that have + been referenced at some point. + +2003-12-16 Richard Sandiford + + * config/mips/mips.c: Include langhooks.h + (mips_build_builtin_va_list): Use lang_hooks.types.make_type. + +2003-12-16 Eric Botcazou + + PR optimization/13313 + * combine.c (make_extraction) [REG]: Do not use + gen_lowpart_for_combine when POS is non-zero. + +2003-12-16 Hartmut Penner + + * altivec.h (vec_cmple, vec_all_numeric): Fix typo. + * testsuite/gcc.dg/altivec-10.c: Test for above. + +2003-12-15 David O'Brien + + * Makefile.in (CPPFLAGS): Initialize from configure. + +2003-12-15 Roger Sayle + + PR middle-end/13400 + * ifcvt.c (noce_process_if_block): Disable unconditional write + optimizations if we could introduce a store to trapping memory + that wasn't present previously. + +2003-12-15 Kazu Hirata + + * system.h (DEFAULT_CALLER_SAVES): Poison. + * toplev.c (flag_caller_saves): Always initialize with 0. + * doc/tm.texi (DEFAULT_CALLER_SAVES): Remove. + +2003-12-15 Kazu Hirata + + * flow.c (EXIT_IGNORE_STACK): Move to ... + * defaults.h (EXIT_IGNORE_STACK): ... here. + * dojump.c (clear_pending_stack_adjust): Don't use #ifdef + EXIT_IGNORE_STACK. + * function.c (expand_function_end): Likewise. + * global.c (global_alloc): Likewise. + * ra.c (init_ra): Likewise. + * reload1.c (init_elim_table): Likewise. + * reorg.c (fill_simple_delay_slots): Likewise. + * resource.c (init_resource_info): Likewise. + * doc/tm.texi (EXIT_IGNORE_STACK): Document that the default + is 0. + +2003-12-15 J"orn Rennecke + + * reload.c (reg_overlap_mentioned_for_reload_p): + When looking at a PLUS in X, avoid spuriously returning nonzero + when IN is a REG or another simple PLUS, or a MEM containing one. + + * loop.c (loop_invariant_p): Amend comment about where new registers + might come from. + +2003-12-15 Andreas Jaeger + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Remove + handling of obsolete language CHILL. + +2003-12-15 Waldek Hebisch + + * tree.c (initializer_zerop): Add test for empty set. + * integrate.c (function_cannot_inline_p): Forbid inlining + functions calling `longjmp'. + +2003-12-15 Nathan Sidwell + + PR c++/11773 + * doc/gcov.texi (Gcov and Optimization): Document inline function + behaviour. Fix some file suffixes. + +2003-12-14 David O'Brien + + * config/i386/i386.h (__amd64, __amd64__): Remove duplicates. + +2003-12-14 Mark Mitchell + + * c-common.h (c_parse_error): Declare it. + * c-common.c (c_parse_error): New function. + * c-parse.y (yyerror): Use it. + +2003-12-14 John David Anglin + + PR target/13054 + * pa-protos.h (indexed_memory_operand, borx_reg_operand, + move_dest_operand, move_src_operand): New protypes. + (basereg_operand, move_operand, reg_or_nonsymb_mem_operand): Deleted. + * pa.c (copy_reg_pointer, indexed_memory_operand, move_dest_operand, + move_src_operand): New functions. + (basereg_operand, reg_or_nonsymb_mem_operand, move_operand): Delete. + (reg_or_0_or_nonsymb_mem_operand): Return false for unscaled indexed + address until cse is not expected on targets with non-equivalent + space registers. + (hppa_legitimize_address): Canonicalize unscaled indexed addresses + on targets non-equivalent space registers. + (emit_move_sequence): Break out indexed addresses from destination + operand. Similarly, break out unscaled indexed addresses from + source operand on targets with non-equivalent space registers. Fix + REG_POINTER flag when possible. Mark register pointer when creating + new pointers. + (print_operand): Handle unscaled index addresses. + * pa.h (IS_INDEX_ADDR_P, IS_LO_SUM_DLT_ADDR_P): New macro subroutines + for EXTRA_CONSTRAINT. + (EXTRA_CONSTRAINT): Rework to make more readable. + (MODE_OK_FOR_SCALED_INDEXING_P, MODE_OK_FOR_UNSCALED_INDEXING_P): New + subroutines for GO_IF_LEGITIMATE_ADDRESS. + (GO_IF_LEGITIMATE_ADDRESS): Rework using new subroutines. Allow scaled + and unscaled addresses. Canonicalize unscaled indexed addresses on + targets with non-equivalent space registers. Document issues in + handling indexed address modes on PA-RISC. + (PREDICATE_CODES): Update for new and deleted predicates. + * pa.md (move_dest_operand, move_src_operand, indexed_memory_operand): + Use new predicates in move patterns. + Add peephole2 patterns to optimize floating point stores. Fix + constrain preferencing in move patterns. Delete patterns for handling + unscaled indexed memory loads. Add missing load and store with + base-register modification patterns. Correct SFmode floating point + store pattern. Add missing zero extension loads. + +2003-12-13 Steven Bosscher + + * ggc-zone.c (struct alloc_zone): Don't pre-declare, it already + comes in with ggc.h. Add a new bool field `dead'. + (destroy_ggc_zone): Don't destroy a zone at once. Instead, only + set the `dead' flag for the dead zone. Wrap a sanity check in + ENABLE_CHECKING. + (ggc_collect_1): Always mark and sweep if a zone has the `dead' + flag set. + (ggc_collect): Free dead zones after collecting. + +2003-12-13 Jan Hubicka + + * coverage.c (get_coverage_counts): Use inform instead of warning + about missing profile. + +2003-12-12 Steven Bosscher + + * Makefile.in (opts.o, explow.o): Depend on langhooks.h + +2003-12-12 Geoffrey Keating + + * config.gcc : Don't use fixproto. + : Likewise. + +2003-12-12 Jakub Jelinek + + * config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K. + (MD_FALLBACK_FRAME_STATE_FOR): Set fpsr_loc, br_loc[6] and + br_loc[7]. Update comment. + (MD_HANDLE_UNWABI): Define. + * config/ia64/unwind-ia64.c (struct unw_state_record): Add + unwabi field. + (struct _Unwind_Context): Increase br_loc array size to 8 entries. + (desc_abi): Set unwabi. + (uw_update_reg_address): Allow br up to 7. + (uw_update_context): Invoke MD_HANDLE_UNWABI if defined. + (uw_install_context): Load b1..b5 from correct locations. + Fix insn loading ar.fpsr. + * doc/tm.texi: Document MD_HANDLE_UNWABI. + +2003-12-12 Roger Sayle + + PR optimization/13037 + * loop.c (update_giv_derive): Ignore redundant sets of a biv when + calculating how to derive a giv from a biv. + +2003-12-12 Neil Booth + + PR preprocessor/12935 preprocessor/12952 preprocessor/13046 + * cpplib.c (prepare_directive_trad): Clear skipping only in + #if and #elif directives. + (do_undef): Call the handler even if the identifier is not a macro. + * cpptrad.c (scan_parameters): Emit an error message. + (_cpp_create_trad_definition): Remember the params list even on + failure. + +2003-12-11 Zack Weinberg + + * arm.c (ARM_ADDRESS_COST, THUMB_ADDRESS_COST): Convert macros + to inline functions: arm_arm_address_cost, arm_thumb_address_cost + respectively. + (arm_address_cost): Use 'em. + +2003-12-12 Rainer Orth + + * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define + __STDC_VERSION__ to ISO C94 for C++. + + * fixinc/inclhack.def (alpha_wchar): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/wchar.h: New file. + +2003-12-11 David Mosberger + + * unwind-libunwind.c (_Unwind_SetGR): Clear the NaT bit as + required by C++ ABI for Itanium. + * config/t-libunwind (LIB2ADDEH): Remove unwind-libunwind.c. + * config/t-libunwind-no-eh: New file. + * configure.in: Check libunwind for _Unwind_Resume() and if it's + present, set libunwind_has_eh_support to "yes". + * configure: Regenerate. + * config.gcc (ia64*-*-linux*): If $libunwind_has_eh_support is + set to yes, use t-libunwind, otherwise, use t-libunwind-no-eh. + +2003-12-11 Richard Sandiford + + * config/mips/mips.c (mips_global_pointer): Force functions with + a nonlocal goto to set up $gp. + +2003-12-11 James E Wilson + + PR target/13132 + * function.c (gen_mem_addressof): When no decl, explicitly clear flag + bits. + +2003-12-12 Nick Clifton + + * config/m32r/m32r.c: Convert to ISO-C + +2003-12-12 Kazuhiro Inaoka + + * doc/invoke.texi: Replace Mitsubishi with Renesas. + * config/m32r/m32r.h: Ditto. + * config/m32r/m32r.c: Ditto. + * config/m32r/m32r.md: Ditto. + +2003-12-11 Steven Bosscher + + * basic-block.h (BLOCK_HEAD, BLOCK_END): Remove. + (BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove. + (basic_block_def): Rename `head' to `head_' and `end' to `end_'. + (BB_HEAD, BB_END): New accessor macros for the `head_' and `end_' + fields of a basic block. + * bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c, + cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c, + cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c, + final.c, flow.c, function.c, gcse.c, global.c, graph.c, + haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c, + loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c, + ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c, + regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c, + sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c, + config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of + accessing the `head' and `end' fields of a basic block directly. + + * gengtype.c: Teach about "void**" pointers and "void *" function + types. Fixes earlier commit. + +2003-12-10 Geoffrey Keating + + * doc/extend.texi (Vector Extensions): Document that bitwise + operations also work on vectors. + +2003-12-10 Richard Earnshaw + + * arm.md: New split patterns for optimizing bitfield accesses. + +2003-12-10 Steven Bosscher + + * README.Portability: Remove K+R section. + + * gengtype-lex.l: Teach about "void**" pointers and + "void*" function types. + +2003-12-10 Eric Botcazou + + PR target/13354 + * config/sparc/sparc.c (sparc_output_mi_thunk): Load DELTA + manually if one can do that with only one instruction. + +2003-12-10 Nick Clifton + + * config.gcc (arm-linux): Include linux.h in tm_file so that + LINUX_TARGET_OS_CPP_BUILTINS is defined. + * config/arm/linux-elf.h (LIB_SPEC): Protect the definition. + +2003-12-09 James E Wilson + + * rtl.def (CODE_LABEL, NOTE): Correct operand numbers in comments. + +2003-12-09 Matt Austern + + PR c/13134 + * c-decl.c (duplicate_decls): Copy visibility flag when appropriate. + +2003-12-09 Kazuhiro Inaoka + + * config/m32r/m32r.h: Add support for m32r2 processor. Including + a new command line option -m32r2 to select it. + * config/m32r/m32r.c: Add support for the new processor variant. + * config/m32r/m32r.md: Likewise. + * config/m32r/t-m32r: Add m32r2 multilibs. + * doc/invoke.texi: Document the new command line switch. + +2003-12-08 Kazu Hirata + + * defaults.h (LOCAL_REGNO): Give the default definition. + * flow.c (LOCAL_REGNO): Remove. + * reload1.c (LOCAL_REGNO): Likewise. + +2003-12-08 Geoffrey Keating + + PR target/11848 + * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Allow change of mode + in floating-point registers between TFmode and DImode. + * rs6000.c (rs6000_emit_move): Split moves early. + (secondary_reload_class): Random Whitespace Change. + (rs6000_split_multireg_move): Support moves involving FP registers. + Emit instructions directly. + * rs6000-protos.h (rs6000_split_multireg_move): Update prototype. + * altivec.md: Update for changes to rs6000_split_multireg_move. + * rs6000.md: Update for changes to rs6000_split_multireg_move. + (movtf_internal): Support moves to/from GPRs. + +2003-12-08 Stuart Hastings + + * config/i386/i386.md: Typo in split of fp-valued if_then_else. + +2003-12-08 James E Wilson + + PR target/13132 + * expmed.c (extract_bit_field): Only call mode_for_size for scalar + integer modes. + +2003-12-08 Nathanael Nerode + + * doc/install.texi: Revert change of Dec 7; gcc is still a 2.13 + directory. + +2003-12-08 Alexandre Oliva + + * config/frv/frv.md (subdi2): Merge with _internal insn_and_split, + by using match_scratch. + (negdi2): New. + +2003-12-08 Jason Merrill + Daniel Berlin + + PR debug/11114 + Support namespaces in DWARF 2 output. + * dwarf2out.c (gen_namespace_die): New function. + (force_namespace_die, setup_namespace_context): New fns. + (declare_in_namespace): New fn. + (gen_decl_die): Call declare_in_namespace. Handle namespaces. + (dwarf2out_decl): Handle namespaces. + (scope_die_for): Pass through a namespace scope. + (class_scope_p): Rename to class_or_namespace_scope_p. + (gen_subprogram_die, gen_variable_die): Adjust. + (gen_struct_or_union_die): Always emit a declaration + if context_die is a namespace. + +2003-12-08 Jan Hubicka + + * unwind-pe.h (read_uleb128): Fix handling of large values + (read_sleb128): Fix handling of large values + +2003-12-08 Andrew Pinski + + PR middle-end/10060 + * emit-rtl.c (copy_rtx_if_shared): Split out into ... + (copy_rtx_if_shared_1): here and optimize the last one + in the sequence into tail-recursion. + (reset_used_flags): Optimize the last one + in the sequence into tail-recursion. + +2003-12-08 Richard Earnshaw + + * arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y) + for constant X. + +2003-12-08 Richard Sandiford + + * calls.c (expand_call): Don't try using tail or recursive calls + after the function body has been expanded. + +2003-12-08 Jan Hubicka + + * i386.md (cmpstr expander): Obey TARGET_INLINE_ALL_STRINGOPS + +2003-12-08 Arnaud Charlet + + PR ada/13324, PR ada/12614 + * doc/install.texi: Update requirements for building Ada. + +2003-12-07 David Edelsohn + Graham Reed + + * collect2.c (GCC_OK_SYMBOL): Add support for AIX C_WEAKEXT. + (GCC_UNDEF_SYMBOL): Same. + +2003-12-07 Kazu Hirata + + * final.c (final_scan_insn): Don't use FINAL_PRESCAN_LABEL. + * system.h (FINAL_PRESCAN_LABEL): Poison. + * doc/tm.texi (FINAL_PRESCAN_LABEL): Remove. + +2003-12-07 Kaveh R. Ghazi + + * Makefile.in (compare): Combine toplevel and $(SUBDIRS) cases. + +2003-12-07 Nathanael Nerode + + * configure.in, aclocal.m4: Revert to pre-2.5x conversion status. + * configure: Regenerate with autoconf 2.13. + + * configure.in: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM + with modern equivalents. + * configure: Regenerate. + + * configure.in: Replace gcc_AC_CHECK_TYPE with AC_CHECK_TYPE. + * aclocal.m4 (gcc_AC_CHECK_TYPE): Remove. + * configure: Regenerate. + + * configure: Regenerate with (preferred) autoconf 2.57. + * doc/install.texi: Note that 'gcc' is now a 2.57 directory. + +2003-12-07 Eric Botcazou + + PR optimization/12965 + * caller-save.c (save_call_clobbered_regs): Do not save/restore + registers around no-return calls. + +2003-12-07 Nathanael Nerode + + * configure.in: Make minimum necessary changes for autoconf 2.5x. + * aclocal.m4: Make minimum necessary changes for autoconf 2.5x. + * configure: Regenerate with autoconf 2.58. + +2003-12-07 Eric Botcazou + + PR optimization/13318 + * loop.c (express_from): Protect integer division from overflow. + +2003-12-07 Eric Botcazou + + PR optimization/13060 + * function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a + replacement already exists. Fix again the whole insn if that fails. + +2003-12-06 Andrew Pinski + + * config/rs6000/rs6000.c (macho_branch_islands): Use + HOST_WIDE_INT_PRINT_UNSIGNED. + +2003-12-06 Richard Sandiford + + * varasm.c (incorporeal_function_p): New. + (assemble_external): Use it as a filter. + * config/mips/mips.c (mips_output_external): Don't check for builtin + functions here. + +2003-12-06 Richard Earnshaw + + * arm.md (IOR (COMPARISON) (AND)): New define_splits. + +2003-12-06 Kelley Cook + + * Makefile.in (program_transform_cross_name): Delete. + (GCC_CROSS_NAME, CPP_CROSS_NAME): Delete. + (PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Delete. + (AR_FOR_TARGET, RANLIB_FOR_TARGET, NM_FOR_TARGET): Adjust for above. + (install_cpp, install_driver, install-man, uninstall): Likewise. + +2003-12-06 Alan Modra + + PR 13169 + * basic-block.h (PROP_ASM_SCAN): Define. + * final.c (regs_asm_clobbered): New array. + * regs.h (regs_asm_clobbered): Declare. + * flow.c (life_analysis): Init it. + (mark_set_regs): Set PROP_ASM_SCAN for asms. + (mark_set_1): Set regs_asm_clobbered. + * global.c (global_alloc): Don't set eliminable_regset when + regs_asm_clobbered. + +2003-12-05 Mark Mitchell + + * config/ia64/ia64.h (MUST_PASS_IN_STACK): Define. + + PR c++/13314 + * emit-rtl.c (set_mem_attributes_minus_bitpos): Robustify. + +2003-12-05 Andrew Pinski + + PR driver/13211 + * gcc.c (execute) Increment execution_count when returning + early because verbose_only_flag is true. + +2003-12-05 Per Bothner + + * cppfiles.c (file_hash_hash): New static function. + (hash_string_eq): Renamed static function to file_hash_eq. + (_cpp_init_files): Create file_hash table with above callbacks. + (cpp_included): Must use htab_find_with_hash insead of htab_find. + (_cpp_find_find, make_cpp_dir): Must use htab_find_slot_with_hash. + +2003-12-05 Per Bothner + + * line-map.h (source_location): New typedef. + (fileline): Redefined as source_location. + (struct line_map, linemap_add, linemap_lookup): Replace filefile + by source_location. + * line-map.c (linemap_add, linemap_lookup): Use source_location. + +2003-12-05 Richard Henderson + + * config/alpha/alpha.c (alpha_build_builtin_va_list): Add dummy + field to suppress -Wpadded warnings. + +2003-12-05 Stuart Hastings + + * config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO. + +2003-12-05 Stuart Menefy + J"orn Rennecke + + PR target/13302 + * sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type). + +2003-12-05 Roger Sayle + + * dojump.c (do_jump): If the expression being compared against + zero, is the subreg of a promoted variable, perform the comparison + in the promoted mode. + * simplify-rtx.c (simplify_unary_operation): Optimize sign and + zero-extensions of subregs of promoted variables where the + extension is identical to that used to promote the variable. + +2003-12-05 Hans-Peter Nilsson + + PR target/13256 + * resource.h (enum mark_resource_type): Remove member MARK_DEST. + The only user changed as follows: + * resource.c (mark_set_resources) : Always recurse for + SET_SRC (x). + : Always recurse on + operands. + : Delete, deferring to default code. + +2003-12-05 Waldek Hebisch + + * stmt.c (expand_nl_goto_receiver): Copy hard register clobbers + and ASM_INPUT barrier from expand_builtin_setjmp_receiver. + +2003-12-05 Richard Sandiford + + * config/mips/mips.c (mips_expand_call): Don't allow laziy binding + for n32 & n64 abicalls. + +2003-12-05 Richard Sandiford + + PR bootstrap/13145 + * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Adjust comment. + * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Add $fcall. + (mips_load_got): Always create a constant MEM. + (mips_expand_call): Use load_callsi and load_calldi. + * config/mips/mips.md (UNSPEC_LOAD_CALL, FAKE_CALL_REGNO): New consts. + (load_callsi, load_calldi): New patterns. + +2003-12-05 Peter Gerwinski + + * tree.def (PLACEHOLDER_EXPR): Clarify commentary. + +2003-12-05 Steven Bosscher + + * config/d30v/d30v-protos.h , config/d30v/d30v.c, + config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, + config/fr30/fr30-protos.h, config/fr30/fr30.c, + config/i370/i370-protos.h, config/i370/i370.c, + config/i960/i960-protos.h, config/i960/i960.c, + config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, + config/m32r/m32r-protos.h, config/m32r/m32r.c, + config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, + config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c: + Convert to ISO C90 function declarations and definitions. + +2003-12-05 Eric Botcazou + + * doc/extend.texi (Constructing Calls): Add warning about + the limitations of the functions. + +2003-12-05 Eric Botcazou + + PR middle-end/11151 + * function.h (struct function): New field 'x_naked_return_label'. + * function.c (free_after_compilation): Set it to NULL. + (expand_function_end): Emit 'naked_return_label' if it exists. + * rtl.h (expand_naked_return): Declare. + * stmt.c (expand_naked_return): New function to generate a + jump to 'naked_return_label'. + * builtins.c (expand_builtin_return): Call expand_naked_return + instead of expand_null_return. + * config/sparc/sparc.md (untyped_return): Likewise. + +2003-12-04 Andrew Pinski + + PR target/11322 + * config/sh/netbsd-elf.h (NO_PROFILE_COUNTERS): Define. + + PR target/12467 + * config/rs6000/altivec.md (altivec_vmsummbm): Fix typo. + +2003-12-04 Stuart Hastings + + * rs6000.c (output_call, macho_branch_islands, + add_compiler_branch_island, no_previous_def, get_previous_label) + Revisions of xx_stub functions for branch islands, + add -fPIC support for Darwin. + * rs6000-protos.h (output_call) Prototype. + * rs6000.md Use output_call. + * invoke.texi Explain Darwin semantics of -longcall. + * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr. + +2003-12-04 Richard Henderson + + * config/i386/i386.md (addqi3_carry): Use q not r constraints. + (subqi3_carry): Likewise. + +2003-12-04 J"orn Rennecke + + PR optimization/13260 + * sh-protos.h (sh_expand_t_scc): Declare. + * sh.h (PREDICATE_CODES): Add cmpsi_operand. + * sh.c (cmpsi_operand, sh_expand_t_scc): New functions. + * sh.md (cmpsi): Use cmpsi_operand. If T_REG is compared to + something that is not a CONST_INT, copy it into a pseudo register. + (subc): Fix description of new T value. + (slt, sgt, sge, sgtu): Don't clobber T after rtl generation is over. + (sltu, sleu, sgeu): Likewise. + (seq, sne): Likewise. Use sh_expand_t_scc. + +2003-12-04 Nathanael Nerode + + * configure.in: Generalize the CONFIG_HEADERS pattern under which + we stamp cstamp-h. + * configure: Regenerate. + + * configure.in: Pull AC_CHECK_HEADER call out of shell if statement + to avoid trouble when updating to autoconf 2.5x. + * configure: Regenerate (with autoconf 2.13 still). + +2003-12-04 J"orn Rennecke + + * sh.md (truncdiqi2): Use andi opcode for immediate. + (reload_outdf+1,reload_outdf+2): Remove constraints. + (movv16sf_i): Fxi multiplier for SUBREG_BYTE. + (movv8qi_i+2): Zero-extend low byte before adding it to high byte. + (fipr, ftrv): Add .s suffix to opcode. + +2003-12-04 Richard Sandiford + + PR target/13186 + + Revert all of the following patch, except the addition of + hook_bool_machine_mode_true: + + 2003-11-02 Richard Sandiford + + * Makefile.in (targhooks.o, reload.o): Update dependencies. + (GTFILES): Add targhooks.c. + (gt-targhooks.h): New rule; depend on s-gtype. + * target.h (direct_pool_load_p): New hook. + * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro. + (TARGET_INITIALIZER): Include it. + * targhooks.h (default_direct_pool_load_p): Declare. + (hook_bool_machine_mode_true): Declare. + * targhooks.c: Include insn-config.h, recog.h, ggc.h and + gt-targhooks.h. + (pool_symbol): New variable. + (default_direct_pool_load_p): New function. + (hook_bool_machine_mode_true): New function. + * reload.c: Include target.h. + (find_reloads): If an alternative will force a constant into memory, + count an extra reload if constant pool symbols are not valid + addresses. If an alternative uses memory to move values between + registers, count the move as two reloads rather than one. + * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define. + * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document. + +2003-12-03 Mark Mitchell + + * config/ia64/hpux.h (TARGET_HAVE_TLS): Define it to false. + * config/ia64/ia64.h (TARGET_HAVE_TLS): Define it to true if + HAVE_AS_TLS is true. + * config/ia64/ia64.c (TARGET_HAVE_TLS): Do not define it. + +2003-12-03 James E Wilson + + * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name. + + * gcc-page.c (extra_order_size_tab): Correct comment. + +2003-12-03 Kazu Hirata + + * config/h8300/h8300.c (push): Call gen_push_h8300hs_advanced + instead of gen_push_h8300hs. + (pop): Call gen_pop_h8300hs_advanced instead of + gen_pop_h8300hs. + * config/h8300/h8300.h (TRAMPOLINE_SIZE): Use Pmode. + * config/h8300/h8300.md (*tablejump_h8300hs_advanced): + Tighten the predicate. + (*tablejump_h8300hs_normal): Tighten the predicate. + (push_h8300hs): Change to + push_h8300hs_advanced. + (pop_h8300hs): Change to pop_h8300hs_advanced. + +2003-12-03 Eric Christopher + + * rtl.c: Fix typo. + * config/mips/mips.h: Ditto. Fix formatting. + +2003-12-04 Ben Elliston + + * future.options: Remove. Move to gnu.org web pages. + +2003-12-03 Eric Christopher + + * c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move + from here... + * c-tree.h: to here. + +2003-12-03 Jan Hubicka + + PR optimization/12324 + * toplev.c (rest_of_decl_compilation): Do not deffer when compiling + in unit-at-a-time mode. + +2003-12-03 Jakub Jelinek + + * expr.c (store_constructor): Only set RTX_UNCHANGING_P for + read-only field if cleared is 0. + +2003-12-03 Nathanael Nerode + + * config.gcc: Mark obsolete targets for GCC 3.4. + +2003-12-03 Zack Weinberg + + * aclocal.m4 (AM_ICONV): Add explicit check for iconv.h. + * config.in, configure.in: Regenerate. + * cpphash.h: Check both HAVE_ICONV and HAVE_ICONV_H before + including iconv.h. + +2003-12-03 Alan Modra + + PR target/11229 + * cse.c (cse_insn): Set classp using src_const_elt if + src_eqv_elt is NULL. + +2003-12-03 Richard Earnshaw + + * gcse.c (reg_clear_last_set): New function. + (reg_set_info): If data is non-null, treat it as an sbitmap of + registers, set the bit for the register being set. + (compute_store_table): Allocate last_set_in with xcalloc. Do not + memset this array on each iteration. Pass reg_set_in_block[bb->index] + to note_stores while computing last_set_in instead of scanning + last_set_in after the first pass through the insns. + Clear last_set_in using reg_clear_last_set instead of explicitly + rescanning after each insn. If checking is enabled, assert that + last_set_in is completely zeroed after each bb has been processed. + +2003-12-02 Geoffrey Keating + + * df.c (df_uses_record) : The argument of a MEM is read-only, + never read-write. + : Delete incorrect comment. + : Remove 'use_flags' variable. + +2003-12-03 David Edelsohn + + * function.c (assign_parms): Make sure parm PARALLEL combined + in reg is composed of more than one object and the mode really + produces a reg. + +2003-12-03 Jan Hubicka + + * i386.c (classify_argument): Make it 64bit clean. + +2003-12-02 Richard Sandiford + + * config/mips/mips.c (mips_output_external): Replace checks for + specific builtin-in functions with a check for DECL_BUILTIN_IN. + +2003-12-02 Richard Henderson + + * rtl.h (PUT_CODE, PUT_MODE): Remove ENUM_BITFIELD cast. + * tree.h (TREE_SET_CODE): Likewise. + * recog.h (struct insn_operand_data): Move const after ENUM_BITFIELD. + +2003-12-02 Ben Elliston + + * dbxstclass.h: Rename from this .. + * xcoff.h: .. to this. + * xcoffout.c: Include xcoff.h. + +2003-12-01 Kaveh R. Ghazi + + * Makefile.in (GCC_CFLAGS): Add -Wold-style-definition. + +2003-12-01 James Lemke + + * config/arm/arm.c (arm_rtx_costs): Improve for xscale multiply. + +2003-12-01 Roger Sayle + + PR optimization/11634 + * recog.c (split_insn): Factor test of INSN_P and handling of + set_noop_p out of here into the two callers. + (split_all_insns): Add INSN_P test and set_noop_p handling here. + If deleting a no-op set after reload that has a REG_UNUSED note, + mark the basic block as changed and recalculate life information. + (split_all_insns_noflow): Add INSN_P test and set_noop_p handling + here. + +2003-12-01 Roger Sayle + + PR optimization/12322 + * gcse.c (struct ls_expr): Change type of hash_index from int to + unsigned int. + (hash_expr): Document hash_table_size parameter and wrap long line. + (ldst_entry): Calculate expression's hash_index and record in ptr. + (trim_ld_motion_mems): Use hash_index to search a single bucket + instead of scanning the entire hash_table. Remove the "del" local + variable and use the equivalent "expr == 0" instead. Change last + to be a pointer to the pointer to the current element, to simplify + and speed-up deleting from a linked list. + +2003-12-01 James E Wilson + + * doc/contrib.texi: Update David Mosberger. + + * doc/c-tree.texi (CONSTRUCTOR): Clarify element order and handling + of missing fields. + + PR target/8407 + * config/ia64/ia64.c (ia64_function_arg): For single-reg HFA, call + gen_rtx_REG to create new reg with argument mode. + +2003-12-01 Steven Bosscher + + * ggc.h (struct alloc_zone): Move forward declaration up. + (new_ggc_zone): New function prototype. + (destroy_ggc_zone): Ditto. + * ggc-simple.c (new_ggc_zone): New function, does nothing. + (destroy_ggc_zone): Ditto. + * ggc-page.c (new_ggc_zone): New function, does nothing. + (destroy_ggc_zone): Ditto. + * ggc-zone.c (struct page_entry): Fix comment. + (ggc_alloc_typed): Use a switch statement instead of ifs. + (new_ggc_zone): New function to set up a new GC zone. + (destroy_ggc_zone): New function to remove a GC zone. + init_ggc): Use new_ggc_zone to set up the default zones. + (ggc_collect): Walk a list of zones, instead of just the + default zones. Report statistics using the zone name. + +2003-12-01 Ulrich Weigand + + * unroll.c (find_splittable_givs): Add missing extend_value_for_giv. + +2003-12-01 Roger Sayle + + PR optimization/12628 + * toplev.c (rest_of_handle_jump_bypass): Call reg_scan. + * regclass.c (reg_scan): Include allocate_reg_info time in + TV_REG_SCAN. Minor clean-ups. + (reg_scan_update): Minor clean-ups. + +2003-12-01 Ulrich Weigand + + * config.gcc (s390x-ibm-tpf*): Add extra_parts. + +2003-12-01 James E Wilson + + * config/ia64/ia64.h (FUNCTION_ARG_REGNO_P): Use AR_REG_FIRST not + GR_ARG_FIRST. + +2003-12-01 Zack Weinberg + + * common.opt: Remove -fgnu-linker. + * flags.h: Remove flag_gnu_linker. + * opts.c: Don't handle OPT_fgnu_linker. + * toplev.c: Don't initialize flag_gnu_linker. + Remove gnu-linker entry from f_options. + * config/dsp16xx/dsp16xx.h (OPTIMIZATION_OPTIONS): + Don't reset flag_gnu_linker. + * config/mips/mips.c (override_options): Likewise. + * doc/invoke.texi: Remove all mention of -fgnu-linker. + +2003-12-01 Daniel Berlin + + * ggc-zone.c (ggc_pch_write_object): Calculate object size using + ggc_get_size (which accounts for large objects properly). + +2003-12-01 Jeff Sturm + + PR optimization/13024 + * toplev.c (rest_of_handle_new_regalloc): Remove rebuild_notes + parameter. + (rest_of_handle_old_regalloc): Likewise. Add rebuild_notes + declaration. Rebuild jump labels following local_alloc if necessary. + (rest_of_compilation): Remove rebuild_label_notes_after_reload + declaration. Don't pass rebuild_notes parameter to + rest_of_handle_new_regalloc and rest_of_handle_old_regalloc. + Don't rebuild jump labels. + +2003-12-01 Jeff Law + + * flow.c (count_or_remove_death_notes_bb): New. Extracted from + count_or_remove_death_notes. + (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP. + +2003-12-01 Andreas Krebbel + + * builtins.c (expand_builtin_longjmp): Added two memory clobbers. + +2003-12-01 Ulrich Weigand + + * reload.c (find_reloads_address): Split addresses of type + (plus (plus (reg) (reg)) (const_int)) only if one register + is either a valid base register or else one of the stack + frame related registers (sp/fp/ap). + +2003-12-01 Steven Bosscher + + * function.c (update_epilogue_consts): Don't use PARAMS. + * rtl.h (web_main): Ditto. + * target.h (is_costly_dependence): Ditto + +2003-12-01 Eric Botcazou + + PR middle-end/7847 + * expr.c (expand_expr) [normal_inner_ref]: When 'offset' is non-zero, + do not recheck that 'op0' is a MEM. Move comment. When testing for + unaligned objects, take also into account the alignment of 'op0' and + 'mode1' if 'op0' is a MEM. + +2003-12-01 Gabriel Dos Reis + + * doc/c-tree.texi (Function Bodies): Update HANDLER documentation. + +2003-12-01 Kelley Cook + + * doc/install.texi: Note that fastjar is built with automake 1.7.x + and autoconf 2.57. + +2003-12-01 Alan Modra + + * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Test + target_flags directly rather than using TARGET_* defines. + +2003-11-30 Ben Elliston + + * doschk.c: Remove. + +2003-11-30 Richard Sandiford + + PR target/12727 + * config/mips/mips.c (mips_save_reg): Fix frame information for sdc1 + on 32-bit big-endian targets. + +2003-11-30 Kazu Hirata + + * genemit.c (register_constraints): Remove. + +2003-11-30 Andreas Krebbel + + * config/s390/s390.md ("tmdi_reg", "tmsi_reg", "*movdi_64", "*movdi_31", + "iordi3"): Insns now use multiple letter constraints. + ("*movdi_lhi", "*movdi_lli", "*movdi_lay"): Insns deleted. They are now + covered by "*movdi_64". + ("*movsi_lhi", "*movsi_lli", "*movsi_lay"): Insns deleted. They are now + covered by "*movsi_zarch" and "*movsi_esa". + ("*movsi_zarch", "*movsi_!zarch"): New insns. + ("*llgt_sisi_split", "*llgt_didi_split"): Insns deleted. Now covered + by "*andsi3_zarch" and "anddi3". + ("*anddi3_ni"): Insn merged with "anddi3". + ("*andsi3_ni"): Insn merged with "*andsi3_zarch". + ("*andsi3_zarch", "*andsi3_esa"): New insns. + ("*iordi3_oi"): Insn merged with "iordi3". + ("*iorsi3_oi"): Insn merged with "*iorsi3_zarch". + ("*iorsi3_zarch", "*iorsi3_esa"): New insns. + + * config/s390/s390.c (s390_single_qi, s390_single_hi): Functions + merged to s390_single_part. + (s390_single_part): New function. + NOTE: Semantics have changed a bit. Now the value of the part must + be different from the others to get a non-negative return value. + (s390_extract_qi, s390_extract_hi): Functions merged to + s390_extract_part. + (s390_extract_part, s390_extra_constraint_str, + s390_const_ok_for_constraint_p): New functions. The L constraint got a + new meaning and the N constraint was added as a multiple letter + constraint. + (s390_extra_constraint): Function deleted. + (print_operand): New output modifier 'i' and 'j' added. + All uses of CONST_OK_FOR_LETTER_P were replaced by + CONST_OK_FOR_CONSTRAINT_P. + + * config/s390/s390-protos.h: Function prototypes adapted. + * doc/md.texi: Documentation for new constraint letters added. + +2003-11-30 Andreas Schwab + + * Makefile.in ($(DESTDIR)$(infodir)/%.info): Fix missing semicolon. + +2003-11-29 James E Wilson + + * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name + instead of in shared_name. + + * final.c (final_start_function): Delete code for NON_SAVING_SETJMP. + * reload1.c (reload): Re-add it here. + +2003-11-30 Alan Modra + + * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Don't + set SECTION_WRITE on TARGET_RELOCATABLE. + +2003-11-29 Kazu Hirata + + * config/h8300/h8300.h (LIBCALL_VALUE): Use R0_REG. + +2003-11-28 Gunther Nikl + + * config/m68k/m68k.c (MOTOROLA): Move from here... + * config/m68k/m68k.h (MOTOROLA): ... to here. + (OUTPUT_JUMP): Use do {...} while (0). + * config/m68k/m68k.md: Replace #ifdef MOTOROLA with C statements. + +2003-11-28 Gunther Nikl + + * config.gcc (m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*, + m68k*-*-netbsdelf*, m68k-*-rtems*): Add tm_defines containing + MOTOROLA and USE_GAS. + * config/m68k/rtemself.h (MOTOROLA): Delete. + * config/m68k/netbsd-elf.h (MOTOROLA, USE_GAS): Delete. + * config/m68k/m68kelf.h (MOTOROLA, USE_GAS, SGS_CMP_ORDER): Delete. + +2003-11-29 Kazu Hirata + + * config/h8300/h8300.h (WORDS_BIG_ENDIAN): Update the comment. + +2003-11-29 Kelley Cook + + * Makefile.in (install-info): Install gccinstall.info too. + +2003-11-29 Ulrich Weigand + + * config/s390/s390.md ("cmpint_di"): Fix incorrect instruction lengths. + +2003-11-29 Ulrich Weigand + + * config/s390/s390.md ("movhi"): Do not emit extender pattern + when loading from a (MEM (ADDRESSOF ...)). + ("movqi"): Likewise. + +2003-11-29 Joseph S. Myers + + PR c/10333 + * c-parse.in (typespec_reserved_nonattr): Reject typeof on + bit-fields. + +2003-11-29 Richard Sandiford + + * stmt.c (expand_asm_operands): Check whether force_const_mem + succeeded. + +2003-11-28 Kaveh R. Ghazi + + * config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New. + * config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): New. + + * config/alpha/gnu.h, config/alpha/linux.h, + config/arm/linux-elf.h, config/cris/cris.h, config/cris/linux.h, + config/i370/linux.h, config/i386/gnu.h, config/i386/i386.h, + config/i386/linux-aout.h, config/i386/linux.h, + config/i386/linux64.h, config/ia64/linux.h, config/m68k/linux.h, + config/m68k/uclinux.h, config/mips/linux.h, + config/mn10300/linux.h, config/pa/pa-linux.h, + config/rs6000/sysv4.h, config/s390/linux.h, config/sh/linux.h, + config/sparc/linux.h, config/sparc/linux64.h, + config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Use + HURD_TARGET_OS_CPP_BUILTINS/LINUX_TARGET_OS_CPP_BUILTINS or ensure + all necessary assertions are included. + +2003-11-28 Jan Hubicka + + * emit-rtl.c (set_used_flags): New. + (verify_rtx_sharing, verify_rtl_sharing): New. + (unshare_all_rtl_1): Rename to.... + (unshare_all_rtl_in_chain): ... this one; make static. + (copy_rtx_if_shared): LABEL_REF chan be shared. + * ifcvt.c (unshare_ifcvt_sequence): New. + (noce_try_move, noce_try_store_flag, noce_try_store_flag_constants, + noce_try_addcc, noce_try_addcc, noce_try_store_flag_mask, + noce_try_cmove, noce_try_store_flag_mask, noce_try_minmax, + noce_try_abs, noce_process_if_block, find_cond_trap + * rtl.h (verify_rtl_sharing, set_used_flags, unshare_all_rtl_in_chain): + Declare. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md: Fix a comment typo. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md (*movsf_h8300h): Change to + *movsf_h8300hs. + (addsi_h8300): Change to *addsi_h8300. + (addsi_h8300h): Change to *addsi_h8300hs. + (subsi3_h8300): Change to *subsi3_h8300. + (subsi3_h8300h): Change to *subsi3_h8300hs. + (neghi2_h8300h): Change to *neghi2_h8300hs. + (negsi2_h8300h): Change to *negsi2_h8300hs. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md (*subhi3_h8300): Remove '&' from the + constraint. + (*subhi3_h8300hs): Likewise. + +2003-11-28 David Edelsohn + + * config/rs6000/rs6000.h (MASK_MFCRF): New. + (TARGET_MFCRF): Test target_flags, not processor type. + (TARGET_SWITCHES): Add mfcrf and no-mfcrf. + Change Don't to Do not. + * config/rs6000/rs6000.c (processors_target_table): Add MASK_MFCRF + to power4, 970, G5. + +2003-11-27 J"orn Rennecke + + * cse.c (cse_set_around_loop): When changing a constant load + to a register -register copy, add a REG_EQUAL note. + +2003-11-27 Randolph Chung + John David Anglin + + * pa.c (hppa_profile_hook): Split gen_call_profiler into separate + insns. Use the regular call expander for the call to the profiler. + * pa.md (call_profiler): Delete. + (load_offset_label_address): New insn to load the address of the + current function for the profiler. + (lcla1, lcla2): New insns to output a code label and load its address. + +2003-11-27 Kazu Hirata + + * final.c (final_scan_insn): Remove commented-out code. + +2003-11-27 Nathanael Nerode + + * doc/install.texi: Remove ADAC reference and make accurate. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.h (FUNCTION_VALUE): Use R0_REG. + (FUNCTION_VALUE_REGNO_P): Likewise. + * config/h8300/h8300.md: Define R0_REG. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + * config/h8300/h8300.md: Likewise. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.h (ELIMINABLE_REGS): Update a comment. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.md: Give names to anonymous insns. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.md (extendqisi2): Remove constraints. + +2003-11-27 Gunther Nikl + + * doc/tm.texi (SYSROOT_HEADERS_SUFFIX_SPEC): Fix typo. + +2003-11-27 Eric Botcazou + + PR optimization/13041 + * final.c (frame_pointer_needed): Fix comment. + * reload1.c (reload): Decrease alignment of the frame + pointer if it was used for register allocation. + +2003-11-27 Eric Botcazou + + PR target/12900 + * reg-stack (move_for_stack_reg): New prototype. Return + whether a control flow insn was deleted. + (subst_stack_regs_pat): Likewise, using the information provided + by move_for_stack_reg. + (subst_stack_regs): Likewise, using the information provided + by subst_stack_regs_pat. + (convert_regs_1): Record whether a control flow insn was deleted, + using the information provided by subst_stack_regs. Purge dead + edges only if a control flow insn was deleted. + +2003-11-27 Eric Botcazou + + PR middle-end/8028 + PR middle-end/9890 + PR middle-end/11151 + PR middle-end/12210 + PR middle-end/12503 + PR middle-end/12692 + * builtins.c (expand_builtin_apply): Use virtual_outgoing_args_rtx + as the base address to copy the memory arguments to. + +2003-11-26 Danny Smith + + * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Declare + function aliases as functions. + +2003-11-26 Nathanael Nerode + + * aclocal.m4 (gcc_AC_PROG_GNAT): Rewrite to account for removal + of ADAC. + * configure: Regenerate. + + * Makefile.in: Remove references to ADAC. + + * configure.in: Remove check for whether ${ADAC} accepts -Wno-long-long. + * configure: Regenerate. + +2003-11-26 Eric Botcazou + Olivier Hainque + + PR target/6466 + * config/sparc/sparc-protos.h (compute_frame_size): New prototype. + (sparc_flat_compute_frame_size): Likewise. + (sparc_flat_save_restore): Move prototype... + * config/sparc/sparc.c (sparc_flat_save_restore): ...here. + (save_regs): New prototype. + (build_big_number): Likewise. + (apparent_fsize): Change type to HOST_WIDE_INT. + (actual_fsize): Likewise. + (frame_base_offset): Likewise. + (build_big_number): Add support for HOST_BITS_PER_WIDE_INT == 64. + Change string descriptor to HOST_WIDE_INT_PRINT_DEC. + [TARGET_ARCH64]: Use the sequence of sparc_emit_set_const64_longway + to load a 64-bit constant. + (sparc_nonflat_function_prologue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Change offset type to HOST_WIDE_INT. + (output_restore_regs): Change offset type to HOST_WIDE_INT. + (sparc_nonflat_function_epilogue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Use build_big_number. + (output_sibcall): Change size type to HOST_WIDE_INT. Use + build_big_number. Change string descriptor to HOST_WIDE_INT_PRINT_DEC. + (sparc_frame_info): Change types for several components. + (sparc_flat_compute_frame_size): Update types according to previous + change. + (sparc_flat_function_prologue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Change offset type to int. Use + build_big_number. + (sparc_flat_function_epilogue): Change offset type to int. + Rename 'size1' into 'reg_offset1'. Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Use build_big_number. Change big number + limit to 4096 instead of 4095. + + * config/sparc/sparc.c (mems_ok_for_ldd_peep): Change offset type to + HOST_WIDE_INT. + +2003-11-24 Waldek Hebisch + + * function.c: Make outer_function-chain external. + * function.h: Likewise. + +2003-11-24 Richard Sandiford + + * config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when + using GNU ld. + * config/mips/iris6.h (IRIX6_STARTFILE_SPEC): New, taking the + whole of the previous STARTFILE_SPEC except crtbegin.o%s. + (IRIX6_ENDFILE_SPEC): Likewise ENDFILE_SPEC and crtend.o%s. + (STARTFILE_SPEC, ENDFILE_SPEC): Define in terms of the above. + (SUBTARGET_EXTRA_SPECS): Define. + * config/mips/iris6gld.h (LINK_SPEC): Change -init function + to __gcc_init and -fini function to __gcc_fini. + (STARTFILE_SPEC): Redefine, including irix6-crti.o before crtbegin.o. + (ENDFILE_SPEC): Likewise, including irix6-crtn.o after crtend.o. + (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Define. + * config/mips/t-iris6gld, + * config/mips/irix6-crti.asm, + * config/mips/irix6-crtn.asm: New files. + +2003-11-24 Eric Christopher + + PR C/13014 + * c-decl.c (c_in_iteration_stmt, c_in_case_stmt): New. + (start_function): Use. + (c_push_function_context): Ditto. + (c-pop_function_context): Ditto. + (language_function): Move... + * c-tree.h: ... here. Add x_in_iteration_stmt, and + x_in_case_stmt. + * c-parse.in (do_stmt_start, select_or_iter_stmt, stmt): Use + c_in_iteration_stmt, c_in_case_stmt for parser state. Move + check for valid break or continue statment here... + * c-semantics.c (genrtl_break_stmt, genrtl_continue_stmt): From + here. Change original errors to abort. + +2003-11-24 Jan Hubicka + + * fold-const.c (fold): Do not return early when optimizing + COMPONENT_REF and constant. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md (tablejump_h8300): Change to + *tablejump_h8300. + (tablejump_h8300h): Change to *tablejump_h8300hs_advanced. + (tablejump_normal_mode): Change to *tablejump_h8300hs_normal. + (indirect_jump_h8300): Change to *indirect_jump_h8300. + (indirect_jump_h8300h): Change to + *indirect_jump_h8300hs_advanced. + (indirect_jump_normal_mode): Change to + *indirect_jump_h8300hs_normal. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md: Remove constraints from expanders. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md: (stm_h8300s_2): Change the name to + stm_h8300s_2_advanced. + (stm_h8300s_2_normal): New. + (stm_h8300s_2): Likewise. + (stm_h8300s_3): Change the name to stm_h8300s_3_advanced. + (stm_h8300s_3_normal): New. + (stm_h8300s_3): Likewise. + (stm_h8300s_4): Change the name to stm_h8300s_4_advanced. + (stm_h8300s_4_normal): New. + (stm_h8300s_4): Likewise. + (ldm_h8300s_2): Change the name to ldm_h8300s_2_advanced. + (ldm_h8300s_2_normal): New. + (ldm_h8300s_2): Likewise. + (ldm_h8300s_3): Change the name to ldm_h8300s_3_advanced. + (ldm_h8300s_3_normal): New. + (ldm_h8300s_3): Likewise. + (ldm_h8300s_4): Change the name to ldm_h8300s_4_advanced. + (ldm_h8300s_4_normal): New. + (ldm_h8300s_4): Likewise. + (two peephole2's): Enable only with !TARGET_NORMAL_MODE. + (two peephole2's): New. + +2003-11-24 Zdenek Dvorak + + * genattrtab.c (simplify_cond): Update indices correctly. + (attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, + attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New. + (check_attr_test, encode_units_mask, compute_alternative_mask, + make_alternative_compare, simplify_and_tree, + attr_rtx_cost, simplify_test_exp, gen_attr, + write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT. + * rtl.def (EQ_ATTR_ALT): New. + +2003-11-23 Zdenek Dvorak + + * genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros. + (length_str, delay_type_str, delay_1_0_str, num_delay_slots_str): + New variables. + (main): Initialize them. + (find_attr): Canonicalize the attribute name string. + (attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize + string arguments. + (attr_printf, attr_eq): Use DEF_ATTR_STRING. + (check_attr_test, check_attr_value, make_length_attrs, + write_length_unit_log, simplify_by_exploding, gen_attr, + write_test_expr, write_attr_value, write_eligible_delay, + write_complex_function, make_internal_attr, + write_const_num_delay_slots): Changed due to change of type of + find_attr. + (fill_attr, evaluate_eq_attr, simplify_and_tree, + attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use + strcmp_check. + +2003-11-23 Kazu Hirata + + PR target/13122 + * config/h8300/h8300.c (push): Call push_h8300hs_normal in + normal mode. + (pop): Call pop_h8300hs_normal in normal mode. + * config/h8300/h8300.md: Likewise. + (pushqi1_h8300hs_normal): New. + (pushqi1): Call pushqi1_h8300hs_normal in normal mode. + (pushhi1_h8300hs_normal): New. + (pushhi1): Call pushhi1_h8300hs_normal in normal mode. + (push_h8300hs_normal): New. + (pop_h8300hs_normal): Likewise. + +2003-11-23 Zdenek Dvorak + + * genattrtab.c (count_sub_rtxs): Removed. + +2003-11-23 Richard Earnshaw + + * recog.c (preprocess_constraints): Only zero those elements of + recog_op_alt that are needed for this insn. + * arm.c (note_invalid_constants): A function can't contain invalid + constants if it has no constraints. + +2003-11-22 Jan Hubicka + + * i386.c (classify_argument): Pass __float128 in memory. + (ix86_return_in_memory): Likewise. + (ix86_libcall_value): Likewsie. + +2003-11-22 Kazu Hirata + + * config/h8300/h8300.c (dosize): Convert to ISO-C. + +2003-11-22 J"orn Rennecke + + * flow.c (update_life_info): Amend comment about when a register + can become dead. + +2003-11-21 Kelley Cook + + * doc/.cvsignore: Delete. + +2003-11-21 Daniel Berlin + David Edelsohn + + * dwarf2out.c (add_location_or_const_value_attribute): Add support + for PARALLEL. + +2003-11-21 Rainer Orth + + * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS): Add -Wno-error. + (TARGET_LIBGCC2_CFLAGS): Define. + + * crtstuff.c [HAS_INIT_SECTION] (__do_global_dtors): Declare. + (__do_global_ctors): Likewise. + +2003-11-21 Mark Wielaard + + * doc/invoke.texi (-O2): Doesn't enable -fweb. + +2003-11-21 Kazu Hirata + + * doc/invoke.texi: Mention dV and dZ. + +2003-11-21 Kazu Hirata + + * doc/invoke.texi: Update dump file names. + Remove de, dW, and dX. + +2003-11-20 James E Wilson + + PR c/13133 + * reload1.c (reload): Delete special handling for setjmp. + +2003-11-21 Andreas Tobler + + * mklibgcc.in: Evaluate shlib_slibdir_qual during link + step too. + * config/t-slibgcc-darwin: Adjust install path. + * config/rs6000/t-darwin: Revert multilib matches since + it is not used on darwin. + +2003-11-20 Richard Henderson + + * ssa.c, ssa-dce.c, ssa-ccp.c: Remove files. + * Makefile.in (OBJS-common, GTFILES): Don't reference them. + (gtype-desc.o, toplev.o, flow.o): Remove ssa.h. + (ssa.o, ssa-dce.o, ssa-ccp.o): Remove. + * flow.c: Don't include ssa.h. + (set_phi_alternative_reg): Remove. + (calculate_global_regs_live): Don't call it. + (mark_used_regs): Don't handle PHI. + * gengtype.c (open_base_files): Don't reference ssa.h. + * rtl.def (PHI): Remove. + * timevar.def (TV_TO_SSA, TV_SSA_CCP, TV_SSA_DCE, TV_FROM_SSA): Kill. + * common.opt: Remove -fssa, -fssa-ccp, -fssa-dce. + * opts.c (common_handle_option): Likewise. + * toplev.c (f_options): Likewise. + (DFI_ssa, DFI_ssa_ccp, DFI_ssa_dce, DFI_ussa): Remove. + (dump_file): Update to match. + (flag_ssa, flag_ssa_ccp, flag_ssa_dce): Remove. + (rest_of_handle_ssa): Remove. + (rest_of_compilation): Don't call it. + * toplev.h (flag_ssa, flag_ssa_dce, flag_ssa_ccp): Remove. + * doc/invoke.texi: Remove -fssa, -fssa-ccp, -fssa-dce. + * doc/passes.texi (SSA optimizations): Remove. + +2003-11-20 Bob Wilson + + * configure.in: Add xtensa-*-* targets to test for dwarf2 debug_line. + * configure: Regenerate. + +2003-11-20 Kelley Cook + + * Makefile.in (Makefile): Pass along CONFIG_SHELL. + +2003-11-20 David Mosberger + + * config/t-libunwind (LIB2ADDEH): Add unwind-c.c. + (SHLIB_LC): Define. + * unwind-libunwind.c (_Unwind_GetCFA): Implement. + (_Unwind_GetBSP) [UNW_TARGET_IA64]: New function. + +2003-11-20 Fariborz Jahanian + David Edelsohn + + * calls.c (expand_call): Allocate new temp in pass1. + (store_one_arg): If PARALLEL, calculate excess using mode size of + rtvec elt. + * expr.c (emit_push_insn): If PARALLEL, calculate offset using + mode size of rtvec elt. + * function.c (assign_parms): Use parm in register, if available. + +2003-11-20 Kazu Hirata + + * config/h8300/lib1funcs.asm (MOVP): Remove. + (ADDP): Likewise. + (CMPP): Likewise. + +2003-11-20 Richard Earnshaw + + * arm.c (use_return_insn): New argument, SIBLING. Support returning + with a single instruction if the stack has been decremented by 4 + and we have a frame pointer. Update all callers. + (output_return_instruction): Likewise. + (arm_output_epilogue): Change argument to SIBLING. Calculate + really_return from the new argument. Update all callers. + * arm.h (USE_RETURN_INSN): Pass NULL for the sibling. + * arm.md (sibcall_epilogue): Call use_return_insn directly, and + pass the sibling call. + * arm-protos.h (use_return_insn, arm_output_epilogue): Update + prototypes. + +2003-11-20 Joseph S. Myers + + * Makefile.in (extraclean): Delete. + * configure.in (target_list): Remove extraclean. + * configure: Regenerate. + * doc/makefile.texi, doc/sourcebuild.texi: Update. + * objc/Make-lang.in (objc.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Makefile.in (lang_checks): Add. + (check-c++, check-f77, check-java, check-g++, check-g77, + check-objc): Remove hardcoded targets. + * doc/sourcebuild.texi: Document testsuite hooks. + * objc/Make-lang.in (check-objc, lang_checks): Add. + +2003-11-19 Scott Snyder + + PR target/13131 + * dwarf2out.c (gen_array_type_die): DW_AT_declaration should be a + flag, not a constant. + +2003-11-19 Kelley Cook + + * config/arc/arc-protos.h: Update to C90 prototypes. + * config/arc/arc.c: Likewise. + * config/arc/initfini.c: Likewise. + +2003-11-19 Andreas Krebbel + + * stmt.c (expand_goto): Memory clobbers added. + +2003-11-19 Andreas Krebbel + + * reload.c (find_reloads): Added missing type casts. + +2003-11-19 James E Wilson + + * combine.c (sets_function_arg_p): Delete unused function. + +2003-11-19 Eric Christopher + + * reload1.c (reload): Revert 2 previous checkins. + +2003-11-19 Nathanael Nerode + + * cpptrad.c (_cpp_scan_out_logical_line): Improve test for + whether directive begins at the beginning of a line. + +2003-11-19 Richard Sandiford + + * config/frv/frv.c (frv_init_libfuncs): Correct ufix_optab entries. + +2003-11-19 Gerald Pfeifer + + * doc/install.texi (Specific): Remove information on old versions + of glibc versus old versions of GCC. + +2003-11-19 Richard SAndiford + + * emit-rtl.c (gen_lowpart): Don't force MEMs into a register unless + the register lowpart is a TRULY_NOOP_TRUNCATION. + +2003-11-19 Richard Henderson + + * config/i386/i386.c (print_reg): Handle QI and HI modes for + non Q regs. + +2003-11-19 Andreas Tobler + + * config/config.gcc (powerpc-*-darwin*): Add libgcc build + specification file. + * config/t-slibgcc-darwin: New file, libgcc build specification. + * config/t-darwin: Add libgcc2 flag -fPIC. + * config/rs6000/t-darwin: Multilib matches float. + * libgcc-darwin.ver: New file, contains libgcc symbols. + +2003-11-18 Nathanael Nerode + + * config/ns32k/ns32k.h: Remove obsolete comment. + +2003-11-18 Roger Sayle + + PR middle-end/11821 + * config/arm/arm.c (arm_rtx_costs_1): Improve estimate of the code + size for calls to libgcc's div & mod subroutines when using -Os. + +2003-11-18 Jan Hubicka + + * cgraph.c (change_decl_assembler_name): Avoid bogus warnings. + +2003-11-18 Marc Espie + + * config/rs6000/sysv4.h: OpenBSD hooks. + +2003-11-18 Richard Henderson + + * expr.c (expand_expr): Don't look through constant arrays if + they don't bind locally. + +2003-11-17 Richard Kenner + + * expr.c (convert_move): Use GET_MODE_PRECISION instead of bitsize + when seeing if truncation or extension. + +2003-11-17 Eric Christopher + + * reload1.c (reload): Fix previous change. + +2003-11-17 Scott Snyder + + PR debug/11325 + * dwarf2out.c (struct die_struct): Add die_definition field. + (add_AT_specification): New. + (gen_subprogram_die, gen_variable_die, + gen_struct_or_union_type_die): Use it. + (prune_unused_types_mark): If we're marking a forward declaration, + also mark the full definition, if it exists. + +2003-11-16 Nick Clifton + + * config/stormy16/stormy16.h (BUILD_VA_LIST_TYPE): Delete. + * config/stormy16/stormy16-protos.h (xstormy16_build_va_list): + Remove prototype. + * config/stormy16/stormy16.c (xstormy16_build_va_list): Rename + to xstormy16_build_builtin_va_list and make static. + (TARGET_BUILD_BUILTIN_VA_LIST): Define. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300-protos.h: Add the prototype for + same_cmp_following_p. + * config/h8300/h8300.c (same_cmp_following_p): New. + * config/h8300/h8300.md (peephole2): Use it. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300.md: Don't use REGNO when its operand is + not guaranteed to be a REG. + +2003-11-16 Richard Sandiford + + * Makefile.in (expr.o): Depend on $(TARGET_H). + * target.h (return_in_msb): New target hook. + * target-def.h (TARGET_RETURN_IN_MSB): New macro. + (TARGET_CALLS): Include it. + * calls.c (shift_returned_value): New function. + (expand_call): Use it. + * expr.c: Include target.h. + (copy_blkmode_from_reg): Check targetm.calls.return_in_msb when + deciding what padding is needed. Change the name of the local + padding variable from big_endian_correction to padding_correction. + * stmt.c (shift_return_value): New function. + (expand_return): Use it. Adjust memory->register copy in the same + way as copy_blkmode_from_reg. Only change the return register's + mode if it was originally BLKmode. + * doc/tm.texi (TARGET_RETURN_IN_MSB): Document. + * config/mips/mips.c (TARGET_RETURN_IN_MSB): Define. + (mips_fpr_return_fields): New, split out from mips_function_value. + (mips_return_in_msb, mips_return_fpr_pair): New functions. + (mips_function_value): Rework to use the functions above. + * config/mips/irix6-libc-compat.c: Delete. + * config/mips/t-iris6 (LIB2FUNCS_STATIC_EXTRA): Undefine. + +2003-11-16 Kazu Hirata + + * doc/install.texi (--enable-checking): Update valgrind's URL. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300.md: Fix warnings by replacing -2147483648 + with -2147483647 - 1. + +2003-11-16 Gerald Pfeifer + + Fix links in online manuals. + * doc/invoke.texi (H8/300 Options): @xref to ld, not ld.info. + (Precompiled Headers): @pxref to cpp, not cpp.info. + +2003-11-16 Jason Merrill + + * Makefile.in, objc/Make-lang.in (objc.tags): Create TAGS.sub + files in each directory and TAGS files that include them for each + front end. + +2003-11-15 Kazu Hirata + + * config/h8300/lib1funcs.asm (divnorm): Store the sign in bit + 3 of S2L. + (modnorm): Likewise. + (exitdiv): Look at bit 3 of S2L only. + +2003-11-15 Kazu Hirata + + * config/h8300/h8300.h (DO_GLOBAL_CTORS_BODY): Fix warnings. + (DO_GLOBAL_DTORS_BODY): Likewise. + +2003-11-15 Joseph S. Myers + + * doc/install.texi (Prerequisites): Refine documentation of + autoconf, automake and perl requirements. Document required + gettext version. + +<2003-11-14 Jason Merrill + + * function.c (assign_parms): Use TREE_TYPE to determine the real + type of the argument object. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Peel off the first + iteration. + +2003-11-14 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_move_block_from_reg): + New routine to save vararg registers on stack. Support for + -mpowerpc64 in mixed mode. + +2003-11-14 Bernardo Innocenti + + * config/m68k/m68k.c: Use C statements instead of #ifdef's when testing + for MOTOROLA versus MIT syntax. Improves readability and provides + better compile-time error checking for both code paths. + +2003-11-14 Kelley Cook + + * config/frv/frv-protos.h: Update for C90. + * config/frv/frv.h: Likewise. + * config/frv/frvbegin.c: Likewise. + * config/frv/frv.c: Likewise. + (frv_adjust_field_align): Delete unused variable. + +2003-11-14 Geoffrey Keating + + * config/rs6000/rs6000.md: Add 'DEFAULT_ABI == ABI_DARWIN' + to each place where TARGET_LONG_DOUBLE_128 is used with + DEFAULT_ABI == ABI_AIX. + + * cppfiles.c (_cpp_find_file): Make 'one or more PCH files were found' + message comply with GNU standards. + +2003-11-14 Richard Kenner + + PR/6552 + * function.c (struct epi_info): New field const_equiv. + (update_epilogue_consts): New function. + (keep_stack_depressed): Clear new field and verify scratch register + doesn't have it set. + Call new function via note_stores. + (handle_epilogue_set): Allow setting SP equiv reg in different mode. + Allow PLUS where second operand is register known set to constant. + (emit_equiv_load): Write load using proper mode if source different. + * config/mips/mips.md (return_internal): Put (return) first. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Add a comment. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (modsi3): Don't save unused + registers. + (divsi3): Likewise. + (reti): Don't restore unused registers. + +2003-11-14 Nick Clifton + + * config/fr30/fr30.c: Include toplev.h + +2003-11-14 Richard Earnshaw + + * except.c (sjlj_emit_function_enter): Mark internal label as LOCAL. + +2003-11-14 Richard Earnshaw + + * arm.c (arm_emit_vector_const, arm_output_load_gr): Use ISO C + function definition syntax. + +2003-11-14 Eric Christopher + + * reload1.c (reload): Revert previous patch. Make + check for assignment into reg_equiv_address stricter. + +2003-11-14 Arnaud Charlet + + * Makefile.in (POSTSTAGE1_FLAGS_TO_PASS): Pass ADAFLAGS. + +2003-11-14 Richard Sandiford + + * config/frv/frv.c (frv_in_small_data_p): Return false for unknown + section names. + +2003-11-14 Jason Merrill + + PR middle-end/12526 + * tree.c (build): A CALL_EXPR has side-effects if its arguments do. + * calls.c (call_expr_flags): New fn. + * tree.h: Declare it. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (__udivsi3): Remove. + (divmodsi3): Change the name to ___udivsi3. + Update all callers. + +2003-11-13 Kaveh R. Ghazi + + * libgcc2.c (__negdi2, __addvsi3, __addvdi3, __subvsi3, __subvdi3, + __mulvsi3, __negvsi2, __negvdi2, __mulvdi3, __lshrdi3, __ashldi3, + __ashrdi3, __ffsDI2, __muldi3, __clzDI2, __ctzDI2, __parityDI2, + __udivmoddi4, __divdi3, __moddi3, __cmpdi2, __ucmpdi2, + __fixunstfDI, __fixunsxfDI, __fixunsdfDI, __fixunssfDI, + __floatdixf, __floatditf, __floatdidf, __floatdisf, __gcc_bcmp): + Const-ify and/or initialize automatic variables at declaration. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (divmodsi4): Replace all the uses + of er4 with er3. Adjust all callers. + +2003-11-13 Andrew Pinski + + * config/darwin.c (machopic_output_possible_stub_label): + Allow stub symbol be not defined when outputting possible + stub label. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Jump to reti + instead of exitdiv. + (___umodsi3): Likewise. + (exitdiv): Do not restore any register. + (reti): Restore registers. + +2003-11-13 Steven Bosscher + + * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm: Fix comment typos. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (udivsi3): Don't save/restore + unused registers. Don't jump to exitdiv. + (umodsi3): Likewise. + +2003-11-13 Mark Mitchell + Kean Johnston + + PR c/13029 + * toplev.c (check_global_declarations): Do not warn about unused + static consts. + +2003-11-13 Pavel Pisa + Kazu Hirata + + * config/h8300/lib1funcs.asm (DenHighNonZero): Optimize using + the approximate quotient method. + +2003-11-13 Richard Earnshaw + + * combine.c (distribute_notes): When re-distributing the notes from + an insn we are about to delete, ensure we can't end up with a cyclic + list of notes. + +2003-11-13 Eric Botcazou + + PR optimization/12926 + * expr.c (expand_assignment) [COMPONENT_REF]: Don't put + the UNCHANGING_RTX_P flag on memory references to read-only + components that are not addressable. + +2003-11-12 Kazu Hirata + + * config/h8300/lib1funcs.asm (divmodsi4): Clear S0P in + DenHighNonZero. + +2003-11-13 Jan Hubicka + + PR opt/12275 + * c-decl.c (finish_decl): Use change_decl_assembler_name. + * c-pragma.c (handle_pragma_redefine_extname): Likewise. + * varasm.c (make_decl_rtl): Likewise. + * cgraph.c (change_decl_assembler_name): New function. + * tree.h (set_decl_assembler_name): Kill dead declaration. + (change_decl_assembler_name): Declare. + + * decl.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. + * decl2.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. + +2003-11-12 Kazu Hirata + + * config/h8300/lib1funcs.asm (___mulsi3): Don't save/restore + an unused register. + +2003-11-12 Richard Sandiford + + PR bootstrap/12752 + * config/mips/t-iris6 (MULTILIB_OPTIONS): Put -mabi=n32 first. + (MULTILIB_OSDIRNAMES): Reorder accordingly. + +2003-11-12 Janis Johnson + + * rs6000-protos.h (rs6000_initial_elimination_offset): Add. + (rs6000_stack_info): Remove. (debug_stack_info): Remove. + (rs6000_emit_eh_reg_restore): Add + * rs6000.c (rs6000_stack_t): Move from rs6000.h, change data type + of vars_size and total_size to HOST_WIDE_INT. + (emit_frame_save): Change parameter size to HOST_WIDE_INT. + (rs6000_stack_info): Make static; change data size to HOST_WIDE_INT. + (debug_stack_info): Make static; change output format of HOST_WIDE_INT + values. + (rs6000_emit_eh_reg_restore): New, with code formerly in rs6000.md. + (rs6000_initial_elimination_offset): New, with code formerly in + INITIAL_ELIMINATION_OFFSET. + * rs6000.h (rs6000_stack_t): Remove. + (INITIAL_ELIMINATION_OFFSET): Replace code with call to function + rs6000_initial_elimination_offset. + * rs6000.md (UNSPECV_EH_RR split): Replace code with call to + rs6000_emit_eh_reg_restore. + +2003-11-12 Mike Stump + + * c-typeck.c (c_convert_parm_for_inlining): Add argnum, which + is the argumnt we are processing so that warnings and errors + will have that information. + * c-tree.h (c_convert_parm_for_inlining): Add argnum. + * lang-hooks-def.h + (lhd_tree_inlining_convert_parm_for_inlining): Likewse. + * langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise. + * langhooks.h (convert_parm_for_inlining): Likewise. + * tree-inline.c (initialize_inlined_parameters): Compute and + pass argnum down. + +2003-11-12 Alexey Starovoytov + Roger Sayle + + PR optimization/12953 + * tree-inline.c (inline_forbidden_p_1): Added check for BUILT_IN + before switch by FUNCTION_CODE. + +2003-11-12 Richard Earnshaw + + * arm.md (storehi): Avoid use of explicit subreg. + (storehi_bigend, storeinthi, movhi_bigend): Likewise. + +2003-11-12 J"orn Rennecke + + * config/sh/sh.md (prefetch): New pattern. + +2003-11-11 Eric Christopher + + * reload1.c (reload): Verify that addresses for + reg_equiv_* are valid for the architecture. + +2003-11-11 Eric Christopher + + * function.c (purge_addressof_1): Add libcall check. + Remove test for cached replacements on fallback case. + Simplify mode comparisons. Add libcall test for + paradoxical subregs. + +2003-11-11 Kazu Hirata + + * config/h8300/t-h8300: Fix an obsolete comment. + +2003-11-11 James E Wilson + + * expmed.c (store_bit_field, extract_bit_field): Revert last two + changes. + +2003-11-11 Kazu Hirata + + * config/h8300/lib1funcs.asm: Replace DenHighZero with + DenHighNonZero. + +2003-11-11 Jan Hubicka + + * cgraphunit.c (cgraph_function_possibly_inlined_p): Use + really_no_inline. + +2003-11-11 John David Anglin + + * pa.h (TRAMPOLINE_TEMPLATE): Fix flushing of cache lines when + generating 64-bit code. + +2003-11-10 David Edelsohn + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Remove + accidental commit in previous change. + +2003-11-10 Fariborz Jahanian + + * config/rs6000/rs6000.h (STACK_SIZE_MODE): Add definition. + * config/rs6000/rs6000.c (reg_or_mem_operand): Add macho-style + address recognition. + (macho_lo_sum_memory_operand): Routine to recognize macho-style + address recognition. + +2003-11-10 Richard Henderson + + * dwarf2out.c (gen_label_die): Cope with DECL_RTL not set. + +2003-11-10 Matt Austern + + * config/darwin-protos.h (darwin_assemble_visibility): Declare. + * config/darwin.c (darwin_assemble_visibility): Define. Warn for + anything other than VISIBILITY_DEFAULT and VISIBILITY_HIDDEN. + * config/darwin.h (TARGET_ASM_ASSEMBLE_VISIBILITY): Use + darwin_assemble_visibility instead of default. + +2003-11-10 Waldek Hebisch + + PR target/12865 + * config/sparc/sparc.c (sparc_initialize_trampoline): Call + __enable_execute_stack only after writing onto the stack. + (sparc64_initialize_trampoline): Likewise. + +2003-11-09 Roger Sayle + + * loop.c (check_dbra_loop): Try swapping the comparison operands + of the loop condition to identify a suitable induction variable. + * unroll.c (loop_iterations): Likewise. + +2003-11-09 Kaveh R. Ghazi + + * config/sparc/sparc.h (TARGET_CPU_CPP_BUILTINS): Fix sparc vs + sparc64 #cpu and #machine assertions. + +2003-11-09 Richard Henderson + + * Makefile.in (rtlanal.o): Depend on BASIC_BLOCK_H. + +2003-11-09 Jan Hubicka + + * tree-optimize.c (tree_rest_of_compilation): Fix warning. + + * cgraphunit.c (cgraph_expand_function): Use + cgraph_possibly_inlined_p. + * tree-optimize.c (tree_rest_of_compilation): Do not kill saved tree. + + * opts.c (common_handle_option): Do not set max-inline-insns. + * params.def: Update comments. + (PARAM_MAX_INLINE_INSNS): Kill. + * invoke.texi (max-inline-insns): Kill. + +2003-11-08 Joseph S. Myers + + PR c/3190 + PR c/8714 + * c-format.c (set_Wformat): Do not enable -Wformat-y2k by default. + * invoke.texi: Update. + +2003-11-08 John David Anglin + + PR optimization/12630 + * pa.c (compute_movstrsi_length): Rename to compute_movstr_length. + Handle length computation 64-bit moves. + (compute_clrstr_length, output_block_clear): Implement block clear. + (output_block_move): Handle 64-bit moves. + (pa_adjust_insn_length): Use compute_movstr_length and + compute_clrstr_length. + * pa.md (movstrsi): Revise operand order and comments. Don't use + match_scratch. + (movstrsi_internal): Delete. + (movstrsi_prereload, movstrsi_postreload): New insns. Define splitter + and peephole2 patterns to transform prereload to postreload form. + (movstrdi, movstrdi_prereload, movstrdi_postreload, clrstrsi, + clrstrsi_prereload, clrstrsi_postreload, clrstrdi, clrstrdi_prereload, + clrstrdi_postreload): New patterns for 64-bit block move, and block + clear. + * pa-protos.h (output_block_clear): New prototype. + +2003-11-08 Andreas Schwab + + * dbxout.c (current_file): Also wrap inside DBX_DEBUGGING_INFO || + XCOFF_DEBUGGING_INFO. + +2003-11-08 Kaveh R. Ghazi + + * dbxout.c (current_file): Wrap declaration in DBX_USE_BINCL. + +2003-11-07 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_legitimize_address): Remove + redundant parens. + + * cppfiles.c (pch_open_file): New parameter 'invalid_pch', set it. + (find_file_in_dir): Likewise. + (_cpp_find_file): Print message if no header file is found + but an invalid PCH file was. + +2003-11-08 Joseph S. Myers + + * c-typeck.c (pedantic_lvalue_warning): Deprecate compound + expressions as lvalues. + (internal_build_compound_expr): Remove special handling for + non-pedantic case. + * doc/extend.texi: Document that all extended lvalues are now + deprecated. + +2003-11-07 Geoffrey Keating + + PR 11654 + * dbxout.c (struct dbx_file): Do not save for PCH. + (current_file): Likewise. + (dbxout_init): Don't allocate struct dbx_file using GC. + (dbxout_start_source_file): Likewise. + +2003-11-07 Falk Hueffner + + * config/alpha/elf.h, config/alpha/unicosmk.h, + config/alpha/vms.h: Convert to ISO C90. + +2003-11-07 Nathanael Nerode + + * config/arm/pe.h: Convert to ISO C90. + +2003-11-07 J"orn Rennecke + + * sh-protos.h (sh_pch_valid_p): Declare. + * sh.c ("intl.h"): Include. + (TARGET_PCH_VALID_P): Override. + (sh_target_switches): New variable. + (target_switches): Define. + (sh_pch_valid_p): New function. + + * sh.h (MODE_AFTER): Don't change mode unless TARGET_HITACHI. + +2003-11-07 Jan Hubicka + + * i386.c (x86_64_sign_extended_value): Return false from tls variables. + (x86_64_zero_extended_value): likewise. + +2003-11-07 Richard Sandiford + + * config/mips/mips.md (loadgp): Take $25 as a second operand. + * config/mips/mips.c (mips_expand_prologue): Modify accordingly. + +2003-11-06 Matt Austern + + * c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY + field instead of hanging an attribute object off the decl. + * tree.h (DECL_VISIBLITY): New accessor macro for + symbol_visibility field in struct tree_decl. + (enum symbol_visibility): Move definition to before tree_decl. + (struct tree_decl): Define new two-bit field, symbol_visibility. + (decl_visibility): Remove declaration. + * varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY + instead of decl_visibility. + (default_binds_local_p_1): Use DECL_VISIBILITY instead of + decl_visibility. + (decl_visibility): Remove. + +2003-11-06 Ulrich Weigand + + * config/s390/s390.c (s390_emit_epilogue): Recognize more cases + where register 14 will be saved. + +2003-11-06 Geoffrey Keating + + * config/rs6000/rs6000.h (USE_FP_FOR_ARG_P): Move to rs6000.c. + (USE_ALTIVEC_FOR_ARG_P): Likewise. + * config/rs6000/rs6000.c (USE_FP_FOR_ARG_P): Move from rs6000.h. + Take a pointer as the CUM parameter. Update callers. + (USE_ALTIVEC_FOR_ARG_P): Likewise. Also correct for Darwin/AIX + 32-bit ABIs. + (function_arg_advance): Use USE_ALTIVEC_FOR_ARG_P. Correct case + of vector parameters as named arguments of stdarg function. + (function_arg): Likewise. + + * config/rs6000/darwin.h (ASM_SPEC): Use -force_cpusubtype_ALL when + -maltivec is specified, not the non-existent -faltivec. + +2003-11-06 Ulrich Weigand + + * config/s390/s390-protos.h (s390_function_value): Declare. + * config/s390/s390.c (TARGET_RETURN_IN_MEMORY): Define. + (s390_return_in_memory): New function. + (s390_function_value): New function. + (s390_function_arg_float): Return false for all arguments larger + than 8 bytes. + (s390_function_arg_pass_by_reference): Likewise. Return true for + all vector arguments. + (s390_function_arg_integer): New function. + (s390_function_arg_advance): Call it. Add sanity checks. + (s390_function_arg): Likewise. + * config/s390/s390.h (FUNCTION_VALUE): Call s390_function_value. + (LIBCALL_VALUE): Likewise. + (RET_REG): Remove. + (RETURN_IN_MEMORY): Remove. + +2003-11-06 Richard Sandiford + + * config/mips/mips-protos.h (mips_initial_elimination_offset): Change + return type to HOST_WIDE_INT. + * config/mips/mips.c (mips_frame_info): Give sizes type HOST_WIDE_INT. + Make initialized a bool. Make register masks unsigned ints. + (compute_frame_size): Make same mask change here. Use HOST_WIDE_INT + where appropriate. + (mips_initial_elimination_offset): Return a HOST_WIDE_INT. + (mips_output_function_prologue): Print sizes as HOST_WIDE_INTs. + +2003-11-06 Richard Sandiford + + * config/frv/frv.c (frv_initial_elimination_offset): Remove bogus + negation. + +2003-11-06 Richard Sandiford + + * config/frv/frv.h (ASM_OUTPUT_ALIGN_WITH_NOP): Define. + +2003-11-06 Momchil Velikov + + * config/mips/mips.c (override_options): Set MASK_SOFT_FLOAT + for VR4111 too. + +2003-11-06 Jan Hubicka + + * builtins.c (simplify_builtin_strrchr, simplify_builtin_strpbrk): Add + missing casts. + +2003-11-06 Zack Weinberg + + * genmodes.c: Change the word "bitsize" to "precision" throughout. + * machmode.def: Likewise. + * machmode.h (GET_MODE_SIZE): Cast value to unsigned short. + (GET_MODE_BITSIZE): Define as GET_MODE_SIZE * BITS_PER_UNIT. + (GET_MODE_PRECISION): New macro. + (mode_bitsize): Renamed mode_precision. + * stor-layout.c (mode_for_size, smallest_mode_for_size): + Use GET_MODE_PRECISION; clarify comments. + +2003-11-05 Joseph S. Myers + + * doc/install-old.texi: Remove old documentation of building + cross-compilers. + * doc/install.texi: Move some of it to here. + +2003-11-05 Per Bothner + + PR preprocessor/12891 + * c-opts.c (finish_options): Set include_cursor to disable premature + calls to push_command_line_include from cpp_scan_nooutput. + Fixes bug reported by DJ Delorie. + +2003-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (setup_incoming_varargs): Remove + code supporting old-style varargs. + + * config/rs6000/rs6000.c (rs6000_machopic_legitimize_pic_address): Use + an intermediate register for better optimisation. + +2003-11-05 Zdenek Dvorak + + PR optimization/10080 + * cfgloopanal.c (variable_initial_value, variable_initial_values, + simple_loop_exit_p): Record the fact that initial value is extended + from inner mode. + (count_strange_loop_iterations, count_loop_iterations): Handle + ivs that iterate in a narrower mode. Fix handling of overflows. + Improve handling of NE conditions. + (inverse, fits_in_mode_p): New static functions. + (simple_increment): Detect variables that iterate in a narrower mode. + * cfgloop.h (struct loop_desc): Fields inner_mode and extend added. + +2003-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (compute_vrsave_mask): Correct off-by-one + error. + + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Darwin + needs VRSAVE. + +2003-11-05 Joseph S. Myers + + * c-typeck.c (pedantic_lvalue_warning): Deprecate use of + conditional expressions as lvalues. + +2003-11-05 Kazu Hirata + + * tsystem.h: Add the prototype of strlen. + * unwind-pe.h (read_encoded_value_with_base): Add an + appropriate cast to handle a case where the pointer size is + smaller than sizeof (int). + +2003-11-04 Richard Sandiford + + * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. + (mips_delegitimize_address): Delete. + (mips_gotoff_global, mips_load_got_page): Declare. + (mips_load_got_global, mips_rewrite_small_data): Declare. + + * config/mips/mips.h (FIND_BASE_TERM): Remove definition. + (DANGEROUS_FOR_LA25_P): Use global_got_operand. + (PREDICATE_CODES): Add global_got_operand, local_got_operand and + small_data_pattern. Remove CONST from const_arith_operand's entry. + + * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. + (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. + (mips_constant_type): Delete. + (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, + SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. + (NUM_SYMBOL_TYPES): New macro. + (mips_address_type): Remove ADDRESS_INVALID. + (machine_function): Add has_gp_insn_p. + (mips_constant_info): Delete. + (mips_address_info): Add the address type as an extra field. Replace + the c field with symbol_type. + (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. + (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. + (mips_reloc_offset_ok_p, mips_classify_constant): Delete. + (mips_split_const, mips_symbolic_constant_p): New functions. + (mips_symbolic_address_p): Take the symbol type and mode as arguments. + (mips_classify_address): Return true if the address is valid, storing + its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] + to test whether a LO_SUM address is allowed. + (mips_symbol_insns): Return 0 for general mips16 symbols. + Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. + Handle the new SYMBOL_GOTOFF_*s. + (mips_address_insns): Update call to mips_classify_address. + (mips_const_insns): Be more fussy about HIGH constants. Remove use + of mips_classify_constant. Be more accurate about CONSTs. + (mips_global_pic_constant_p): Delete. + (const_arith_operand): Only accept CONST_INTs. + (call_insn_operand): Remove call to mips_classify_constant. + Let mips_symbolic_constant_p check for invalid offsets. + (move_operand): Check for general_operands first. Only accept symbolic + constants if they satisfy mips_symbolic_constant_p and cannot be split. + (symbolic_constant): Use mips_symbolic_constant_p. + (global_got_operand, local_got_operand): New predicates. + (stack_operand): Update call to mips_classify_address. + (mips_legitimate_address_p): Likewise. + (mips_reloc, mips_lui_reloc): Delete. + (mips_force_temporary): Only use the given temporary if no_new_pseudos. + Use emit_move_insn. + (mips_split_symbol, mips_unspec_address): New functions. + (mips_unspec_offset_high): New function. + (mips_load_got): Replace reloc argument with a symbol_type. + Use mips_unspec_address to create the address and put it in a + LO_SUM with the base register. + (mips_load_got16, mips_load_got32): Delete. + (mips_emit_high, mips_legitimize_symbol): Delete. + (mips_gotoff_global): New function. + (mips_load_got_page, mips_load_got_global): New functions. + (mips_legitimize_symbol): Inline handling of LO_SUM splits. + (mips_legitimize_const_move): Likewise. Remove HIGH handling. + Inline code to handle constants plus invalid offsets. Use + mips_split_symbol to legitimize constant pool addresses. + (mips_delegitimize_address): Delete. + (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs + a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. + (mips_subword): Pass memrefs through mips_rewrite_small_data. + (mips_output_move): Remove use of mips_classify_constant. + (mips_expand_call): Use mips_unspec_offset_high to calculate the + high part of the GOT address for calls to global functions. + (override_options): Initialize mips_split_p[], mips_lo_relocs[] + and mips_hi_relocs[]. + (print_operand): Use print_operand_reloc to handle '%h' and '%R'. + Remove use of mips_classify_constant. + (mips_reloc_string): Delete. + (print_operand_reloc): New function. + (print_operand_address): Update call to mips_classify_address. + (mips_rewrite_small_data_p, small_data_pattern_1): New functions. + (small_data_pattern): New predicate. + (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. + (mips_function_has_gp_insn): New function. + (mips_global_pointer): Use it. + (mips_gp_insn): Delete. + (mips_expand_prologue): When compiling for n32/n64 abicalls, use a + single loadgp pattern to initialize $gp. Pass it the offset of _gp + from the start of the current function. + (mips16_gp_pseudo_reg): Revert last patch. + + * config/mips/mips.md (RELOC_*): Delete. + (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. + (got): New insn attribute. + (type): Set to "load" if got == load. + (length): Set to 4 if got == load, 8 if got == xgot_high. + (lui[sd]i): Delete. + (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. + (*got_disp[sd]i, *got_page[sd]i): Likewise. + (*low[sd]i): Change constraints to "d". Add a new define_split to + rewrite small data constants into LO_SUMs. + (loadgp): New insns. + +2003-11-04 Rainer Orth + + * config/mips/_tilib.c: Use _ABI* in _MIPS_SIM tests. + +2003-11-04 DJ Delorie + + * config/v850/v850.md (mulhisi3): Expand the const_int case + separately to avoid trying to sign extend the const. + +2003-11-04 Richard Sandiford + + * emit-rtl.c (copy_rtx_if_shared): Don't allow MEMs with constant + addresses to be shared. + (force_const_mem): Return a copy of the pool entry. + +2003-11-03 Andreas Jaeger + + * Makefile.in (GCC_CFLAGS): Remove @WERROR@ again. + +2003-11-03 Kelley Cook + + * Makefile.in (cpp.dvi): New target split from cpp.info. + (gcc.dvi): New target split from gcc.info. + (gccint.dvi): New target split from gccint.info. + (cppinternals.dvi): New target split from cppinternals.info + (gccinstall.info): New specific rule. + (gccinstall.dvi): Likewise. + (dvi): Move targets to $(docobjdir). + ($(docobjdir)/%.dvi): New implicit rule. + +2003-11-03 Richard Kenner + + * doc/gty.texi (tag, desc): Say more about role of desc values in + selecting between tags. + +2003-11-03 Alexander Kabaev + + * real.c (encode_ieee_single): Ensure proper promotion. + +2003-11-03 Volker Reichelt + + * doc/contrib.texi: Add Giovanni Bajo, Dara Hazeghi, Falk Hueffner, + and Andrew Pinski. + +2003-11-03 Syd Polk + + * config/rs6000/rs6000.c (rs6000_override_options): Add G3, G4, and G5 + marketing names to the list of supported processors. + * config/rs6000/rs6000.h: Ditto. + * doc/invoke.texi: Ditto. + * config.gcc: Ditto. + +2003-11-03 Rainer Orth + + * fixinc/inclhack.def (stdio_va_list): Allow tab before va_list. + Merge two substitutions. + * fixinc/fixincl.x: Regenerate. + Fixes PR bootstrap/12666. + +2003-11-03 Joseph S. Myers + + * doc/install-old.texi: Remove VMS documentation. + +2003-11-03 Jan Hubicka + + * i386.c (override_options): Remove hack enabling 128bit long double + commited by accident. + +2003-11-02 Per Bothner + + * c-opts.c (needValue): Do cpp_find_main_file before processing + any imacros flags, so pfile->main_file is set for the latter. + +2003-11-03 Andreas Jaeger + Zack Weinberg + + * Makefile.in (GCC_CFLAGS): Allow blacklisting of warnings. + (SYSCALLS.c.X-warn): Suppress warnings. + +2003-11-02 John David Anglin + + PR optimization/12845 + * pa.c (output_cbranch): Use cmpb for DImode comparisons with 0. + +2003-11-02 Zack Weinberg + + * print-rtl.c (print_rtx): Call PRINT_REG with second argument -1. + * config/i386/i386.c (print_reg): Abort on a virtual register + if code != -1; not if file == asm_out_file. + * config/i386/i386.h (PRINT_REG): Document meaning of CODE == -1. + (DEBUG_PRINT_REG): Delete, unused. + +2003-11-02 Andreas Schwab + + * config/ia64/fde-glibc.c (_GNU_SOURCE): Define to 1 instead of + empty to avoid conflict with the definition from configure. + +2003-11-02 Roger Sayle + + PR optimization/10817 + * ifcvt.c (noce_emit_move_insn): Improve documentation comment. + (noce_try_move): New function to optimize an if-the-else into an + unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a". + (noce_process_if_block): Attempt simplification with noce_try_move. + + * simplify-rtx.c (simplify_ternary_operation): Some minor fixes + and improvements to the optimizations of IF_THEN_ELSE expressions. + (simplify_subreg): Silence signed/unsigned comparison warning. + +2003-11-02 Richard Sandiford + + * Makefile.in (targhooks.o, reload.o): Update dependencies. + (GTFILES): Add targhooks.c. + (gt-targhooks.h): New rule; depend on s-gtype. + * target.h (direct_pool_load_p): New hook. + * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro. + (TARGET_INITIALIZER): Include it. + * targhooks.h (default_direct_pool_load_p): Declare. + (hook_bool_machine_mode_true): Declare. + * targhooks.c: Include insn-config.h, recog.h, ggc.h and + gt-targhooks.h. + (pool_symbol): New variable. + (default_direct_pool_load_p): New function. + (hook_bool_machine_mode_true): New function. + * reload.c: Include target.h. + (find_reloads): If an alternative will force a constant into memory, + count an extra reload if constant pool symbols are not valid + addresses. If an alternative uses memory to move values between + registers, count the move as two reloads rather than one. + * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define. + * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document. + +2003-11-02 Eric Botcazou + + PR optimization/12799 + * postreload.c (reload_cse_move2add): Generate the add2 + patterns manually. + +2003-11-02 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: + Return 0 for all complex modes whose size is lesser or equal to + a word. Add a ??? comment for the condition used with 16-byte + aligned modes. + +2003-11-01 Kelley Cook + + * .cvsignore: Remove c-parse* and tradcif.c. + * objc/.cvsignore: Delete. + +2003-11-01 Roger Sayle + + * unwind-sjlj.c (_Unwind_GetCFA): Return (_Unwind_Word)0 instead + of NULL. + +2003-11-01 John David Anglin + + * som.h (DO_GLOBAL_DTORS_BODY): Change to C90 declaration. + + * libgcc2.c (SYMBOL__MAIN): Provide C90 declaration. + + * collect2.c (scan_libraries): Fix typos. + + PR preprocessor/12847 + * cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c, + cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c, + c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, + DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with + "CPP_". + +2003-11-01 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Correct + no_units calculation. + +2003-11-01 Andreas Jaeger + + * unwind-dw2.c (_Unwind_FrameState): Remove commas at end of + enumeration list. + +2003-11-01 Andreas Schwab + + * config/ia64/sysv4.h (SDATA_SECTION_FUNCTION): Update to C90 + prototypes. + (SBSS_SECTION_FUNCTION): Likewise. + +2003-11-01 Andreas Jaeger + + * Makefile.in (GCC_CFLAGS): Add @WERROR@ for target files. + +2003-11-01 Andreas Tobler + + * config/rs6000/sysv4.h (EXTRA_SECTION_FUNCTIONS): Update to C90 + prototypes. + +2003-11-01 Andreas Jaeger + + * unwind-dw2.c (_Unwind_FindEnclosingFunction): Constify variable. + (uw_frame_state_for): Constify variables. + (extract_cie_info): Constify first argument. + + * unwind-dw2-fde-darwin.c: Adjust prototype of + _Unwind_Find_registered_FDE for recent changes. + (examine_objects): Constify return value and local variable result. + (_Unwind_Find_FDE): Constify return value and local variable ret. + +2003-10-31 Per Bothner + + * c-opts.c (finish_options): Change to returns boolean - false iff + the call to cpp_find_main_file fails. + (c_common_init): Skip preprocess_file if finish_options failed. + (c_common_parse_file): Break if finish_options failed. + Fixes PR preprocessor/12545. + +2003-10-31 John David Anglin + + * aclocal.m4: Blacklist ultrix* for mmap file. + * configure: Rebuilt. + + * function.c (assign_parms): Add ATTRIBUTE_UNUSED to variable + reg_parm_stack_space. + * toplev.c (default_get_pch_validity): Fix warning. + + * vax.c: Include toplev.h. + (vax_init_libfuncs): Fix typo (umod). + * vax.h (ASM_COMMENT_START): Define. + (PRINT_OPERAND): Fix warning when HOST_WIDE_INT is a long long. + +2003-10-31 Roger Sayle + + PR middle-end/11968 + * expr.c (expand_expr ): Remove inappropriate and + confusing comment; distributivity isn't handled in expand_expr. + * fold-const.c (extract_muldiv_1 ): Allow overflow + in distributivity, if wrap-around semantics are specified with + -fwrapv. + +2003-11-01 Alan Modra + + PR 12315 + * final.c (profile_function): Allow for NULL svrtx. + +2003-10-31 John David Anglin + + * pa.c (pa_select_section): Use new style declaration. + * som.h (readonly_data): Likewise. + +2003-10-31 Kelley Cook + + * config/rs6000/rs6000.c: Update to C90 prototypes. + +2003-10-31 Richard Earnshaw + + PR target/7513 + * arm.h (CONDITIONAL_REGISTER_USAGE): Disable use of LR in Thumb + code. + +2003-10-31 Andreas Jaeger , + Zack Weinberg + + + * crtstuff.c (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + * unwind-dw2-fde.h (struct fde_vector): + Constify 'orig_data' and 'array' fields. + (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + (get_cie, next_fde, _Unwind_Find_FDE): Constify arguments, + return values, and casts of type fde *, struct dwarf_fde *, + and struct dwarf_cie *. + * unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + (get_cie_encoding, ): Constify struct dwarf_cie * argument. + (get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare) + (fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert) + fde_split, SWAP, frame_downheap, frame_heapsort) + (classify_object_over_fdes, add_fdes, linear_search_fdes, + binary_search_unencoded_fdes, binary_search_single_encoding_fdes, + binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE): + Constify arguments, local variables, return values, and casts + of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *. + Use const pointer types in sizeof expressions, for clarity. + * unwind-dw2-fde-glibc.c + (_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value. + (struct unw_eh_callback_data): Constify 'ret' field. + +2003-10-31 Fariborz Jahanian + David Edelsohn + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): New. + (function_arg): Call it. + (rs6000_function_value): Widen integral return value to mode based + on TARGET_32BIT, not word_mode. + * config/rs6000/rs6000.h (PROMOTE_MODE): Likewise. + (UNITS_PER_ARG): New. + (RS6000_ARG_SIZE): Use it. + +2003-10-31 Gerald Pfeifer + + * .cvsignore: No longer ignore gengtype-lex.c, gengtype-yacc.c, + and gengtype-yacc.h. + +2003-10-31 Richard Earnshaw + + PR optimization/8896 + * postreload.c (reload_combine): Check that REGY doesn't die in an + insn of the form (set (regx) (plus (regx) (regy))), ie REGX != REGY. + +2003-10-31 Josef Zlomek + + PR/10239 + * cfgrtl.c (delete_insn): Decrease LABEL_NUSES for all REG_LABEL notes. + +2003-10-31 Josef Zlomek + + PR/11640 + * cfgrtl.c (try_redirect_by_replacing_jump): Move jump + immediatelly before BARRIER. + +2003-10-31 Kelley Cook + + * Makefile.in (STRICT2_WARN): Add -Wold-style-definition. + +2003-10-31 Richard Earnshaw + + PR target/11271 + * reload.c (find_reloads_address): Handle any register in + (PLUS (PLUS (REG) (REG)) (CONST_INT). + +2003-10-31 Richard Earnshaw + + * ggc-page.c (ggc_pch_read): Wrap call to poison_pages in + ENABLE_GC_CHECKING not in GGC_POISON. + +2003-10-31 Nathanael Nerode + + PR bootstrap/9863 + * configure.in: Bail out if awk is missing. + * configure: Regenerate. + + PR ada/12761 + * Makefile.in: Move default definitions of X_ADA_CFLAGS, + T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS from ada/Make-lang.in to here. + +2003-10-30 Richard Henderson + + * c-objc-common.c (c_tree_printer): Handle types correctly. + Factor code a bit. + +2003-10-30 Kelley Cook + + * value-prof.c, web.c: Update to C90. + +2003-10-30 Eric Christopher + + * function.c (purge_addressof_1): Add case for REG_RETVAL + notes when modes are unequal. + +2003-10-31 Jan Hubicka + + * i386-modes.def: Add XFmode format adjustment. + +2003-10-30 Jan Hubicka + + * real.c (encode_ieee_extended): Back out previous patch. + +2003-10-30 Jan Hubicka + + * real.c (encode_ieee_extended): Initialize whole array. + * reg-stack.c (move_for_stack_reg0: Use always XFmode. + * i386-modes.def: Change definitions of TFmode and XFmode. + * i386.c (classify_argument): Rename TFmodes to XFmodes; add new TFmode + code. + (construct_container): Allow constructing of TFmode integer containers. + (ix86_return_in_memory): XFmode is not returned in memory. + (init_ext_80387_constants): Always use XFmode. + (print_operand): Likewise. + (ix86_prepare_fp_compare_regs): Likewise. + (split_to_parts): Deal with TFmode. + (split_long_move): Simplify. + (ix86_init_mmx_sse_builtins): Add __float80, __float128. + (ix86_memory_move_cost): Do not confuse TFmode. + * i386.h (LONG_DOUBLE_TYPE_SIZE): Set to 96. + (IS_STACK_MODE): TFmode is not stack mode. + (HARD_REGNO_NREGS, CLASS_MAX_NREGS): Deal nicely with XFmode. + (VALID_SSE_REG_MODE): Allow TFmode. + (VALID_FP_MODE_P): Disallow TFmode. + (VALID_INT_MODE_P): Allow TFmode in 64bit mode. + * i386.md (TFmode patterns): Kill. + (movtf, motf_rex64): New patterns. + +2003-10-30 Richard Sandiford + + * config/mips/mips.md (adddi3): Fix typo in mips16 stack pointer code. + +2003-10-30 Richard Sandiford + + * config/mips/mips.md (mov_lwl): Use memory_operand where appropriate. + (mov_lwr, mov_swl, mov_swr): Likewise. + (mov_ldl, mov_ldr, mov_sdl, mov_sdr): Likewise. + +2003-10-30 Richard Sandiford + + * config/mips/mips.c (mips_global_pointer): Don't try to use $25. + +2003-10-30 Richard Henderson + + * config/mips/mips.c (mips_build_builtin_va_list): Use runtime + test for irix6 rather than preprocessor test. + +2003-10-30 Richard Henderson + + * cppcharset.c (one_utf8_to_utf16): Initialize 's' to silence warning. + +2003-10-30 Ulrich Weigand + + * config/s390/s390.c (struct machine_function): Use save_return_addr_p + as a general flag that the return address register needs to be saved, + not necessarily because of __builtin_return_addr (0). + (s390_split_branches): Remove TEMP_REG and TEMP_USED arguments, + remove special handling of zSeries machines. + (s390_optimize_prolog): Remove TEMP_USED argument, treat the return + register as a regular register on zSeries machines. + (s390_reorg): Adjust calls to s390_split_branches and + s390_optimize_prolog. + (s390_frame_info): On zSeries machines, do not assume the return + register is always used. Update regs_ever_live with current data + for the special registers. + (s390_emit_epilogue): Use save_return_addr_p to determine whether + the return register was saved. + * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Do not mark + RETURN_REGNUM fixed on zSeries machines. + (REG_ALLOC_ORDER): Use RETURN_REGNUM last. + * config/s390/s390.md ("*doloop_si"): Handle branch overflow + via ahi-jgne pair on zSeries machines. + ("*doloop_di"): Likewise. + ("*doloop_di_long"): Remove. + +2003-10-30 Richard Earnshaw + + * arm.c (arm_override_options): Revert change of arm_constant_limit + when optimizing for size. + +2003-10-29 Richard Henderson + + * fold-const.c (fold_single_bit_test): Convert the input to the + operational intermediate type. + +2003-10-29 Richard Henderson + + * builtins.c (std_build_builtin_va_list): New. + * expr.h (std_build_builtin_va_list): Declare. + * defaults.h (BUILD_VA_LIST_TYPE): New. + * system.h (BUILD_VA_LIST_TYPE): Poison. + * target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New. + * target.h (struct gcc_target): Add build_builtin_va_list. + * tree.c (build_common_tree_nodes_2): Use it. + + * config/alpha/alpha-protos.h, config/alpha/alpha.c, + config/alpha/alpha.h, config/alpha/unicosmk.h, + config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h, + config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, + config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h, + config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, + config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c, + config/mips/mips.h, config/rs6000/rs6000-protos.h, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, + config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, + config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h, + config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, + config/xtensa/xtensa.h: Rename foo_build_va_list to + foo_build_builtin_va_list; make it static. Define + TARGET_BUILD_BUILTIN_VA_LIST. Remove BUILD_VA_LIST_TYPE. + Update protos. + + * config/i386/i386.c (ix86_expand_carry_flag_compare): Make static. + * config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove. + +2003-10-29 James E Wilson + + * recog.c (asm_operand_ok): Add missing break after case 'X'. + Change if statements to else if statements in default case. + (extract_constrain_insn_cached): Fix misspelling of constrain_operands + in comment. + (constrain_operands_cached): Likewise. + (constrain_operands): Change if statements to else if statements in + default case. + * reload.c (find_reloads): Likewise. + +2003-10-29 Richard Henderson + + * config/m68k/m68k.c (notice_update_cc): Clear cc status for + shifts and rotates. + +2003-10-30 Alan Modra + + * config/rs6000/rs6000.md: Remove duplicate pattern. + +2003-10-29 Hans-Peter Nilsson + + * real.c (do_divide): Initialize result with a 0. + + * configure.in : Look for + first. AC_DEFINE HAVE_VALGRIND_MEMCHECK_H + if it exists. + * configure, config.in: Regenerate. + * ggc-common.c [ENABLE_VALGRIND_CHECKING && + HAVE_VALGRIND_MEMCHECK_H]: Include . Use + #elif for other alternatives. + * ggc-page.c: Ditto. + * ggc-zone.c: Don't assume ; instead copy + include structure from ggc-common.c. + +2003-10-29 John David Anglin + + * pa-linux.h (ASM_OUTPUT_ADDR_VEC_ELT): Use label in big switch ELTs. + (ASM_OUTPUT_ADDR_DIFF_ELT): Use label difference in big switch ELTs. + * pa.c (pa_adjust_insn_length): Check for btable branches using + attribute TYPE_BTABLE_BRANCH. + (pa_reorg): Simplify. + * pa.h (CASE_VECTOR_MODE): Change big switch mode to SImode. + (ASM_OUTPUT_ADDR_VEC_ELT): As above. + (ASM_OUTPUT_ADDR_DIFF_ELT): As above. + * pa.md (btable_branch): New instruction type. + (in_branch_delay, in_nullified_branch_delay, in_call_delay): Disallow + btable branches. + (define_delay): Add btable branches to insn types that may have an + insn in the delay position. + (Z2, Z3): Add btable branch to list. + Simplify unamed pattern set copy pic_label_operand to register. Add + PA 2.0 variant. + (short_jump): New jump for use in branch tables. + (casesi, casesi0): Revise for new branch table formats. + (casesi32, casesi32p, casesi64p): New casesi patterns. + (indirect_jump): Move. + +2003-10-29 David Edelsohn + + * config/rs6000/rs6000.h (UNITS_PER_WORD): Revert to + !TARGET_POWERPC64. + (UNITS_PER_GPR_WORD): Delete. + (HARD_REGNO_NREGS): Revert to UNITS_PER_WORD. + (HARD_REGNO_MODE_OK): Same. + (CLASS_MAX_NREGS): Same. + +2003-10-29 John David Anglin + + * pa.h (ASM_COMMENT_START): Define. + +2003-10-29 Zack Weinberg + + * genmodes.c (complete_mode): Record MODE_CC, MODE_INT, + MODE_FLOAT, and MODE_PARTIAL_INT modes as having one + component, not zero. + +2003-10-29 Andreas Schwab + + * config/ia64/t-ia64 (LIB2ADDEH): Add $(srcdir)/gthr-gnat.c. + +2003-10-29 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: + Never return 1 for complex integral modes whose size is lesser or + equal to a word. + (function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode + in the comment. + (function_arg_advance) [TARGET_ARCH64]: Don't special-case complex + modes. + (sparc_va_arg) [TARGET_ARCH64]: Handle any types whose size is + greater than 16 bytes by reference. + +2003-10-29 Richard Kenner + + * config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE, + not TARGET_ILP32. + (ia64_initialize_trampoline): Use globalize_label target call. + +2003-10-29 Andreas Schwab + + * doc/install.texi (Building): Add a sentence about building Ada + for a canadian cross. + +2003-10-28 Zack Weinberg + + * config/ia64/ia64.c (cmptf_libfunc): New static. + (ia64_expand_compare): Add logic to open-code calls to + _U_Qfcmp for TFmode comparisons. + (ia64_hpux_init_libfuncs): Initialize cmptf_libfunc. + Set libfuncs for TFmode eq/ne/gt/ge/lt/gt to 0; these should + never be generated anymore. + * config/ia64/ia64.md (cmptf): New expander. + +2003-10-28 Zack Weinberg + + * ia64.md (UNSPEC_SETF_EXP,UNSPEC_FR_SQRT_RECIP_APPROX): New constants. + (*sqrt_approx): New instruction pattern for approximate square roots. + (*setf_exp_xf): New instruction pattern for exponentiation. + (*maddxf4_alts_truncsf): New instruction pattern for truncation. + (sqrtsf2_internal_thr): New define_and_split implementing + throughput-optimized inline calculation of SFmode square root. + (sqrtdf2_internal_thr): Likewise for DFmode. + (sqrtxf2_internal_thr): Likewise for XFmode. + (sqrtsf2, sqrtdf2, sqrtxf2): New expanders to choose between + latency- and throughput-optimized square root algorithms. + * ia64.h (MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, + TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT): + New macros. + (TARGET_SWITCHES): Add -minline-sqrt-min-latency and + -minline-sqrt-max-throughput. + * ia64.c (ia64_override_options): If both -minline-sqrt-min-latency + and -minline-sqrt-max-throughput are given, notify the user + that both options cannot be used simultaneously. + If -minline-sqrt-min-latency is given, notify the user that + this mode is not yet implemented. + (rtx_needs_barrier): Reformat initial comment to obey + 72-character width limit. Support UNSPEC_SETF_EXP and + UNSPEC_FR_SQRT_RECIP_APPROX. + +2003-10-29 Alan Modra + + * config/rs6000/rs6000.md (movdf_softfloat64): Allow dummy ctr,ctr + moves. + +2003-10-28 Franz Sirl + + PR target/11598 + PR libgcj/10610 + * config/rs6000/sysv4.h (PREFERRED_STACK_BOUNDARY): New macro. + +2003-10-28 Richard Earnshaw + + * arm.c (arm_output_epilogue): When using a frame pointer, don't emit + an extra stack adjustment insn if the stack pointer is already + pointing at the right place. + (use_return_insn): Allow a return insn to be used when we have a + frame pointer if the stack pointer is in the right place. + (output_return_instruction): Handle it. + +2003-10-28 Andreas Jaeger + + * ggc-zone.c (check_cookies): Add missing variable. + Add void to prototypes. + +2003-10-27 Kaveh R. Ghazi + + * config/mips/irix6-libc-compat.c (inet_makeaddr): Prototype. + * crtstuff.c (__do_global_ctors_1): Move prototype. + * unwind-dw2.c (NO_SIZE_OF_ENCODED_VALUE): Define when + appropriate. + * unwind-sjlj.c (_Unwind_GetCFA, _Unwind_FindEnclosingFunction): + Mark parameter with __attribute__((unused)). + +2003-10-27 Zack Weinberg + + * c-decl.c (pushdecl): Clarify comment. + +2003-10-27 Arnaud Charlet + + * doc/install.texi: Update instructions for Ada cross builds + + PR ada/5909: + * doc/sourcebuild.texi: Document Ada test suite. + +2003-10-27 Stephane Carrez + + * config/m68hc11/m68hc11.c: Convert to ISO C90. + * config/m68hc11/m68hc11-protos.h: Likewise. + +2003-10-27 Jan Hubicka + Eric Botcazou + + * toplev.c (enum dump_file_index, dump_file): Fix ordering of + webizer pass dump. + +2003-10-27 Jakub Jelinek + Jan Hubicka + + * reload1.c (struct elim_table): Change offset, initial_offset and + previous_offset fields to HOST_WIDE_INT. + (offsets_at): Change from int to HOST_WIDE_INT. + (reload): Adjust offsets_at initialization. + (eliminate_regs_in_insn): Change type of offset to HOST_WIDE_INT. + (verify_initial_elim_offsets): Change type of t to HOST_WIDE_INT. + * config/i386/i386.c (ix86_compute_frame_layout): Change offset type + to HOST_WIDE_INT. Don't save regs using mov for huge frame sizes + if TARGET_64BIT. + (pro_epilogue_adjust_stack): New function. + (ix86_expand_prologue, ix86_expand_epilogue): Use it. + * config/i386/i386.md (pro_epilogue_adjust_stack): Remove. + (pro_epilogue_adjust_stack_1): Remove * in front of name. + (pro_epilogue_adjust_stack_rex64): Handle -2147483648 properly. + (pro_epilogue_adjust_stack_rex64_2): New insn. + + * config/i386/i386.c (ix86_expand_epilogue): Fix comment typo. + + * config/i386/i386.c (ix86_expand_call): Replace 40 with + FIRST_REX_INT_REG + 3 /* R11 */. + +2003-10-26 Richard Henderson + + * config/alpha/alpha.md (attr cannot_copy): New. + (call_osf_2_er, call_value_osf_2_er, ldgp_er_1, ldgp_er_2, + prologue_ldgp_er_2, prologue_ldgp_1): Set it. + * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Test it. + 2003-10-26 Daniel Berlin * ggc-zone.c: New file, zone allocating collector. @@ -35,7 +4461,7 @@ 2003-10-26 Bernardo Innocenti * config/m68k/m68k.c (m68k_output_function_prologue): Eliminate - num_saved_regs, use current_frame.reg_no instead. + num_saved_regs, use current_frame.reg_no instead. 2003-10-26 Bernardo Innocenti Paul Dale @@ -122,9 +4548,9 @@ 2003-10-25 Richard Henderson - * config/i386/i386.c (ix86_eax_live_at_start_p): New. - (ix86_expand_prologue): Save and restore eax around stack probe - if it's live. + * config/i386/i386.c (ix86_eax_live_at_start_p): New. + (ix86_expand_prologue): Save and restore eax around stack probe + if it's live. 2003-10-25 Jan Hubicka @@ -322,7 +4748,7 @@ 2003-10-24 Danny Smith - * config/i386/cygwin.asm. Add copyright notice. Add comment + * config/i386/cygwin.asm: Add copyright notice. Add comment on why this code is needed. 2003-10-23 Kazu Hirata @@ -455,7 +4881,6 @@ * c-pch.c (struct c_pch_validity): Add pch_init field. (pch_init): Set it. (c_common_valid_pch): Check it. - (get_ident): Bump the PCH version number. 2003-10-22 David Taylor @@ -1596,7 +6021,7 @@ * config/i386/i386.c (x86_this_parameter): Fix typo. -2003-10-11 Jan Hubicka +203-10-11 Jan Hubicka * Makefile.in (web.o): New. * web.c: New file. diff --git a/gcc/ChangeLog.7 b/gcc/ChangeLog.7 index c796d0fd23c..f9c6a7dbcb0 100644 --- a/gcc/ChangeLog.7 +++ b/gcc/ChangeLog.7 @@ -12648,7 +12648,7 @@ Thu Mar 28 16:35:31 2002 Jeffrey A Law (law@redhat.com) Thu Mar 28 19:13:36 CET 2002 Jan Hubicka - * ifcvt.c (if_convert): Clear aux_for_blocks early enought. + * ifcvt.c (if_convert): Clear aux_for_blocks early enough. Thu Mar 28 13:21:53 CET 2002 Jan Hubicka diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 81f819c256f..bd65e0bf67e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -63,7 +63,6 @@ target_noncanonical=@target_noncanonical@ # Sed command to transform gcc to installed name. program_transform_name = @program_transform_name@ -program_transform_cross_name = @program_transform_name@ # ----------------------------- # Directories used during build @@ -99,6 +98,18 @@ VPATH = @srcdir@ vpath %.texi $(docdir):$(docdir)/include +# ---- +# Default values for variables overridden in Makefile fragments. +# These need to be quite early in the Makefile so as to avoid +# trouble induced by changes in fragment ordering. +# ---- + +# For ada/Make-lang.in; overridden in, for example, config/pa/x-ada. +X_ADA_CFLAGS = +T_ADA_CFLAGS = +X_ADAFLAGS = +T_ADAFLAGS = + # -------- # UNSORTED # -------- @@ -152,7 +163,7 @@ coverageexts = .{gcda,gcno} # stage1, as not all versions of gcc understand -Wno-long-long. LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes STRICT_WARN = @strict1_warn@ -STRICT2_WARN = -pedantic -Wno-long-long @WERROR@ +STRICT2_WARN = -pedantic -Wno-long-long -Wold-style-definition @WERROR@ # This is set by --enable-checking. The idea is to catch forgotten # "extern" tags in header files. @@ -175,12 +186,16 @@ gengtype-yacc.o-warn = -Wno-error c-parse.o-warn = -Wno-error # flex output may yield harmless "no previous prototype" warnings gengtype-lex.o-warn = -Wno-error +# SYSCALLS.c misses prototypes +SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either # $(GCC_WARN_CFLAGS), or nothing. WARN_CFLAGS = @warn_cflags@ +CPPFLAGS = @CPPFLAGS@ + # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = T_CFLAGS = @@ -188,7 +203,6 @@ T_CFLAGS = X_CPPFLAGS = T_CPPFLAGS = -ADAC = @ADAC@ AWK = @AWK@ CC = @CC@ BISON = @BISON@ @@ -275,7 +289,7 @@ GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isyste # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. # It omits XCFLAGS, and specifies -B./. # It also specifies -isystem ./include to find, e.g., stddef.h. -GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS) +GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS) # --------------------------------------------------- # Programs which produce files for the target machine @@ -288,7 +302,7 @@ AR_FOR_TARGET = ` \ if [ "$(host)" = "$(target)" ] ; then \ echo ar; \ else \ - t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \ + t='$(program_transform_name)'; echo ar | sed -e $$t ; \ fi; \ fi` AR_FLAGS_FOR_TARGET = @@ -301,7 +315,7 @@ RANLIB_FOR_TARGET = ` \ if [ "$(host)" = "$(target)" ] ; then \ echo $(RANLIB); \ else \ - t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \ + t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \ fi; \ fi` NM_FOR_TARGET = ` \ @@ -313,7 +327,7 @@ NM_FOR_TARGET = ` \ if [ "$(host)" = "$(target)" ] ; then \ echo nm; \ else \ - t='$(program_transform_cross_name)'; echo nm | sed -e $$t ; \ + t='$(program_transform_name)'; echo nm | sed -e $$t ; \ fi; \ fi` @@ -366,6 +380,7 @@ host_xm_defines=@host_xm_defines@ xm_file_list=@xm_file_list@ xm_include_list=@xm_include_list@ xm_defines=@xm_defines@ +lang_checks=check-gcc lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt lang_specs_files=@lang_specs_files@ lang_tree_files=@lang_tree_files@ @@ -588,12 +603,6 @@ UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'` GCOV_INSTALL_NAME = `echo gcov|sed '$(program_transform_name)'` GCCBUG_INSTALL_NAME = `echo gccbug|sed '$(program_transform_name)'` -# Actual name to use when installing a cross-compiler. -GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'` -CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'` -PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'` -UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'` - # Setup the testing framework, if you have one EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ echo $${rootme}/../expect/expect ; \ @@ -843,22 +852,22 @@ OBJS-common = \ cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o \ cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o \ dbxout.o debug.o df.o diagnostic.o dojump.o doloop.o dominance.o \ - dwarf2asm.o dwarf2out.o dwarfout.o emit-rtl.o except.o explow.o \ + dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o \ expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o \ genrtl.o ggc-common.o global.o graph.o gtype-desc.o \ haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o insn-modes.o \ insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \ integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \ loop.o optabs.o options.o opts.o params.o postreload.o predict.o \ - print-rtl.o print-tree.o value-prof.o \ + print-rtl.o print-tree.o value-prof.o \ profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \ real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \ reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \ sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \ - sibcall.o simplify-rtx.o sreal.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \ - stor-layout.o stringpool.o targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \ - unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \ - alloc-pool.o et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o + sibcall.o simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o \ + targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o unroll.o \ + varasm.o varray.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \ + et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o OBJS-md = $(out_object_file) OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o \ @@ -926,7 +935,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 # all.cross, start.encap, rest.encap, # install-normal, install-common, install-info, install-man, # uninstall, -# mostlyclean, clean, distclean, extraclean, maintainer-clean, +# mostlyclean, clean, distclean, maintainer-clean, # stage1, stage2, stage3, stage4 # # Each language is linked in with a series of hooks. The name of each @@ -951,6 +960,7 @@ endif Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c $(LANG_MAKEFRAGS) LANGUAGES="$(CONFIG_LANGUAGES)" \ CONFIG_HEADERS= \ + CONFIG_SHELL="$(SHELL)" \ CONFIG_FILES=$@ $(SHELL) config.status config.h: cs-config.h ; @true @@ -1312,7 +1322,7 @@ c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \ - $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h + $(RTL_H) function.h langhooks.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(TREE_H) sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ hard-reg-set.h $(BASIC_BLOCK_H) @@ -1451,7 +1461,7 @@ version.o: version.c version.h gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h \ $(HASHTAB_H) $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \ libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \ - ssa.h cselib.h insn-addr.h + cselib.h insn-addr.h ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h @@ -1506,7 +1516,7 @@ diagnostic.o : diagnostic.c $(DIAGNOSTIC_H) real.h \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \ input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H) opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(TM_H) $(LANGHOOKS_H) $(GGC_H) $(RTL_H) \ + coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \ @@ -1517,7 +1527,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_ debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \ dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ - ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ + $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ langhooks.h insn-flags.h cfglayout.h real.h cfgloop.h \ hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h $(COVERAGE_H) $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ @@ -1535,10 +1545,11 @@ rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) real.h \ $(GGC_H) errors.h $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H) -rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) \ - hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h +print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H) +rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ + $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h \ + $(BASIC_BLOCK_H) errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) @@ -1563,7 +1574,7 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \ function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h $(INSN_ATTR_H) insn-config.h \ $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ - except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h + except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h $(TARGET_H) dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ flags.h function.h $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \ langhooks.h @@ -1579,7 +1590,7 @@ expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_ toplev.h $(TM_P_H) langhooks.h explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ flags.h hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ - toplev.h function.h $(GGC_H) $(TM_P_H) gt-explow.h + toplev.h function.h $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ flags.h insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \ toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H) \ @@ -1593,9 +1604,6 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_ flags.h function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \ insn-config.h xcoffout.h c-pragma.h $(GGC_H) $(TARGET_H) \ sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h -dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) dwarf.h flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \ - debug.h langhooks.h $(TARGET_H) dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) dwarf2.h debug.h flags.h insn-config.h reload.h output.h $(DIAGNOSTIC_H) real.h \ hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \ @@ -1643,7 +1651,8 @@ web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h flags.h $(BASIC_BLOCK_H) function.h output.h toplev.h df.h gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h flags.h real.h insn-config.h $(GGC_H) $(RECOG_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h + $(BASIC_BLOCK_H) function.h langhooks.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \ + except.h gt-gcse.h $(TREE_H) sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ function.h hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \ @@ -1652,14 +1661,6 @@ resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretype lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h flags.h real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \ $(BASIC_BLOCK_H) $(TM_P_H) df.h function.h -ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) varray.h \ - $(EXPR_H) hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \ - $(BASIC_BLOCK_H) output.h ssa.h -ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \ - $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h -ssa-ccp.o : ssa-ccp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \ - $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h \ - errors.h $(GGC_H) df.h function.h df.o : df.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 $(FIBHEAP_H) @@ -1685,7 +1686,7 @@ unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-co alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(RECOG_H) function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H) + $(RECOG_H) function.h except.h $(EXPR_H) $(GGC_H) $(TM_P_H) cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h @@ -1811,10 +1812,10 @@ predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE $(PARAMS_H) $(TARGET_H) cfgloop.h $(COVERAGE_H) lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) $(GGC_H) bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(BASIC_BLOCK_H) flags.h output.h cfglayout.h $(FIBHEAP_H) \ + $(RTL_H) $(BASIC_BLOCK_H) flags.h timevar.h output.h cfglayout.h $(FIBHEAP_H) \ $(TARGET_H) tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \ + $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h timevar.h \ $(PARAMS_H) $(COVERAGE_H) cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \ @@ -2051,7 +2052,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \ $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \ $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \ $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \ - $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h \ + $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h \ $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \ $(srcdir)/c-common.h $(srcdir)/c-tree.h \ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ @@ -2656,11 +2657,10 @@ TEXI_CPPINT_FILES = cppinternals.texi # patterns. To use them, put each of the specific target with with their # specific dependencies but no build commands. -$(docobjdir)/cpp.info cpp.dvi: $(TEXI_CPP_FILES) -$(docobjdir)/gcc.info gcc.dvi: $(TEXI_GCC_FILES) -$(docobjdir)/gccint.info gccint.dvi: $(TEXI_GCCINT_FILES) -$(docobjdir)/gccinstall.info gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) -$(docobjdir)/cppinternals.info cppinternals.dvi: $(TEXI_CPPINT_FILES) +$(docobjdir)/cpp.info: $(TEXI_CPP_FILES) +$(docobjdir)/gcc.info: $(TEXI_GCC_FILES) +$(docobjdir)/gccint.info: $(TEXI_GCCINT_FILES) +$(docobjdir)/cppinternals.info: $(TEXI_CPPINT_FILES) $(docobjdir)/%.info: %.texi stmp-docobjdir if [ x$(BUILD_INFO) = xinfo ]; then \ @@ -2668,14 +2668,28 @@ $(docobjdir)/%.info: %.texi stmp-docobjdir -I $(docdir)/include -o $@ $<; \ fi -dvi:: gcc.dvi gccint.dvi gccinstall.dvi cpp.dvi cppinternals.dvi +# Duplicate entry to handle renaming of gccinstall.info +$(docobjdir)/gccinstall.info: $(TEXI_GCCINSTALL_FILES) stmp-docobjdir + if [ x$(BUILD_INFO) = xinfo ]; then \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) \ + -I $(docdir)/include -o $@ $<; \ + fi + +$(docobjdir)/cpp.dvi: $(TEXI_CPP_FILES) +$(docobjdir)/gcc.dvi: $(TEXI_GCC_FILES) +$(docobjdir)/gccint.dvi: $(TEXI_GCCINT_FILES) +$(docobjdir)/cppinternals.dvi: $(TEXI_CPPINT_FILES) + +dvi:: $(docobjdir)/gcc.dvi $(docobjdir)/gccint.dvi \ + $(docobjdir)/gccinstall.dvi $(docobjdir)/cpp.dvi \ + $(docobjdir)/cppinternals.dvi -%.dvi: %.texi stmp-docobjdir - $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $< +$(docobjdir)/%.dvi: %.texi stmp-docobjdir + $(TEXI2DVI) -I $(docdir) -I $(docdir)/include -o $@ $< -gccinstall.dvi: - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(TEXI2DVI) -I $$s/doc -I $$s/doc/include -o $@ $$s/doc/install.texi +# Duplicate entry to handle renaming of gccinstall.dvi +$(docobjdir)/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) stmp-docobjdir + $(TEXI2DVI) -I $(docdir) -I $(docdir)/include -o $@ $< generated-manpages:: $(docobjdir)/gcov.1 $(docobjdir)/cpp.1 \ $(docobjdir)/gcc.1 $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7 \ @@ -2817,24 +2831,6 @@ distclean: clean lang.distclean -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi -rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null -# Delete anything likely to be found in the source directory -# that shouldn't be in the distribution. -extraclean: distclean lang.extraclean - -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~* - -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej - -rm -f config/*/=* config/*/"#"* config/*/*~* - -rm -f config/*/*.orig config/*/*.rej - -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz - -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs - -rm -f *lose config/*lose config/*/*lose - -rm -f *.s *.s[0-9] *.i config/ChangeLog - -rm -f y.tab.c yacc.* - -rm -f */=* */"#"* */*~* - -rm -f */patch* */*.orig */*.rej - -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz - -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs - -rm -f */*lose */*.s */*.s[0-9] */*.i - # Get rid of every file that's generated from some other file, except for `configure'. # Most of these files ARE PRESENT in the GCC distribution. maintainer-clean: @@ -2861,21 +2857,12 @@ install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ # Handle cpp installation. install-cpp: cpp$(exeext) - -if [ -f gcc-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \ - if [ x$(cpp_install_dir) != x ]; then \ - rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ - else true; fi; \ - else \ - rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ - if [ x$(cpp_install_dir) != x ]; then \ - rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ - else true; fi; \ - fi + -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) + -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) + -if [ x$(cpp_install_dir) != x ]; then \ + rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ + else true; fi # Create the installation directories. # $(libdir)/gcc/include isn't currently searched by cpp. @@ -2918,22 +2905,14 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs chmod a-x $(DESTDIR)$(libsubdir)/specs; \ fi # Install protoize if it was compiled. - -if [ -f protoize$(exeext) ]; \ - then \ - if [ -f gcc-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ - else \ - rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ - fi ; \ - rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ - $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ - chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ + -if [ -f protoize$(exeext) ]; then \ + rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ + rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ + rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ + $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ + chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \ fi # Install gcov if it was compiled. -if [ -f gcov$(exeext) ]; \ @@ -2947,22 +2926,17 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs # $(target_noncanonical)-gcc-$(version) # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc. install-driver: installdirs xgcc$(exeext) + -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) + -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) + -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version) + -( cd $(DESTDIR)$(bindir) && \ + $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ) -if [ -f gcc-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \ - ( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GCC_CROSS_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \ if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \ rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \ $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \ else true; fi; \ else \ - rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \ - ( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \ rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \ ( cd $(DESTDIR)$(bindir) && \ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \ @@ -2976,6 +2950,7 @@ install-info:: doc installdirs \ $(DESTDIR)$(infodir)/cpp.info \ $(DESTDIR)$(infodir)/gcc.info \ $(DESTDIR)$(infodir)/cppinternals.info \ + $(DESTDIR)$(infodir)/gccinstall.info \ $(DESTDIR)$(infodir)/gccint.info $(DESTDIR)$(infodir)/%.info: $(docobjdir)/%.info installdirs @@ -2990,22 +2965,16 @@ $(DESTDIR)$(infodir)/%.info: $(docobjdir)/%.info installdirs -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ if [ -f $(DESTDIR)$(infodir)/dir ] ; then \ if [ -f $@ ]; then \ - install-info --dir-file=$(DESTDIR)$(infodir)/dir $@ \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \ else true; fi; \ else true; fi; \ else true; fi; # Install the man pages. install-man: installdirs $(GENERATED_MANPAGES) lang.install-man - -if [ -f gcc-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \ - else \ - rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \ - fi + -rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) + -$(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) + -chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) -rm -f $(DESTDIR)$(man1dir)/cpp$(man1ext) -$(INSTALL_DATA) $(docobjdir)/cpp.1 $(DESTDIR)$(man1dir)/cpp$(man1ext) -chmod a-x $(DESTDIR)$(man1dir)/cpp$(man1ext) @@ -3136,20 +3105,14 @@ uninstall: lang.uninstall -rm -rf $(DESTDIR)$(libsubdir) -rm -rf $(DESTDIR)$(libexecsubdir) -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext) -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) - -rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext) -if [ x$(cpp_install_dir) != x ]; then \ rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ - rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ else true; fi -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext) -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext) -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext) -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) - -rm -rf $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/protoize$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/unprotoize$(man1ext) @@ -3224,10 +3187,6 @@ site.exp: ./config.status Makefile CHECK_TARGETS = check-gcc @check_languages@ -check-c++ : check-g++ -check-f77 : check-g77 -check-java : - check: $(CHECK_TARGETS) # The idea is to parallelize testing of multilibs, for example: @@ -3235,7 +3194,8 @@ check: $(CHECK_TARGETS) # will run 3 concurrent sessions of check-gcc, eventually testing # all 10 combinations. GNU make is required, as is a shell that expands # alternations within braces. -check-gcc//% check-g++//% check-g77//% check-objc//%: site.exp +lang_checks_parallel = $(lang_checks:=//%) +$(lang_checks_parallel): site.exp target=`echo "$@" | sed 's,//.*,,'`; \ variant=`echo "$@" | sed 's,^[^/]*//,,'`; \ vardots=`echo "$$variant" | sed 's,/,.,g'`; \ @@ -3250,7 +3210,7 @@ $(TESTSUITEDIR)/site.exp: site.exp -rm -f $@ sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@ -check-g++ check-gcc check-g77 check-objc: check-% : $(TESTSUITEDIR)/site.exp +$(lang_checks): check-% : $(TESTSUITEDIR)/site.exp -(rootme=`${PWD_COMMAND}`; export rootme; \ srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \ cd $(TESTSUITEDIR); \ @@ -3335,18 +3295,19 @@ paranoia: paranoia.o real.o $(LIBIBERTY) # Update the tags table. TAGS: lang.tags - (cd $(srcdir); \ - incs= ; \ - list='$(SUBDIRS)'; for dir in $$list; do \ - if test -f $$dir/TAGS; then \ - incs="$$incs --include $$dir/TAGS"; \ - fi; \ - done; \ - mkdir tmp-tags; \ - mv -f c-parse.[ch] tmp-tags; \ - etags *.y *.h *.c $$incs; \ - mv tmp-tags/* .; \ - rmdir tmp-tags) + (cd $(srcdir); \ + incs= ; \ + list='$(SUBDIRS)'; for dir in $$list; do \ + if test -f $$dir/TAGS; then \ + incs="$$incs --include $$dir/TAGS.sub"; \ + fi; \ + done; \ + mkdir tmp-tags; \ + mv -f c-parse.[ch] tmp-tags; \ + etags -o TAGS.sub *.y *.h *.c; \ + mv tmp-tags/* .; \ + rmdir tmp-tags; \ + etags --include TAGS.sub $$incs) # ------------------------------------------------------ # Bootstrap-related targets (not used during 'make all') @@ -3360,7 +3321,7 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*` # the context of the stage_x rule. POSTSTAGE1_FLAGS_TO_PASS = \ - ADAC="\$$(CC)" \ + ADAFLAGS="$(BOOT_ADAFLAGS)" \ CFLAGS="$(BOOT_CFLAGS)" \ LDFLAGS="$(BOOT_LDFLAGS)" \ WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \ @@ -3589,25 +3550,7 @@ fastcompare fastcompare3 fastcompare4 fastcompare-lean fastcompare3-lean fastcom gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force -rm -f .bad_compare case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ - for file in *$(objext); do \ - case "$@" in \ - slowcompare* ) \ - tail +16c ./$$file > tmp-foo1; \ - tail +16c stage$$stage/$$file > tmp-foo2 \ - && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ - ;; \ - fastcompare* ) \ - cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ - ;; \ - gnucompare* ) \ - cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ - ;; \ - esac ; \ - done - case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ - for dir in tmp-foo $(SUBDIRS); do \ + for dir in . $(SUBDIRS); do \ if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ for file in $$dir/*$(objext); do \ case "$@" in \ diff --git a/gcc/README.Portability b/gcc/README.Portability index d50947a4349..2724f2a53fd 100644 --- a/gcc/README.Portability +++ b/gcc/README.Portability @@ -14,18 +14,15 @@ I'm going to start from a base of the ISO C89 standard, since that is probably what most people code to naturally. Obviously using constructs introduced after that is not a good idea. -The first section of this file deals strictly with portability issues, -the second with common coding pitfalls, and the third with obsolete -K+R portability issues. +For the complete coding style conventions used in GCC, please read +http://gcc.gnu.org/codingconventions.html - Portability Issues - ================== - String literals --------------- -Some SGI compilers choke on the parentheses in:- +Irix6 "cc -n32" and OSF4 "cc" have problems with constant string +initializers with parens around it, e.g. const char string[] = ("A string"); @@ -176,7 +173,7 @@ WITH UMLAUT. Other common pitfalls --------------------- -o Expecting 'plain' char to be either sign or unsigned extending +o Expecting 'plain' char to be either sign or unsigned extending. o Shifting an item by a negative amount or by greater than or equal to the number of bits in a type (expecting shifts by 32 to be sensible @@ -198,204 +195,3 @@ o Passing incorrect types to fprintf and friends. o Adding a function declaration for a module declared in another file to a .c file instead of to a .h file. - - K+R Portability Issues - ====================== - -Unary + -------- - -K+R C compilers and preprocessors have no notion of unary '+'. Thus -the following code snippet contained 2 portability problems. - -int x = +2; /* int x = 2; */ -#if +1 /* #if 1 */ -#endif - - -Pointers to void ----------------- - -K+R C compilers did not have a void pointer, and used char * as the -pointer to anything. The macro PTR is defined as either void * or -char * depending on whether you have a standards compliant compiler or -a K+R one. Thus - - free ((void *) h->value.expansion); - -should have been written - - free ((PTR) h->value.expansion); - -Further, an initial investigation indicates that pointers to functions -returning void were okay. Thus the example given by "Calling -functions through pointers to functions" below appeared not to cause a -problem. - - -String literals ---------------- - -K+R C did not allow concatenation of string literals like - - "This is a " "single string literal". - - -signed keyword --------------- - -The signed keyword did not exist in K+R compilers; it was introduced -in ISO C89, so you could not use it. In both K+R and standard C, -unqualified char and bitfields may be signed or unsigned. There is no -way to portably declare signed chars or signed bitfields. - -All other arithmetic types are signed unless you use the 'unsigned' -qualifier. For instance, it was safe to write - - short paramc; - -instead of - - signed short paramc; - -If you have an algorithm that depends on signed char or signed -bitfields, you had to find another way to write it before it could be -integrated into GCC. - - -Function prototypes -------------------- - -You need to provide a function prototype for every function before you -use it, and functions had to be defined K+R style. The function -prototype should have used the PARAMS macro, which takes a single -argument. Therefore the parameter list had to be enclosed in -parentheses. For example, - -int myfunc PARAMS ((double, int *)); - -int -myfunc (var1, var2) - double var1; - int *var2; -{ - ... -} - -This implies that if the function takes no arguments, it had to be -declared and defined as follows: - -int myfunc PARAMS ((void)); - -int -myfunc () -{ - ... -} - -You also had to use PARAMS when referring to function protypes in -other circumstances, for example see "Calling functions through -pointers to functions" below. - -Variable-argument functions are best described by example:- - -void cpp_ice PARAMS ((cpp_reader *, const char *msgid, ...)); - -void -cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...)) -{ - VA_OPEN (ap, msgid); - VA_FIXEDARG (ap, cpp_reader *, pfile); - VA_FIXEDARG (ap, const char *, msgid); - - ... - VA_CLOSE (ap); -} - -See ansidecl.h for the definitions of the above macros and more. - -One aspect of using K+R style function declarations, is you could not -have arguments whose types are char, short, or float, since without -prototypes (ie, K+R rules), these types are promoted to int, int, and -double respectively. - -Calling functions through pointers to functions ------------------------------------------------ - -K+R C compilers require parentheses around the dereferenced function -pointer expression in the call, whereas ISO C relaxes the syntax. For -example - -typedef void (* cl_directive_handler) PARAMS ((cpp_reader *, const char *)); - *p->handler (pfile, p->arg); - -had to become - - (*p->handler) (pfile, p->arg); - - -Macros ------- - -The rules under K+R C and ISO C for achieving stringification and -token pasting are quite different. Therefore some macros have been -defined which will get it right depending upon the compiler. - - CONCAT2(a,b) CONCAT3(a,b,c) and CONCAT4(a,b,c,d) - -will paste the tokens passed as arguments. You must not leave any -space around the commas. Also, - - STRINGX(x) - -will stringify an argument; to get the same result on K+R and ISO -compilers x should not have spaces around it. - - -Passing structures by value ---------------------------- - -You had to avoid passing structures by value, either to or from -functions. It seems some K+R compilers handle this differently or not -at all. - - -Enums ------ - -In K+R C, you had to cast enum types to use them as integers, and some -compilers in particular give lots of warnings for using an enum as an -array index. - - -Bitfields ---------- - -See also "signed keyword" above. In K+R C only unsigned int bitfields -were defined (i.e. unsigned char, unsigned short, unsigned long. -Using plain int/short/long was not allowed). - - -Reserved Keywords ------------------ - -K+R C has "entry" as a reserved keyword, so you had to not use it for -your variable names. - - -Type promotions ---------------- - -K+R used unsigned-preserving rules for arithmetic expresssions, while -ISO uses value-preserving. This means an unsigned char compared to an -int is done as an unsigned comparison in K+R (since unsigned char -promotes to unsigned) while it is signed in ISO (since all of the -values in unsigned char fit in an int, it promotes to int). - - -Suffixes on Integer Constants ------------------------------ - -K+R C did not accept a 'u' suffix on integer constants. If you wanted -to declare a constant to be be unsigned, you had to use an explicit -cast. diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index ca7fa5c608d..788db372e19 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -318,46 +318,33 @@ AC_SUBST(INSTALL_DATA)dnl dnl Test for GNAT. dnl We require the gnatbind program, and a compiler driver that -dnl understands Ada. The user may set the driver name explicitly -dnl with ADAC; also, the user's CC setting is tried. Failing that, -dnl we try gcc and cc, then a sampling of names known to be used for -dnl the Ada driver on various systems. +dnl understands Ada. We use the user's CC setting, already found. dnl dnl Sets the shell variable have_gnat to yes or no as appropriate, and -dnl substitutes GNATBIND and ADAC. +dnl substitutes GNATBIND. AC_DEFUN([gcc_AC_PROG_GNAT], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) +AC_REQUIRE([AC_PROG_CC]) AC_CHECK_TOOL(GNATBIND, gnatbind, no) -AC_CACHE_CHECK([for compiler driver that understands Ada], - gcc_cv_prog_adac, +AC_CACHE_CHECK([whether compiler driver understands Ada], + gcc_cv_cc_supports_ada, [cat >conftest.adb <&1 || echo failure` - if test x"$errors" = x; then - gcc_cv_prog_adac=$cand - break - fi -done +gcc_cv_cc_supports_ada=no +# There is a bug in old released versions of GCC which causes the +# driver to exit successfully when the appropriate language module +# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1. +# Therefore we must check for the error message as well as an +# unsuccessful exit. +errors=`(${CC} -c conftest.adb) 2>&1 || echo failure` +if test x"$errors" = x; then + gcc_cv_cc_supports_ada=yes + break +fi rm -f conftest.*]) -ADAC=$gcc_cv_prog_adac -AC_SUBST(ADAC) -if test x$GNATBIND != xno && test x$ADAC != xno; then +if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then have_gnat=yes else have_gnat=no @@ -424,7 +411,7 @@ else # read() to the same fd. The only system known to have a problem here # is VMS, where text files have record structure. case "$host_os" in - vms*) + vms* | ultrix*) gcc_cv_func_mmap_file=no ;; *) gcc_cv_func_mmap_file=yes;; @@ -620,6 +607,8 @@ AC_DEFUN([AM_ICONV], done ]) + AC_CHECK_HEADERS([iconv.h]) + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no diff --git a/gcc/ada/.cvsignore b/gcc/ada/.cvsignore deleted file mode 100644 index 2ff143dfe88..00000000000 --- a/gcc/ada/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -gnat_ug_unx.info* -gnat_ug_vms.info* -gnat_ug_vxw.info* -gnat_ug_wnt.info* -gnat_rm.info* -gnat-style.info* diff --git a/gcc/ada/35soccon.ads b/gcc/ada/35soccon.ads new file mode 100644 index 00000000000..cd19222e1a7 --- /dev/null +++ b/gcc/ada/35soccon.ads @@ -0,0 +1,158 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- G N A T . S O C K E T S . C O N S T A N T S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2000-2003 Free Software Foundation, Inc. -- +-- -- +-- GNAT is 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 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides target dependent definitions of constant for use +-- by the GNAT.Sockets package (g-socket.ads). This package should not be +-- directly with'ed by an applications program. + +-- This is the version for i386 FreeBSD + +package GNAT.Sockets.Constants is + + -------------- + -- Families -- + -------------- + + AF_INET : constant := 2; -- IPv4 address family + AF_INET6 : constant := 28; -- IPv6 address family + + ----------- + -- Modes -- + ----------- + + SOCK_STREAM : constant := 1; -- Stream socket + SOCK_DGRAM : constant := 2; -- Datagram socket + + ------------------- + -- Socket errors -- + ------------------- + + EACCES : constant := 13; -- Permission denied + EADDRINUSE : constant := 48; -- Address already in use + EADDRNOTAVAIL : constant := 49; -- Cannot assign address + EAFNOSUPPORT : constant := 47; -- Addr family not supported + EALREADY : constant := 37; -- Operation in progress + EBADF : constant := 9; -- Bad file descriptor + ECONNABORTED : constant := 53; -- Connection aborted + ECONNREFUSED : constant := 61; -- Connection refused + ECONNRESET : constant := 54; -- Connection reset by peer + EDESTADDRREQ : constant := 39; -- Destination addr required + EFAULT : constant := 14; -- Bad address + EHOSTDOWN : constant := 64; -- Host is down + EHOSTUNREACH : constant := 65; -- No route to host + EINPROGRESS : constant := 36; -- Operation now in progress + EINTR : constant := 4; -- Interrupted system call + EINVAL : constant := 22; -- Invalid argument + EIO : constant := 5; -- Input output error + EISCONN : constant := 56; -- Socket already connected + ELOOP : constant := 62; -- Too many symbolic lynks + EMFILE : constant := 24; -- Too many open files + EMSGSIZE : constant := 40; -- Message too long + ENAMETOOLONG : constant := 63; -- Name too long + ENETDOWN : constant := 50; -- Network is down + ENETRESET : constant := 52; -- Disconn. on network reset + ENETUNREACH : constant := 51; -- Network is unreachable + ENOBUFS : constant := 55; -- No buffer space available + ENOPROTOOPT : constant := 42; -- Protocol not available + ENOTCONN : constant := 57; -- Socket not connected + ENOTSOCK : constant := 38; -- Operation on non socket + EOPNOTSUPP : constant := 45; -- Operation not supported + EPFNOSUPPORT : constant := 46; -- Unknown protocol family + EPROTONOSUPPORT : constant := 43; -- Unknown protocol + EPROTOTYPE : constant := 41; -- Unknown protocol type + ESHUTDOWN : constant := 58; -- Cannot send once shutdown + ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported + ETIMEDOUT : constant := 60; -- Connection timed out + ETOOMANYREFS : constant := 59; -- Too many references + EWOULDBLOCK : constant := 35; -- Operation would block + + ----------------- + -- Host errors -- + ----------------- + + HOST_NOT_FOUND : constant := 1; -- Unknown host + TRY_AGAIN : constant := 2; -- Host name lookup failure + NO_DATA : constant := 4; -- No data record for name + NO_RECOVERY : constant := 3; -- Non recoverable errors + + ------------------- + -- Control flags -- + ------------------- + + FIONBIO : constant := -2147195266; -- Set/clear non-blocking io + FIONREAD : constant := 1074030207; -- How many bytes to read + + -------------------- + -- Shutdown modes -- + -------------------- + + SHUT_RD : constant := 0; -- No more recv + SHUT_WR : constant := 1; -- No more send + SHUT_RDWR : constant := 2; -- No more recv/send + + --------------------- + -- Protocol levels -- + --------------------- + + SOL_SOCKET : constant := 65535; -- Options for socket level + IPPROTO_IP : constant := 0; -- Dummy protocol for IP + IPPROTO_UDP : constant := 17; -- UDP + IPPROTO_TCP : constant := 6; -- TCP + + ------------------- + -- Request flags -- + ------------------- + + MSG_OOB : constant := 1; -- Process out-of-band data + MSG_PEEK : constant := 2; -- Peek at incoming data + MSG_EOR : constant := 8; -- Send end of record + MSG_WAITALL : constant := 64; -- Wait for full reception + + -------------------- + -- Socket options -- + -------------------- + + TCP_NODELAY : constant := 1; -- Do not coalesce packets + SO_SNDBUF : constant := 4097; -- Set/get send buffer size + SO_RCVBUF : constant := 4098; -- Set/get recv buffer size + SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs + SO_LINGER : constant := 128; -- Defer close to flush data + SO_ERROR : constant := 4103; -- Get/clear error status + SO_BROADCAST : constant := 32; -- Can send broadcast msgs + IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group + IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL + IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback + +end GNAT.Sockets.Constants; diff --git a/gcc/ada/3ssoliop.ads b/gcc/ada/3ssoliop.ads index 18b7abb7e63..82ac94ff280 100644 --- a/gcc/ada/3ssoliop.ads +++ b/gcc/ada/3ssoliop.ads @@ -34,7 +34,7 @@ -- This package is used to provide target specific linker_options for the -- support of scokets as required by the package GNAT.Sockets. --- This is the UnixWare version of this package +-- This is the Solaris version of this package package GNAT.Sockets.Linker_Options is private diff --git a/gcc/ada/3vtrasym.adb b/gcc/ada/3vtrasym.adb index 26382c11130..85f541d018b 100644 --- a/gcc/ada/3vtrasym.adb +++ b/gcc/ada/3vtrasym.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2003 Ada Core Technologies, Inc. -- +-- Copyright (C) 1999-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -26,7 +26,8 @@ -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- --- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ @@ -34,7 +35,6 @@ with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback; with Interfaces.C; -with Interfaces.C.Strings; with System; with System.Aux_DEC; with System.Soft_Links; @@ -45,133 +45,230 @@ package body GNAT.Traceback.Symbolic is pragma Warnings (Off); pragma Linker_Options ("--for-linker=sys$library:trace.exe"); - use Interfaces.C.Strings; + use Interfaces.C; use System; use System.Aux_DEC; use System.Traceback_Entries; - type Dscdef1_Type is record - Maxstrlen : Unsigned_Word; - Dtype : Unsigned_Byte; - Class : Unsigned_Byte; - Pointer : chars_ptr; + subtype User_Arg_Type is Unsigned_Longword; + subtype Cond_Value_Type is Unsigned_Longword; + + type ASCIC is record + Count : unsigned_char; + Data : char_array (1 .. 255); end record; + pragma Convention (C, ASCIC); - for Dscdef1_Type use record - Maxstrlen at 0 range 0 .. 15; - Dtype at 2 range 0 .. 7; - Class at 3 range 0 .. 7; - Pointer at 4 range 0 .. 31; + for ASCIC use record + Count at 0 range 0 .. 7; + Data at 1 range 0 .. 8 * 255 - 1; end record; - for Dscdef1_Type'Size use 64; + for ASCIC'Size use 8 * 256; + + function Fetch_ASCIC is new Fetch_From_Address (ASCIC); + + procedure Symbolize + (Status : out Cond_Value_Type; + Current_PC : in Address; + Adjusted_PC : in Address; + Current_FP : in Address; + Current_R26 : in Address; + Image_Name : out Address; + Module_Name : out Address; + Routine_Name : out Address; + Line_Number : out Integer; + Relative_PC : out Address; + Absolute_PC : out Address; + PC_Is_Valid : out Long_Integer; + User_Act_Proc : Address := Address'Null_Parameter; + User_Arg_Value : User_Arg_Type := User_Arg_Type'Null_Parameter); + + pragma Interface (External, Symbolize); + + pragma Import_Valued_Procedure + (Symbolize, "TBK$SYMBOLIZE", + (Cond_Value_Type, Address, Address, Address, Address, + Address, Address, Address, Integer, + Address, Address, Long_Integer, + Address, User_Arg_Type), + (Value, Value, Value, Value, Value, + Reference, Reference, Reference, Reference, + Reference, Reference, Reference, + Value, Value), + User_Act_Proc); + + function Decode_Ada_Name (Encoded_Name : String) return String; + -- Decodes an Ada identifier name. Removes leading "_ada_" and trailing + -- __{DIGIT}+ or ${DIGIT}+, converts other "__" to '.' - Image_Buf : String (1 .. 10240); - Image_Len : Integer; - Image_Need_Hdr : Boolean := True; - Image_Do_Another_Line : Boolean; - Image_Xtra_Msg : Boolean; + --------------------- + -- Decode_Ada_Name -- + --------------------- - procedure Traceback_Image (Out_Desc : access Dscdef1_Type); + function Decode_Ada_Name (Encoded_Name : String) return String is + Decoded_Name : String (1 .. Encoded_Name'Length); + Pos : Integer := Encoded_Name'First; + Last : Integer := Encoded_Name'Last; + DPos : Integer := 1; - procedure Traceback_Image (Out_Desc : access Dscdef1_Type) is - Image : String (1 .. Integer (Out_Desc.Maxstrlen)); begin - Image := Value (Out_Desc.Pointer, - Interfaces.C.size_t (Out_Desc.Maxstrlen)); + if Pos > Last then + return ""; + end if; + + -- Skip leading _ada_ - if Image_Do_Another_Line and then - (Image_Need_Hdr or else - Image (Image'First .. Image'First + 27) /= - " image module routine") + if Encoded_Name'Length > 4 + and then Encoded_Name (Pos .. Pos + 4) = "_ada_" then - declare - First : Integer := Image_Len + 1; - Last : Integer := First + Image'Length - 1; - begin - Image_Buf (First .. Last + 1) := Image & ASCII.LF; - Image_Len := Last + 1; - end; - - Image_Need_Hdr := False; - - if Image (Image'First .. Image'First + 3) = "----" then - if Image_Xtra_Msg = False then - Image_Xtra_Msg := True; - else - Image_Xtra_Msg := False; - end if; - end if; + Pos := Pos + 5; + end if; - if Out_Desc.Maxstrlen = 79 and then not Image_Xtra_Msg then - Image_Len := Image_Len - 1; - Image_Do_Another_Line := False; - end if; + -- Skip trailing __{DIGIT}+ or ${DIGIT}+ + + if Encoded_Name (Last) in '0' .. '9' then + for J in reverse Pos + 2 .. Last - 1 loop + case Encoded_Name (J) is + when '0' .. '9' => + null; + when '$' => + Last := J - 1; + exit; + when '_' => + if Encoded_Name (J - 1) = '_' then + Last := J - 2; + end if; + exit; + when others => + exit; + end case; + end loop; end if; - end Traceback_Image; - subtype User_Arg_Type is Unsigned_Longword; - subtype Cond_Value_Type is Unsigned_Longword; + -- Now just copy encoded name to decoded name, converting "__" to '.' - procedure Show_Traceback - (Status : out Cond_Value_Type; - Faulting_FP : Address; - Faulting_SP : Address; - Faulting_PC : Address; - Detail_Level : Integer := Integer'Null_Parameter; - User_Act_Proc : Address := Address'Null_Parameter; - User_Arg_Value : User_Arg_Type := User_Arg_Type'Null_Parameter; - Exceptionn : Unsigned_Longword := Unsigned_Longword'Null_Parameter); + while Pos <= Last loop + if Encoded_Name (Pos) = '_' and then Encoded_Name (Pos + 1) = '_' + and then Pos /= Encoded_Name'First + then + Decoded_Name (DPos) := '.'; + Pos := Pos + 2; - pragma Interface (External, Show_Traceback); + else + Decoded_Name (DPos) := Encoded_Name (Pos); + Pos := Pos + 1; + end if; - pragma Import_Valued_Procedure - (Show_Traceback, "TBK$SHOW_TRACEBACK", - (Cond_Value_Type, Address, Address, Address, Integer, Address, - User_Arg_Type, Unsigned_Longword), - (Value, Value, Value, Value, Reference, Value, Value, Reference), - Detail_Level); + DPos := DPos + 1; + end loop; + return Decoded_Name (1 .. DPos - 1); + end Decode_Ada_Name; ------------------------ -- Symbolic_Traceback -- ------------------------ function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is - Res : String (1 .. 256 * Traceback'Length); - Len : Integer; - Status : Cond_Value_Type; + Status : Cond_Value_Type; + Image_Name : ASCIC; + Image_Name_Addr : Address; + Module_Name : ASCIC; + Module_Name_Addr : Address; + Routine_Name : ASCIC; + Routine_Name_Addr : Address; + Line_Number : Integer; + Relative_PC : Address; + Absolute_PC : Address; + PC_Is_Valid : Long_Integer; + Return_Address : Address; + Res : String (1 .. 256 * Traceback'Length); + Len : Integer; begin if Traceback'Length > 0 then - Len := 0; -- Since image computation is not thread-safe we need task lockout + System.Soft_Links.Lock_Task.all; - for I in Traceback'Range loop - Image_Len := 0; - Image_Do_Another_Line := True; - Image_Xtra_Msg := False; - Show_Traceback + for J in Traceback'Range loop + if J = Traceback'Last then + Return_Address := Address_Zero; + else + Return_Address := PC_For (Traceback (J + 1)); + end if; + + Symbolize (Status, - FP_For (Traceback (I)), - SP_For (Traceback (I)), - PC_For (Traceback (I)), - 0, - Traceback_Image'Address); + PC_For (Traceback (J)), + PC_For (Traceback (J)), + PV_For (Traceback (J)), + Return_Address, + Image_Name_Addr, + Module_Name_Addr, + Routine_Name_Addr, + Line_Number, + Relative_PC, + Absolute_PC, + PC_Is_Valid); + + Image_Name := Fetch_ASCIC (Image_Name_Addr); + Module_Name := Fetch_ASCIC (Module_Name_Addr); + Routine_Name := Fetch_ASCIC (Routine_Name_Addr); declare First : Integer := Len + 1; - Last : Integer := First + Image_Len - 1; + Last : Integer := First + 80 - 1; + Pos : Integer; + Routine_Name_D : String := Decode_Ada_Name + (To_Ada + (Routine_Name.Data (1 .. size_t (Routine_Name.Count)), + False)); + begin - Res (First .. Last + 1) := Image_Buf & ASCII.LF; - Len := Last + 1; + Res (First .. Last) := (others => ' '); + + Res (First .. First + Integer (Image_Name.Count) - 1) := + To_Ada + (Image_Name.Data (1 .. size_t (Image_Name.Count)), + False); + + Res (First + 10 .. + First + 10 + Integer (Module_Name.Count) - 1) := + To_Ada + (Module_Name.Data (1 .. size_t (Module_Name.Count)), + False); + + Res (First + 30 .. + First + 30 + Routine_Name_D'Length - 1) := + Routine_Name_D; + + -- If routine name doesn't fit 20 characters, output + -- the line number on next line at 50th position + + if Routine_Name_D'Length > 20 then + Pos := First + 30 + Routine_Name_D'Length; + Res (Pos) := ASCII.LF; + Last := Pos + 80; + Res (Pos + 1 .. Last) := (others => ' '); + Pos := Pos + 51; + else + Pos := First + 50; + end if; + + Res (Pos .. Pos + Integer'Image (Line_Number)'Length - 1) := + Integer'Image (Line_Number); + + Res (Last) := ASCII.LF; + Len := Last; end; end loop; - System.Soft_Links.Unlock_Task.all; + System.Soft_Links.Unlock_Task.all; return Res (1 .. Len); + else return ""; end if; diff --git a/gcc/ada/45intnam.ads b/gcc/ada/45intnam.ads new file mode 100644 index 00000000000..eb05daaa912 --- /dev/null +++ b/gcc/ada/45intnam.ads @@ -0,0 +1,136 @@ +------------------------------------------------------------------------------ +-- -- +-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- A D A . I N T E R R U P T S . N A M E S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 1991-2003 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- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL 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 GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the FreeBSD THREADS version of this package + +with System.OS_Interface; +-- used for names of interrupts + +package Ada.Interrupts.Names is + + SIGHUP : constant Interrupt_ID := + System.OS_Interface.SIGHUP; -- hangup + + SIGINT : constant Interrupt_ID := + System.OS_Interface.SIGINT; -- interrupt (rubout) + + SIGQUIT : constant Interrupt_ID := + System.OS_Interface.SIGQUIT; -- quit (ASCD FS) + + SIGILL : constant Interrupt_ID := + System.OS_Interface.SIGILL; -- illegal instruction (not reset) + + SIGTRAP : constant Interrupt_ID := + System.OS_Interface.SIGTRAP; -- trace trap (not reset) + + SIGIOT : constant Interrupt_ID := + System.OS_Interface.SIGIOT; -- IOT instruction + + SIGABRT : constant Interrupt_ID := -- used by abort, + System.OS_Interface.SIGABRT; -- replace SIGIOT in the future + + SIGFPE : constant Interrupt_ID := + System.OS_Interface.SIGFPE; -- floating point exception + + SIGKILL : constant Interrupt_ID := + System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) + + SIGBUS : constant Interrupt_ID := + System.OS_Interface.SIGBUS; -- bus error + + SIGSEGV : constant Interrupt_ID := + System.OS_Interface.SIGSEGV; -- segmentation violation + + SIGPIPE : constant Interrupt_ID := -- write on a pipe with + System.OS_Interface.SIGPIPE; -- no one to read it + + SIGALRM : constant Interrupt_ID := + System.OS_Interface.SIGALRM; -- alarm clock + + SIGTERM : constant Interrupt_ID := + System.OS_Interface.SIGTERM; -- software termination signal from kill + + SIGURG : constant Interrupt_ID := + System.OS_Interface.SIGURG; -- urgent condition on IO channel + + SIGSTOP : constant Interrupt_ID := + System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) + + SIGTSTP : constant Interrupt_ID := + System.OS_Interface.SIGTSTP; -- user stop requested from tty + + SIGCONT : constant Interrupt_ID := + System.OS_Interface.SIGCONT; -- stopped process has been continued + + SIGCHLD : constant Interrupt_ID := + System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD + + SIGCLD : constant Interrupt_ID := + System.OS_Interface.SIGCLD; -- child status change + + SIGTTIN : constant Interrupt_ID := + System.OS_Interface.SIGTTIN; -- background tty read attempted + + SIGTTOU : constant Interrupt_ID := + System.OS_Interface.SIGTTOU; -- background tty write attempted + + SIGIO : constant Interrupt_ID := -- input/output possible, + System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) + + SIGXCPU : constant Interrupt_ID := + System.OS_Interface.SIGXCPU; -- CPU time limit exceeded + + SIGXFSZ : constant Interrupt_ID := + System.OS_Interface.SIGXFSZ; -- filesize limit exceeded + + SIGVTALRM : constant Interrupt_ID := + System.OS_Interface.SIGVTALRM; -- virtual timer expired + + SIGPROF : constant Interrupt_ID := + System.OS_Interface.SIGPROF; -- profiling timer expired + + SIGWINCH : constant Interrupt_ID := + System.OS_Interface.SIGWINCH; -- window size change + + SIGUSR1 : constant Interrupt_ID := + System.OS_Interface.SIGUSR1; -- user defined signal 1 + + SIGUSR2 : constant Interrupt_ID := + System.OS_Interface.SIGUSR2; -- user defined signal 2 + + -- Beware that the mapping of names to signals may be + -- many-to-one. There may be aliases. Also, for all + -- signal names that are not supported on the current system + -- the value of the corresponding constant will be zero. + +end Ada.Interrupts.Names; diff --git a/gcc/ada/52osinte.ads b/gcc/ada/52osinte.ads index ba2e532cc24..b6f30233193 100644 --- a/gcc/ada/52osinte.ads +++ b/gcc/ada/52osinte.ads @@ -153,6 +153,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#80#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/53osinte.ads b/gcc/ada/53osinte.ads index b4934b464c5..6ade0986762 100644 --- a/gcc/ada/53osinte.ads +++ b/gcc/ada/53osinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1999-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2003 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- -- @@ -153,6 +153,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#10#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/54osinte.ads b/gcc/ada/54osinte.ads index 037fd09e829..cced53c4fc6 100644 --- a/gcc/ada/54osinte.ads +++ b/gcc/ada/54osinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2000-2002 Ada Core Technologies, Inc. -- +-- Copyright (C) 2000-2003 Ada Core Technologies, 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- -- @@ -157,6 +157,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#0008#; + SIG_BLOCK : constant := 1; SIG_UNBLOCK : constant := 2; SIG_SETMASK : constant := 3; diff --git a/gcc/ada/55osinte.adb b/gcc/ada/55osinte.adb new file mode 100644 index 00000000000..466a15d2b33 --- /dev/null +++ b/gcc/ada/55osinte.adb @@ -0,0 +1,108 @@ +------------------------------------------------------------------------------ +-- -- +-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . O S _ I N T E R F A C E -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 1991-2003 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- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL 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 GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. It is -- +-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- +-- State University (http://www.gnat.com). -- +-- -- +------------------------------------------------------------------------------ + +-- This is the FreeBSD THREADS version of this package + +with Interfaces.C; use Interfaces.C; + +package body System.OS_Interface is + + function Errno return int is + type int_ptr is access all int; + + function internal_errno return int_ptr; + pragma Import (C, internal_errno, "__error"); + begin + return (internal_errno.all); + end Errno; + + function Get_Stack_Base (thread : pthread_t) return Address is + pragma Unreferenced (thread); + begin + return (0); + end Get_Stack_Base; + + procedure pthread_init is + begin + null; + end pthread_init; + + ----------------- + -- To_Duration -- + ----------------- + + function To_Duration (TS : timespec) return Duration is + begin + return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; + end To_Duration; + + ----------------- + -- To_Timespec -- + ----------------- + + function To_Timespec (D : Duration) return timespec is + S : time_t; + F : Duration; + begin + S := time_t (Long_Long_Integer (D)); + F := D - Duration (S); + + -- If F has negative value due to a round-up, adjust for positive F + -- value. + if F < 0.0 then S := S - 1; F := F + 1.0; end if; + return timespec'(ts_sec => S, + ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); + end To_Timespec; + + + function To_Duration (TV : struct_timeval) return Duration is + begin + return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; + end To_Duration; + + function To_Timeval (D : Duration) return struct_timeval is + S : long; + F : Duration; + begin + S := long (Long_Long_Integer (D)); + F := D - Duration (S); + + -- If F has negative value due to a round-up, adjust for positive F + -- value. + if F < 0.0 then S := S - 1; F := F + 1.0; end if; + return struct_timeval'(tv_sec => S, + tv_usec => long (Long_Long_Integer (F * 10#1#E6))); + end To_Timeval; + +end System.OS_Interface; diff --git a/gcc/ada/55osinte.ads b/gcc/ada/55osinte.ads new file mode 100644 index 00000000000..581870c63f7 --- /dev/null +++ b/gcc/ada/55osinte.ads @@ -0,0 +1,632 @@ +------------------------------------------------------------------------------ +-- -- +-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . O S _ I N T E R F A C E -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 1991-2003 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- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL 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 GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. It is -- +-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- +-- State University (http://www.gnat.com). -- +-- -- +------------------------------------------------------------------------------ + +-- This is the FreeBSD PTHREADS version of this package + +with Interfaces.C; +package System.OS_Interface is + pragma Preelaborate; + + pragma Linker_Options ("-pthread"); + + subtype int is Interfaces.C.int; + subtype short is Interfaces.C.short; + subtype long is Interfaces.C.long; + subtype unsigned is Interfaces.C.unsigned; + subtype unsigned_short is Interfaces.C.unsigned_short; + subtype unsigned_long is Interfaces.C.unsigned_long; + subtype unsigned_char is Interfaces.C.unsigned_char; + subtype plain_char is Interfaces.C.plain_char; + subtype size_t is Interfaces.C.size_t; + + ----------- + -- Errno -- + ----------- + + function Errno return int; + pragma Inline (Errno); + + EAGAIN : constant := 35; + EINTR : constant := 4; + EINVAL : constant := 22; + ENOMEM : constant := 12; + ETIMEDOUT : constant := 60; + + ------------- + -- Signals -- + ------------- + + Max_Interrupt : constant := 31; + type Signal is new int range 0 .. Max_Interrupt; + for Signal'Size use int'Size; + + SIGHUP : constant := 1; -- hangup + SIGINT : constant := 2; -- interrupt (rubout) + SIGQUIT : constant := 3; -- quit (ASCD FS) + SIGILL : constant := 4; -- illegal instruction (not reset) + SIGTRAP : constant := 5; -- trace trap (not reset) + SIGIOT : constant := 6; -- IOT instruction + SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future + SIGEMT : constant := 7; -- EMT instruction + SIGFPE : constant := 8; -- floating point exception + SIGKILL : constant := 9; -- kill (cannot be caught or ignored) + SIGBUS : constant := 10; -- bus error + SIGSEGV : constant := 11; -- segmentation violation + SIGSYS : constant := 12; -- bad argument to system call + SIGPIPE : constant := 13; -- write on a pipe with no one to read it + SIGALRM : constant := 14; -- alarm clock + SIGTERM : constant := 15; -- software termination signal from kill + SIGURG : constant := 16; -- urgent condition on IO channel + SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) + SIGTSTP : constant := 18; -- user stop requested from tty + SIGCONT : constant := 19; -- stopped process has been continued + SIGCLD : constant := 20; -- alias for SIGCHLD + SIGCHLD : constant := 20; -- child status change + SIGTTIN : constant := 21; -- background tty read attempted + SIGTTOU : constant := 22; -- background tty write attempted + SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) + SIGXCPU : constant := 24; -- CPU time limit exceeded + SIGXFSZ : constant := 25; -- filesize limit exceeded + SIGVTALRM : constant := 26; -- virtual timer expired + SIGPROF : constant := 27; -- profiling timer expired + SIGWINCH : constant := 28; -- window size change + SIGINFO : constant := 29; -- information request (NetBSD/FreeBSD) + SIGUSR1 : constant := 30; -- user defined signal 1 + SIGUSR2 : constant := 31; -- user defined signal 2 + + SIGADAABORT : constant := SIGABRT; + -- Change this if you want to use another signal for task abort. + -- SIGTERM might be a good one. + + type Signal_Set is array (Natural range <>) of Signal; + + -- Interrupts that must be unmasked at all times. FreeBSD + -- pthreads will not allow an application to mask out any + -- interrupt needed by the threads library. + Unmasked : constant Signal_Set := + (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); + + -- FreeBSD will uses SIGPROF for timing. Do not allow a + -- handler to attach to this signal. + Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); + + type sigset_t is private; + + function sigaddset + (set : access sigset_t; + sig : Signal) return int; + pragma Import (C, sigaddset, "sigaddset"); + + function sigdelset + (set : access sigset_t; + sig : Signal) return int; + pragma Import (C, sigdelset, "sigdelset"); + + function sigfillset (set : access sigset_t) return int; + pragma Import (C, sigfillset, "sigfillset"); + + function sigismember + (set : access sigset_t; + sig : Signal) return int; + pragma Import (C, sigismember, "sigismember"); + + function sigemptyset (set : access sigset_t) return int; + pragma Import (C, sigemptyset, "sigemptyset"); + + -- sigcontext is architecture dependent, so define it private + type struct_sigcontext is private; + + type old_struct_sigaction is record + sa_handler : System.Address; + sa_mask : sigset_t; + sa_flags : int; + end record; + pragma Convention (C, old_struct_sigaction); + + type new_struct_sigaction is record + sa_handler : System.Address; + sa_flags : int; + sa_mask : sigset_t; + end record; + pragma Convention (C, new_struct_sigaction); + + subtype struct_sigaction is new_struct_sigaction; + type struct_sigaction_ptr is access all struct_sigaction; + + SIG_BLOCK : constant := 1; + SIG_UNBLOCK : constant := 2; + SIG_SETMASK : constant := 3; + + SIG_DFL : constant := 0; + SIG_IGN : constant := 1; + + SA_SIGINFO : constant := 16#0040#; + + function sigaction + (sig : Signal; + act : struct_sigaction_ptr; + oact : struct_sigaction_ptr) return int; + pragma Import (C, sigaction, "sigaction"); + + ---------- + -- Time -- + ---------- + + Time_Slice_Supported : constant Boolean := True; + -- Indicates wether time slicing is supported (i.e SCHED_RR is supported) + + type timespec is private; + + function nanosleep (rqtp, rmtp : access timespec) return int; + pragma Import (C, nanosleep, "nanosleep"); + + type clockid_t is private; + + CLOCK_REALTIME : constant clockid_t; + + function clock_gettime + (clock_id : clockid_t; + tp : access timespec) + return int; + pragma Import (C, clock_gettime, "clock_gettime"); + + function To_Duration (TS : timespec) return Duration; + pragma Inline (To_Duration); + + function To_Timespec (D : Duration) return timespec; + pragma Inline (To_Timespec); + + type struct_timezone is record + tz_minuteswest : int; + tz_dsttime : int; + end record; + pragma Convention (C, struct_timezone); + type struct_timeval is private; + -- This is needed on systems that do not have clock_gettime() + -- but do have gettimeofday(). + + function To_Duration (TV : struct_timeval) return Duration; + pragma Inline (To_Duration); + + function To_Timeval (D : Duration) return struct_timeval; + pragma Inline (To_Timeval); + + function gettimeofday + (tv : access struct_timeval; + tz : System.Address) return int; + pragma Import (C, gettimeofday, "gettimeofday"); + + procedure usleep (useconds : unsigned_long); + pragma Import (C, usleep, "usleep"); + + ------------------------- + -- Priority Scheduling -- + ------------------------- + + SCHED_FIFO : constant := 1; + SCHED_OTHER : constant := 2; + SCHED_RR : constant := 3; + + ------------- + -- Process -- + ------------- + + type pid_t is private; + + Self_PID : constant pid_t; + + function kill (pid : pid_t; sig : Signal) return int; + pragma Import (C, kill, "kill"); + + function getpid return pid_t; + pragma Import (C, getpid, "getpid"); + + --------- + -- LWP -- + --------- + + function lwp_self return System.Address; + -- lwp_self does not exist on this thread library, revert to pthread_self + -- which is the closest approximation (with getpid). This function is + -- needed to share 7staprop.adb across POSIX-like targets. + pragma Import (C, lwp_self, "pthread_self"); + + ------------- + -- Threads -- + ------------- + + type Thread_Body is access + function (arg : System.Address) return System.Address; + + type pthread_t is private; + subtype Thread_Id is pthread_t; + + type pthread_mutex_t is limited private; + type pthread_cond_t is limited private; + type pthread_attr_t is limited private; + type pthread_mutexattr_t is limited private; + type pthread_condattr_t is limited private; + type pthread_key_t is private; + + PTHREAD_CREATE_DETACHED : constant := 1; + PTHREAD_CREATE_JOINABLE : constant := 0; + + ----------- + -- Stack -- + ----------- + + Stack_Base_Available : constant Boolean := False; + -- Indicates wether the stack base is available on this target. + -- This allows us to share s-osinte.adb between all the FSU run time. + -- Note that this value can only be true if pthread_t has a complete + -- definition that corresponds exactly to the C header files. + + function Get_Stack_Base (thread : pthread_t) return Address; + pragma Inline (Get_Stack_Base); + -- returns the stack base of the specified thread. + -- Only call this function when Stack_Base_Available is True. + + function Get_Page_Size return size_t; + function Get_Page_Size return Address; + pragma Import (C, Get_Page_Size, "getpagesize"); + -- returns the size of a page, or 0 if this is not relevant on this + -- target + + PROT_NONE : constant := 0; + PROT_READ : constant := 1; + PROT_WRITE : constant := 2; + PROT_EXEC : constant := 4; + PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; + + PROT_ON : constant := PROT_NONE; + PROT_OFF : constant := PROT_ALL; + + function mprotect + (addr : Address; len : size_t; prot : int) return int; + pragma Import (C, mprotect); + + ----------------------------------------- + -- Nonstandard Thread Initialization -- + ----------------------------------------- + -- FSU_THREADS requires pthread_init, which is nonstandard + -- and this should be invoked during the elaboration of s-taprop.adb + -- + -- FreeBSD does not require this so we provide an empty Ada body. + procedure pthread_init; + + --------------------------- + -- POSIX.1c Section 3 -- + --------------------------- + + function sigwait + (set : access sigset_t; + sig : access Signal) return int; + pragma Import (C, sigwait, "sigwait"); + + function pthread_kill + (thread : pthread_t; + sig : Signal) return int; + pragma Import (C, pthread_kill, "pthread_kill"); + + type sigset_t_ptr is access all sigset_t; + + function pthread_sigmask + (how : int; + set : sigset_t_ptr; + oset : sigset_t_ptr) return int; + pragma Import (C, pthread_sigmask, "pthread_sigmask"); + + ---------------------------- + -- POSIX.1c Section 11 -- + ---------------------------- + + function pthread_mutexattr_init + (attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); + + function pthread_mutexattr_destroy + (attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); + + function pthread_mutex_init + (mutex : access pthread_mutex_t; + attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); + + function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); + + function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); + + function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); + + function pthread_condattr_init + (attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); + + function pthread_condattr_destroy + (attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); + + function pthread_cond_init + (cond : access pthread_cond_t; + attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_cond_init, "pthread_cond_init"); + + function pthread_cond_destroy (cond : access pthread_cond_t) return int; + pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); + + function pthread_cond_signal (cond : access pthread_cond_t) return int; + pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); + + function pthread_cond_wait + (cond : access pthread_cond_t; + mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); + + function pthread_cond_timedwait + (cond : access pthread_cond_t; + mutex : access pthread_mutex_t; + abstime : access timespec) return int; + pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); + + Relative_Timed_Wait : constant Boolean := False; + -- pthread_cond_timedwait requires an absolute delay time + + ---------------------------- + -- POSIX.1c Section 13 -- + ---------------------------- + + PTHREAD_PRIO_NONE : constant := 0; + PTHREAD_PRIO_PROTECT : constant := 2; + PTHREAD_PRIO_INHERIT : constant := 1; + + function pthread_mutexattr_setprotocol + (attr : access pthread_mutexattr_t; + protocol : int) return int; + pragma Import + (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol"); + + function pthread_mutexattr_getprotocol + (attr : access pthread_mutexattr_t; + protocol : access int) return int; + pragma Import + (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol"); + + function pthread_mutexattr_setprioceiling + (attr : access pthread_mutexattr_t; + prioceiling : int) return int; + pragma Import + (C, pthread_mutexattr_setprioceiling, + "pthread_mutexattr_setprioceiling"); + + function pthread_mutexattr_getprioceiling + (attr : access pthread_mutexattr_t; + prioceiling : access int) return int; + pragma Import + (C, pthread_mutexattr_getprioceiling, + "pthread_mutexattr_getprioceiling"); + + type struct_sched_param is record + sched_priority : int; + end record; + pragma Convention (C, struct_sched_param); + + function pthread_getschedparam + (thread : pthread_t; + policy : access int; + param : access struct_sched_param) return int; + pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); + + function pthread_setschedparam + (thread : pthread_t; + policy : int; + param : access struct_sched_param) return int; + pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); + + function pthread_attr_setscope + (attr : access pthread_attr_t; + contentionscope : int) return int; + pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); + + function pthread_attr_getscope + (attr : access pthread_attr_t; + contentionscope : access int) return int; + pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); + + function pthread_attr_setinheritsched + (attr : access pthread_attr_t; + inheritsched : int) return int; + pragma Import + (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); + + function pthread_attr_getinheritsched + (attr : access pthread_attr_t; + inheritsched : access int) return int; + pragma Import + (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); + + function pthread_attr_setschedpolicy + (attr : access pthread_attr_t; + policy : int) return int; + pragma Import (C, pthread_attr_setschedpolicy, + "pthread_attr_setschedpolicy"); + + function pthread_attr_getschedpolicy + (attr : access pthread_attr_t; + policy : access int) return int; + pragma Import (C, pthread_attr_getschedpolicy, + "pthread_attr_getschedpolicy"); + + function pthread_attr_setschedparam + (attr : access pthread_attr_t; + sched_param : int) return int; + pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); + + function pthread_attr_getschedparam + (attr : access pthread_attr_t; + sched_param : access int) return int; + pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); + + function sched_yield return int; + pragma Import (C, sched_yield, "pthread_yield"); + + ----------------------------- + -- P1003.1c - Section 16 -- + ----------------------------- + + function pthread_attr_init (attributes : access pthread_attr_t) return int; + pragma Import (C, pthread_attr_init, "pthread_attr_init"); + + function pthread_attr_destroy + (attributes : access pthread_attr_t) return int; + pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); + + function pthread_attr_setdetachstate + (attr : access pthread_attr_t; + detachstate : int) return int; + pragma Import + (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); + + function pthread_attr_getdetachstate + (attr : access pthread_attr_t; + detachstate : access int) return int; + pragma Import + (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); + + function pthread_attr_getstacksize + (attr : access pthread_attr_t; + stacksize : access size_t) return int; + pragma Import + (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); + + function pthread_attr_setstacksize + (attr : access pthread_attr_t; + stacksize : size_t) return int; + pragma Import + (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); + + function pthread_create + (thread : access pthread_t; + attributes : access pthread_attr_t; + start_routine : Thread_Body; + arg : System.Address) return int; + pragma Import (C, pthread_create, "pthread_create"); + + function pthread_detach (thread : pthread_t) return int; + pragma Import (C, pthread_detach, "pthread_detach"); + + procedure pthread_exit (status : System.Address); + pragma Import (C, pthread_exit, "pthread_exit"); + + function pthread_self return pthread_t; + pragma Import (C, pthread_self, "pthread_self"); + + ---------------------------- + -- POSIX.1c Section 17 -- + ---------------------------- + + function pthread_setspecific + (key : pthread_key_t; + value : System.Address) return int; + pragma Import (C, pthread_setspecific, "pthread_setspecific"); + + function pthread_getspecific (key : pthread_key_t) return System.Address; + pragma Import (C, pthread_getspecific, "pthread_getspecific"); + + type destructor_pointer is access + procedure (arg : System.Address); + + function pthread_key_create + (key : access pthread_key_t; + destructor : destructor_pointer) return int; + pragma Import (C, pthread_key_create, "pthread_key_create"); + + -------------------------------------- + -- Non-portable pthread functions -- + -------------------------------------- + + function pthread_set_name_np + (thread : pthread_t; + name : System.Address) return int; + pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); + +private + + type sigset_t is array (1 .. 4) of unsigned; + + -- In FreeBSD the component sa_handler turns out to + -- be one a union type, and the selector is a macro: + -- #define sa_handler __sigaction_u._handler + -- #define sa_sigaction __sigaction_u._sigaction + + -- Should we add a signal_context type here ? + -- How could it be done independent of the CPU architecture ? + -- sigcontext type is opaque, so it is architecturally neutral. + -- It is always passed as an access type, so define it as an empty record + -- since the contents are not used anywhere. + type struct_sigcontext is null record; + pragma Convention (C, struct_sigcontext); + + type pid_t is new int; + Self_PID : constant pid_t := 0; + + type time_t is new long; + + type timespec is record + ts_sec : time_t; + ts_nsec : long; + end record; + pragma Convention (C, timespec); + + type clockid_t is new int; + CLOCK_REALTIME : constant clockid_t := 0; + + type struct_timeval is record + tv_sec : long; + tv_usec : long; + end record; + pragma Convention (C, struct_timeval); + + type pthread_t is new System.Address; + type pthread_attr_t is new System.Address; + type pthread_mutex_t is new System.Address; + type pthread_mutexattr_t is new System.Address; + type pthread_cond_t is new System.Address; + type pthread_condattr_t is new System.Address; + type pthread_key_t is new int; + +end System.OS_Interface; diff --git a/gcc/ada/55system.ads b/gcc/ada/55system.ads index 65bcc0ebd7f..72c51b0df52 100644 --- a/gcc/ada/55system.ads +++ b/gcc/ada/55system.ads @@ -138,8 +138,8 @@ private Support_Long_Shifts : constant Boolean := True; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := False; - ZCX_By_Default : constant Boolean := False; - GCC_ZCX_Support : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + GCC_ZCX_Support : constant Boolean := True; Front_End_ZCX_Support : constant Boolean := False; -- Obsolete entries, to be removed eventually (bootstrap issues!) diff --git a/gcc/ada/56osinte.ads b/gcc/ada/56osinte.ads index c6bcbeb9ad4..3d7ff038f59 100644 --- a/gcc/ada/56osinte.ads +++ b/gcc/ada/56osinte.ads @@ -167,6 +167,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#80#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/56system.ads b/gcc/ada/56system.ads new file mode 100644 index 00000000000..a7371a2d9a2 --- /dev/null +++ b/gcc/ada/56system.ads @@ -0,0 +1,150 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (FreeBSD/x86 Version) -- +-- -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package System is +pragma Pure (System); +-- Note that we take advantage of the implementation permission to +-- make this unit Pure instead of Preelaborable, see RM 13.7(36) + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := Integer'Last; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 0.000_001; + + -- Storage-related Declarations + + type Address is private; + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 32; + Memory_Size : constant := 2 ** 32; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := Low_Order_First; + + -- Priority-related Declarations (RM D.1) + + Max_Priority : constant Positive := 30; + Max_Interrupt_Priority : constant Positive := 31; + + subtype Any_Priority is Integer range 0 .. 31; + subtype Priority is Any_Priority range 0 .. 30; + subtype Interrupt_Priority is Any_Priority range 31 .. 31; + + Default_Priority : constant Priority := 15; + +private + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + AAMP : constant Boolean := False; + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := False; + Command_Line_Args : constant Boolean := True; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Functions_Return_By_DSP : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + OpenVMS : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := False; + Support_64_Bit_Divides : constant Boolean := True; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; + ZCX_By_Default : constant Boolean := False; + GCC_ZCX_Support : constant Boolean := False; + Front_End_ZCX_Support : constant Boolean := False; + + -- Obsolete entries, to be removed eventually (bootstrap issues!) + + High_Integrity_Mode : constant Boolean := False; + Long_Shifts_Inlined : constant Boolean := True; + +end System; diff --git a/gcc/ada/5aml-tgt.adb b/gcc/ada/5aml-tgt.adb index 60e998e024d..69385b66d37 100644 --- a/gcc/ada/5aml-tgt.adb +++ b/gcc/ada/5aml-tgt.adb @@ -108,6 +108,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -117,6 +118,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Relocatable); diff --git a/gcc/ada/5asystem.ads b/gcc/ada/5asystem.ads index 3e445d90b27..f0067b37f84 100644 --- a/gcc/ada/5asystem.ads +++ b/gcc/ada/5asystem.ads @@ -138,8 +138,8 @@ private Support_Long_Shifts : constant Boolean := True; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := False; - ZCX_By_Default : constant Boolean := False; - GCC_ZCX_Support : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + GCC_ZCX_Support : constant Boolean := True; Front_End_ZCX_Support : constant Boolean := False; -- Obsolete entries, to be removed eventually (bootstrap issues!) diff --git a/gcc/ada/5bml-tgt.adb b/gcc/ada/5bml-tgt.adb index 2f18936c5db..c07d58cb01a 100644 --- a/gcc/ada/5bml-tgt.adb +++ b/gcc/ada/5bml-tgt.adb @@ -35,10 +35,10 @@ with Ada.Text_IO; use Ada.Text_IO; with MLib.Fil; with MLib.Utl; with Namet; use Namet; +with Osint; use Osint; with Opt; with Output; use Output; with Prj.Com; -with Sdefault; package body MLib.Tgt is @@ -120,6 +120,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -129,6 +130,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Lib_Version); pragma Unreferenced (Relocatable); @@ -175,9 +177,9 @@ package body MLib.Tgt is Last : Natural; begin - Open (File, In_File, - Sdefault.Include_Dir_Default_Name.all & - "/s-osinte.ads"); + Open + (File, In_File, + Include_Dir_Default_Prefix & "/s-osinte.ads"); while not End_Of_File (File) loop Get_Line (File, Line, Last); diff --git a/gcc/ada/5bosinte.ads b/gcc/ada/5bosinte.ads index ab144c0f4d6..9d43a19bc93 100644 --- a/gcc/ada/5bosinte.ads +++ b/gcc/ada/5bosinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1997-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2003 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- -- @@ -162,6 +162,7 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#0100#; SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; diff --git a/gcc/ada/5cosinte.ads b/gcc/ada/5cosinte.ads index 86c507e0251..3dfe47d2f24 100644 --- a/gcc/ada/5cosinte.ads +++ b/gcc/ada/5cosinte.ads @@ -162,6 +162,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#0100#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/5gml-tgt.adb b/gcc/ada/5gml-tgt.adb index 027ae8a8684..c5390a685ce 100644 --- a/gcc/ada/5gml-tgt.adb +++ b/gcc/ada/5gml-tgt.adb @@ -103,6 +103,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -112,6 +113,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Relocatable); diff --git a/gcc/ada/5gsystem.ads b/gcc/ada/5gsystem.ads index c18318ca364..2a2c5f4f026 100644 --- a/gcc/ada/5gsystem.ads +++ b/gcc/ada/5gsystem.ads @@ -124,7 +124,7 @@ private Exit_Status_Supported : constant Boolean := True; Fractional_Fixed_Ops : constant Boolean := False; Frontend_Layout : constant Boolean := False; - Functions_Return_By_DSP : constant Boolean := True; + Functions_Return_By_DSP : constant Boolean := False; Machine_Overflows : constant Boolean := False; Machine_Rounds : constant Boolean := True; OpenVMS : constant Boolean := False; diff --git a/gcc/ada/5hml-tgt.adb b/gcc/ada/5hml-tgt.adb index 5398d563990..c790df89bfb 100644 --- a/gcc/ada/5hml-tgt.adb +++ b/gcc/ada/5hml-tgt.adb @@ -102,6 +102,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -111,6 +112,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Relocatable); diff --git a/gcc/ada/5hosinte.ads b/gcc/ada/5hosinte.ads index 1e51907f1af..379f0dc0a20 100644 --- a/gcc/ada/5hosinte.ads +++ b/gcc/ada/5hosinte.ads @@ -164,6 +164,7 @@ package System.OS_Interface is type struct_sigaction_ptr is access all struct_sigaction; SA_RESTART : constant := 16#40#; + SA_SIGINFO : constant := 16#10#; SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; diff --git a/gcc/ada/5iosinte.ads b/gcc/ada/5iosinte.ads index e112c8cdaf5..4dceebfac96 100644 --- a/gcc/ada/5iosinte.ads +++ b/gcc/ada/5iosinte.ads @@ -196,6 +196,8 @@ package System.OS_Interface is end record; type Machine_State_Ptr is access all Machine_State; + SA_SIGINFO : constant := 16#04#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/5lintman.adb b/gcc/ada/5lintman.adb deleted file mode 100644 index 56871f3d9ec..00000000000 --- a/gcc/ada/5lintman.adb +++ /dev/null @@ -1,401 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T -- --- -- --- B o d y -- --- -- --- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2003, Ada Core Technologies -- --- -- --- 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- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL 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 GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the GNU/Linux version of this package - --- This file performs the system-dependent translation between machine --- exceptions and the Ada exceptions, if any, that should be raised when they --- occur. This version works for the x86 running linux. - --- This is a Sun OS (FSU THREADS) version of this package - --- PLEASE DO NOT add any dependences on other packages. ??? why not ??? --- This package is designed to work with or without tasking support. - --- Make a careful study of all signals available under the OS, to see which --- need to be reserved, kept always unmasked, or kept always unmasked. Be on --- the lookout for special signals that may be used by the thread library. - --- The definitions of "reserved" differ slightly between the ARM and POSIX. --- Here is the ARM definition of reserved interrupt: - --- The set of reserved interrupts is implementation defined. A reserved --- interrupt is either an interrupt for which user-defined handlers are not --- supported, or one which already has an attached handler by some other --- implementation-defined means. Program units can be connected to --- non-reserved interrupts. - --- POSIX.5b/.5c specifies further: - --- Signals which the application cannot accept, and for which the application --- cannot modify the signal action or masking, because the signals are --- reserved for use by the Ada language implementation. The reserved signals --- defined by this standard are Signal_Abort, Signal_Alarm, --- Signal_Floating_Point_Error, Signal_Illegal_Instruction, --- Signal_Segmentation_Violation, Signal_Bus_Error. If the implementation --- supports any signals besides those defined by this standard, the --- implementation may also reserve some of those. - --- The signals defined by POSIX.5b/.5c that are not specified as being --- reserved are SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2, --- SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGIO SIGURG, and all --- the real-time signals. - --- Beware of reserving signals that POSIX.5b/.5c require to be available for --- users. POSIX.5b/.5c say: - --- An implementation shall not impose restrictions on the ability of an --- application to send, accept, block, or ignore the signals defined by this --- standard, except as specified in this standard. - --- Here are some other relevant requirements from POSIX.5b/.5c: - --- For the environment task, the initial signal mask is that specified for --- the process... - --- It is anticipated that the paragraph above may be modified by a future --- revision of this standard, to require that the realtime signals always be --- initially masked for a process that is an Ada active partition. - --- For all other tasks, the initial signal mask shall include all the signals --- that are not reserved signals and are not bound to entries of the task. - -with Interfaces.C; --- used for int and other types - -with System.Error_Reporting; --- used for Shutdown - -with System.OS_Interface; --- used for various Constants, Signal and types - -with Ada.Exceptions; --- used for Exception_Id --- Raise_From_Signal_Handler - -with System.Soft_Links; --- used for Get_Machine_State_Addr - -with Unchecked_Conversion; - -package body System.Interrupt_Management is - - use Interfaces.C; - use System.Error_Reporting; - use System.OS_Interface; - - package TSL renames System.Soft_Links; - - type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID; - Exception_Interrupts : constant Interrupt_List := - (SIGFPE, SIGILL, SIGSEGV); - - Unreserve_All_Interrupts : Interfaces.C.int; - pragma Import - (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts"); - - subtype int is Interfaces.C.int; - subtype unsigned_short is Interfaces.C.unsigned_short; - subtype unsigned_long is Interfaces.C.unsigned_long; - - ---------------------- - -- Notify_Exception -- - ---------------------- - - pragma Warnings (Off); - -- Because many unaccessed arguments - - Signal_Mask : aliased sigset_t; - -- The set of signals handled by Notify_Exception - - -- This function identifies the Ada exception to be raised using - -- the information when the system received a synchronous signal. - -- Since this function is machine and OS dependent, different code - -- has to be provided for different target. - - procedure Notify_Exception - (signo : Signal; - gs : unsigned_short; - fs : unsigned_short; - es : unsigned_short; - ds : unsigned_short; - edi : unsigned_long; - esi : unsigned_long; - ebp : unsigned_long; - esp : unsigned_long; - ebx : unsigned_long; - edx : unsigned_long; - ecx : unsigned_long; - eax : unsigned_long; - trapno : unsigned_long; - err : unsigned_long; - eip : unsigned_long; - cs : unsigned_short; - eflags : unsigned_long; - esp_at_signal : unsigned_long; - ss : unsigned_short; - fpstate : System.Address; - oldmask : unsigned_long; - cr2 : unsigned_long); - - procedure Notify_Exception - (signo : Signal; - gs : unsigned_short; - fs : unsigned_short; - es : unsigned_short; - ds : unsigned_short; - edi : unsigned_long; - esi : unsigned_long; - ebp : unsigned_long; - esp : unsigned_long; - ebx : unsigned_long; - edx : unsigned_long; - ecx : unsigned_long; - eax : unsigned_long; - trapno : unsigned_long; - err : unsigned_long; - eip : unsigned_long; - cs : unsigned_short; - eflags : unsigned_long; - esp_at_signal : unsigned_long; - ss : unsigned_short; - fpstate : System.Address; - oldmask : unsigned_long; - cr2 : unsigned_long) - is - pragma Warnings (On); - - function To_Machine_State_Ptr is new - Unchecked_Conversion (Address, Machine_State_Ptr); - - -- These are not directly visible - - procedure Raise_From_Signal_Handler - (E : Ada.Exceptions.Exception_Id; - M : System.Address); - pragma Import - (Ada, Raise_From_Signal_Handler, - "ada__exceptions__raise_from_signal_handler"); - pragma No_Return (Raise_From_Signal_Handler); - - mstate : Machine_State_Ptr; - message : aliased constant String := "" & ASCII.Nul; - -- A null terminated String. - - Result : int; - - begin - - -- Raise_From_Signal_Handler makes sure that the exception is raised - -- safely from this signal handler. - - -- ??? The original signal mask (the one we had before coming into this - -- signal catching function) should be restored by - -- Raise_From_Signal_Handler. For now, restore it explicitely - - Result := pthread_sigmask (SIG_UNBLOCK, Signal_Mask'Access, null); - pragma Assert (Result = 0); - - -- Check that treatment of exception propagation here - -- is consistent with treatment of the abort signal in - -- System.Task_Primitives.Operations. - - mstate := To_Machine_State_Ptr (TSL.Get_Machine_State_Addr.all); - mstate.eip := eip; - mstate.ebx := ebx; - mstate.esp := esp_at_signal; - mstate.ebp := ebp; - mstate.esi := esi; - mstate.edi := edi; - - case signo is - when SIGFPE => - Raise_From_Signal_Handler - (Constraint_Error'Identity, message'Address); - when SIGILL => - Raise_From_Signal_Handler - (Constraint_Error'Identity, message'Address); - when SIGSEGV => - Raise_From_Signal_Handler - (Storage_Error'Identity, message'Address); - when others => - if Shutdown ("Unexpected signal") then - null; - end if; - end case; - end Notify_Exception; - - --------------------------- - -- Initialize_Interrupts -- - --------------------------- - - -- Nothing needs to be done on this platform. - - procedure Initialize_Interrupts is - begin - null; - end Initialize_Interrupts; - -begin - declare - act : aliased struct_sigaction; - old_act : aliased struct_sigaction; - Result : int; - - function State (Int : Interrupt_ID) return Character; - pragma Import (C, State, "__gnat_get_interrupt_state"); - -- Get interrupt state. Defined in a-init.c - -- The input argument is the interrupt number, - -- and the result is one of the following: - - User : constant Character := 'u'; - Runtime : constant Character := 'r'; - Default : constant Character := 's'; - -- 'n' this interrupt not set by any Interrupt_State pragma - -- 'u' Interrupt_State pragma set state to User - -- 'r' Interrupt_State pragma set state to Runtime - -- 's' Interrupt_State pragma set state to System (use "default" - -- system handler) - - begin - -- Need to call pthread_init very early because it is doing signal - -- initializations. - - pthread_init; - - Abort_Task_Interrupt := SIGADAABORT; - - act.sa_handler := Notify_Exception'Address; - - act.sa_flags := 0; - - -- On some targets, we set sa_flags to SA_NODEFER so that during the - -- handler execution we do not change the Signal_Mask to be masked for - -- the Signal. - - -- This is a temporary fix to the problem that the Signal_Mask is - -- not restored after the exception (longjmp) from the handler. - -- The right fix should be made in sigsetjmp so that we save - -- the Signal_Set and restore it after a longjmp. - - -- Since SA_NODEFER is obsolete, instead we reset explicitely - -- the mask in the exception handler. - - Result := sigemptyset (Signal_Mask'Access); - pragma Assert (Result = 0); - - -- Add signals that map to Ada exceptions to the mask. - - for J in Exception_Interrupts'Range loop - if State (Exception_Interrupts (J)) /= Default then - Result := - sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J))); - pragma Assert (Result = 0); - end if; - end loop; - - act.sa_mask := Signal_Mask; - - pragma Assert (Keep_Unmasked = (Interrupt_ID'Range => False)); - pragma Assert (Reserve = (Interrupt_ID'Range => False)); - - -- Process state of exception signals - - for J in Exception_Interrupts'Range loop - if State (Exception_Interrupts (J)) /= User then - Keep_Unmasked (Exception_Interrupts (J)) := True; - Reserve (Exception_Interrupts (J)) := True; - - if State (Exception_Interrupts (J)) /= Default then - Result := - sigaction - (Signal (Exception_Interrupts (J)), act'Unchecked_Access, - old_act'Unchecked_Access); - pragma Assert (Result = 0); - end if; - end if; - end loop; - - if State (Abort_Task_Interrupt) /= User then - Keep_Unmasked (Abort_Task_Interrupt) := True; - Reserve (Abort_Task_Interrupt) := True; - end if; - - -- Set SIGINT to unmasked state as long as it's - -- not in "User" state. Check for Unreserve_All_Interrupts last - - if State (SIGINT) /= User then - Keep_Unmasked (SIGINT) := True; - Reserve (SIGINT) := True; - end if; - - -- Check all signals for state that requires keeping them - -- unmasked and reserved - - for J in Interrupt_ID'Range loop - if State (J) = Default or else State (J) = Runtime then - Keep_Unmasked (J) := True; - Reserve (J) := True; - end if; - end loop; - - -- Add the set of signals that must always be unmasked for this target - - for J in Unmasked'Range loop - Keep_Unmasked (Interrupt_ID (Unmasked (J))) := True; - Reserve (Interrupt_ID (Unmasked (J))) := True; - end loop; - - -- Add target-specific reserved signals - - for J in Reserved'Range loop - Reserve (Interrupt_ID (Reserved (J))) := True; - end loop; - - -- Process pragma Unreserve_All_Interrupts. This overrides any - -- settings due to pragma Interrupt_State: - - if Unreserve_All_Interrupts /= 0 then - Keep_Unmasked (SIGINT) := False; - Reserve (SIGINT) := False; - end if; - - -- We do not have Signal 0 in reality. We just use this value - -- to identify non-existent signals (see s-intnam.ads). Therefore, - -- Signal 0 should not be used in all signal related operations hence - -- mark it as reserved. - - Reserve (0) := True; - end; -end System.Interrupt_Management; diff --git a/gcc/ada/5lml-tgt.adb b/gcc/ada/5lml-tgt.adb index ad40c10b0df..b9d4217fe19 100644 --- a/gcc/ada/5lml-tgt.adb +++ b/gcc/ada/5lml-tgt.adb @@ -106,6 +106,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -115,6 +116,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Relocatable); diff --git a/gcc/ada/5losinte.ads b/gcc/ada/5losinte.ads index 498fa62574e..8ca3d616072 100644 --- a/gcc/ada/5losinte.ads +++ b/gcc/ada/5losinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2003 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- -- @@ -162,6 +162,8 @@ package System.OS_Interface is end record; type Machine_State_Ptr is access all Machine_State; + SA_SIGINFO : constant := 16#04#; + SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; diff --git a/gcc/ada/5nsystem.ads b/gcc/ada/5nsystem.ads new file mode 100644 index 00000000000..37a495d8870 --- /dev/null +++ b/gcc/ada/5nsystem.ads @@ -0,0 +1,150 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (GNU-Linux/x86-64 Version) -- +-- -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package System is +pragma Pure (System); +-- Note that we take advantage of the implementation permission to +-- make this unit Pure instead of Preelaborable, see RM 13.7(36) + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := Integer'Last; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 0.000_001; + + -- Storage-related Declarations + + type Address is private; + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 64; + Memory_Size : constant := 2 ** 64; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := Low_Order_First; + + -- Priority-related Declarations (RM D.1) + + Max_Priority : constant Positive := 30; + Max_Interrupt_Priority : constant Positive := 31; + + subtype Any_Priority is Integer range 0 .. 31; + subtype Priority is Any_Priority range 0 .. 30; + subtype Interrupt_Priority is Any_Priority range 31 .. 31; + + Default_Priority : constant Priority := 15; + +private + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + AAMP : constant Boolean := False; + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := False; + Command_Line_Args : constant Boolean := True; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Functions_Return_By_DSP : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + OpenVMS : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := False; + Support_64_Bit_Divides : constant Boolean := True; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + GCC_ZCX_Support : constant Boolean := True; + Front_End_ZCX_Support : constant Boolean := False; + + -- Obsolete entries, to be removed eventually (bootstrap issues!) + + High_Integrity_Mode : constant Boolean := False; + Long_Shifts_Inlined : constant Boolean := True; + +end System; diff --git a/gcc/ada/5posinte.ads b/gcc/ada/5posinte.ads index fa94ad21feb..57f04a82c17 100644 --- a/gcc/ada/5posinte.ads +++ b/gcc/ada/5posinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1997-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2003 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- -- @@ -155,6 +155,10 @@ package System.OS_Interface is SIG_DFL : constant := 0; SIG_IGN : constant := 1; + SA_SIGINFO : constant := 0; + -- Dummy constant for a sa_flags bit. A proper definition is needed only + -- for the GCC/ZCX EH scheme (see System.Interrupt_Management). + function sigaction (sig : Signal; act : struct_sigaction_ptr; diff --git a/gcc/ada/5sml-tgt.adb b/gcc/ada/5sml-tgt.adb index 901e7a68bee..a7bc9333b66 100644 --- a/gcc/ada/5sml-tgt.adb +++ b/gcc/ada/5sml-tgt.adb @@ -100,6 +100,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -109,6 +110,7 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Address); pragma Unreferenced (Relocatable); diff --git a/gcc/ada/5tosinte.ads b/gcc/ada/5tosinte.ads index 14570656b9b..eaaf4e584df 100644 --- a/gcc/ada/5tosinte.ads +++ b/gcc/ada/5tosinte.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1997-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2003, 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- -- @@ -249,6 +249,8 @@ package System.OS_Interface is pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; + SA_SIGINFO : constant := 16#08#; + SIG_BLOCK : constant := 1; SIG_UNBLOCK : constant := 2; SIG_SETMASK : constant := 3; diff --git a/gcc/ada/5vml-tgt.adb b/gcc/ada/5vml-tgt.adb index 3dba336db29..269e8b045e5 100644 --- a/gcc/ada/5vml-tgt.adb +++ b/gcc/ada/5vml-tgt.adb @@ -59,13 +59,9 @@ package body MLib.Tgt is -- Options to use when invoking gcc to build the dynamic library No_Start_Files : aliased String := "-nostartfiles"; - For_Linker_Opt : aliased String := "--for-linker=symvec.opt"; - Gsmatch : aliased String := "--for-linker=gsmatch=equal,1,0"; - VMS_Options : constant Argument_List := - (No_Start_Files'Access, For_Linker_Opt'Access, Gsmatch'Access); - --- Command : String_Access; + VMS_Options : Argument_List := + (No_Start_Files'Access, null); Gnatsym_Name : constant String := "gnatsym"; @@ -134,6 +130,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -143,10 +140,9 @@ package body MLib.Tgt is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Lib_Address); - pragma Unreferenced (Lib_Version); pragma Unreferenced (Relocatable); - Opt_File_Name : constant String := "symvec.opt"; + Lib_File : constant String := Lib_Dir & Directory_Separator & "lib" & @@ -163,6 +159,13 @@ package body MLib.Tgt is -- file name of an interface of the SAL. -- For other libraries, always return True. + function Option_File_Name return String; + -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt" + + function Version_String return String; + -- Returns Lib_Version if not empty, otherwise returns "1". + -- Fails gnatmake if Lib_Version is not the image of a positive number. + ------------------ -- Is_Interface -- ------------------ @@ -192,7 +195,57 @@ package body MLib.Tgt is end if; end Is_Interface; + ---------------------- + -- Option_File_Name -- + ---------------------- + + function Option_File_Name return String is + begin + if Symbol_Data.Symbol_File = No_Name then + return "symvec.opt"; + + else + return Get_Name_String (Symbol_Data.Symbol_File); + end if; + end Option_File_Name; + + -------------------- + -- Version_String -- + -------------------- + + function Version_String return String is + Version : Integer := 0; + begin + if Lib_Version = "" then + return "1"; + + else + begin + Version := Integer'Value (Lib_Version); + + if Version <= 0 then + raise Constraint_Error; + end if; + + return Lib_Version; + + exception + when Constraint_Error => + Fail ("illegal version """, Lib_Version, + """ (on VMS version must be a positive number)"); + return ""; + end; + end if; + end Version_String; + + Opt_File_Name : constant String := Option_File_Name; + For_Linker_Opt : constant String_Access := + new String'("--for-linker=" & Opt_File_Name); + Version : constant String := Version_String; + begin + VMS_Options (VMS_Options'First + 1) := For_Linker_Opt; + for J in Inter'Range loop To_Lower (Inter (J).all); end loop; @@ -288,19 +341,61 @@ package body MLib.Tgt is end; end if; - -- Allocate the argument list and put the symbol file name + -- Allocate the argument list and put the symbol file name, the + -- reference (if any) and the policy (if not autonomous). - Arguments := new Argument_List (1 .. Ofiles'Length + 2); + Arguments := new Argument_List (1 .. Ofiles'Length + 8); - Last_Argument := 1; + Last_Argument := 0; + + -- Verbosity if Verbose_Mode then + Last_Argument := Last_Argument + 1; Arguments (Last_Argument) := new String'("-v"); + end if; + + -- Version number (major ID) + + if Lib_Version /= "" then + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'("-V"); Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'(Version); end if; + -- Symbol file + + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'("-s"); + Last_Argument := Last_Argument + 1; Arguments (Last_Argument) := new String'(Opt_File_Name); + -- Reference Symbol File + + if Symbol_Data.Reference /= No_Name then + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'("-r"); + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := + new String'(Get_Name_String (Symbol_Data.Reference)); + end if; + + -- Policy + + case Symbol_Data.Symbol_Policy is + when Autonomous => + null; + + when Compliant => + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'("-c"); + + when Controlled => + Last_Argument := Last_Argument + 1; + Arguments (Last_Argument) := new String'("-C"); + end case; + -- Add each relevant object file for Index in Ofiles'Range loop diff --git a/gcc/ada/5vsymbol.adb b/gcc/ada/5vsymbol.adb index d505491c86b..c623e42b383 100644 --- a/gcc/ada/5vsymbol.adb +++ b/gcc/ada/5vsymbol.adb @@ -36,10 +36,32 @@ package body Symbols is Symbol_Vector : constant String := "SYMBOL_VECTOR=("; Equal_Data : constant String := "=DATA)"; Equal_Procedure : constant String := "=PROCEDURE)"; + Gsmatch : constant String := "gsmatch=equal,"; Symbol_File_Name : String_Access := null; -- Name of the symbol file + Sym_Policy : Policy := Autonomous; + -- The symbol policy. Set by Initialize + + Major_ID : Integer := 1; + -- The Major ID. May be modified by Initialize if Library_Version is + -- specified or if it is read from the reference symbol file. + + Soft_Major_ID : Boolean := True; + -- False if library version is specified in procedure Initialize. + -- When True, Major_ID may be modified if found in the reference symbol + -- file. + + Minor_ID : Natural := 0; + -- The Minor ID. May be modified if read from the reference symbol file + + Soft_Minor_ID : Boolean := True; + -- False if symbol policy is Autonomous, if library version is specified + -- in procedure Initialize and is not the same as the major ID read from + -- the reference symbol file. When True, Minor_ID may be increased in + -- Compliant symbol policy. + subtype Byte is Character; -- Object files are stream of bytes, but some of these bytes, those for -- the names of the symbols, are ASCII characters. @@ -67,6 +89,9 @@ package body Symbols is Number_Of_Characters : Natural := 0; -- The number of characters of each section + -- The following variables are used by procedure Process when reading an + -- object file. + Code : Number := 0; Length : Natural := 0; @@ -87,6 +112,10 @@ package body Symbols is procedure Get (N : out Natural); -- Read two bytes from the object file, LSByte first, as a Natural + + function Image (N : Integer) return String; + -- Returns the image of N, without the initial space + ----------- -- Equal -- ----------- @@ -121,15 +150,32 @@ package body Symbols is N := Natural (Result); end Get; + ----------- + -- Image -- + ----------- + + function Image (N : Integer) return String is + Result : constant String := N'Img; + begin + if Result (Result'First) = ' ' then + return Result (Result'First + 1 .. Result'Last); + + else + return Result; + end if; + end Image; + ---------------- -- Initialize -- ---------------- procedure Initialize - (Symbol_File : String; - Force : Boolean; - Quiet : Boolean; - Success : out Boolean) + (Symbol_File : String; + Reference : String; + Symbol_Policy : Policy; + Quiet : Boolean; + Version : String; + Success : out Boolean) is File : Ada.Text_IO.File_Type; Line : String (1 .. 1_000); @@ -140,6 +186,40 @@ package body Symbols is Symbol_File_Name := new String'(Symbol_File); + -- Record the policy + + Sym_Policy := Symbol_Policy; + + -- Record the version (Major ID) + + if Version = "" then + Major_ID := 1; + Soft_Major_ID := True; + + else + begin + Major_ID := Integer'Value (Version); + Soft_Major_ID := False; + + if Major_ID <= 0 then + raise Constraint_Error; + end if; + + exception + when Constraint_Error => + if not Quiet then + Put_Line ("Version """ & Version & """ is illegal."); + Put_Line ("On VMS, version must be a positive number"); + end if; + + Success := False; + return; + end; + end if; + + Minor_ID := 0; + Soft_Minor_ID := Sym_Policy /= Autonomous; + -- Empty the symbol tables Symbol_Table.Set_Last (Original_Symbols, 0); @@ -149,11 +229,11 @@ package body Symbols is Success := True; - -- If Force is not set, attempt to read the symbol file + -- If policy is not autonomous, attempt to read the reference file - if not Force then + if Sym_Policy /= Autonomous then begin - Open (File, In_File, Symbol_File); + Open (File, In_File, Reference); exception when Ada.Text_IO.Name_Error => @@ -161,7 +241,7 @@ package body Symbols is when X : others => if not Quiet then - Put_Line ("could not open """ & Symbol_File & """"); + Put_Line ("could not open """ & Reference & """"); Put_Line (Exception_Message (X)); end if; @@ -169,20 +249,31 @@ package body Symbols is return; end; + -- Read line by line + while not End_Of_File (File) loop Get_Line (File, Line, Last); + -- Ignore empty lines + if Last = 0 then null; + -- Ignore lines starting with "case_sensitive=" + elsif Last > Case_Sensitive'Length and then Line (1 .. Case_Sensitive'Length) = Case_Sensitive then null; + -- Line starting with "SYMBOL_VECTOR=(" + elsif Last > Symbol_Vector'Length and then Line (1 .. Symbol_Vector'Length) = Symbol_Vector then + + -- SYMBOL_VECTOR=(=DATA) + if Last > Symbol_Vector'Length + Equal_Data'Length and then Line (Last - Equal_Data'Length + 1 .. Last) = Equal_Data then @@ -195,6 +286,8 @@ package body Symbols is Kind => Data, Present => True); + -- SYMBOL_VECTOR=(=PROCEDURE) + elsif Last > Symbol_Vector'Length + Equal_Procedure'Length and then Line (Last - Equal_Procedure'Length + 1 .. Last) = @@ -209,9 +302,11 @@ package body Symbols is Kind => Proc, Present => True); + -- Anything else is incorrectly formatted + else if not Quiet then - Put_Line ("symbol file """ & Symbol_File & + Put_Line ("symbol file """ & Reference & """ is incorrectly formatted:"); Put_Line ("""" & Line (1 .. Last) & """"); end if; @@ -221,10 +316,95 @@ package body Symbols is return; end if; + -- Lines with "gsmatch=equal,, + + elsif Last > Gsmatch'Length + and then Line (1 .. Gsmatch'Length) = Gsmatch + then + declare + Start : Positive := Gsmatch'Length + 1; + Finish : Positive := Start; + OK : Boolean := True; + ID : Integer; + + begin + loop + if Line (Finish) not in '0' .. '9' + or else Finish >= Last - 1 + then + OK := False; + exit; + end if; + + exit when Line (Finish + 1) = ','; + + Finish := Finish + 1; + end loop; + + if OK then + ID := Integer'Value (Line (Start .. Finish)); + OK := ID /= 0; + + -- If Soft_Major_ID is True, it means that + -- Library_Version was not specified. + + if Soft_Major_ID then + Major_ID := ID; + + -- If the Major ID in the reference file is different + -- from the Library_Version, then the Minor ID will be 0 + -- because there is no point in taking the Minor ID in + -- the reference file, or incrementing it. So, we set + -- Soft_Minor_ID to False, so that we don't modify + -- the Minor_ID later. + + elsif Major_ID /= ID then + Soft_Minor_ID := False; + end if; + + Start := Finish + 2; + Finish := Start; + + loop + if Line (Finish) not in '0' .. '9' then + OK := False; + exit; + end if; + + exit when Finish = Last; + + Finish := Finish + 1; + end loop; + + -- Only set Minor_ID if Soft_Minor_ID is True (see above) + + if OK and then Soft_Minor_ID then + Minor_ID := Integer'Value (Line (Start .. Finish)); + end if; + end if; + + -- If OK is not True, that means the line is not correctly + -- formatted. + + if not OK then + if not Quiet then + Put_Line ("symbol file """ & Reference & + """ is incorrectly formatted"); + Put_Line ("""" & Line (1 .. Last) & """"); + end if; + + Close (File); + Success := False; + return; + end if; + end; + + -- Anything else is incorrectly formatted + else if not Quiet then Put_Line ("unexpected line in symbol file """ & - Symbol_File & """"); + Reference & """"); Put_Line ("""" & Line (1 .. Last) & """"); end if; @@ -247,7 +427,8 @@ package body Symbols is Success : out Boolean) is begin - -- Open the object file. Return with Success = False if this fails. + -- Open the object file with Byte_IO. Return with Success = False if + -- this fails. begin Open (File, In_File, Object_File); @@ -410,8 +591,9 @@ package body Symbols is else - -- First find if the symbols in the symbol file are also in the - -- object files. + -- First find if the symbols in the reference symbol file are also + -- in the object files. Note that this is not done if the policy is + -- Autonomous, because no reference symbol file has been read. -- Expect the first symbol in the symbol file to also be the first -- in Complete_Symbols. @@ -450,13 +632,27 @@ package body Symbols is -- If the symbol is not found, mark it as such in the table if not Found then - if not Quiet then + if (not Quiet) or else Sym_Policy = Controlled then Put_Line ("symbol """ & S_Data.Name.all & """ is no longer present in the object files"); end if; + if Sym_Policy = Controlled then + Success := False; + return; + + elsif Soft_Minor_ID then + Minor_ID := Minor_ID + 1; + Soft_Minor_ID := False; + end if; + Original_Symbols.Table (Index_1).Present := False; Free (Original_Symbols.Table (Index_1).Name); + + if Soft_Minor_ID then + Minor_ID := Minor_ID + 1; + Soft_Minor_ID := False; + end if; end if; end loop; @@ -466,6 +662,18 @@ package body Symbols is S_Data := Complete_Symbols.Table (Index); if S_Data.Present then + + if Sym_Policy = Controlled then + Put_Line ("symbol """ & S_Data.Name.all & + """ is not in the reference symbol file"); + Success := False; + return; + + elsif Soft_Minor_ID then + Minor_ID := Minor_ID + 1; + Soft_Minor_ID := False; + end if; + Symbol_Table.Increment_Last (Original_Symbols); Original_Symbols.Table (Symbol_Table.Last (Original_Symbols)) := S_Data; @@ -501,6 +709,13 @@ package body Symbols is Put (File, Case_Sensitive); Put_Line (File, "NO"); + -- Put the version IDs + + Put (File, Gsmatch); + Put (File, Image (Major_ID)); + Put (File, ','); + Put_Line (File, Image (Minor_ID)); + -- And we are done Close (File); diff --git a/gcc/ada/5vtraent.adb b/gcc/ada/5vtraent.adb index bab8daf7f08..532acad6e32 100644 --- a/gcc/ada/5vtraent.adb +++ b/gcc/ada/5vtraent.adb @@ -47,22 +47,13 @@ package body System.Traceback_Entries is end PC_For; ------------ - -- SP_For -- + -- PV_For -- ------------ - function SP_For (TB_Entry : Traceback_Entry) return System.Address is + function PV_For (TB_Entry : Traceback_Entry) return System.Address is begin - return TB_Entry.SP; - end SP_For; - - ------------ - -- FP_For -- - ------------ - - function FP_For (TB_Entry : Traceback_Entry) return System.Address is - begin - return TB_Entry.FP; - end FP_For; + return TB_Entry.PV; + end PV_For; ------------------ -- TB_Entry_For -- @@ -70,7 +61,7 @@ package body System.Traceback_Entries is function TB_Entry_For (PC : System.Address) return Traceback_Entry is begin - return (PC => PC, SP => System.Null_Address, FP => System.Null_Address); + return (PC => PC, PV => System.Null_Address); end TB_Entry_For; end System.Traceback_Entries; diff --git a/gcc/ada/5vtraent.ads b/gcc/ada/5vtraent.ads index ed71437ea62..0d27c197fff 100644 --- a/gcc/ada/5vtraent.ads +++ b/gcc/ada/5vtraent.ads @@ -35,34 +35,25 @@ -- -- ------------------------------------------------------------------------------ --- This is the Alpha/OpenVMS version of this package. +-- This is the Alpha/OpenVMS version of this package package System.Traceback_Entries is - type Traceback_Entry is private; - - Null_TB_Entry : constant Traceback_Entry; - - function PC_For (TB_Entry : Traceback_Entry) return System.Address; - function SP_For (TB_Entry : Traceback_Entry) return System.Address; - function FP_For (TB_Entry : Traceback_Entry) return System.Address; - - function TB_Entry_For (PC : System.Address) return Traceback_Entry; - -private - type Traceback_Entry is record PC : System.Address; - SP : System.Address; - FP : System.Address; + PV : System.Address; end record; pragma Suppress_Initialization (Traceback_Entry); - Null_TB_Entry : constant Traceback_Entry - := (PC => System.Null_Address, - SP => System.Null_Address, - FP => System.Null_Address); + Null_TB_Entry : constant Traceback_Entry := + (PC => System.Null_Address, + PV => System.Null_Address); + + function PC_For (TB_Entry : Traceback_Entry) return System.Address; + function PV_For (TB_Entry : Traceback_Entry) return System.Address; + + function TB_Entry_For (PC : System.Address) return Traceback_Entry; end System.Traceback_Entries; diff --git a/gcc/ada/5wml-tgt.adb b/gcc/ada/5wml-tgt.adb index ffb3b2acf68..5747ead4cdb 100644 --- a/gcc/ada/5wml-tgt.adb +++ b/gcc/ada/5wml-tgt.adb @@ -91,6 +91,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -99,6 +100,7 @@ package body MLib.Tgt is is pragma Unreferenced (Ofiles); pragma Unreferenced (Interfaces); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Driver_Name); pragma Unreferenced (Lib_Version); pragma Unreferenced (Auto_Init); diff --git a/gcc/ada/5wosinte.ads b/gcc/ada/5wosinte.ads index cf9aee5a35b..8a74f50d14b 100644 --- a/gcc/ada/5wosinte.ads +++ b/gcc/ada/5wosinte.ads @@ -46,6 +46,8 @@ with Interfaces.C.Strings; package System.OS_Interface is pragma Preelaborate; + pragma Linker_Options ("-mthreads"); + subtype int is Interfaces.C.int; subtype long is Interfaces.C.long; diff --git a/gcc/ada/5wsystem.ads b/gcc/ada/5wsystem.ads index 9316644e0d9..2a7496a9843 100644 --- a/gcc/ada/5wsystem.ads +++ b/gcc/ada/5wsystem.ads @@ -139,7 +139,7 @@ private Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := False; ZCX_By_Default : constant Boolean := False; - GCC_ZCX_Support : constant Boolean := True; + GCC_ZCX_Support : constant Boolean := False; Front_End_ZCX_Support : constant Boolean := False; -- Obsolete entries, to be removed eventually (bootstrap issues!) diff --git a/gcc/ada/5wtaprop.adb b/gcc/ada/5wtaprop.adb index 506ece210c1..aa84c28bfaf 100644 --- a/gcc/ada/5wtaprop.adb +++ b/gcc/ada/5wtaprop.adb @@ -296,9 +296,13 @@ package body System.Task_Primitives.Operations is Timed_Out : out Boolean; Status : out Integer) is - Time_Out : DWORD; - Result : BOOL; - Wait_Result : DWORD; + Time_Out_Max : constant DWORD := 16#FFFF0000#; + -- NT 4 cannot handle timeout values that are too large, + -- e.g. DWORD'Last - 1 + + Time_Out : DWORD; + Result : BOOL; + Wait_Result : DWORD; begin -- Must reset Cond BEFORE L is unlocked. @@ -315,8 +319,8 @@ package body System.Task_Primitives.Operations is Wait_Result := 0; else - if Rel_Time >= Duration (DWORD'Last - 1) / 1000 then - Time_Out := DWORD'Last - 1; + if Rel_Time >= Duration (Time_Out_Max) / 1000 then + Time_Out := Time_Out_Max; else Time_Out := DWORD (Rel_Time * 1000); end if; diff --git a/gcc/ada/5ytiitho.adb b/gcc/ada/5ytiitho.adb deleted file mode 100644 index f0027fd24e1..00000000000 --- a/gcc/ada/5ytiitho.adb +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . -- --- I N I T I A L I Z E _ T A S K _ H O O K S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks AE 653 version of this procedure - -separate (System.Threads.Initialization) - -procedure Initialize_Task_Hooks is - - -- When defining the following routines for export in an AE 1.1 - -- simulation of AE653, Interfaces.C.int may be used for the - -- parameters of FUNCPTR. - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - -------------------------------- - -- Imported vThreads Routines -- - -------------------------------- - - procedure procCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, procCreateHookAdd, "procCreateHookAdd"); - -- Registers task registration routine for AE653 - - procedure procStartHookAdd (StartHookFunction : FUNCPTR); - pragma Import (C, procStartHookAdd, "procStartHookAdd"); - -- Registers task restart routine for AE653 - - Result : OSI.STATUS; -begin - -- Register the exported routines with the vThreads ARINC API - procCreateHookAdd (Register'Access); - procStartHookAdd (Reset_TSD'Access); - -- Register the environment task - Result := Register (OSI.taskIdSelf); - pragma Assert (Result /= -1); -end Initialize_Task_Hooks; diff --git a/gcc/ada/5zinit.adb b/gcc/ada/5zinit.adb index c947057f044..3fe64bd1aed 100644 --- a/gcc/ada/5zinit.adb +++ b/gcc/ada/5zinit.adb @@ -33,9 +33,6 @@ -- This is the VxWorks version of this package -with System.OS_Interface; --- used for various Constants, Signal and types - with Interfaces.C; -- used for int and other types @@ -47,10 +44,58 @@ package body System.Init is -- This unit contains initialization circuits that are system dependent. use Ada.Exceptions; - use System.OS_Interface; - use type Interfaces.C.int; + use Interfaces.C; + + -------------------------- + -- Signal Definitions -- + -------------------------- + + NSIG : constant := 32; + -- Number of signals on the target OS + type Signal is new int range 0 .. Interfaces.C."-" (NSIG, 1); + + SIGILL : constant := 4; -- illegal instruction (not reset) + SIGFPE : constant := 8; -- floating point exception + SIGBUS : constant := 10; -- bus error + SIGSEGV : constant := 11; -- segmentation violation + + type sigset_t is new long; + + SIG_SETMASK : constant := 3; + SA_ONSTACK : constant := 16#0004#; + + type struct_sigaction is record + sa_handler : System.Address; + sa_mask : sigset_t; + sa_flags : int; + end record; + pragma Convention (C, struct_sigaction); + type struct_sigaction_ptr is access all struct_sigaction; + + function sigdelset (set : access sigset_t; sig : Signal) return int; + pragma Import (C, sigdelset, "sigdelset"); + + function sigemptyset (set : access sigset_t) return int; + pragma Import (C, sigemptyset, "sigemptyset"); + + function sigaction + (sig : Signal; + act : struct_sigaction_ptr; + oact : struct_sigaction_ptr) return int; + pragma Import (C, sigaction, "sigaction"); + + type sigset_t_ptr is access all sigset_t; + + function pthread_sigmask + (how : int; + set : sigset_t_ptr; + oset : sigset_t_ptr) return int; + pragma Import (C, pthread_sigmask, "sigprocmask"); + + ------------------------------- + -- Binder Generated Values -- + ------------------------------- - -- Copies of global values computed by the binder Gl_Main_Priority : Integer := -1; pragma Export (C, Gl_Main_Priority, "__gl_main_priority"); @@ -104,11 +149,6 @@ package body System.Init is -- Common procedure that is executed when a SIGFPE, SIGILL, -- SIGSEGV, or SIGBUS is captured. - procedure Install_Handler; - pragma Export (C, Install_Handler, "__gnat_install_handler"); - -- Install handler for the synchronous signals. The C profile - -- here is what is expected by the binder-generated main. - ------------------------ -- GNAT_Error_Handler -- ------------------------ @@ -238,16 +278,6 @@ package body System.Init is end if; end Set_Globals; - ----------------------------- - -- Install_Signal_Handlers -- - ----------------------------- - - function Install_Signal_Handlers return Interfaces.C.int is - begin - Install_Handler; - return 0; - end Install_Signal_Handlers; - --------------------- -- Install_Handler -- --------------------- diff --git a/gcc/ada/5zintman.adb b/gcc/ada/5zintman.adb index 2933f240a39..d5e8afcf904 100644 --- a/gcc/ada/5zintman.adb +++ b/gcc/ada/5zintman.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 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- -- @@ -53,31 +53,37 @@ with Interfaces.C; with System.OS_Interface; -- used for various Constants, Signal and types -with Ada.Exceptions; --- used for Raise_Exception - package body System.Interrupt_Management is - use Ada.Exceptions; use System.OS_Interface; use type Interfaces.C.int; - type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID; - Exception_Interrupts : constant Interrupt_List (1 .. 4) := - (SIGFPE, SIGILL, SIGSEGV, SIGBUS); + type Signal_List is array (Signal_ID range <>) of Signal_ID; + Exception_Signals : constant Signal_List (1 .. 4) := + (SIGFPE, SIGILL, SIGSEGV, SIGBUS); - -- Keep these variables global so that they are initialized only once. + -- Keep these variables global so that they are initialized only once + -- What are "these variables" ???, I see only one Exception_Action : aliased struct_sigaction; - ---------------------- - -- Notify_Exception -- - ---------------------- + procedure Map_And_Raise_Exception (signo : Signal); + pragma Import (C, Map_And_Raise_Exception, "__gnat_map_signal"); + -- Map signal to Ada exception and raise it. Different versions + -- of VxWorks need different mappings. + + ----------------------- + -- Local Subprograms -- + ----------------------- procedure Notify_Exception (signo : Signal); -- Identify the Ada exception to be raised using -- the information when the system received a synchronous signal. + ---------------------- + -- Notify_Exception -- + ---------------------- + procedure Notify_Exception (signo : Signal) is Mask : aliased sigset_t; Result : int; @@ -98,20 +104,7 @@ package body System.Interrupt_Management is Result := taskResume (My_Id); end if; - case signo is - when SIGFPE => - Raise_Exception (Constraint_Error'Identity, "SIGFPE"); - when SIGILL => - Raise_Exception (Constraint_Error'Identity, "SIGILL"); - when SIGSEGV => - Raise_Exception - (Program_Error'Identity, - "stack overflow or erroneous memory access"); - when SIGBUS => - Raise_Exception (Program_Error'Identity, "SIGBUS"); - when others => - Raise_Exception (Program_Error'Identity, "unhandled signal"); - end case; + Map_And_Raise_Exception (signo); end Notify_Exception; --------------------------- @@ -126,10 +119,10 @@ package body System.Interrupt_Management is old_act : aliased struct_sigaction; begin - for J in Exception_Interrupts'Range loop + for J in Exception_Signals'Range loop Result := sigaction - (Signal (Exception_Interrupts (J)), Exception_Action'Access, + (Signal (Exception_Signals (J)), Exception_Action'Access, old_act'Unchecked_Access); pragma Assert (Result = 0); end loop; @@ -160,15 +153,15 @@ begin -- Change this if you want to use another signal for task abort. -- SIGTERM might be a good one. - Abort_Task_Interrupt := SIGABRT; + Abort_Task_Signal := SIGABRT; Exception_Action.sa_handler := Notify_Exception'Address; Exception_Action.sa_flags := SA_ONSTACK; Result := sigemptyset (mask'Access); pragma Assert (Result = 0); - for J in Exception_Interrupts'Range loop - Result := sigaddset (mask'Access, Signal (Exception_Interrupts (J))); + for J in Exception_Signals'Range loop + Result := sigaddset (mask'Access, Signal (Exception_Signals (J))); pragma Assert (Result = 0); end loop; @@ -185,5 +178,15 @@ begin Reserve (J) := True; end if; end loop; + + -- Add exception signals to the set of unmasked signals + + for J in Exception_Signals'Range loop + Keep_Unmasked (Exception_Signals (J)) := True; + end loop; + + -- The abort signal must also be unmasked + + Keep_Unmasked (Abort_Task_Signal) := True; end; end System.Interrupt_Management; diff --git a/gcc/ada/5zintman.ads b/gcc/ada/5zintman.ads new file mode 100644 index 00000000000..b0a4c3c5bda --- /dev/null +++ b/gcc/ada/5zintman.ads @@ -0,0 +1,123 @@ +------------------------------------------------------------------------------ +-- -- +-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 1992-2003 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- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL 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 GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the VxWorks version of this package. + +-- This package encapsulates and centralizes information about all +-- uses of interrupts (or signals), including the target-dependent +-- mapping of interrupts (or signals) to exceptions. + +-- Unlike the original design, System.Interrupt_Management can only +-- be used for tasking systems. + +-- PLEASE DO NOT remove the Elaborate_Body pragma from this package. +-- Elaboration of this package should happen early, as most other +-- initializations depend on it. Forcing immediate elaboration of +-- the body also helps to enforce the design assumption that this +-- is a second-level package, just one level above System.OS_Interface +-- with no cross-dependencies. + +-- PLEASE DO NOT put any subprogram declarations with arguments of +-- type Interrupt_ID into the visible part of this package. The type +-- Interrupt_ID is used to derive the type in Ada.Interrupts, and +-- adding more operations to that type would be illegal according +-- to the Ada Reference Manual. This is the reason why the signals +-- sets are implemeneted using visible arrays rather than functions. + +with System.OS_Interface; +-- used for sigset_t + +with Interfaces.C; +-- used for int + +package System.Interrupt_Management is + + pragma Elaborate_Body; + + type Interrupt_Mask is limited private; + + type Interrupt_ID is new Interfaces.C.int + range 0 .. System.OS_Interface.Max_Interrupt; + + type Interrupt_Set is array (Interrupt_ID) of Boolean; + + subtype Signal_ID is Interrupt_ID + range 0 .. Interfaces.C."-" (System.OS_Interface.NSIG, 1); + + type Signal_Set is array (Signal_ID) of Boolean; + + -- The following objects serve as constants, but are initialized + -- in the body to aid portability. This permits us to use more + -- portable names for interrupts, where distinct names may map to + -- the same interrupt ID value. + -- + -- For example, suppose SIGRARE is a signal that is not defined on + -- all systems, but is always reserved when it is defined. If we + -- have the convention that ID zero is not used for any "real" + -- signals, and SIGRARE = 0 when SIGRARE is not one of the locally + -- supported signals, we can write + -- Reserved (SIGRARE) := true; + -- and the initialization code will be portable. + + Abort_Task_Signal : Signal_ID; + -- The signal that is used to implement task abortion if + -- an interrupt is used for that purpose. This is one of the + -- reserved signals. + + Keep_Unmasked : Signal_Set := (others => False); + -- Keep_Unmasked (I) is true iff the signal I is one that must + -- that must be kept unmasked at all times, except (perhaps) for + -- short critical sections. This includes signals that are + -- mapped to exceptions, but may also include interrupts + -- (e.g. timer) that need to be kept unmasked for other + -- reasons. Where signal masking is per-task, the signal should be + -- unmasked in ALL TASKS. + + Reserve : Interrupt_Set := (others => False); + -- Reserve (I) is true iff the interrupt I is one that cannot be + -- permitted to be attached to a user handler. The possible reasons + -- are many. For example, it may be mapped to an exception used to + -- implement task abortion, or used to implement time delays. + + procedure Initialize_Interrupts; + -- On systems where there is no signal inheritance between tasks (e.g + -- VxWorks, GNU/LinuxThreads), this procedure is used to initialize + -- interrupts handling in each task. Otherwise this function should + -- only be called by initialize in this package body. + +private + type Interrupt_Mask is new System.OS_Interface.sigset_t; + -- In some implementation Interrupt_Mask can be represented + -- as a linked list. + +end System.Interrupt_Management; diff --git a/gcc/ada/5zml-tgt.adb b/gcc/ada/5zml-tgt.adb index 7016a222cd6..0331c9f23f8 100644 --- a/gcc/ada/5zml-tgt.adb +++ b/gcc/ada/5zml-tgt.adb @@ -93,6 +93,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -106,6 +107,7 @@ package body MLib.Tgt is pragma Unreferenced (Interfaces); pragma Unreferenced (Lib_Filename); pragma Unreferenced (Lib_Dir); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Driver_Name); pragma Unreferenced (Lib_Address); pragma Unreferenced (Lib_Version); diff --git a/gcc/ada/5ztaprop.adb b/gcc/ada/5ztaprop.adb index 2451e91dce5..6ee3f80fdcf 100644 --- a/gcc/ada/5ztaprop.adb +++ b/gcc/ada/5ztaprop.adb @@ -45,8 +45,8 @@ with System.Tasking.Debug; with System.Interrupt_Management; -- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +-- Abort_Task_Signal +-- Signal_ID -- Initialize_Interrupts with System.Soft_Links; @@ -262,7 +262,7 @@ package body System.Task_Primitives.Operations is Result := sigaction - (Signal (Interrupt_Management.Abort_Task_Interrupt), + (Signal (Interrupt_Management.Abort_Task_Signal), act'Unchecked_Access, old_act'Unchecked_Access); pragma Assert (Result = 0); @@ -1008,7 +1008,7 @@ package body System.Task_Primitives.Operations is begin Result := kill (T.Common.LL.Thread, - Signal (Interrupt_Management.Abort_Task_Interrupt)); + Signal (Interrupt_Management.Abort_Task_Signal)); pragma Assert (Result = 0); end Abort_Task; @@ -1126,6 +1126,13 @@ package body System.Task_Primitives.Operations is Result := sigemptyset (Unblocked_Signal_Mask'Access); pragma Assert (Result = 0); + for J in Interrupt_Management.Signal_ID loop + if System.Interrupt_Management.Keep_Unmasked (J) then + Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J)); + pragma Assert (Result = 0); + end if; + end loop; + Environment_Task_ID := Environment_Task; -- Initialize the lock used to synchronize chain of all ATCBs. diff --git a/gcc/ada/5zthrini.adb b/gcc/ada/5zthrini.adb deleted file mode 100644 index ded9a5118bb..00000000000 --- a/gcc/ada/5zthrini.adb +++ /dev/null @@ -1,113 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks version of this package; to use this implementation, --- the task hook libraries should be included in the VxWorks kernel. - -with System.Secondary_Stack; -with Interfaces.C; -with Unchecked_Conversion; - -package body System.Threads.Initialization is - - use Interfaces.C; - - package SSS renames System.Secondary_Stack; - - procedure Initialize_Task_Hooks; - -- Register the appropriate hooks (Register and Reset_TSD) to the - -- underlying OS, so that they will be called when a task is created - -- or reset. - - Current_ATSD : aliased System.Address; - pragma Import (C, Current_ATSD, "__gnat_current_atsd"); - - --------------------------- - -- Initialize_Task_Hooks -- - --------------------------- - - procedure Initialize_Task_Hooks is separate; - -- Separate, as these hooks are different for AE653 and VxWorks 5.5. - - -------------- - -- Register -- - -------------- - - function Register (T : OSI.Thread_Id) return OSI.STATUS is - TSD : ATSD_Access := new ATSD; - Result : OSI.STATUS; - begin - -- It cannot be assumed that the caller of this routine has a ATSD; - -- so neither this procedure nor the procedures that it calls should - -- raise or handle exceptions, or make use of a secondary stack. - - if OSI.taskIdVerify (T) = OSI.ERROR - or else OSI.taskVarGet (T, Current_ATSD'Access) /= OSI.ERROR - then - return OSI.ERROR; - end if; - - Result := OSI.taskVarAdd (T, Current_ATSD'Access); - pragma Assert (Result /= -1); - Result := OSI.taskVarSet (T, Current_ATSD'Access, TSD.all'Address); - pragma Assert (Result /= -1); - TSD.Sec_Stack_Addr := SSS.SS_Create; - SSS.SS_Init (TSD.Sec_Stack_Addr); - return Result; - end Register; - - --------------- - -- Reset_TSD -- - --------------- - - function Reset_TSD (T : OSI.Thread_Id) return OSI.STATUS is - TSD_Ptr : int; - function To_Address is new Unchecked_Conversion - (Interfaces.C.int, ATSD_Access); - begin - TSD_Ptr := OSI.taskVarGet (T, Current_ATSD'Access); - pragma Assert (TSD_Ptr /= OSI.ERROR); - - -- Just reset the secondary stack pointer. The implementation here - -- assumes that the fixed secondary stack implementation is used. - -- If not, there will be a memory leak (along with allocation, which - -- is prohibited for ARINC processes once the system enters "normal" - -- mode). - - SSS.SS_Init (To_Address (TSD_Ptr).Sec_Stack_Addr); - return OSI.OK; - end Reset_TSD; - -begin - Initialize_Task_Hooks; -end System.Threads.Initialization; diff --git a/gcc/ada/5ztiitho.adb b/gcc/ada/5ztiitho.adb deleted file mode 100644 index f5c60043dee..00000000000 --- a/gcc/ada/5ztiitho.adb +++ /dev/null @@ -1,52 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . -- --- I N I T I A L I Z E _ T A S K _ H O O K S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks 5.5 version of this procedure - -separate (System.Threads.Initialization) - -procedure Initialize_Task_Hooks is - - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - procedure taskCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, taskCreateHookAdd, "taskCreateHookAdd"); - - Result : OSI.STATUS; -begin - taskCreateHookAdd (Register'Access); - -- Register the environment task - Result := Register (OSI.taskIdSelf); - pragma Assert (Result /= -1); -end Initialize_Task_Hooks; diff --git a/gcc/ada/6vcstrea.adb b/gcc/ada/6vcstrea.adb index 1a320bc545e..04690190b0a 100644 --- a/gcc/ada/6vcstrea.adb +++ b/gcc/ada/6vcstrea.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,6 +36,8 @@ with Unchecked_Conversion; package body Interfaces.C_Streams is + use type System.CRTL.size_t; + ------------ -- fread -- ------------ @@ -154,14 +156,6 @@ package body Interfaces.C_Streams is size : size_t) return int is - function C_setvbuf - (stream : FILEs; - buffer : chars; - mode : int; - size : size_t) - return int; - pragma Import (C, C_setvbuf, "setvbuf"); - use type System.Address; begin @@ -173,9 +167,11 @@ package body Interfaces.C_Streams is if mode = IONBF and then (stream = stdout or else stream = stderr) then - return C_setvbuf (stream, buffer, IOLBF, size); + return System.CRTL.setvbuf + (stream, buffer, IOLBF, System.CRTL.size_t (size)); else - return C_setvbuf (stream, buffer, mode, size); + return System.CRTL.setvbuf + (stream, buffer, mode, System.CRTL.size_t (size)); end if; end setvbuf; diff --git a/gcc/ada/7sinmaop.adb b/gcc/ada/7sinmaop.adb index 8c767b231e4..8fe6b3a89bd 100644 --- a/gcc/ada/7sinmaop.adb +++ b/gcc/ada/7sinmaop.adb @@ -325,11 +325,16 @@ begin Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIG_IGN)); - for I in Interrupt_ID loop - if Keep_Unmasked (I) then - Result := sigaddset (mask'Access, Signal (I)); + for J in Interrupt_ID loop + + -- We need to check whether J is in Keep_Unmasked because + -- the index type of the Keep_Unmasked array is not always + -- Interrupt_ID; it may be a subtype of Interrupt_ID. + + if J in Keep_Unmasked'Range and then Keep_Unmasked (J) then + Result := sigaddset (mask'Access, Signal (J)); pragma Assert (Result = 0); - Result := sigdelset (allmask'Access, Signal (I)); + Result := sigdelset (allmask'Access, Signal (J)); pragma Assert (Result = 0); end if; end loop; diff --git a/gcc/ada/7sintman.adb b/gcc/ada/7sintman.adb index 72b1cf87380..801adac39f2 100644 --- a/gcc/ada/7sintman.adb +++ b/gcc/ada/7sintman.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003, 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- -- @@ -152,7 +152,7 @@ begin function State (Int : Interrupt_ID) return Character; pragma Import (C, State, "__gnat_get_interrupt_state"); - -- Get interrupt state. Defined in a-init.c + -- Get interrupt state. Defined in a-init.c -- The input argument is the interrupt number, -- and the result is one of the following: @@ -175,7 +175,16 @@ begin act.sa_handler := Notify_Exception'Address; - act.sa_flags := 0; + act.sa_flags := SA_SIGINFO; + + -- Setting SA_SIGINFO asks the kernel to pass more than just the signal + -- number argument to the handler when it is called. The set of extra + -- parameters typically includes a pointer to a structure describing + -- the interrupted context. Although the Notify_Exception handler does + -- not use this information, it is actually required for the GCC/ZCX + -- exception propagation scheme because on some targets (at least + -- alpha-tru64), the structure contents are not even filled when this + -- flag is not set. -- On some targets, we set sa_flags to SA_NODEFER so that during the -- handler execution we do not change the Signal_Mask to be masked for diff --git a/gcc/ada/7sosprim.adb b/gcc/ada/7sosprim.adb index 7cc32510576..c4a7a112380 100644 --- a/gcc/ada/7sosprim.adb +++ b/gcc/ada/7sosprim.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2003 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- -- @@ -47,11 +47,11 @@ package body System.OS_Primitives is pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; - type time_t is new Integer; + type time_t is new Long_Integer; type struct_timeval is record tv_sec : time_t; - tv_usec : Integer; + tv_usec : Long_Integer; end record; pragma Convention (C, struct_timeval); diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index af03db0b3a1..a49c825dc86 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,1779 @@ +2003-12-23 Kelley Cook + + * gnat_ug.texi: Force a CVS commit by updating copyright. + * gnat_ug_vxw.texi: Regenerate. + * gnat_ug_wnt.texi: Regenerate. + * gnat_ug_vms.texi: Regenerate. + * gnat_ug_unx.texi: Regenerate. + +2003-12-20 Kazu Hirata + + * trans.c: Remove uses of "register" specifier in + declarations of local variables. + +2003-12-18 Kelley Cook + + * stamp-xgnatug: New stamp file. + * Make-lang.in (stamp-xgnatug): New stamp file and comment. + (ada/doctools/xgnatug): Add $(build_exeext). + (ada/gnat_ug_unx.texi, ada/gnat_ug_vwx.texi, ada/gnat_ug_vms.texi + ada/gnat_ug_wnt.texi): Update to depend on stamp-xgnatug. + +2003-12-17 Ed Falis + + * a-elchha.adb (Tailored_Exception_Information): made Info constant to + eliminate warning. + + * a-exextr.adb: Add context clause for + Ada.Exceptions.Last_Chance_Handler. + +2003-12-17 Sergey Rybin + + * cstand.adb (Create_Standard): Change the way how the declaration of + the Duration type is created (making it the same way as it is for all + the other standard types). + +2003-12-17 Robert Dewar + + * s-crtl.ads: Fix header format + Change Pure to Preelaborate + +2003-12-17 Ed Schonberg + + * checks.adb (Selected_Length_Checks): Generate an Itype reference for + the expression type only if it is declared in the current unit. + + * sem_ch3.adb (Constrain_Index): Handle properly a range whose bounds + are universal and already analyzed, as can occur in constrained + subcomponents that depend on discriminants, when one constraint is a + subtype mark. + + * sem_res.adb (Resolve_Type_Conversion): Any arithmetic expression of + type Any_Fixed is legal as the argument of a conversion, if only one + fixed-point type is in context. + +2003-12-17 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-12-15 Robert Dewar + + * exp_ch6.adb (Expand_Thread_Body): Fix error in picking up default + sec stack size. + +2003-12-15 Vincent Celier + + * gnatchop.adb: (Error_Msg): Do not exit on error for a warning + (Gnatchop): Do not set failure status when reporting the number of + warnings. + +2003-12-15 Doug Rupp + + * s-ctrl.ads: New file. + + * Makefile.rtl (GNAT_RTL_NONTASKING_OBJS): Add s-crtl$(objext). + + * Make-lang.in: (GNAT_ADA_OBJS): Add ada/s-crtl.o. + (GNATBIND_OBJS): Add ada/s-crtl.o. + + * Makefile.in [VMS]: Clean up ifeq rules. + + * gnatlink.adb, 6vcstrea.adb, a-direio.adb, a-sequio.adb, + a-ststio.adb, a-textio.adb, g-os_lib.adb, a-witeio.adb, + g-os_lib.ads, i-cstrea.adb, i-cstrea.ads, s-direio.adb, + s-fileio.adb, s-memcop.ads, s-memory.adb, s-stache.adb, + s-tasdeb.adb: Update copyright. + Import System.CRTL. + Make minor modifications to use System.CRTL declared functions instead + of importing locally. + +2003-12-15 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-12-11 Ed Falis + + * 5zinit.adb: Clean up. + + * 5zintman.adb (Notify_Exception): replaced case statement with a call + to __gnat_map_signal, imported from init.c to support + signal -> exception mappings that depend on the vxWorks version. + + * init.c: + Created and exported __gnat_map_signal to support signal -> exception + mapping that is dependent on the VxWorks version. + Change mapping of SIGBUS from Program_Error to Storage_Error on VxWorks + +2003-12-11 Vasiliy Fofanv + + * 5wosinte.ads: Link with -mthreads switch. + +2003-12-11 Arnaud Charlet + + * init.c (__gnat_install_handler [NetBSD]): Set + __gnat_handler_installed, as done on all other platforms. + Remove duplicated code. + +2003-12-11 Jerome Guitton + + * Makefile.in (rts-zfp, rts-ravenscar): Create libgnat.a. + +2003-12-11 Thomas Quinot + + * sinfo.ads: Fix inconsistent example code in comment. + +2003-12-11 Robert Dewar + + * a-tiinau.adb: Add a couple of comments + + * sem_ch3.adb: Minor reformatting + + * sem_prag.adb: + Fix bad prototype of Same_Base_Type in body (code reading cleanup) + Minor reformatting throughout + +2003-12-11 Ed Schonberg + + * exp_ch7.adb (Establish_Transient_Scope): If the call is within the + bounds of a loop, create a separate block in order to generate proper + cleanup actions to prevent memory leaks. + + * sem_res.adb (Resolve_Call): After a call to + Establish_Transient_Scope, the call may be rewritten and relocated, in + which case no further processing is needed. + + * sem_util.adb: (Wrong_Type): Refine previous fix. + Fixes ACATS regressions. + + PR ada/13353 + + * sem_prag.adb (Back_End_Cannot_Inline): A renaming_as_body can always + be inlined. + +2003-12-08 Jerome Guitton + + * 5ytiitho.adb, 5zthrini.adb, 5ztiitho.adb, i-vthrea.adb, + i-vthrea.ads, s-tpae65.adb, s-tpae65.ads: Cleanup: Remove a bunch of + obsolete files. + + * Makefile.in: (rts-ravenscar): Generate an empty libgnat.a. + (rts-zfp): Ditto. + +2003-12-08 Robert Dewar + + * 7sintman.adb: Minor reformatting + + * bindgen.adb: Configurable_Run_Time mode no longer suppresses the + standard linker options to get standard libraries linked. We now plan + to provide dummy versions of these libraries to match the appropriate + configurable run-time (e.g. if a library is not needed at all, provide + a dummy empty library). + + * targparm.ads: Configurable_Run_Time mode no longer affects linker + options (-L parameters and standard libraries). What we plan to do is + to provide dummy libraries where the libraries are not required. + + * gnatbind.adb: Minor comment improvement + +2003-12-08 Javier Miranda + + * exp_aggr.adb (Build_Record_Aggr_Code): Do not remove the expanded + aggregate in the parent. Otherwise constants with limited aggregates + are not supported. Add new formal to pass the component type (Ctype). + It is required to call the corresponding IP subprogram in case of + default initialized components. + (Gen_Assign): In case of default-initialized component, generate a + call to the IP subprogram associated with the component. + (Build_Record_Aggr_Code): Remove the aggregate from the parent in case + of aggregate with default initialized components. + (Has_Default_Init_Comps): Improve implementation to recursively check + all the present expressions. + + * exp_ch3.ads, exp_ch3.adb (Build_Initialization_Call): Add new formal + to indicate that the initialization call corresponds to a + default-initialized component of an aggregate. + In case of default initialized aggregate with tasks this parameter is + used to generate a null string (this is just a workaround that must be + improved later). In case of discriminants, this parameter is used to + generate a selected component node that gives access to the discriminant + value. + + * exp_ch9.ads, exp_ch9.adb (Build_Task_Allocate_Block_With_Stmts): New + subprogram, based on Build_Task_Allocate_Block, but adapted to expand + allocated aggregates with default-initialized components. + + * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Improve error message if + the box notation is used in positional aggregates. + +2003-12-08 Samuel Tardieu + + * lib.ads: Fix typo in comment + +2003-12-08 Vincent Celier + + * prj.adb (Project_Empty): New component Unkept_Comments + (Scan): Remove procedure; moved to Prj.Err. + + * prj.ads (Project_Data): New Boolean component Unkept_Comments + (Scan): Remove procedure; moved to Prj.Err. + + * prj-dect.adb: Manage comments for the different declarations. + + * prj-part.adb (With_Record): New component Node + (Parse): New Boolean parameter Store_Comments, defaulted to False. + Set the scanner to return ends of line and comments as tokens, if + Store_Comments is True. + (Pre_Parse_Context_Clause): Create the N_With_Clause nodes so that + comments are associated with these nodes. Store the node IDs in the + With_Records. + (Post_Parse_Context_Clause): Use the N_With_Clause nodes stored in the + With_Records. + (Parse_Single_Project): Call Pre_Parse_Context_Clause before creating + the N_Project node. Call Tree.Save and Tree.Reset before scanning the + current project. Call Tree.Restore afterwards. Set the various nodes + for comment storage (Next_End, End_Of_Line, Previous_Line, + Previous_End). + + * prj-part.ads (Parse): New Boolean parameter Store_Comments, + defaulted to False. + + * prj-pp.adb (Write_String): New Boolean parameter Truncated, defaulted + to False. When Truncated is True, truncate the string, never go to the + next line. + (Write_End_Of_Line_Comment): New procedure + (Print): Process comments for nodes N_With_Clause, + N_Package_Declaration, N_String_Type_Declaration, + N_Attribute_Declaration, N_Typed_Variable_Declaration, + N_Variable_Declaration, N_Case_Construction, N_Case_Item. + Process nodes N_Comment. + + * prj-tree.ads, prj-tree.adb (Default_Project_Node): If it is a node + without comments and there are some comments, set the flag + Unkept_Comments to True. + (Scan): If there are comments, set the flag Unkept_Comments to True and + clear the comments. + (Project_Node_Kind): Add enum values N_Comment_Zones, N_Comment + (Next_End_Nodes: New table + (Comment_Zones_Of): New function + (Scan): New procedure; moved from Prj. Accumulate comments in the + Comments table and set end of line comments, comments after, after end + and before end. + (Add_Comments): New procedure + (Save, Restore, Seset_State): New procedures + (There_Are_Unkept_Comments): New function + (Set_Previous_Line_Node, Set_Previous_End_Node): New procedures + (Set_End_Of_Line, Set_Next_End_Node, Remove_Next_End_Node): New + procedures. + (First_Comment_After, First_Comment_After_End): New functions + (First_Comment_Before, First_Comment_Before_End): New functions + (Next_Comment): New function + (End_Of_Line_Comment, Follows_Empty_Line, + Is_Followed_By_Empty_Line): New functions + (Set_First_Comment_After, Set_First_Comment_After_End): New procedures + (Set_First_Comment_Before, Set_First_Comment_Before_End): New procedures + (Set_Next_Comment): New procedure + (Default_Project_Node): Associate comment before if the node can store + comments. + + * scans.ads (Token_Type): New enumeration value Tok_Comment + (Comment_Id): New global variable + + * scng.ads, scng.adb (Comment_Is_Token): New Boolean global variable, + defaulted to False. + (Scan): Store position of start of comment. If comments are tokens, set + Comment_Id and set Token to Tok_Comment when scanning a comment. + (Set_Comment_As_Token): New procedure + + * sinput-p.adb: Update Copyright notice + (Source_File_Is_Subunit): Call Prj.Err.Scanner.Scan instead of Prj.Scan + that no longer exists. + +2003-12-08 Javier Miranda + + * sem_aggr.adb: Add dependence on Exp_Tss package + Correct typo in comment + (Resolve_Aggregate): In case of array aggregates set the estimated + type of the aggregate before calling resolve. This is needed to know + the name of the corresponding IP in case of limited array aggregates. + (Resolve_Array_Aggregate): Delay the resolution to the expansion phase + in case of default initialized array components. + + * sem_ch12.adb (Analyze_Formal_Object_Declaration): Allow limited + types. Required to give support to limited aggregates in generic + formals. + +2003-12-08 Ed Schonberg + + * sem_ch3.adb (Check_Initialization): For legality purposes, an + inlined body functions like an instantiation. + (Decimal_Fixed_Point_Declaration): Do not set kind of first subtype + until bounds are analyzed, to diagnose premature use of type. + + * sem_util.adb (Wrong_Type): Improve error message when the type of + the expression is used prematurely. + +2003-12-08 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-12-08 Arnaud Charlet + + * sinfo.h, einfo.h, nmake.ads, nmake.adb, treeprs.ads: Removed, since + they are automatically generated by Make-lang.in and cause nothing but + maintenance troubles. + +2003-12-05 Thomas Quinot + + * 3ssoliop.ads: Fix comment (this is the Solaris, not the UnixWare, + version of this unit). + +2003-12-05 Olivier Hainque + + * 53osinte.ads, 54osinte.ads, 55osinte.ads, 56osinte.ads, 5bosinte.ads, + 5cosinte.ads, 5hosinte.ads, 5iosinte.ads, 5losinte.ads, + 5tosinte.ads: Define the SA_SIGINFO constant, to allow references from + the body of System.Interrupt_Management common to several targets. + Update copyright notice when appropriate. + + * 52osinte.ads, 5posinte.ads: Define a dummy value for the SA_SIGINFO + constant. + + * 7sintman.adb (elaboration): Set SA_SIGINFO in the sigaction flags, + to ensure that the kernel fills in the interrupted context structure + before calling a signal handler, which is necessary to be able to + unwind past it. Update the copyright notice. + +2003-12-05 Jerome Guitton + + * a-elchha.ads: New file. + + * a-elchha.adb: New default last chance handler. Contents taken from + Ada.Exceptions.Exception_Traces.Unhandled_Exception_Terminate. + + * a-exextr.adb (Unhandled_Exception_Terminate): Most of this routine + is moved to a-elchha.adb to provide a target-independent default last + chance handler. + + * Makefile.rtl: Add a-elchha.o + + * Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Add a-elchha.o. + +2003-12-05 Ed Schonberg + + * exp_ch6.adb (Expand_Call): If the subprogram is inlined and is + declared in an instance, do not inline the call if the instance is not + frozen yet, to prevent order of elaboration problems. + + * sem_prag.adb: Add comments for previous fix. + +2003-12-05 Samuel Tardieu + + * g-table.adb: Use the right variable in Set_Item. + Update copyright notice. + +2003-12-05 Arnaud Charlet + + * Makefile.in: Remove unused rules. + +2003-12-05 Vincent Celier + + * switch-c.adb (Scan_Front_End_Switches): Remove processing of + -nostdlib. Not needed here after all. + +2003-12-03 Thomas Quinot + + PR ada/11724 + + * adaint.h, adaint.c, g-os_lib.ads: + Do not assume that the offset argument to lseek(2) is a 32 bit integer, + on some platforms (including FreeBSD), it is a 64 bit value. + Introduce a __gnat_lseek wrapper in adaint.c to allow for portability. + +2003-12-03 Arnaud Charlet + + * gnatvsn.ads (Library_Version): Now contain only the relevant + version info. + (Verbose_Library_Version): New constant. + + * g-spipat.adb, g-awk.adb, g-debpoo.adb, + g-memdum.adb, g-thread.adb, s-geveop.adb, s-interr.adb, + s-taskin.adb, s-tassta.adb: Make code compile with -gnatwa. + + * gnatlbr.adb: Clean up: replace Library_Version by + Verbose_Library_Version. + + * make.adb, lib-writ.adb, exp_attr.adb: + Clean up: replace Library_Version by Verbose_Library_Version. + + * 5lintman.adb: Removed. + + * Makefile.in: + Update and simplify computation of LIBRARY_VERSION. + Fix computation of GSMATCH_VERSION. + 5lintman.adb is no longer used: replaced by 7sintman.adb. + +2003-12-03 Robert Dewar + + * exp_ch5.adb: + (Possible_Bit_Aligned_Component): Maybe_Bit_Aligned_Large_Component new + name. Modified to consider small non-bit-packed arrays as troublesome + and in need of component-by-component assigment expansion. + +2003-12-03 Vincent Celier + + * lang-specs.h: Process nostdlib as nostdinc + + * back_end.adb: Update Copyright notice + (Scan_Compiler_Arguments): Process -nostdlib directly. + +2003-12-03 Jose Ruiz + + * Makefile.in: + When defining LIBGNAT_TARGET_PAIRS for bare board targets, remove the + redundant inclusion of EXTRA_HIE_NONE_TARGET_PAIRS, which is always + included in HIE_NONE_TARGET_PAIRS. + +2003-12-03 Ed Schonberg + + * sem_attr.adb: + (Legal_Formal_Attribute): Attribute is legal in an inlined body, as it + is legal in an instance, because legality is cheched in the template. + + * sem_prag.adb: + (Analyze_Pragma, case Warnings): In an inlined body, the pragma may be + appplied to an unchecked conversion of a formal parameter. + + * sem_warn.adb: + (Output_Unreferenced_Messages): Suppress "not read" warnings on imported + variables. + +2003-12-03 Olivier Hainque + + * tb-alvms.c (unwind_regular_code, unwind_kernel_handler): New + routines. The second one is new functionality to deal with backtracing + through signal handlers. + (unwind): Split into the two separate subroutines above. + Update the documentation, and deal properly with sizeof (REG) different + from sizeof (void*). + +2003-12-01 Nicolas Setton + + * a-except.adb (Raise_Current_Excep): Add a pragma Inspection_Point, + so that the debugger can reliably access the value of the parameter, + and therefore is able to display the exception name when an exception + breakpoint is reached. + +2003-12-01 Thomas Quinot + + * fmap.adb: Fix typo in warning message. + + * g-socket.ads, g-socket.adb: Make Free a visible instance of + Ada.Unchecked_Deallocation (no need to wrap it in a subprogram). + +2003-12-01 Vincent Celier + + * mlib-prj.adb (Build_Library.Process): Do not check a withed unit if + ther is no Afile. + (Build_Library): Get the switches only if Default_Switches is declared + in package Binder. + +2003-12-01 Ed Schonberg + + * exp_ch6.adb (Expand_Actuals): When applying validity checks to + actuals that are indexed components, reanalyze actual to ensure that + packed array references are properly expanded. + + * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Add special case for + attempted assignment to a discriminant. + +2003-12-01 Robert Dewar + + * rtsfind.adb, exp_ch4.adb, s-exnint.ads, s-exnint.adb: Minor + reformatting. + + * switch-c.adb: Minor reformatting of comments + +2003-12-01 Arnaud Charlet + + * Makefile.in: Clean ups. + +2003-12-01 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-12-01 Arnaud Charlet + + * 5wsystem.ads: Disable zero cost exception, not ready yet. + +2003-11-29 Ulrich Weigand + + * Make-lang.in (nmake.ads): Add dependency on ada/nmake.adb + to force serialization. + +2003-11-26 Thomas Quinot + + * g-socket.ads, g-socket.adb: + Clarify documentation of function Stream. Introduce a Free procedure + to release the returned Stream once it becomes unused. + + * 5asystem.ads: For Alpha Tru64, enable ZCX by default. + +2003-11-26 Arnaud Charlet + + (Cond_Timed_Wait): Introduce new constant Time_Out_Max, + since NT 4 cannot handle timeout values that are too large, + e.g. DWORD'Last - 1. + +2003-11-26 Ed Schonberg + + * exp_ch4.adb: + (Expand_N_Slice): Recognize all cases of slices that appear as actuals + in procedure calls and whose expansion must be deferred. + + * exp_ch6.adb (Add_Call_By_Copy_Node): Remove previous fix. Proper fix + is in exp_ch4. + + * sem_ch3.adb: + (Build_Derived_Array_Type): Create operator for unconstrained type + if ancestor is unconstrained. + +2003-11-26 Vincent Celier + + * make.adb (Project_Object_Directory): New global variable + (Change_To_Object_Directory): New procedure + (Collect_Arguments_And_Compile): Call Change_To_Object_Directory instead + of Change_Dir directly. Do not change working directory to object + directory of main project after each compilation. + (Gnatmake): Use Change_To_Object_Directory instead of Change_Dir + directly. + Change to object directory of main project before binding step. + (Initialize): Initialize Project_Object_Directory to No_Project + + * mlib-prj.adb: + (Build_Library): Take into account Builder'Default_Switches ("Ada") when + binding a Stand-Alone Library. + + * output.adb: Update Copyright notice + (Write_Char): Output buffer when full + +2003-11-26 Robert Dewar + + * sem_ch13.adb: (Check_Size): Reset size if size is too small + + * sem_ch13.ads: + (Check_Size): Fix documentation to include bit-packed array case + + * sem_res.adb: Implement restriction No_Direct_Boolean_Operators + + * s-rident.ads: Put No_Direct_Boolean_Operators in proper order + + * s-rident.ads: Add new restriction No_Direct_Boolean_Operators + +2003-11-24 Arnaud Charlet + + PR ada/13142 + * utils.c (init_gigi_decls): Change name of built-in setjmp to + __builtin_setjmp, since this is apparently needed by recent + non Ada changes. + +2003-11-24 Rainer Orth + + * adadecode.c: Only include ctype.h if not IN_GCC. + (__gnat_decode): Use ISDIGIT from safe-ctype.h. + +2003-11-24 Jose Ruiz + + * Makefile.in: + Use 5zintman.ads for VxWorks targets. This file avoid confusion between + signals and interrupts. + + * 5zintman.ads: New File. + + * 5zintman.adb: Replace Exception_Interrupts by Exception_Signals, and + add exception signals to the set of unmasked signals. + + * 5ztaprop.adb: + Use Abort_Task_Signal instead of Abort_Task_Interrupt to avoid confusion + between signals and interrupts. + Add to Unblocked_Signal_Mask the set of signals that are in + Keep_Unmasked. + + * 7sinmaop.adb: + Adding a check to see whether the Interrupt_ID we want to unmask is in + the range of Keep_Unmasked (in procedure Interrupt_Self_Process). The + reason is that the index type of the Keep_Unmasked array is not always + Interrupt_ID; it may be a subtype of Interrupt_ID. + +2003-11-24 Gary Dismukes + + * exp_util.adb: + (Remove_Side_Effects): Condition constantness of object created for a + an unchecked type conversion on the constantness of the expression + to ensure the correct value for 'Constrained when passing components + of view-converted class-wide objects. + +2003-11-24 Robert Dewar + + * par-load.adb (Load): Improve handling of misspelled and missing units + Removes several cases of compilation abandoned messages + + * lib.adb: (Remove_Unit): New procedure + + * lib.ads: (Remove_Unit): New procedure + + * lib-load.adb: Minor reformatting + +2003-11-24 Vincent Celier + + * make.adb: + (Gnatmake, Initialize): Call Usage instead of Makeusg directly + (Marking_Label): Label to mark processed source files. Incremented for + each executable. + (Gnatmake): Increase Marking_Labet for each executable + (Is_Marked): Compare against marking label + (Mark): Mark with marking label + +2003-11-24 Jerome Guitton + + * s-thread.ads: + Move the declaration of the TSD for System.Threads to System.Soft_Links. + Add some comments. + + * Makefile.in: Added target pair for s-thread.adb for cert runtime. + (rts-cert): build a single relocatable object for the run-time lib. + Fix perms. + +2003-11-24 Vasiliy Fofanov + + * Make-lang.in: + Use gnatls rather than gcc to obtain the location of GNAT RTL for + crosstools build. + +2003-11-24 Sergey Rybin + + * opt.adb (Tree_Write): Gnat_Version_String is now a function, so we + can not use it as before (that is, as a variable) when dumping it into + the tree file. Add a local variable to store the result of this + function and to be used as the string to be written into the tree. + + * scn.adb (Initialize_Scanner): Add comments explaining the recent + changes. + + * sinput.adb (Source_First, Source_Last): In case of + Internal_Source_File, replace returning attributes of + Internal_Source_Ptr (which is wrong) with returning attributes of + Internal_Source. + +2003-11-24 Ed Schonberg + + * sem_ch3.adb: + (New_Concatenation_Op): Proper name for New_Binary_Operator, only + used for implicit concatenation operators. + Code cleanup. + + * sem_elab.adb: + (Check_Elab_Call): Set No_Elaboration_Check appropriately on calls in + task bodies that are in the scope of a Suppress pragma. + (Check_A Call): Use the flag to prevent spurious elaboration checks. + + * sinfo.ads, sinfo.adb: + New flag No_Elaboration_Check on function/procedure calls, to properly + suppress checks on calls in task bodies that are within a local suppress + pragma. + + * exp_ch4.adb: + (Expand_Concatenate_Other): Use the proper integer type for the + expression for the upper bound, to avoid universal_integer computations + when possible. + +2003-11-21 Kelley Cook + + * .cvsignore: Delete. + +2003-11-21 Andreas Schwab + + * 55system.ads: Set ZCX_By_Default and GCC_ZCX_Support to True. + +2003-11-21 Vasiliy Fofanov + + * 5wsystem.ads: Enable zero cost exception. + +2003-11-21 Jerome Guitton + + * 5ztiitho.adb: Remove an unreferenced variable. + +2003-11-21 Thomas Quinot + + * adaint.c: For FreeBSD, use mkstemp. + +2003-11-21 Arnaud Charlet + + * gnatlbr.adb: Now reference Gnat_Static_Version_String. + +2003-11-21 Robert Dewar + + * bld.adb: Remove useless USE of gnatvsn + + * gnatchop.adb: Minor reformatting + Clean up version handling to be more consistent + + * gnatxref.adb: Minor reformatting + + * gprcmd.adb: Minor reformatting + Fix output of copyright to be more consistent with other tools + +2003-11-21 Vincent Celier + + * make.adb (Scan_Make_Args): Do not transmit --RTS= to gnatlink + +2003-11-21 Sergey Rybin + + * atree.adb (Initialize): Add initializations for global variables + used in New_Copy_Tree. + + * cstand.adb (Create_Standard): Add call to Initialize_Scanner (with + Internal_Source_File as the actual). + Put the set of statements creating Any_Character before the set of + statements creating Any_Array to have Any_Character fully initialized + when it is used in creating Any_Array. + + * scn.adb (Initialize_Scanner): Do not set Comes_From_Source ON and do + not call Scan in case if the actual is Internal_Source_File + Add 2003 to copyright note. + + * sinput.adb (Source_First, Source_Last, Source_Text): Add code for + processing Internal_Source_File. + + * types.ads: Add the constant Internal_Source_File representing the + source buffer for artificial source-code-like strings created within + the compiler (the definition of Source_File_Index is changed). + +2003-11-20 Arnaud Charlet + + * 35soccon.ads, 45intnam.ads, 55osinte.adb, 55osinte.ads, + 56system.ads: New file, FreeBSD version. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (ada.extraclean): Delete. + +2003-11-19 Arnaud Charlet + + * gnatmem.adb: Clean up verbose output. + + * gprcmd.adb: Change copyright to FSF. + +2003-11-19 Vincent Celier + + * symbols.adb: (Initialize): New parameters Reference, Symbol_Policy + and Version (ignored). + + * symbols.ads: (Policy): New type + (Initialize): New parameter Reference, Symbol_Policy and + Library_Version. + Remove parameter Force. + Minor reformatting. + + * snames.ads, snames.adbadb: New standard names + Library_Reference_Symbol_File and Library_Symbol_Policy + + * mlib-prj.adb: + (Build_Library): Call Build_Dinamic_Library with the Symbol_Data of the + project. + + * mlib-tgt.adb: + (Build_Dynamic_Library): New parameter Symbol_Data (ignored) + + * mlib-tgt.ads: (Build_Dynamic_Library): New parameter Symbol_Data + + * prj.adb: (Project_Empty): New component Symbol_Data + + * prj.ads: (Policy, Symbol_Record): New types + (Project_Data): New component Symbol_Data + + * prj-attr.adb: + New attributes Library_Symbol_File, Library_Symbol_Policy and + Library_Reference_Symbol_File. + + * prj-nmsc.adb: + (Ada_Check): When project is a Stand-Alone library project, process + attribute Library_Symbol_File, Library_Symbol_Policy and + Library_Reference_Symbol_File. + + * 5aml-tgt.adb, 5bml-tgt.adb, 5gml-tgt.adb, 5hml-tgt.adb, + 5wml-tgt.adb, 5zml-tgt.adb, 5lml-tgt.adb, + 5sml-tgt.adb (Build_Dynamic_Library): New parameter + Symbol_Data (ignored). + + * 5vml-tgt.adb (VMS_Options): Remove --for-linker=gsmatch=equal,1,0 + (Build_Dynamic_Library): New parameter Symbol_Data. New internal + functions Option_File_Name and Version_String. Set new options of + gnatsym related to symbol file, symbol policy and reference symbol + file. + + * 5vsymbol.adb: + Extensive modifications to take into account the reference symbol file, + the symbol policy, the library version and to put in the symbol file the + minor and major IDs. + + * bld.adb (Process_Declarative_Items): Put second argument of + gprcmd to_absolute between single quotes, to avoid problems with + Windows. + + * bld-io.adb: Update Copyright notice. + (Flush): Remove last character of a line, if it is a back slash, to + avoid make problems. + + * gnatsym.adb: + Implement new scheme with reference symbol file and symbol policy. + + * g-os_lib.ads: (Is_Directory): Clarify comment + +2003-11-19 Robert Dewar + + * atree.adb: Move New_Copy_Tree global variables to head of package + + * errout.adb: Minor reformatting + +2003-11-19 Javier Miranda + + * sem_ch4.adb: (Diagnose_Call): Improve error message. + Add reference to Ada0Y (AI-50217) + + * sem_ch6.adb, sem_ch8.adb, sem_type.adb, + sem_util.adb: Add reference to AI-50217 + + * sinfo.ads: (N_With_Clause): Document fields referred to AI-50217 + + * sprint.adb: Add reference to Ada0Y (AI-50217, AI-287) + + * sem_aggr.adb: Complete documentation of AI-287 changes + + * par-ch4.adb: Document previous changes. + + * lib-load.adb, lib-writ.adb, einfo.ads, par-ch10.adb, + sem_cat.adb, sem_ch3.adb, sem_ch10.adb, sem_ch12.adb: Add references to + Ada0Y (AI-50217) + + * exp_aggr.adb: Add references to AI-287 in previous changes + +2003-11-19 Ed Schonberg + + * exp_ch6.adb: + (Add_Call_By_Copy_Node): Do not original node of rewritten expression + in the rewriting is the result of an inlined call. + + * exp_ch6.adb (Add_Call_By_Copy_Node): If actual for (in-)out + parameter is a type conversion, use original node to construct the + post-call assignment, because expression may have been rewritten, e.g. + if it is a packed array. + + * sem_attr.adb: + (Resolve_Attribute, case 'Constrained): Attribute is legal in an inlined + body, just as it is in an instance. + Categorization routines + + * sem_ch12.adb (Analyze_Association, Instantiate_Formal_Subprogram, + Instantiate_Object): Set proper sloc reference for message on missing + actual. + +2003-11-19 Thomas Quinot + + * Makefile.in: Add FreeBSD libgnat pairs. + + * usage.adb: Fix typo in usage message. + +2003-11-19 Jerome Guitton + + * Makefile.in: On powerpc-wrs-vxworksae: Add s-thread.ad?, + s-thrini.ad? and s-tiitho.adb to the full runtime, to support the + pragma Thread_Body. + Remove i-vthrea.ad? and s-tpae65.ad?, not needed anymore. + + * s-thread.adb: This file is now a dummy implementation of + System.Thread. + +2003-11-19 Sergey Rybin + + * rtsfind.adb (Initialize): Add initialization for RTE_Is_Available + +2003-11-19 Emmanuel Briot + + * xref_lib.adb (Parse_Identifier_Info): Add handling of generic + instanciation references in the parent type description. + +2003-11-18 Richard Kenner + + * ada-tree.def: (ALLOCATE_EXPR): Class is "2", not "s". + + * decl.c (gnat_to_gnu_entity, case E_Floating_Point_Subtype): Set + TYPE_PRECISION directly from esize. + +2003-11-18 Thomas Quinot + + * cstreams.c: + Use realpath(3) on FreeBSD. Fix typo in comment while we are at it. + + * init.c: Initialization routines for FreeBSD + + * link.c: Link info for FreeBSD + + * sysdep.c: Add the case of FreeBSD + +2003-11-17 Jerome Guitton + + * 5zthrini.adb: Remove the call to Init_RTS at elaboration, as it is + already called in System.Threads. + + * 5ztiitho.adb (Initialize_Task_Hooks): Remove the registration of the + environment task, as it has been moved to System.Threads.Initialization. + +2003-11-17 Arnaud Charlet + + * adaint.c (__gnatlib_install_locks): Only reference + __gnat_install_locks on VMS, since other platforms can avoid using + --enable-threads=gnat + +2003-11-17 Richard Kenner + + * ada-tree.h: (TYPE_IS_PACKED_ARRAY_TYPE_P): New macro. + + * decl.c (gnat_to_gnu_entity, case E_Array_Subtype): Set + TYPE_PACKED_ARRAY_TYPE_P. + (validate_size): Do not verify size if TYPE_IS_PACKED_ARRAY_TYPE_P. + + Part of PR ada/12806 + * utils.c (float_type_for_precision): Renamed from float_type_for_size. + Use GET_MODE_PRECISION instead of GET_MODE_BITSIZE. + +2003-11-17 Vincent Celier + + * gnatchop.adb (Error_Msg): New Boolean parameter Warning, defaulted + to False. + Do not set exit status to Failure when Warning is True. + (Gnatchop): Make errors "no compilation units found" and + "no source files written" warnings only. + + * make.adb (Gnatmake): When using a project file, set + Look_In_Primary_Dir to False. + (Configuration_Pragmas_Switch): Check for Global_Configuration_Pragmas + and Local_Configuration_Pragmas in the project where they are declared + not an extending project which might have inherited them. + + * osint.adb (Locate_File): If Name is already an absolute path, do not + look for a directory. + + * par-ch10.adb (P_Compilation_Unit): If source contains no token, and + -gnats (Check_Syntax) is used, issue only a warning, not an error. + + * prj.adb (Register_Default_Naming_Scheme): Add new component Project + in objects of type Variable_Value. + + * prj.ads: (Variable_Value): New component Project + + * prj-nmsc.adb (Ada_Check.Warn_If_Not_Sources): No warning if source + is in a project extended by Project. + + * prj-proc.adb (Add_Attributes): New parameter Project. Set component + Project of Variable_Values to this new parameter value. + (Expression): Set component Project of Variable_Values. + (Process_Declarative_Items): Call Add_Attributes with parameter Project. + Set the component Project in array elements. + +2003-11-17 Sergey Rybin + + * errout.adb: (Initialize): Add initialization for error nodes. + + * sem_ch12.adb (Initialize): Add missing initializations for + Exchanged_Views and Hidden_Entities. + +2003-11-17 Ed Schonberg + + * sem_ch12.adb (Copy_Generic_Node): Preserve entity when copying an + already instantiated tree for use in subsequent inlining. + (Analyze_Associations, Instantiate_Formal_Subprogram, + Instantiate_Object): improve error message for mismatch in + instantiations. + + * sem_ch6.adb (Build_Body_To_Inline): Major cleanup to handle + instantiations of subprograms declared in instances. + +2003-11-17 Javier Miranda + + * sem_ch4.adb (Analyze_Allocator): Previous modification must be + executed only under the Extensions_Allowed flag. + +2003-11-17 Robert Dewar + + * a-exexda.adb (Address_Image): Fix documentation to indicate leading + zeroes suppressed. + (Address_Image): Fix bug of returning 0x instead of 0x0 + Minor reformatting (function specs). + + * einfo.ads: Minor fix for documentation of Is_Bit_Packed_Array + (missed case of 33-63) + + * freeze.adb, sem_ch13.adb: Properly check size of packed bit array + + * s-thread.adb: Add comments for pragma Restriction + + * exp_aggr.adb, g-debuti.adb, par-ch4.adb, sem_aggr.adb, + sem_ch6.adb, sprint.adb, xref_lib.adb: Minor reformatting + +2003-11-17 Ed Falis + + * s-thread.adb: Added No_Tasking restriction for this implementation. + +2003-11-17 Emmanuel Briot + + * xref_lib.adb (Parse_Identifier_Info): Add handling of generic + instanciation references in the parent type description. + +2003-11-17 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-11-16 Jason Merrill + + * Make-lang.in (ada.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-14 Andreas Jaeger + + * lang.opt: Change -Wno-long-long to -Wlong-long since the latter + is the canonical version. + * misc.c (gnat_handle_option): Likewise. + + * Makefile.in (LIBGNAT_TARGET_PAIRS): Add rules for x86_64-linux. + + * 5nsystem.ads: New file for x86_64-linux-gnu. + +2003-11-14 Arnaud Charlet + + * nmake.ads, nmake.adb, sinfo.h, treeprs.ads: Regenerated. + + * comperr.adb: Fix logic in previous change. + +2003-11-13 Vincent Celier + + * 5bml-tgt.adb (Build_Dynamic_Library): Use + Osint.Include_Dir_Default_Prefix instead of + Sdefault.Include_Dir_Default_Name. + + * gnatlbr.adb: Update Copyright notice + (Gnatlbr): : Use Osint.Include_Dir_Default_Prefix instead of + Sdefault.Include_Dir_Default_Name and Osint.Object_Dir_Default_Prefix + instead of Sdefault.Object_Dir_Default_Name + + * gnatlink.adb: + (Process_Binder_File): Never suppress the option following -Xlinker + + * mdll-utl.adb: + (Gcc): Use Osint.Object_Dir_Default_Prefix instead of + Sdefault.Object_Dir_Default_Name. + + * osint.ads, osint.adb: + (Include_Dir_Default_Prefix, Object_Dir_Default_Prefix): New functions + Minor reformatting. + + * vms_conv.ads: Minor reformating + Remove GNAT STANDARD and GNAT PSTA + + * vms_conv.adb: + Allow GNAT MAKE to have several files on the command line. + (Init_Object_Dirs): Use Osint.Object_Dir_Default_Prefix instead of + Sdefault.Object_Dir_Default_Name. + Minor Reformating + Remove data for GNAT STANDARD + + * vms_data.ads: + Add new compiler qualifier /PRINT_STANDARD (-gnatS) + Remove data for GNAT STANDARD + Remove options and documentation for -gnatwb/-gnatwB: these warning + options no longer exist. + +2003-11-13 Ed Falis + + * 5zthrini.adb: (Init_RTS): Made visible + + * 5zthrini.adb: + (Register): Removed unnecessary call to taskVarGet that checked whether + an ATSD was already set as a task var for the argument thread. + + * s-thread.adb: + Updated comment to reflect that this is a VxWorks version + Added context clause for System.Threads.Initialization + Added call to System.Threads.Initialization.Init_RTS + +2003-11-13 Jerome Guitton + + * 5zthrini.adb: + (Init_RTS): New procedure, for the initialization of the run-time lib. + + * s-thread.adb: + Remove dependancy on System.Init, so that this file can be used in the + AE653 sequential run-time lib. + +2003-11-13 Robert Dewar + + * bindgen.adb: Minor reformatting + +2003-11-13 Ed Schonberg + + * checks.adb: + (Apply_Discriminant_Check): Do no apply check if target type is derived + from source type with no applicable constraint. + + * lib-writ.adb: + (Ensure_System_Dependency): Do not apply the style checks that may have + been specified for the main unit. + + * sem_ch8.adb: + (Find_Selected_Component): Further improvement in error message, with + RM reference. + + * sem_res.adb: + (Resolve): Handle properly the case of an illegal overloaded protected + procedure. + +2003-11-13 Javier Miranda + + * exp_aggr.adb: + (Has_Default_Init_Comps): New function to check the presence of + default initialization in an aggregate. + (Build_Record_Aggr_Code): Recursively expand the ancestor in case of + extension aggregate of a limited record. In addition, a new formal + was added to do not initialize the record controller (if any) during + this recursive expansion of ancestors. + (Init_Controller): Add support for limited record components. + (Expand_Record_Aggregate): In case of default initialized components + convert the aggregate into a set of assignments. + + * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Update the comment + describing the new syntax. + Nothing else needed to be done because this subprogram delegates part of + its work to P_Precord_Or_Array_Component_Association. + (P_Record_Or_Array_Component_Association): Give support to the new + syntax for default initialization of components. + + * sem_aggr.adb: + (Resolve_Aggregate): Relax the strictness of the frontend in case of + limited aggregates. + (Resolve_Record_Aggregate): Give support to default initialized + components. + (Get_Value): In case of default initialized components, duplicate + the corresponding default expression (from the record type + declaration). In case of default initialization in the *others* + choice, do not check that all components have the same type. + (Resolve_Extension_Aggregate): Give support to limited extension + aggregates. + + * sem_ch3.adb: + (Check_Initialization): Relax the strictness of the front-end in case + of aggregate and extension aggregates. This test is now done in + Get_Value in a per-component manner. + + * sem_ch4.adb (Analyze_Allocator): Don't post an error if the + expression corresponds to a limited aggregate. This test is now done + in Get_Value. + + * sinfo.ads, sinfo.adb (N_Component_Association): Addition of + Box_Present flag. + + * sprint.adb (Sprint_Node_Actual): Modified to print an mbox if + present in an N_Component_Association node + +2003-11-13 Thomas Quinot + + * sem_ch9.adb (Analyze_Accept_Statement): A procedure hides a + type-conformant entry only if they are homographs. + +2003-11-13 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-11-12 Rainer Orth + + * adadecode.c: Use <> form of include for ctype.h. + * sysdep.c [IN_RTS]: Use <> form of include for time.h. + +2003-11-12 Rainer Orth + + * 5gsystem.ads (Functions_Return_By_DSP): Set to False. + Works around PR middle-end/6552. + +2003-11-10 Ed Falis + + * 5ytiitho.adb: (procStartHookAdd): Definition and call deleted + + * 5zinit.adb: (Install_Handler): Moved back to spec + (Install_Signal_Handlers): Deleted + + * 5zthrini.adb: Added context clause for System.Storage_Elements + (Register): Only handles creation of taskVar; initialization moved to + Thread_Body_Enter. + (Reset_TSD): Deleted; replaced by Thread_Body_Enter + Added declaration of environment task secondary stack and + initialization. + + * s-thread.adb: Implement bodies for thread body processing + + * s-thread.ads: + Added comment identifying supported targets for pragma Thread_Body. + +2003-11-10 Pascal Obry + + * adaint.c (_gnat_stat) [WIN32]: Check if name is not bigger than + GNAT_MAX_PATH_LEN. + + * s-fileio.adb: + (Open): Properly check for string length before copying into the buffer. + Raises Name_Error if buffer is too small. Note that this was a potential + buffer overflow. + +2003-11-10 Romain Berrendonner + + * bindgen.adb, comperr.adb: Code clean ups. + * gnatvsn.ads, gnatvsn.adb (Get_Gnat_Version_Type): New function. + +2003-11-10 Sergey Rybin + + * gnat1drv.adb: Add call to Sem_Elim.Initialize. + +2003-11-10 Vincent Celier + + * gprcmd.adb: + (Gprcmd): Add new command "prefix" to get the prefix of the GNAT + installation. + + * make.adb (Scan_Make_Arg): Transmit -nostdlib to the compiler + + * prj.adb: (Project_Empty): Add new boolean component Virtual + + * prj.ads: (Virtual_Prefix): New constant string + (Project_Data): New boolean component Virtual + + * prj-nmsc.adb (Language_Independent_Check): Adjust error message when + a library project is extended by a virtual extending project. + + * prj-part.adb: + Modifications throughout to implement extending-all project, including: + (Virtual_Hash, Processed_Hash): New hash tables + (Create_Virtual_Extending_Project): New procedure + (Look_For_Virtual_Projects_For): New procedure + + * prj-proc.adb: + (Process): After checking the projects, if main project is an + extending-all project, set the object directory of all virtual extending + project to the object directory of the main project. + Adjust error message when a virtual extending project has the same + object directory as an project being extended. + (Recursive_Process): If name starts with the virtual prefix, set Virtual + to True in the project data. + + * prj-tree.adb: + (Default_Project_Node): Add new boolean component Extending_All + (Is_Extending_All): New function + (Set_Is_Extending_All): New procedure + + * prj-tree.ads: (Is_Extending_All): New function + (Set_Is_Extending_All): New procedure + (Project_Node_Record): New boolean component Extending_All + + * switch-c.adb: (Scan_Front_End_Switches): Process -nostdlib + + * vms_data.ads: + Add qualifier /NOSTD_LIBRARIES (-nostdlib) for the compiler + + * bld.adb (Recursive_Process): If MAKE_ROOT is not defined, call + "gprcmd prefix" to define it. + +2003-11-10 Thomas Quinot + + * einfo.ads: Fix a typo and remove an extraneous word in comments. + + * lib-load.adb: + (Create_Dummy_Package_Unit): Set the scope of the entity for the + created dummy package to Standard_Standard, not to itself, to + defend other parts of the front-end against encoutering a cycle in + the scope chain. + + * sem_ch10.adb: + (Analyze_With_Clause): When setting the entities for the successive + N_Expanded_Names that constitute the name of a child unit, do not + attempt to go further than Standard_Standard in the chain of scopes. + This case arises from the placeholder units created by + Create_Dummy_Package_Unit in the case of a with_clause for a + nonexistent child unit. + +2003-11-10 Ed Schonberg + + * exp_ch6.adb: + (Expand_Thread_Body): Place subprogram on scope stack, so that new + declarations are given the proper scope. + + * sem_ch13.adb: + (Check_Expr_Constants): Reject an expression that contains a constant + created during expansion, and that appears after the object to which + the address clause applies. + + * sem_ch5.adb (Check_Controlled_Array_Attribute): Subsidiary of + Analyze_Iteration_Scheme, to rewrite a loop parameter specification + that uses 'Range of a function call with controlled components, so + that the function result can be finalized before starting the loop. + + * sem_ch8.adb: + (Find_Selected_Component): Improve error message when prefix is + an implicit dereference of an incomplete type. + +2003-11-10 Robert Dewar + + * opt.ads: New Print_Standard flag for -gnatS switch + + * sem_ch13.adb: Remove some additional checks for unaligned arrays + + * cstand.adb (Create_Standard): Print out package standard if -gnatS + switch set + + * debug.adb: Update doc for -gnatds to discuss relationship with new + -gnatS flag + + * sinfo.adb: Add new field Entity_Or_Associated_Node + + * sinfo.ads: Add new field Entity_Or_Associated_Node + Update documentation for Associated_Node and Entity fields to clarify + relationship and usage. + + * sprint.adb: + (Write_Id): Properly process Associated_Node field in generic template + + * switch-c.adb: + Recognize new -gnatS switch for printing package Standard + This replaces gnatpsta + + * usage.adb: + Add line for new -gnatS switch for printing package Standard + This replaces gnatpsta + +2003-11-10 Andreas Jaeger + + * 7sosprim.adb: tv_usec of struct_timeval and time_t are long + integer. + +2003-11-10 Arnaud Charlet + + * misc.c, lang.opt: Add handling of -nostdlib, now recognized/needed + by gnat1. + +2003-11-10 Arnaud Charlet + + * Makefile.in, Make-lang.in: Remove build of gnat_wrapper and gnatpsta, + no longer needed. + + * gnatpsta.adb, gnat_wrapper.adb: Removed, no longer needed. + + * sysdep.c: Add handling of cygwin. + +2003-11-10 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-11-10 Arnaud Charlet + + PR 12950 + * osint.ads, osint.adb (Relocate_Path, Executable_Suffix): New + functions. Used to handle dynamic prefix relocation, via set_std_prefix. + Replace GNAT_ROOT by GCC_ROOT. + + * Make-lang.in: Use new function Relocate_Path to generate sdefault.adb + +2003-11-06 Zack Weinberg + + * misc.c (fp_prec_to_size, fp_size_to_prec): Use GET_MODE_PRECISION + and update for changed meaning of GET_MODE_BITSIZE. + +2003-11-04 Doug Rupp + + * sysdep.c: Problem discovered during IA64 VMS port. + [VMS] #include to get proper prototypes. + + * adaint.c: + Issues discovered/problems fixed during IA64 VMS port. + [VMS] #define _POSIX_EXIT for proper semantics. + [VMS] #include for proper prototypes. + [VMS] (fork): #define IA64 version. + (__gnat_os_exit): Remove unnecessary VMS specific code. + +2003-11-04 Richard Kenner + + Part of PR ada/12806 + + * ada-tree.h (TYPE_DIGITS_VALUE, SET_TYPE_DIGITS_VALUE): Save count as + tree, not integer. + + * decl.c: + (gnat_to_gnu_entity, case E_Floating_Point_Type): Save count as tree, + not integer. + + * targtyps.c, decl.c, misc.c, + gigi.h (fp_prec_to_size, fp_size_to_prec): Temporary + routines to work around change in FP sizing semantics in GCC. + + * utils.c: + (build_vms_descriptor): TYPE_DIGITS_VALUE is tree, not integer. + + * gigi.h: (enumerate_modes): New function. + + * Make-lang.in: (ada/misc.o): Add real.h. + + * misc.c: (enumerate_modes): New function. + +2003-11-04 Robert Dewar + + * 3vtrasym.adb: Minor reformatting + Use terminology encoded/decoded name, rather than C++ specific notion + of mangling (this is the terminology used throughout GNAT). + + * einfo.h: Regenerated + + * einfo.ads, einfo.adb: Add new flag Is_Thread_Body + + * exp_ch6.adb: + (Expand_N_Subprogram_Body): Handle expansion of thread body procedure + + * par-prag.adb: Add dummy entry for Thread_Body pragma + + * rtsfind.ads: + Add entries for System.Threads entities for thread body processing + + * sem_attr.adb: + (Analyze_Pragma, Access attributes): Check these are not applied to a + thread body, since this is not permitted + + * sem_prag.adb: Add processing for Thread_Body pragma. + Minor comment fix. + + * sem_res.adb: + (Resolve_Call): Check for incorrect attempt to call a thread body + procedure with a direct call. + + * snames.ads, snames.adb: Add entry for Thread_Body pragma + Add names associated with thread body expansion + + * snames.h: Add entry for Thread_Body pragma + + * s-thread.adb: Add entries for thread body processing + These are dummy bodies so far + + * s-thread.ads: Add documentation on thread body handling. + Add entries for thread body processing. + +2003-11-04 Javier Miranda + + * sem_ch10.adb: + (Build_Limited_Views): Return after posting an error in case of limited + with_clause on subprograms, generics, instances or generic renamings + (Install_Limited_Withed_Unit): Do nothing in case of limited with_clause + on subprograms, generics, instances or generic renamings + +2003-11-04 Arnaud Charlet + + * raise.c (setup_to_install): Correct mistake in last revision; two + arguments out of order. + + * trans.c, cuintp.c, argv.c, aux-io.c, cal.c, errno.c, exit.c, + gnatbl.c, init.c, stringt.h, utils.c, utils2.c: Update copyright + notice, missed in previous change. + Remove trailing blanks and other style errors introduced in previous + change. + +2003-11-04 Olivier Hainque + + * decl.c (gnat_to_gnu_field): Adjust the conditions under which we get + rid of the wrapper for a LJM type, ensuring we don't do that if the + field is addressable. This avoids potential low level type view + mismatches later on, for instance in a by-reference argument passing + process. + +2003-11-04 Richard Kenner + + * decl.c (gnat_to_gnu_field): No longer check for BLKmode being + aligned at byte boundary. + +2003-11-04 Joel Brobecker + + * decl.c (components_to_record): Do not delete the empty variants from + the end of the union type. + +2003-11-04 Ed Schonberg + + * exp_ch4.adb (Expand_N_Op_Eq): Use base type when locating primitive + operation for a derived type, an explicit declaration may use a local + subtype of Boolean. + +2003-11-04 Vincent Celier + + * make.adb (Gnatmake): Allow main sources on the command line with a + library project when it is only for compilation (no binding or + linking). + +2003-11-04 Rainer Orth + + * Makefile.in: Remove many duplicate variables. + +2003-11-03 Kelley Cook + + * Make-lang.in (dvi): Move targets to $(docobjdir). + (gnat_ug_vms.dvi): Simplify rule and adjust target. + (gnat_ug_wnt.dvi): Likewise. + (gnat_ug_unx.dvi): Likewise. + (gnat_ug_vxw.dvi): Likewise. + (gnat_rm.dvi): Likewise. + (gnat-style.dvi): Likewise. + +2003-10-31 Kelley Cook + + * gigi.h: Missed commit from update for C90. + +2003-10-31 Kelley Cook + + * Makefile.in (ada/b_gnat1.o): Compile with -Wno-error. + +2003-10-31 Andreas Schwab + + * raise.c (get_action_description_for): Fix typo in last change. + +2003-10-31 Nathanael Nerode + + PR ada/12761 + * ada/Make-lang.in: Move default definitions of X_ADA_CFLAGS, + T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS from here to master Makefile.in. + +2003-10-30 Kelley Cook + + * adadecode.c, adaint.c, argv.c, aux-io.c, cal.c, cio.c, cstreams.c, + ctrl_c.c, cuintp.c, decl.c, errno.c, exit.c, expect.c, final.c, + gigi.h, gmem.c, gnatbl.c, init.c, misc.c, mkdir.c, raise.c, socket.c, + sysdep.c, sysdep.c, targtyps.c, tb-alvms.c, tb-alvxw.c, tracebak.c, + trans.c, utils.c, utils2.c: Convert function prototypes to C90. + +2003-10-30 Vasiliy Fofanov + + * 3vtrasym.adb: + Demangle Ada symbols returned by TBK$SYMBOLIZE. Correctly align line + numbers when symbol name is too long. + +2003-10-30 Ed Falis + + * g-signal.ads, g-signal.adb: New files + + * impunit.adb: (Non_Imp_File_Names): Added "g-signal" + + * Makefile.rtl: Introduce GNAT.Signals + +2003-10-30 Robert Dewar + + * freeze.adb: Minor reformatting + + * lib-writ.adb (Write_ALI): Never write ali file if -gnats is specified + + * par.adb, par-ch12.adb, par-ch13.adb, par-ch2.adb, par-ch3.adb, + par-ch5.adb, par-ch6.adb, par-ch9.adb, par-util.adb: + New handling of Id_Check parameter to improve recognition of keywords + used as identifiers. + Update copyright notice to include 2003 + +2003-10-29 Robert Dewar + + * 3vtrasym.adb, 5vtraent.ads, sprint.adb, + sem_ch10.adb: Minor reformatting + + * exp_ch5.adb (Expand_Assign_Array): Test for bit unaligned operands + (Expand_Assign_Record): Test right hand side for bit unaligned as well + +2003-10-29 Vasiliy Fofanov + + * 3vtrasym.adb, 5vtraent.adb, 5vtraent.ads, tb-alvms.c: + Support for TBK$SYMBOLIZE-based symbolic traceback. + +2003-10-29 Jose Ruiz + + * exp_disp.adb: + Revert previous change, that did not work well when pragma No_Run_Time + was used in conjunction with a run-time other than ZFP. + +2003-10-29 Vincent Celier + + * make.adb: + (Gnatmake): When there are no Ada mains in attribute Main, disable the + bind and link steps only is switch -z is not used. + +2003-10-29 Arnaud Charlet + + * Makefile.generic: Remove duplicated setting of CC. + + * Makefile.prolog: Set CC to gcc by default, to override make's + default (cc). + + * einfo.h: Regenerated. + +2003-10-29 Ed Schonberg + + * sem_ch10.adb (Analyze_Subunit): Restore state of suppress flags for + current body, after compiling subunit. + + * itypes.adb (Create_Itype): In ASIS_Mode, do not freeze the itype + when in deleted code, because gigi needs properly ordered freeze + actions to annotate types. + + * freeze.adb (Is_Fully_Defined): Predicate must be recursive, to + prevent the premature freezing of record type that contains + subcomponents with a private type that does not yet have a completion. + +2003-10-29 Javier Miranda + + * sem_ch12.adb: + (Analyze_Package_Instantiation): Check that instances can not be used in + limited with_clauses. + + * sem_ch8.adb: + (Analyze_Package_Renaming): Check that limited withed packages cannot + be renamed. Improve text on error messages related to limited + with_clauses. + + * einfo.adb, einfo.ads: Remove Non_Limited_Views attribute. + + * sprint.adb: (Sprint_Node_Actual): Print limited with_clauses. + Update copyright notice. + + * sem_ch10.adb: (Build_Limited_Views): Complete its documentation. + (Install_Limited_Context_Clauses): New subprogram that isolates all the + checks required for limited context_clauses and installs the limited + view. + (Install_Limited_Withed_Unit): Complete its documentation. + (Analyze_Context): Check that limited with_clauses are only allowed in + package specs. + (Install_Context): Call Install_Limited_Context_Clauses after the + parents have been installed. + (Install_Limited_Withed_Unit): Add documentation. Mark the installed + package as 'From_With_Type'; this mark indicates that the limited view + is installed. Used to check bad usages of limited with_clauses. + (Build_Limited_Views): Do not add shadow entities to the scope's list + of entities. Do not add real entities to the Non_Limited_Views chain. + Improve error notification. + (Remove_Context_Clauses): Remove context clauses in two phases: + limited views first and regular views later (to maintain the + stack model). + (Remove_Limited_With_Clause): If the package is analyzed then reinstall + its visible entities. + +2003-10-29 Thomas Quinot + + * sem_type.adb (Specific_Type): Type Universal_Fixed is compatible + with any type that Is_Fixed_Point_Type. + + * sinfo.ads: Fix documentation for Associated_Node attribute. + +2003-10-29 Sergey Rybin + + * switch-c.adb (Scan_Front_End_Switches): ASIS_Mode is set now when + both '-gnatc' and '-gnatt' are specified. + + * atree.adb (Initialize): Add initialization for Node_Count (set to + zero). + +2003-10-29 Richard Kenner + + * decl.c (gnat_to_gnu_entity, case E_Subprogram): If no return value, + do not consider as Pure. + + Part of implementation of function-at-a-time: + + * trans.c (gnat_to_gnu_code): If IS_STMT, call expand_expr_stmt. + (tree_transform): Add new argument to build_component_ref. + (tree_transform, case N_Assignment_Statement): Make and return an + EXPR_STMT. + (tree_transform): If result IS_STMT, set flags and return it. + (gnat_expand_stmt, set_lineno_from_sloc): New functions. + + * utils2.c (build_simple_component_ref, build_component_ref): Add new + arg, NO_FOLD_P. + (build_binary_op, case EQ_EXPR): Pass additional arg to it. + (build_allocator): Likewise. + + * utils.c (convert_to_fat_pointer, convert_to_thin_pointer, convert): + Add new arg to build_component_ref. + (maybe_unconstrained_array, unchecked_convert): Likewise. + + * ada-tree.def (EXPR_STMT): New code. + + * ada-tree.h (IS_STMT, TREE_SLOC, EXPR_STMT_EXPR): New macros. + + * decl.c (gnat_to_gnu_entity, case object): Add extra arg to + build_component_ref calls. + + * misc.c (gnat_expand_expr): If IS_STMT, call gnat_expand_stmt. + + * gigi.h (gnat_expand_stmt, set_lineno_from_sloc): New functions. + (build_component_ref): Add new argument, NO_FOLD_P. + +2003-10-27 Arnaud Charlet + + * Makefile.generic: Add missing substitution on object_deps handling. + + PR ada/5909: + * Make-lang.in (check-ada): Enable ACATS test suite. + +2003-10-27 Robert Dewar + + * exp_ch3.adb: + (Freeze_Array_Type): We do not need an initialization routine for types + derived from String or Wide_String. They should be treated the same + as String and Wide_String themselves. This caused problems with the + use of Initialize_Scalars. + + * exp_ch5.adb: + (Expand_Assign_Record): Do component-wise assignment of non-byte aligned + composites. This allows use of component clauses that are not byte + aligned. + + * sem_prag.adb: + (Analyze_Pragma, case Pack): Generate warning and ignore pack if there + is an attempt to pack an array of atomic objects. + + * make.adb, prj-env.adb, prj-env.ads: Minor reformatting + +2003-10-27 Pascal Obry + + * g-dirope.adb: + (Basename): Check for drive letters in a pathname only on DOS based OS. + +2003-10-27 Vincent Celier + + * make.adb: + (Gnatmake): When unable to change dir to the object dir, display the + content of the parent dir of the obj dir, to try to understand why this + happens. + +2003-10-27 GNAT Script + + * Make-lang.in: Makefile automatically updated + +2003-10-27 Ed Schonberg + + * sem_ch12.adb: + (Inline_Instance_Body): Indicate that the save/restore of use_clauses + should not be done in Save/Restore_Scope_Stack, because it is performed + locally. + + * sem_ch8.adb: + (Save_Scope_Stack, Restore_Scope_Stack): Add parameter to indicate + whether use clauses should be removed/restored. + + * sem_ch8.ads: + (Save_Scope_Stack, Restore_Scope_Stack): Add parameter to indicate + whether use clauses should be removed/restored. + 2003-10-26 Andreas Jaeger * Makefile.in: Remove duplicated lines. diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in index 4ce68a6057d..45e16f94335 100644 --- a/gcc/ada/Make-lang.in +++ b/gcc/ada/Make-lang.in @@ -1,4 +1,4 @@ -# Top level makefile fragment for GNU Ada (GNAT). +# Top level -*- makefile -*- fragment for GNU Ada (GNAT). # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. @@ -24,7 +24,7 @@ # # foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-normal, foo.install-common, foo.install-man, -# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. @@ -46,11 +46,6 @@ RMDIR = rm -rf # default extensions shext = -X_ADA_CFLAGS = -T_ADA_CFLAGS = - -X_ADAFLAGS = -T_ADAFLAGS = # Extra flags to pass to recursive makes. BOOT_ADAFLAGS= $(ADAFLAGS) @@ -86,6 +81,7 @@ ADA_FLAGS_TO_PASS = \ ada-warn = $(ALL_ADA_CFLAGS) $(WERROR) # unresolved warnings in a couple of files ada/tracebak.o-warn = -Wno-error +ada/b_gnat1.o-warn = -Wno-error ada/b_gnatb.o-warn = -Wno-error .adb.o: @@ -122,7 +118,7 @@ GNAT1_C_OBJS = ada/b_gnat1.o ada/adadecode.o ada/adaint.o ada/cstreams.o \ # Object files from Ada sources that are used by gnat1 GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \ - ada/a-ioexce.o \ + ada/a-elchha.o ada/a-ioexce.o \ ada/s-memory.o ada/s-carun8.o ada/s-casuti.o ada/s-strcom.o ada/s-purexc.o \ ada/s-htable.o ada/s-traceb.o ada/s-mastop.o ada/s-except.o ada/ali.o \ ada/alloc.o ada/atree.o ada/butil.o ada/casing.o ada/checks.o ada/comperr.o \ @@ -157,7 +153,7 @@ GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \ ada/stylesw.o ada/validsw.o ada/system.o ada/table.o ada/targparm.o \ ada/tbuild.o ada/tree_gen.o ada/tree_io.o ada/treepr.o ada/treeprs.o \ ada/ttypef.o ada/ttypes.o ada/types.o ada/uintp.o ada/uname.o ada/urealp.o \ - ada/usage.o ada/widechar.o + ada/usage.o ada/widechar.o ada/s-crtl.o # Object files for gnat executables GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o @@ -177,6 +173,7 @@ GNATBIND_OBJS = \ ada/tracebak.o \ ada/a-except.o \ ada/ada.o \ + ada/a-elchha.o \ ada/ali-util.o \ ada/ali.o \ ada/alloc.o \ @@ -215,6 +212,7 @@ GNATBIND_OBJS = \ ada/s-carun8.o \ ada/s-casuti.o \ ada/s-crc32.o \ + ada/s-crtl.o \ ada/s-except.o \ ada/s-exctab.o \ ada/s-htable.o \ @@ -294,10 +292,10 @@ regnattools: # use host-gcc host-gnatmake host-gnatbind host-gnatlink # put the host RTS dir first in the PATH to hide the default runtime # files that are among the sources -RTS_DIR:=$(dir $(subst \,/,$(shell $(CC) -print-libgcc-file-name))) +RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) cross-gnattools: force $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)\ - ADA_INCLUDES="-I$(RTS_DIR)adainclude -I$(RTS_DIR)adalib" \ + ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \ GNATMAKE="gnatmake" \ GNATBIND="gnatbind" \ GNATLINK="gnatlink" \ @@ -407,10 +405,6 @@ ada.all.cross: then \ $(MV) gnatprep$(exeext) gnatprep-cross$(exeext); \ fi - -if [ -f gnatpsta$(exeext) ] ; \ - then \ - $(MV) gnatpsta$(exeext) gnatpsta-cross$(exeext); \ - fi -if [ -f gnatxref$(exeext) ] ; \ then \ $(MV) gnatxref$(exeext) gnatxref-cross$(exeext); \ @@ -440,34 +434,56 @@ ada.start.encap: ada.rest.encap: ada.tags: force - cd $(srcdir)/ada; etags *.c *.h *.ads *.adb + cd $(srcdir)/ada; etags -o TAGS.sub *.c *.h *.ads *.adb; \ + etags --include TAGS.sub --include ../TAGS.sub + ada.generated-manpages: # Generate documentation. # # The generated Texinfo files for the User Guide are stored in -# $(srcdir), like the Info files. +# $(srcdir). However, if the documentation files depended on +# executables in the build tree, there'd be no way to ship a source +# tree with the documentation already generated such that `make' +# wouldn't attempt to rebuild it. So, we punt and arrange for the +# documentation files to depend on a stamp file which has the +# combined dependencies of the texi files and the generatator file. +# This stamp file calls a submake to build the executable. +# +# If gnu make 3.80 is ever made a requirement to build, then +# this dance could be avoided using an order-only dependency: +# +# $(srcdir)/ada/gnat_ug_unx.texi: \ +# ada/gnat_ug.texi ada/ug_words | ada/doctools/xgnatug$(build_exeext) + +$(srcdir)/ada/stamp-xgnatug: ada/xgnatug.adb ada/gnat_ug.texi ada/ug_words + $(MAKE) ada/doctools/xgnatug$(build_exeext) + $(STAMP) $(srcdir)/ada/stamp-xgnatug -ada/doctools/xgnatug : ada/xgnatug.adb +ada/doctools/xgnatug$(build_exeext): ada/xgnatug.adb -$(MKDIR) ada/doctools cp $^ ada/doctools cd ada/doctools && gnatmake -q xgnatug -$(srcdir)/ada/gnat_ug_unx.texi : ada/doctools/xgnatug \ - $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words - ada/doctools/xgnatug unx $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_unx.texi +$(srcdir)/ada/gnat_ug_unx.texi: $(srcdir)/ada/stamp-xgnatug + ada/doctools/xgnatug unx $(srcdir)/ada/gnat_ug.texi \ + $(srcdir)/ada/ug_words \ + $(srcdir)/ada/gnat_ug_unx.texi -$(srcdir)/ada/gnat_ug_vms.texi : ada/doctools/xgnatug \ - $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words - ada/doctools/xgnatug vms $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_vms.texi +$(srcdir)/ada/gnat_ug_vms.texi: $(srcdir)/ada/stamp-xgnatug + ada/doctools/xgnatug vms $(srcdir)/ada/gnat_ug.texi \ + $(srcdir)/ada/ug_words \ + $(srcdir)/ada/gnat_ug_vms.texi -$(srcdir)/ada/gnat_ug_vxw.texi : ada/doctools/xgnatug \ - $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words - ada/doctools/xgnatug vxworks $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_vxw.texi +$(srcdir)/ada/gnat_ug_vxw.texi: $(srcdir)/ada/stamp-xgnatug + ada/doctools/xgnatug vxworks $(srcdir)/ada/gnat_ug.texi \ + $(srcdir)/ada/ug_words \ + $(srcdir)/ada/gnat_ug_vxw.texi -$(srcdir)/ada/gnat_ug_wnt.texi : ada/doctools/xgnatug \ - $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words - ada/doctools/xgnatug wnt $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_wnt.texi +$(srcdir)/ada/gnat_ug_wnt.texi: $(srcdir)/ada/stamp-xgnatug + ada/doctools/xgnatug wnt $(srcdir)/ada/gnat_ug.texi \ + $(srcdir)/ada/ug_words \ + $(srcdir)/ada/gnat_ug_wnt.texi $(docobjdir)/gnat_ug_unx.info : $(srcdir)/ada/gnat_ug_unx.texi \ $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi \ @@ -510,39 +526,38 @@ install-info:: $(DESTDIR)$(infodir)/gnat_ug_vms.info \ $(DESTDIR)$(infodir)/gnat_rm.info \ $(DESTDIR)$(infodir)/gnat-style.info -ada/gnat_ug_unx.dvi : $(srcdir)/ada/gnat_ug_unx.texi \ - $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_unx.dvi $$s/ada/gnat_ug_unx.texi +dvi:: $(docobjdir)/gnat_ug_vms.dvi $(docobjdir)/gnat_ug_wnt.dvi \ + $(docobjdir)/gnat_ug_unx.dvi $(docobjdir)/gnat_ug_vxw.dvi \ + $(docobjdir)/gnat_rm.dvi $(docobjdir)/gnat-style.dvi -ada/gnat_ug_vms.dvi : $(srcdir)/ada/gnat_ug_vms.texi \ - $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_vms.dvi $$s/ada/gnat_ug_vms.texi +$(docobjdir)/gnat_ug_unx.dvi: ada/gnat_ug_unx.texi \ + $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< -ada/gnat_ug_vxw.dvi : $(srcdir)/ada/gnat_ug_vxw.texi \ - $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_vxw.dvi $$s/ada/gnat_ug_vxw.texi +$(docobjdir)/gnat_ug_vms.dvi: ada/gnat_ug_vms.texi \ + $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< -ada/gnat_ug_wnt.dvi : $(srcdir)/ada/gnat_ug_wnt.texi \ - $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_wnt.dvi $$s/ada/gnat_ug_wnt.texi +$(docobjdir)/gnat_ug_vxw.dvi: ada/gnat_ug_vxw.texi \ + $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< -ada/gnat_rm.dvi : $(srcdir)/ada/gnat_rm.texi \ - $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_rm.dvi $$s/ada/gnat_rm.texi +$(docobjdir)/gnat_ug_wnt.dvi: ada/gnat_ug_wnt.texi \ + $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< -ada/gnat-style.dvi : $(srcdir)/ada/gnat-style.texi \ - $(srcdir)/doc/include/fdl.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; \ - cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat-style.dvi $$s/ada/gnat-style.texi +$(docobjdir)/gnat_rm.dvi: ada/gnat_rm.texi \ + $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< -dvi:: ada/gnat_ug_vms.dvi ada/gnat_ug_wnt.dvi \ - ada/gnat_ug_unx.dvi ada/gnat_ug_vxw.dvi \ - ada/gnat_rm.dvi ada/gnat-style.dvi +$(docobjdir)/gnat-style.dvi: ada/gnat-style.texi $(docdir)/include/fdl.texi \ + stmp-docobjdir + $(TEXI2DVI) -c -I $(docdir)/include -o $@ $< # Install hooks: @@ -715,21 +730,6 @@ ada.install-common: fi ; \ fi -if [ -f gnat1$(exeext) ] ; \ - then \ - if [ -f gnatpsta-cross$(exeext) ] ; \ - then \ - $(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext); \ - $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext); \ - if [ -d $(DESTDIR)$(tooldir)/bin/. ] ; then \ - rm -f $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext); \ - $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext); \ - fi; \ - else \ - $(RM) $(DESTDIR)$(bindir)/gnatpsta$(exeext); \ - $(INSTALL_PROGRAM) gnatpsta$(exeext) $(DESTDIR)$(bindir)/gnatpsta$(exeext); \ - fi ; \ - fi - -if [ -f gnat1$(exeext) ] ; \ then \ if [ -f gnatxref-cross$(exeext) ] ; \ then \ @@ -862,7 +862,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(bindir)/gnatmem$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatname$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatprep$(exeext) - -$(RM) $(DESTDIR)$(bindir)/gnatpsta$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatxref$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatclean$(exeext) -$(RM) $(DESTDIR)$(bindir)/gnatsym$(exeext) @@ -880,7 +879,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatmem$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatname$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatprep$(exeext) - -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatxref$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatclean$(exeext) -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatsym$(exeext) @@ -898,7 +896,6 @@ ada.uninstall: -$(RM) $(DESTDIR)$(tooldir)/bin/gnatmem$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatname$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatprep$(exeext) - -$(RM) $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatxref$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatclean$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/gnatsym$(exeext) @@ -928,7 +925,6 @@ ada.distclean: -$(RM) gnatmem$(exeext) -$(RM) gnatname$(exeext) -$(RM) gnatprep$(exeext) - -$(RM) gnatpsta$(exeext) -$(RM) gnatfind$(exeext) -$(RM) gnatxref$(exeext) -$(RM) gnatclean$(exeext) @@ -939,10 +935,9 @@ ada.distclean: -$(RMDIR) ada/rts -$(RM) ada/tools/* -$(RMDIR) ada/tools -ada.extraclean: ada.maintainer-clean: - -$(RM) ada/a-sinfo.h - -$(RM) ada/a-einfo.h + -$(RM) ada/sinfo.h + -$(RM) ada/einfo.h -$(RM) ada/nmake.adb -$(RM) ada/nmake.ads -$(RM) ada/treeprs.ads @@ -969,7 +964,17 @@ ada.stagefeedback: stagefeedback-start -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stagefeedback/ada -$(MV) ada/stamp-* stagefeedback/ada -check-ada: +check-ada: check-gnat + +ACATSDIR = $(TESTSUITEDIR)/ada/acats + +check-gnat: + test -d $(ACATSDIR) || mkdir -p $(ACATSDIR) + testdir=`cd ${srcdir}/${ACATSDIR}; ${PWD_COMMAND}`; \ + export testdir; cd $(ACATSDIR); $${testdir}/run_acats $(CHAPTERS) + +.PHONY: check-gnat + # Bootstrapping targets for just GNAT - use the same stage directories gnatboot: force @@ -1054,7 +1059,7 @@ ada/nmake.adb : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb $(CP) $^ ada/bldtools (cd ada/bldtools; gnatmake -q xnmake ; ./xnmake -b ../nmake.adb ) -ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb +ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/nmake.adb -$(MKDIR) ada/bldtools $(CP) $^ ada/bldtools (cd ada/bldtools; gnatmake -q xnmake ; ./xnmake -s ../nmake.ads ) @@ -1063,33 +1068,32 @@ update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \ ada/nmake.ads $(CP) $^ $(srcdir)/ada -# Note: the strings below do not make sense for Ada strings in the OS/2 -# case. This is ignored for now since the OS/2 version doesn't use -# these -- there are no default locations. ada/sdefault.adb: ada/stamp-sdefault ; @true ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \ Makefile $(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb + $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb $(ECHO) "package body Sdefault is" >>tmp-sdefault.adb - $(ECHO) " S1 : aliased constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb - $(ECHO) " S2 : aliased constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb - $(ECHO) " S3 : aliased constant String := \"$(target)/\";" >>tmp-sdefault.adb - $(ECHO) " S4 : aliased constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb + $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb + $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb + $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb + $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb + $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb $(ECHO) " begin" >>tmp-sdefault.adb - $(ECHO) " return new String'(S1);" >>tmp-sdefault.adb + $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb $(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb $(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb $(ECHO) " begin" >>tmp-sdefault.adb - $(ECHO) " return new String'(S2);" >>tmp-sdefault.adb + $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb $(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb $(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb $(ECHO) " begin" >>tmp-sdefault.adb - $(ECHO) " return new String'(S3);" >>tmp-sdefault.adb + $(ECHO) " return Relocate_Path (S0, S3);" >>tmp-sdefault.adb $(ECHO) " end Target_Name;" >>tmp-sdefault.adb $(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb $(ECHO) " begin" >>tmp-sdefault.adb - $(ECHO) " return new String'(S4);" >>tmp-sdefault.adb + $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb $(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb $(ECHO) "end Sdefault;" >> tmp-sdefault.adb $(srcdir)/move-if-change tmp-sdefault.adb ada/sdefault.adb @@ -1097,7 +1101,7 @@ ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \ ada/sdefault.o : ada/sdefault.ads ada/sdefault.adb ada/types.ads \ ada/unchdeal.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/unchconv.ads + ada/unchconv.ads ada/osint.ads ADA_TREE_H = ada/ada-tree.h ada/ada-tree.def @@ -1196,7 +1200,7 @@ ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(LANGHOOKS_DEF_H) libfuncs.h $(OPTABS_H) ada/ada.h ada/types.h \ ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \ ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \ - ada/adadecode.h opts.h options.h target.h + ada/adadecode.h opts.h options.h target.h real.h ada/targtyps.o : ada/targtyps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ada/ada.h ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/uintp.h \ @@ -1230,95 +1234,118 @@ ada/a-charac.o : ada/ada.ads ada/a-charac.ads ada/system.ads ada/a-chlat1.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \ ada/system.ads -ada/ada.o : ada/ada.ads ada/system.ads +ada/a-elchha.o : ada/ada.ads ada/a-except.ads ada/a-elchha.ads \ + ada/a-elchha.adb ada/system.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-traent.ads ada/unchconv.ads ada/a-except.o : ada/ada.ads ada/a-except.ads ada/a-except.adb \ ada/a-excach.adb ada/a-exexda.adb ada/a-exexpr.adb ada/a-exextr.adb \ - ada/a-excpol.adb ada/a-exstat.adb ada/a-unccon.ads ada/a-uncdea.ads \ - ada/interfac.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ + ada/a-elchha.ads ada/a-excpol.adb ada/a-exstat.adb ada/a-unccon.ads \ + ada/a-uncdea.ads ada/interfac.ads ada/system.ads ada/s-exctab.ads \ ada/s-except.ads ada/s-mastop.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-traceb.ads ada/s-traent.ads ada/s-unstyp.ads ada/unchconv.ads + ada/s-traceb.ads ada/s-traent.ads ada/s-traent.adb ada/s-unstyp.ads \ + ada/unchconv.ads -ada/a-ioexce.o : ada/ada.ads ada/a-ioexce.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/unchconv.ads +ada/a-ioexce.o : ada/ada.ads ada/a-except.ads ada/a-ioexce.ads \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.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/unchconv.ads -ada/ali.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \ - ada/ali.adb ada/alloc.ads ada/butil.ads ada/casing.ads ada/debug.ads \ - ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ - ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \ - ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads +ada/ada.o : ada/ada.ads ada/system.ads ada/ali-util.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \ ada/ali-util.ads ada/ali-util.adb ada/alloc.ads ada/binderr.ads \ ada/casing.ads ada/debug.ads ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/interfac.ads ada/lib.ads ada/namet.ads ada/opt.ads ada/osint.ads \ - ada/output.ads ada/rident.ads ada/system.ads ada/s-assert.ads \ - ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \ - ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/interfac.ads ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads \ + ada/osint.ads ada/output.ads ada/rident.ads ada/system.ads \ + ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads ada/s-exctab.adb \ + ada/s-htable.ads ada/s-htable.adb ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads + +ada/ali.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \ + ada/ali.adb ada/alloc.ads ada/butil.ads ada/casing.ads ada/debug.ads \ + ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-htable.adb ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads ada/alloc.o : ada/alloc.ads ada/system.ads ada/atree.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \ ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \ - ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \ + ada/einfo.adb ada/elists.ads ada/elists.adb ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads + +ada/back_end.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/back_end.ads ada/back_end.adb ada/casing.ads \ + ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/fname.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \ + ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/switch.ads ada/switch-c.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/back_end.o : ada/alloc.ads ada/atree.ads ada/back_end.ads \ - ada/back_end.adb ada/casing.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \ - ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/switch.ads ada/switch-c.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads ada/bcheck.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/ali-util.ads \ - ada/alloc.ads ada/bcheck.ads ada/bcheck.adb ada/binderr.ads \ - ada/butil.ads ada/casing.ads ada/fname.ads ada/gnat.ads \ - ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \ - ada/rident.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ + ada/ali-util.adb ada/alloc.ads ada/bcheck.ads ada/bcheck.adb \ + ada/binderr.ads ada/butil.ads ada/casing.ads ada/debug.ads \ + ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \ + ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads ada/osint.ads \ + ada/output.ads ada/rident.ads ada/system.ads ada/s-crc32.ads \ + ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/widechar.ads ada/binde.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \ ada/binde.ads ada/binde.adb ada/binderr.ads ada/butil.ads \ ada/casing.ads ada/debug.ads ada/fname.ads ada/gnat.ads \ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/namet.ads ada/opt.ads ada/output.ads \ - ada/rident.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ - ada/unchdeal.ads + ada/hostparm.ads ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads \ + ada/output.ads ada/rident.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \ + ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/widechar.ads ada/binderr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/binderr.ads \ - ada/binderr.adb ada/butil.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ - ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/binderr.adb ada/butil.ads ada/debug.ads ada/gnat.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/opt.ads ada/output.ads ada/system.ads \ + ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/bindgen.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \ ada/binde.ads ada/bindgen.ads ada/bindgen.adb ada/butil.ads \ @@ -1326,60 +1353,79 @@ ada/bindgen.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ ada/osint.ads ada/osint-b.ads ada/output.ads ada/rident.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-memory.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-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/targparm.ads ada/tree_io.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-memory.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-strops.ads \ + ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/bindusg.o : ada/bindusg.ads ada/bindusg.adb ada/gnat.ads \ ada/g-os_lib.ads ada/g-string.ads ada/osint.ads ada/output.ads \ ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ ada/types.ads ada/unchconv.ads ada/unchdeal.ads -ada/butil.o : ada/alloc.ads ada/butil.ads ada/butil.adb ada/hostparm.ads \ - ada/namet.ads ada/output.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/types.ads \ - ada/unchconv.ads ada/unchdeal.ads +ada/butil.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/butil.ads \ + ada/butil.adb ada/debug.ads ada/gnat.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/opt.ads ada/output.ads ada/system.ads ada/s-exctab.ads \ + ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads -ada/casing.o : ada/alloc.ads ada/casing.ads ada/casing.adb ada/csets.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/opt.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads +ada/casing.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ + ada/casing.adb ada/csets.ads ada/csets.adb ada/debug.ads ada/gnat.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/opt.ads ada/output.ads ada/system.ads \ + ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/widechar.ads ada/checks.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ - ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_ch2.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \ - ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.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/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads \ + ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/fname.ads \ + ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \ + ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \ + ada/lib-sort.adb ada/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_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads ada/validsw.ads ada/comperr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/comperr.ads ada/comperr.adb ada/debug.ads \ - ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/fname.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \ - ada/osint.ads ada/output.ads ada/sdefault.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/sprint.ads ada/system.ads \ - ada/s-exctab.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-traent.ads \ - ada/s-unstyp.ads ada/table.ads ada/treepr.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/comperr.ads ada/comperr.adb \ + ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/output.ads \ + ada/output.adb ada/sdefault.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/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/treepr.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/csets.o : ada/csets.ads ada/csets.adb ada/gnat.ads ada/g-string.ads \ ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/system.ads \ @@ -1387,522 +1433,840 @@ ada/csets.o : ada/csets.ads ada/csets.adb ada/gnat.ads ada/g-string.ads \ ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/cstand.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/csets.ads ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/layout.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/rident.ads ada/sem_mech.ads \ - ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/tbuild.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \ + ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \ + ada/layout.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ + ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-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/ttypef.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/urealp.adb ada/widechar.ads + +ada/debug.o : ada/debug.ads ada/debug.adb ada/system.ads ada/debug_a.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/debug.ads ada/debug_a.ads ada/debug_a.adb \ - ada/einfo.ads ada/output.ads ada/sinfo.ads ada/sinput.ads \ - ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \ + ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/nlists.ads ada/nlists.adb ada/opt.ads \ + ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ ada/unchdeal.ads ada/urealp.ads -ada/debug.o : ada/debug.ads ada/debug.adb ada/system.ads - ada/einfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/einfo.ads ada/einfo.adb ada/namet.ads ada/nlists.ads ada/output.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/snames.adb \ + ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/elists.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/elists.ads ada/elists.adb ada/gnat.ads ada/g-os_lib.ads \ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \ - ada/output.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads + +ada/err_vars.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/err_vars.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/output.ads \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-memory.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-unstyp.ads \ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/errout.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/errout.adb \ - ada/erroutc.ads ada/fname.ads ada/gnat.ads ada/g-htable.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads \ - ada/scans.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ - ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \ + ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \ + ada/errout.adb ada/erroutc.ads ada/fname.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/scans.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/erroutc.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ ada/debug.ads ada/err_vars.ads ada/erroutc.ads ada/erroutc.adb \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \ - ada/rident.ads ada/sinput.ads ada/snames.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads - -ada/err_vars.o : ada/alloc.ads ada/err_vars.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads - -ada/eval_fat.o : ada/alloc.ads ada/einfo.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/eval_fat.adb \ - ada/hostparm.ads ada/rident.ads ada/sem_util.ads ada/snames.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/targparm.ads \ - ada/ttypef.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/output.adb ada/rident.ads ada/sinput.ads ada/sinput.adb \ + ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads -ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch3.ads ada/exp_ch7.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/freeze.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \ +ada/eval_fat.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/eval_fat.ads ada/eval_fat.adb ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/rident.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tree_io.ads ada/ttypef.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/urealp.adb -ada/expander.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \ - ada/exp_attr.ads ada/exp_ch11.ads ada/exp_ch12.ads ada/exp_ch13.ads \ - ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch5.ads \ - ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch8.ads ada/exp_ch9.ads \ - ada/exp_prag.ads ada/expander.ads ada/expander.adb ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads \ - ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.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-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \ + ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch11.ads ada/exp_ch2.ads \ + ada/exp_ch3.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ + ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/exp_attr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/einfo.ads ada/exp_attr.ads ada/exp_attr.adb \ - ada/exp_ch2.ads ada/exp_ch9.ads ada/exp_imgv.ads ada/exp_pakd.ads \ - ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.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_attr.ads ada/exp_attr.adb \ + ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_ch9.ads \ + ada/exp_imgv.ads ada/exp_pakd.ads ada/exp_strm.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \ + ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \ - ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \ + ada/widechar.ads ada/exp_ch11.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/atree.adb ada/casing.ads ada/casing.adb 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_ch11.ads \ ada/exp_ch11.adb ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch5.ads ada/sem_ch8.ads ada/sem_res.ads ada/sem_util.ads \ - ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/exp_ch12.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/exp_ch12.ads ada/exp_ch12.adb ada/exp_tss.ads ada/exp_util.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/rtsfind.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/interfac.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/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_ch5.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/exp_ch13.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/elists.ads ada/exp_ch13.ads ada/exp_ch13.adb ada/exp_ch3.ads \ - ada/exp_ch6.ads ada/exp_imgv.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads \ - ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ +ada/exp_ch12.o : ada/ada.ads ada/a-except.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/exp_ch12.ads ada/exp_ch12.adb \ + ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/rident.ads ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads -ada/exp_ch2.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch2.ads ada/exp_ch2.adb ada/exp_smem.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/exp_vfpt.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem.ads ada/sem_eval.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch11.ads \ - ada/exp_ch3.ads ada/exp_ch3.adb ada/exp_ch4.ads ada/exp_ch7.ads \ - ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_smem.ads \ - ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/freeze.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ +ada/exp_ch13.o : ada/ada.ads ada/a-except.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/exp_ch13.ads ada/exp_ch13.adb \ + ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_imgv.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch7.ads \ + ada/sem_ch8.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/validsw.ads + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ + ada/tree_io.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + +ada/exp_ch2.o : ada/ada.ads ada/a-except.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/elists.adb ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch2.ads \ + ada/exp_ch2.adb ada/exp_ch7.ads ada/exp_smem.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/exp_vfpt.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.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_ch8.ads \ + ada/sem_eval.ads ada/sem_res.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-imgenu.ads ada/s-memory.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-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_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads \ + ada/exp_ch3.ads ada/exp_ch3.adb ada/exp_ch4.ads ada/exp_ch7.ads \ + ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_smem.ads \ + ada/exp_strm.ads ada/exp_tss.ads ada/exp_tss.adb ada/exp_util.ads \ + ada/expander.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads \ + ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \ + ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \ + ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads \ + ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads \ + ada/sem_intr.ads ada/sem_mech.ads ada/sem_res.ads ada/sem_res.adb \ + ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch3.ads \ - ada/exp_ch4.ads ada/exp_ch4.adb ada/exp_ch7.ads ada/exp_ch9.ads \ - ada/exp_disp.ads ada/exp_fixd.ads ada/exp_pakd.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/exp_vfpt.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rident.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch13.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-cn.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \ + ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads \ + ada/exp_ch4.adb ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \ + ada/exp_fixd.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \ + ada/exp_util.adb ada/exp_vfpt.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.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_cat.ads \ + ada/sem_ch13.ads ada/sem_ch8.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/sinfo-cn.ads ada/sinput.ads ada/snames.ads \ + ada/sprint.ads ada/stand.ads ada/stringt.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/validsw.ads ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/einfo.ads ada/exp_aggr.ads ada/exp_ch11.ads \ - ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch7.ads ada/exp_dbug.ads \ - ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch13.ads \ - ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \ + ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch5.ads ada/exp_ch5.adb \ + ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \ + ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ + ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \ + ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch6.ads \ - ada/exp_ch6.adb ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_dbug.ads \ - ada/exp_disp.ads ada/exp_dist.ads ada/exp_intr.ads ada/exp_pakd.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \ - ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch6.ads ada/sem_ch8.ads \ - ada/sem_disp.ads ada/sem_dist.ads ada/sem_res.ads ada/sem_util.ads \ - ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imgenu.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads \ + ada/exp_ch6.ads ada/exp_ch6.adb ada/exp_ch7.ads ada/exp_ch9.ads \ + ada/exp_dbug.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_intr.ads \ + ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \ + ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-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_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \ + ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch4.ads ada/sem_ch6.ads \ + ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \ + ada/sem_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/snames.ads \ + ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads -ada/exp_ch7.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ - ada/exp_ch7.ads ada/exp_ch7.adb ada/exp_ch9.ads ada/exp_dbug.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_ch3.ads ada/sem_ch7.ads ada/sem_ch8.ads \ +ada/exp_ch7.o : ada/ada.ads ada/a-except.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_ch11.ads ada/exp_ch7.ads ada/exp_ch7.adb \ + ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_tss.ads ada/exp_util.ads \ + ada/exp_util.adb ada/fname.ads ada/fname-uf.ads ada/freeze.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/sem.ads \ + ada/sem_ch3.ads ada/sem_ch7.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/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads -ada/exp_ch8.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/exp_ch8.ads \ +ada/exp_ch8.o : ada/ada.ads ada/a-except.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_ch11.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/freeze.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/opt.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/exp_util.adb ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.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_ch8.ads ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-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/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch11.ads ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch9.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/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ + ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \ ada/exp_ch9.adb ada/exp_dbug.ads ada/exp_smem.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/freeze.ads ada/gnat.ads ada/g-htable.ads \ + ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ + ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \ + ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ ada/sem_ch11.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_elab.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads - -ada/exp_code.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_code.ads \ - ada/exp_code.adb ada/fname.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \ - ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/exp_dbug.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/einfo.ads ada/exp_dbug.ads ada/exp_dbug.adb \ - ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/output.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads \ + ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads + +ada/exp_code.o : ada/ada.ads ada/a-except.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/eval_fat.ads ada/exp_code.ads \ + ada/exp_code.adb ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/lib-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_cat.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/widechar.ads -ada/exp_disp.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ +ada/exp_dbug.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/exp_dbug.ads ada/exp_dbug.adb ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.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/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/widechar.ads + +ada/exp_disp.o : ada/ada.ads ada/a-except.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/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ ada/exp_ch7.ads ada/exp_disp.ads ada/exp_disp.adb ada/exp_tss.ads \ - ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \ - ada/sem_disp.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/exp_tss.adb ada/exp_util.ads ada/exp_util.adb ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \ + ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-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_ch8.ads \ + ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \ + ada/widechar.ads -ada/exp_dist.o : ada/ada.ads ada/a-uncdea.ads ada/alloc.ads ada/atree.ads \ - ada/einfo.ads ada/elists.ads ada/exp_dist.ads ada/exp_dist.adb \ - ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads \ - ada/g-htable.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads ada/sem_ch8.ads \ - ada/sem_dist.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ +ada/exp_dist.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ + ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads \ + ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \ + ada/exp_dist.ads ada/exp_dist.adb ada/exp_strm.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/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_ch3.ads \ + ada/sem_ch8.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/stringt.adb ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ ada/unchdeal.ads ada/urealp.ads -ada/exp_fixd.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/exp_fixd.ads ada/exp_fixd.adb ada/exp_tss.ads ada/exp_util.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/exp_fixd.o : ada/ada.ads ada/a-except.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/eval_fat.ads ada/exp_fixd.ads ada/exp_fixd.adb \ + ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \ + ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \ + ada/sem_ch8.ads ada/sem_eval.ads ada/sem_eval.adb 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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tbuild.ads ada/tree_io.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/urealp.adb -ada/exp_imgv.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \ - ada/einfo.ads ada/exp_imgv.ads ada/exp_imgv.adb ada/exp_tss.ads \ - ada/exp_util.ads ada/get_targ.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem_res.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ +ada/exp_imgv.o : ada/ada.ads ada/a-except.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/exp_imgv.ads ada/exp_imgv.adb \ + ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem_res.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads -ada/exp_intr.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \ +ada/exp_intr.o : ada/ada.ads ada/a-except.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_ch11.ads ada/exp_ch4.ads \ + ada/exp_ch7.ads ada/exp_code.ads ada/exp_fixd.ads ada/exp_intr.ads \ + ada/exp_intr.adb ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \ + ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \ + ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \ + ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \ + ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \ + ada/widechar.ads + +ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ - ada/exp_ch4.ads ada/exp_ch7.ads ada/exp_code.ads ada/exp_fixd.ads \ - ada/exp_intr.ads ada/exp_intr.adb ada/exp_tss.ads ada/exp_util.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/itypes.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ + ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads \ + ada/exp_pakd.adb ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.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_eval.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/exp_pakd.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb ada/exp_tss.ads \ - ada/exp_util.ads ada/get_targ.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/tbuild.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \ + ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads -ada/exp_prag.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ - ada/exp_prag.ads ada/exp_prag.adb ada/exp_tss.ads ada/exp_util.ads \ - ada/expander.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ +ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/casing.adb 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_ch11.ads ada/exp_prag.ads \ + ada/exp_prag.adb ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_eval.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/snames.adb ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/types.ads \ + ada/types.adb ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/exp_smem.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/exp_smem.ads ada/exp_smem.adb ada/exp_tss.ads ada/exp_util.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads +ada/exp_smem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/exp_smem.ads ada/exp_smem.adb ada/exp_tss.ads \ + ada/exp_util.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \ + ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ + ada/rtsfind.ads ada/sem.ads ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/exp_strm.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/exp_strm.ads ada/exp_strm.adb ada/exp_tss.ads ada/get_targ.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/rtsfind.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/table.ads ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/exp_strm.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/exp_strm.ads ada/exp_strm.adb ada/exp_tss.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \ + ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ + ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads -ada/exp_tss.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/elists.ads \ - ada/exp_tss.ads ada/exp_tss.adb ada/exp_util.ads ada/lib.ads \ - ada/namet.ads ada/rtsfind.ads ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/exp_tss.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/exp_tss.ads ada/exp_tss.adb \ + ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/rtsfind.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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/exp_util.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/exp_util.adb ada/get_targ.ads ada/gnat.ads ada/g-string.ads \ +ada/exp_util.o : ada/ada.ads ada/a-except.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/elists.adb ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads \ + ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \ + ada/fname.ads ada/fname-uf.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/targparm.ads ada/tbuild.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ - ada/validsw.ads + ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \ + ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch8.ads \ + ada/sem_eval.ads ada/sem_eval.adb 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-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/urealp.adb ada/validsw.ads -ada/exp_vfpt.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/exp_vfpt.ads ada/exp_vfpt.adb ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/rtsfind.ads ada/sem_res.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/tbuild.ads ada/ttypef.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/exp_vfpt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/exp_vfpt.ads ada/exp_vfpt.adb ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \ + ada/sem_res.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \ + ada/ttypef.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb + +ada/expander.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \ + ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_attr.ads \ + ada/exp_ch11.ads ada/exp_ch12.ads ada/exp_ch13.ads ada/exp_ch2.ads \ + ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch5.ads ada/exp_ch6.ads \ + ada/exp_ch7.ads ada/exp_ch8.ads ada/exp_ch9.ads ada/exp_prag.ads \ + ada/expander.ads ada/expander.adb ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads ada/sem_util.ads \ + ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/fmap.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \ ada/debug.ads ada/fmap.ads ada/fmap.adb ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \ - ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads - -ada/fname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ - ada/fname.ads ada/fname.adb ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ - ada/opt.ads ada/output.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/fname-uf.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ ada/alloc.ads ada/casing.ads ada/debug.ads ada/fmap.ads ada/fname.ads \ ada/fname-uf.ads ada/fname-uf.adb ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ ada/krunch.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \ + ada/s-memory.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/widechar.ads + +ada/fname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/fname.ads ada/fname.adb ada/gnat.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/opt.ads ada/output.ads ada/system.ads ada/s-exctab.ads \ + ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/freeze.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ - ada/exp_ch7.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/freeze.ads ada/freeze.adb ada/get_targ.ads ada/gnat.ads \ - ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/layout.ads ada/lib.ads ada/lib-xref.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch6.ads ada/sem_ch7.ads \ - ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_prag.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \ - ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_pakd.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/expander.ads ada/fname.ads ada/freeze.ads \ + ada/freeze.adb ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/itypes.ads ada/layout.ads ada/lib.ads \ + ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/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_cat.ads ada/sem_ch13.ads ada/sem_ch4.ads \ + ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \ + ada/sem_dist.ads ada/sem_elab.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/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-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/widechar.ads -ada/frontend.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \ - ada/cstand.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ +ada/frontend.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \ + ada/cstand.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_ch11.ads \ ada/exp_dbug.ads ada/fmap.ads ada/fname.ads ada/fname-uf.ads \ - ada/frontend.ads ada/frontend.adb ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ - ada/lib.ads ada/lib-load.ads ada/live.ads ada/namet.ads ada/nlists.ads \ - ada/opt.ads ada/osint.ads ada/output.ads ada/par.ads ada/prepcomp.ads \ - ada/rtsfind.ads ada/scn.ads ada/scng.ads ada/sem.ads ada/sem_ch8.ads \ - ada/sem_elab.ads ada/sem_prag.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/sinput.ads ada/sinput-l.ads ada/snames.ads ada/sprint.ads \ - ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/get_targ.o : ada/get_targ.ads ada/get_targ.adb ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \ - ada/unchconv.ads ada/unchdeal.ads + ada/frontend.ads ada/frontend.adb ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \ + ada/live.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/osint.ads ada/output.ads ada/par.ads \ + ada/prepcomp.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_ch8.ads ada/sem_elab.ads ada/sem_prag.ads ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \ + ada/sinput-l.ads ada/snames.ads ada/sprint.ads ada/stand.ads \ + ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ + ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads ada/g-hesora.o : ada/gnat.ads ada/g-hesora.ads ada/g-hesora.adb \ ada/system.ads @@ -1910,56 +2274,67 @@ ada/g-hesora.o : ada/gnat.ads ada/g-hesora.ads ada/g-hesora.adb \ ada/g-htable.o : ada/gnat.ads ada/g-htable.ads ada/g-htable.adb \ ada/system.ads ada/s-htable.ads -ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/back_end.ads ada/casing.ads ada/comperr.ads ada/csets.ads \ - ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/fmap.ads ada/fname.ads \ - ada/fname-uf.ads ada/frontend.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnat1drv.ads ada/gnat1drv.adb \ - ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/lib-writ.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ - ada/opt.ads ada/osint.ads ada/output.ads ada/prepcomp.ads \ - ada/repinfo.ads ada/restrict.ads ada/rident.ads ada/sem.ads \ - ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads \ - ada/sem_type.ads ada/sinfo.ads ada/sinput.ads ada/sinput-l.ads \ - ada/snames.ads ada/sprint.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-soflin.ads \ +ada/g-os_lib.o : ada/ada.ads ada/a-except.ads ada/gnat.ads \ + ada/g-os_lib.ads ada/g-os_lib.adb ada/g-string.ads ada/system.ads \ + ada/s-casuti.ads ada/s-crtl.ads ada/s-exctab.ads ada/s-exctab.adb \ + ada/s-htable.ads ada/s-parame.ads ada/s-secsta.ads ada/s-soflin.ads \ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/targparm.ads ada/tree_gen.ads ada/treepr.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/usage.ads + ada/s-traent.ads ada/unchconv.ads ada/unchdeal.ads + +ada/g-speche.o : ada/gnat.ads ada/g-speche.ads ada/g-speche.adb \ + ada/system.ads + +ada/g-string.o : ada/gnat.ads ada/g-string.ads ada/g-string.adb \ + ada/system.ads ada/unchdeal.ads + +ada/get_targ.o : ada/get_targ.ads ada/get_targ.adb ada/system.ads \ + ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/gnat.o : ada/gnat.ads ada/system.ads +ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/back_end.ads ada/casing.ads ada/comperr.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/fmap.ads \ + ada/fname.ads ada/fname-uf.ads ada/frontend.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnat1drv.ads ada/gnat1drv.adb ada/gnatvsn.ads \ + ada/hostparm.ads ada/inline.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/lib-writ.ads ada/lib-xref.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads \ + ada/output.ads ada/prepcomp.ads ada/repinfo.ads ada/restrict.ads \ + ada/rident.ads ada/sem.ads ada/sem_ch12.ads ada/sem_ch13.ads \ + ada/sem_ch8.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_type.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \ + ada/sinput-l.ads ada/snames.ads ada/sprint.ads ada/stand.ads \ + ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads + ada/gnatbind.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/ali-util.ads \ ada/alloc.ads ada/bcheck.ads ada/binde.ads ada/binderr.ads \ ada/bindgen.ads ada/bindusg.ads ada/butil.ads ada/casing.ads \ - ada/csets.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \ + ada/csets.ads ada/debug.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatbind.ads ada/gnatbind.adb \ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ ada/osint.ads ada/osint-b.ads ada/output.ads ada/rident.ads \ - ada/switch.ads ada/switch-b.ads ada/system.ads ada/s-assert.ads \ - ada/s-casuti.ads ada/s-exctab.ads ada/s-htable.ads ada/s-rident.ads \ + ada/switch.ads ada/switch-b.ads ada/system.ads ada/s-casuti.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-memory.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-strops.ads ada/s-sopco3.ads \ ada/s-sopco4.ads ada/s-sopco5.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads - -ada/gnatvsn.o : ada/gnatvsn.ads ada/system.ads - -ada/g-os_lib.o : ada/ada.ads ada/a-except.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-os_lib.adb ada/g-string.ads ada/system.ads \ - ada/s-casuti.ads ada/s-exctab.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-traent.ads ada/unchconv.ads ada/unchdeal.ads - -ada/g-speche.o : ada/gnat.ads ada/g-speche.ads ada/g-speche.adb \ - ada/system.ads + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads -ada/g-string.o : ada/gnat.ads ada/g-string.ads ada/g-string.adb \ - ada/system.ads ada/unchdeal.ads +ada/gnatvsn.o : ada/gnatvsn.ads ada/gnatvsn.adb ada/system.ads \ + ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads ada/hlo.o : ada/hlo.ads ada/hlo.adb ada/output.ads ada/system.ads \ ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \ @@ -1967,167 +2342,258 @@ ada/hlo.o : ada/hlo.ads ada/hlo.adb ada/output.ads ada/system.ads \ ada/hostparm.o : ada/hostparm.ads ada/system.ads -ada/impunit.o : ada/alloc.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/impunit.ads ada/impunit.adb \ - ada/lib.ads ada/namet.ads ada/opt.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads +ada/impunit.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/impunit.ads ada/impunit.adb ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/namet.adb ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/widechar.ads ada/inline.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \ - ada/exp_ch7.ads ada/exp_tss.ads ada/fname.ads ada/fname-uf.ads \ - ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/inline.ads ada/inline.adb ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads \ - ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch8.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ + ada/atree.adb ada/casing.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_ch11.ads ada/exp_ch7.ads ada/exp_tss.ads \ + ada/exp_tss.adb ada/exp_util.ads ada/fname.ads ada/fname-uf.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/inline.adb ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem_ch10.ads \ + ada/sem_ch12.ads ada/sem_ch8.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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/interfac.o : ada/interfac.ads ada/system.ads -ada/itypes.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/gnat.ads \ +ada/itypes.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads \ - ada/itypes.adb ada/namet.ads ada/opt.ads ada/sem.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/itypes.adb ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads \ + ada/output.ads ada/sem.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ ada/unchdeal.ads ada/urealp.ads ada/krunch.o : ada/hostparm.ads ada/krunch.ads ada/krunch.adb \ ada/system.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads ada/layout.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch3.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.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_ch3.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/layout.ads ada/layout.adb \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/repinfo.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch13.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/lib.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/debug.ads ada/einfo.ads ada/fname.ads ada/gnat.ads \ - ada/g-hesora.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ - ada/lib-sort.adb ada/namet.ads ada/opt.ads ada/output.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \ - ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/layout.ads \ + ada/layout.adb ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/repinfo.ads ada/repinfo.adb 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_ch13.ads ada/sem_ch8.ads \ + ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/lib-load.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \ - ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/fname.ads ada/fname-uf.ads ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-load.ads ada/lib-load.adb ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \ - ada/par.ads ada/rident.ads ada/scn.ads ada/scng.ads ada/sinfo.ads \ - ada/sinput.ads ada/sinput-l.ads ada/snames.ads ada/stand.ads \ - ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads +ada/lib-load.o : ada/ada.ads ada/a-except.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/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/fname.ads ada/fname-uf.ads ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib-load.ads \ + ada/lib-load.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \ + ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/sinput-l.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-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/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/lib-util.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/hostparm.ads ada/lib.ads ada/lib-util.ads \ - ada/lib-util.adb ada/namet.ads ada/osint.ads ada/osint-c.ads \ - ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-unstyp.ads ada/table.ads ada/types.ads \ - ada/unchconv.ads ada/unchdeal.ads +ada/lib-util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-util.adb \ + ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \ + ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/lib-writ.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \ - ada/atree.ads ada/casing.ads ada/debug.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ - ada/fname-uf.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-util.ads ada/lib-writ.ads ada/lib-writ.adb ada/lib-xref.ads \ - ada/namet.ads ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads \ - ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads ada/scn.ads \ - ada/scng.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads ada/s-traent.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/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/fname.ads ada/fname-uf.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \ + ada/lib-util.ads ada/lib-util.adb ada/lib-writ.ads ada/lib-writ.adb \ + ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \ + ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads \ + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/tbuild.ads ada/tbuild.adb ada/tree_io.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/widechar.ads ada/lib-xref.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ - ada/g-hesora.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-xref.ads \ - ada/lib-xref.adb ada/namet.ads ada/nlists.ads ada/opt.ads \ - ada/output.ads ada/sem_prag.ads ada/sinfo.ads ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/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/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-util.adb \ + ada/lib-xref.ads ada/lib-xref.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \ + ada/sem_prag.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads +ada/lib.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/widechar.ads + ada/live.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/lib.ads ada/live.ads ada/live.adb ada/nlists.ads ada/output.ads \ - ada/sem_util.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imgenu.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-traent.ads \ - ada/s-unstyp.ads ada/table.ads ada/tree_io.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/live.ads ada/live.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/system.ads \ ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads ada/s-stache.ads \ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traceb.ads \ - ada/s-traent.ads ada/unchconv.ads + ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads + +ada/namet.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/namet.adb ada/opt.ads ada/output.ads \ + ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/types.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads + +ada/nlists.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads + +ada/nmake.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads -ada/namet.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ +ada/opt.o : ada/ada.ads ada/a-except.ads ada/gnat.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \ + ada/opt.adb ada/system.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads + +ada/osint-b.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/namet.adb ada/opt.ads ada/output.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \ - ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads \ + ada/osint-b.ads ada/osint-b.adb ada/output.ads ada/system.ads \ + ada/s-exctab.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/widechar.ads - -ada/nlists.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/einfo.ads ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \ - ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads ada/snames.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \ - ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/nmake.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/nmake.adb ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/unchdeal.ads -ada/opt.o : ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/opt.ads ada/opt.adb ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads +ada/osint-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads \ + ada/osint-c.ads ada/osint-c.adb ada/output.ads ada/system.ads \ + ada/s-exctab.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/osint.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \ ada/debug.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ ada/namet.ads ada/opt.ads ada/osint.ads ada/osint.adb ada/output.ads \ - ada/sdefault.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ + ada/sdefault.ads ada/system.ads ada/s-casuti.ads ada/s-exctab.ads \ ada/s-htable.ads ada/s-htable.adb ada/s-memory.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-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ @@ -2135,49 +2601,40 @@ ada/osint.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ ada/unchconv.ads ada/unchdeal.ads -ada/osint-b.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-b.ads ada/osint-b.adb \ - ada/system.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads - -ada/osint-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/osint-c.adb \ - ada/system.ads ada/s-assert.ads ada/s-exctab.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tree_io.ads ada/types.ads ada/unchconv.ads \ - ada/unchdeal.ads - ada/output.o : ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ ada/output.ads ada/output.adb ada/system.ads ada/s-exctab.ads \ ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads ada/unchconv.ads \ ada/unchdeal.ads ada/par.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ - ada/fname-uf.ads ada/gnat.ads ada/g-os_lib.ads ada/g-speche.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.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/fname.ads ada/fname-uf.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-load.ads ada/lib-sort.adb ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ ada/osint.ads ada/output.ads ada/par.ads ada/par.adb ada/par-ch10.adb \ ada/par-ch11.adb ada/par-ch12.adb ada/par-ch13.adb ada/par-ch2.adb \ ada/par-ch3.adb ada/par-ch4.adb ada/par-ch5.adb ada/par-ch6.adb \ ada/par-ch7.adb ada/par-ch8.adb ada/par-ch9.adb ada/par-endh.adb \ ada/par-labl.adb ada/par-load.adb ada/par-prag.adb ada/par-sync.adb \ - ada/par-tchk.adb ada/par-util.adb ada/scans.ads ada/scn.ads \ - ada/scng.ads ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads \ - ada/sinput-l.ads ada/snames.ads ada/stringt.ads ada/style.ads \ - ada/styleg.ads ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/par-tchk.adb ada/par-util.adb ada/restrict.ads ada/rident.ads \ + ada/scans.ads ada/scans.adb ada/scn.ads ada/scng.ads ada/scng.adb \ + ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \ + ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/snames.adb \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \ + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \ + ada/widechar.ads ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \ @@ -2185,7 +2642,7 @@ ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads ada/prep.ads \ ada/prep.adb ada/scans.ads ada/sinput.ads ada/snames.ads \ - ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-carun8.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \ ada/s-exctab.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ @@ -2193,730 +2650,1126 @@ ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/prepcomp.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ - ada/alloc.ads ada/casing.ads ada/debug.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-dyntab.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/alloc.ads ada/casing.ads ada/csets.ads ada/debug.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ + ada/g-dyntab.ads ada/g-dyntab.adb ada/g-hesorg.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \ ada/lib.ads ada/lib-writ.ads ada/namet.ads ada/opt.ads ada/osint.ads \ ada/output.ads ada/prep.ads ada/prepcomp.ads ada/prepcomp.adb \ - ada/scans.ads ada/scn.ads ada/scng.ads ada/sinput.ads ada/sinput-l.ads \ - ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinput.ads \ + ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ + ada/s-crc32.adb ada/s-exctab.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads ada/repinfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/debug.ads ada/einfo.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/opt.ads ada/output.ads ada/repinfo.ads \ - ada/repinfo.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/output.adb ada/repinfo.ads \ + ada/repinfo.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/restrict.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/fname.ads ada/fname-uf.ads ada/hostparm.ads \ - ada/lib.ads ada/namet.ads ada/restrict.ads ada/restrict.adb \ - ada/rident.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/system.ads ada/s-exctab.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/fname.ads ada/fname-uf.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/restrict.ads ada/restrict.adb \ + ada/rident.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/rident.o : ada/rident.ads ada/system.ads ada/s-rident.ads ada/rtsfind.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ - ada/fname-uf.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/lib-load.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads ada/rtsfind.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/fname.ads ada/fname-uf.ads \ + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \ ada/rtsfind.adb ada/sem.ads ada/sem_ch7.ads ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-secsta.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-exctab.adb \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads ada/s-assert.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-assert.ads ada/s-assert.adb ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-traent.ads ada/unchconv.ads - -ada/scans.o : ada/alloc.ads ada/scans.ads ada/scans.adb ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/s-assert.ads ada/s-assert.adb ada/s-exctab.ads ada/s-exctab.adb \ + ada/s-htable.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/unchconv.ads ada/s-carun8.o : ada/system.ads ada/s-carun8.ads ada/s-carun8.adb \ ada/unchconv.ads ada/s-casuti.o : ada/system.ads ada/s-casuti.ads ada/s-casuti.adb +ada/s-crc32.o : ada/interfac.ads ada/system.ads ada/s-crc32.ads \ + ada/s-crc32.adb + +ada/s-crtl.o : ada/system.ads ada/s-crtl.ads ada/s-parame.ads + +ada/s-except.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-except.ads ada/s-stalib.ads ada/s-traent.ads ada/unchconv.ads + +ada/s-exctab.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-htable.adb 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/unchconv.ads + +ada/s-htable.o : ada/ada.ads ada/a-uncdea.ads ada/system.ads \ + ada/s-htable.ads ada/s-htable.adb + +ada/s-imgenu.o : ada/system.ads ada/s-imgenu.ads ada/s-imgenu.adb \ + ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads + +ada/s-mastop.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-except.ads ada/s-mastop.ads ada/s-mastop.adb ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads + +ada/s-memory.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-crtl.ads ada/s-memory.ads ada/s-memory.adb 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-traent.ads ada/unchconv.ads + +ada/s-parame.o : ada/system.ads ada/s-parame.ads ada/s-parame.adb + +ada/s-purexc.o : ada/system.ads ada/s-purexc.ads + +ada/s-secsta.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-parame.ads ada/s-secsta.ads ada/s-secsta.adb 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/unchconv.ads ada/unchdeal.ads + +ada/s-soflin.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-except.ads ada/s-mastop.ads ada/s-parame.ads ada/s-secsta.ads \ + ada/s-soflin.ads ada/s-soflin.adb ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads + +ada/s-sopco3.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco3.adb \ + ada/s-sopco4.ads ada/s-sopco5.ads ada/unchconv.ads + +ada/s-sopco4.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ + ada/s-sopco4.adb ada/s-sopco5.ads ada/unchconv.ads + +ada/s-sopco5.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ + ada/s-sopco5.ads ada/s-sopco5.adb ada/unchconv.ads + +ada/s-stache.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-crtl.ads ada/s-parame.ads ada/s-soflin.ads ada/s-stache.ads \ + ada/s-stache.adb ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-traent.ads ada/unchconv.ads + +ada/s-stalib.o : ada/ada.ads ada/a-except.ads ada/system.ads \ + ada/s-memory.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stalib.adb ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \ + ada/unchconv.ads + +ada/s-stoele.o : ada/system.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/unchconv.ads + +ada/s-strcom.o : ada/system.ads ada/s-strcom.ads ada/s-strcom.adb \ + ada/unchconv.ads + +ada/s-strops.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ + ada/s-stoele.adb ada/s-strops.ads ada/s-strops.adb ada/unchconv.ads + +ada/s-traceb.o : ada/system.ads ada/s-traceb.ads ada/s-traceb.adb + +ada/s-traent.o : ada/system.ads ada/s-traent.ads ada/s-traent.adb + +ada/s-unstyp.o : ada/system.ads ada/s-unstyp.ads + +ada/s-wchcnv.o : ada/interfac.ads ada/system.ads ada/s-wchcnv.ads \ + ada/s-wchcnv.adb ada/s-wchcon.ads ada/s-wchjis.ads + +ada/s-wchcon.o : ada/system.ads ada/s-wchcon.ads + +ada/s-wchjis.o : ada/system.ads ada/s-wchjis.ads ada/s-wchjis.adb + +ada/scans.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/opt.ads ada/output.ads ada/scans.ads ada/scans.adb \ + ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/scn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/einfo.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-string.ads \ + ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/namet.ads \ - ada/opt.ads ada/scans.ads ada/scn.ads ada/scn.adb ada/scng.ads \ - ada/scng.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \ - ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ - ada/s-imgenu.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/namet.adb ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/scans.ads ada/scn.ads ada/scn.adb ada/scng.ads ada/scng.adb \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \ + ada/snames.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ ada/widechar.ads -ada/scng.o : ada/alloc.ads ada/casing.ads ada/csets.ads ada/err_vars.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/interfac.ads ada/namet.ads ada/opt.ads ada/scans.ads ada/scng.ads \ - ada/scng.adb ada/sinput.ads ada/snames.ads ada/stringt.ads \ +ada/scng.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ + ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/namet.ads ada/opt.ads ada/output.ads ada/scans.ads \ + ada/scng.ads ada/scng.adb ada/sinput.ads ada/snames.ads ada/stringt.ads \ ada/styleg.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/s-crc32.o : ada/interfac.ads ada/system.ads ada/s-crc32.ads \ - ada/s-crc32.adb - -ada/sem_aggr.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/freeze.ads ada/gnat.ads \ - ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rident.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_aggr.ads ada/sem_aggr.adb ada/sem_cat.ads \ - ada/sem_ch13.ads ada/sem_ch8.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/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - ada/sem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/expander.ads ada/fname.ads \ - ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hlo.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/opt.ads \ - ada/output.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \ - ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \ - ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \ - ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads \ - ada/sem_prag.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \ + ada/debug_a.adb ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/expander.ads \ + ada/fname.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hlo.ads \ + ada/hostparm.ads ada/inline.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/rident.ads ada/sem.ads ada/sem.adb \ + ada/sem_attr.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \ + ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch2.adb ada/sem_ch3.ads \ + ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \ + ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_prag.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-carun8.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \ - ada/a-except.ads ada/alloc.ads ada/atree.ads ada/casing.ads \ - ada/checks.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/eval_fat.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/expander.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sdefault.ads \ - ada/sem.ads ada/sem_attr.ads ada/sem_attr.adb ada/sem_cat.ads \ - ada/sem_ch6.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/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.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-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/tbuild.ads ada/ttypef.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/widechar.ads +ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads \ + ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \ + ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/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_aggr.adb \ + ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch4.ads \ + ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \ + ada/sem_elab.ads ada/sem_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/sprint.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/validsw.ads ada/widechar.ads -ada/sem_case.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ - ada/g-hesora.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/sem.ads \ - ada/sem_case.ads ada/sem_case.adb ada/sem_eval.ads ada/sem_res.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads +ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \ + ada/a-except.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ + ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \ + ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/freeze.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ + ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \ + ada/sem_attr.adb ada/sem_cat.ads ada/sem_ch4.ads ada/sem_ch6.ads \ + ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \ + ada/sem_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_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/system.ads ada/s-carun8.ads \ + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \ + ada/types.adb ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \ + ada/widechar.ads -ada/sem_cat.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \ +ada/sem_case.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.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_tss.ads ada/fname.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \ - ada/nlists.ads ada/opt.ads ada/sem.ads ada/sem_cat.ads ada/sem_cat.adb \ - ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/sem.ads ada/sem_case.ads ada/sem_case.adb \ + 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/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + +ada/sem_cat.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.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_tss.ads ada/fname.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/sem.ads ada/sem_cat.ads \ + ada/sem_cat.adb ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/sem_ch10.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.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/elists.adb \ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \ ada/exp_util.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/impunit.ads ada/inline.ads ada/lib.ads \ - ada/lib-load.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/output.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch10.ads \ - ada/sem_ch10.adb ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \ - ada/sem_dist.ads ada/sem_prag.ads ada/sem_util.ads ada/sem_warn.ads \ - ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \ - ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/impunit.ads ada/inline.ads ada/interfac.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-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_ch10.ads ada/sem_ch10.adb \ + ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads \ + ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/widechar.ads -ada/sem_ch11.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ +ada/sem_ch11.o : ada/ada.ads ada/a-except.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/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch11.ads ada/sem_ch11.adb ada/sem_ch5.ads ada/sem_ch8.ads \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch11.ads \ + ada/sem_ch11.adb ada/sem_ch5.ads ada/sem_ch8.ads ada/sem_res.ads \ + ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/sem_ch12.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ - ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/checks.ads \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \ ada/expander.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \ - ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/lib-load.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/output.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \ - ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch12.adb ada/sem_ch13.ads \ - ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \ - ada/sem_elab.ads ada/sem_elim.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/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/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_cat.ads ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch12.adb \ + ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads \ + ada/sem_ch7.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_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/sinput-l.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads \ - ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ + ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/widechar.ads ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/debug.ads ada/einfo.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_ch13.ads ada/sem_ch13.adb \ - ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ - ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \ - ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/sem_ch2.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ - ada/restrict.ads ada/rident.ads ada/sem_ch2.ads ada/sem_ch2.adb \ - ada/sem_ch8.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/system.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/eval_fat.ads ada/exp_ch3.ads ada/exp_dist.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/layout.ads \ - ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \ - ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_case.ads ada/sem_case.adb \ - ada/sem_cat.ads 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_mech.ads \ - ada/sem_res.ads ada/sem_smem.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_warn.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads \ + ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/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_ch13.ads ada/sem_ch13.adb 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-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/table.ads ada/table.adb ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/urealp.adb -ada/sem_ch4.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/gnat.ads ada/g-speche.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/lib.ads \ - ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ - ada/sem.ads ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch4.ads \ - ada/sem_ch4.adb 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/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/types.ads \ +ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \ + ada/sem_ch2.ads ada/sem_ch2.adb ada/sem_ch8.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/types.adb \ ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/sem_ch5.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/expander.ads ada/freeze.ads ada/gnat.ads \ - ada/g-hesora.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \ - ada/opt.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_case.ads \ - ada/sem_case.adb ada/sem_ch3.ads ada/sem_ch5.ads ada/sem_ch5.adb \ - ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads +ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads \ + ada/exp_ch3.ads ada/exp_ch7.ads ada/exp_dist.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.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_aggr.ads ada/sem_attr.ads ada/sem_case.ads ada/sem_case.adb \ + ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads \ + ada/sem_ch3.adb ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch7.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_mech.ads ada/sem_res.ads ada/sem_res.adb ada/sem_smem.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \ + ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \ + ada/widechar.ads -ada/sem_ch6.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \ - ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads ada/expander.ads \ - ada/fname.ads ada/freeze.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \ - ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \ - ada/sem_ch12.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \ - ada/sem_ch6.ads ada/sem_ch6.adb ada/sem_ch8.ads ada/sem_disp.ads \ - ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_mech.ads \ - ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_warn.ads ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ - ada/styleg.ads ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ - ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/validsw.ads +ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads \ + ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \ + ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/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_cat.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_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/snames.ads ada/stand.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-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/widechar.ads -ada/sem_ch7.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \ - ada/einfo.ads ada/elists.ads ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/exp_dbug.ads ada/exp_disp.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ - ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \ - ada/opt.ads ada/output.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch12.ads \ +ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/eval_fat.ads ada/exp_ch2.ads ada/exp_ch7.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-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/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_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_ch3.ads \ + ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb ada/sem_ch6.ads \ + ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \ + ada/sem_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/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-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/widechar.ads + +ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/exp_ch7.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-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \ + ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-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_aggr.ads ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch12.ads \ + ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \ + ada/sem_ch6.adb 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_intr.ads \ + ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/validsw.ads ada/widechar.ads + +ada/sem_ch7.o : ada/ada.ads ada/a-except.ads ada/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/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dbug.ads \ + ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/inline.ads ada/interfac.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_cat.ads ada/sem_ch12.ads \ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch7.adb \ - ada/sem_ch8.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/style.ads \ - ada/styleg.ads ada/styleg-c.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/snames.adb ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/widechar.ads ada/sem_ch8.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \ - ada/fname.ads ada/freeze.ads ada/gnat.ads ada/g-os_lib.ads \ - ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/inline.ads ada/lib.ads ada/lib-load.ads ada/lib-xref.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/exp_ch7.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-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/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_cat.ads ada/sem_ch12.ads ada/sem_ch3.ads ada/sem_ch4.ads \ - ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch8.adb ada/sem_res.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo-cn.ads \ - ada/snames.ads ada/stand.ads ada/style.ads ada/styleg.ads \ - ada/styleg-c.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch8.adb ada/sem_disp.ads \ + ada/sem_dist.ads ada/sem_elab.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/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/sem_ch9.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \ +ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_ch9.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \ - ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads \ + ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_tss.ads \ + ada/exp_util.ads ada/expander.ads ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \ + ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \ + ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch4.ads \ ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch9.ads \ - ada/sem_ch9.adb ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ - ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/sem_ch9.adb ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.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/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads + +ada/sem_disp.o : ada/ada.ads ada/a-except.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/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads \ + ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \ + ada/namet.adb 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/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ + ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_disp.adb \ + ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-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/widechar.ads -ada/sem_disp.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \ +ada/sem_dist.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.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_ch7.ads ada/exp_disp.ads ada/exp_tss.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \ - ada/opt.ads ada/output.ads ada/sem.ads ada/sem_ch6.ads ada/sem_disp.ads \ - ada/sem_disp.adb ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads - -ada/sem_dist.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dist.ads \ - ada/exp_tss.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \ - ada/rtsfind.ads ada/sem.ads ada/sem_dist.ads ada/sem_dist.adb \ - ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads ada/uname.ads \ + ada/exp_dist.ads ada/exp_tss.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ + ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ + ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_dist.ads \ + ada/sem_dist.adb ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \ + ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/sem_elab.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ - ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \ - ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib-load.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_elab.ads \ - ada/sem_elab.adb ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.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/elists.adb \ + ada/err_vars.ads ada/errout.ads ada/erroutc.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-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-load.ads ada/lib-sort.adb ada/lib-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_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads \ + ada/sem_elab.ads ada/sem_elab.adb ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \ + ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tbuild.ads ada/tree_io.ads ada/types.ads \ - ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/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_elim.o : ada/ada.ads ada/a-uncdea.ads ada/alloc.ads ada/atree.ads \ - ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/namet.ads \ - ada/nlists.ads ada/sem_elim.ads ada/sem_elim.adb ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-stalib.ads \ - ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \ +ada/sem_elim.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ + ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads \ + ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/sem_elim.ads ada/sem_elim.adb 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-htable.adb \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/sem_eval.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/checks.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \ - ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ - ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \ - ada/sem_ch8.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.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-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads + ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \ + ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \ + ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/eval_fat.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \ + ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \ + ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \ + ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ + ada/restrict.ads ada/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_cat.ads ada/sem_ch4.ads ada/sem_ch6.ads \ + ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \ + ada/sem_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/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/widechar.ads -ada/sem_intr.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ - ada/hostparm.ads ada/lib.ads ada/namet.ads ada/rident.ads \ +ada/sem_intr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/fname.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/rident.ads \ ada/sem_eval.ads ada/sem_intr.ads ada/sem_intr.adb ada/sem_util.ads \ - ada/sinfo.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/table.ads ada/targparm.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/sem_maps.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/einfo.ads ada/gnat.ads ada/g-os_lib.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ - ada/opt.ads ada/output.ads ada/sem_maps.ads ada/sem_maps.adb \ - ada/sinfo.ads ada/snames.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/sem_maps.ads ada/sem_maps.adb ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ ada/unchdeal.ads ada/urealp.ads -ada/sem_mech.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ - ada/nlists.ads ada/opt.ads ada/rident.ads ada/sem.ads ada/sem_mech.ads \ - ada/sem_mech.adb ada/sem_util.ads ada/sinfo.ads ada/snames.ads \ - ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/targparm.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads +ada/sem_mech.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/rident.ads ada/sem.ads \ + ada/sem_mech.ads ada/sem_mech.adb ada/sem_util.ads ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tree_io.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/sem_prag.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dist.ads \ - ada/expander.ads ada/fname.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/lib.ads ada/lib-writ.ads ada/lib-xref.ads ada/namet.ads \ - ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_disp.ads \ - ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_mech.ads \ - ada/sem_prag.ads ada/sem_prag.adb ada/sem_res.ads ada/sem_type.ads \ - ada/sem_util.ads ada/sem_vfpt.ads ada/sinfo.ads ada/sinfo-cn.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ - ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ + ada/atree.adb ada/casing.ads ada/casing.adb ada/checks.ads \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \ + ada/erroutc.ads ada/eval_fat.ads ada/exp_ch7.ads ada/exp_dist.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-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads ada/g-string.ads \ + ada/gnatvsn.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-writ.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/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_cat.ads ada/sem_ch13.ads \ + ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads \ + ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \ + ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_mech.ads \ + ada/sem_prag.ads ada/sem_prag.adb ada/sem_res.ads ada/sem_res.adb \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_vfpt.ads \ + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \ + ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads 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-imgenu.ads ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads - -ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads \ - ada/debug_a.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \ - ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads ada/exp_tss.ads \ - ada/exp_util.ads ada/expander.ads ada/freeze.ads ada/gnat.ads \ - ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch4.ads \ - ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \ - ada/sem_elab.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads \ - ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \ - ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \ - ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads - -ada/sem_smem.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/hostparm.ads \ - ada/namet.ads ada/sem_smem.ads ada/sem_smem.adb ada/sinfo.ads \ - ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/sem_type.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/debug.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \ - ada/erroutc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads ada/opt.ads \ - ada/output.ads ada/sem.ads ada/sem_ch6.ads ada/sem_ch8.ads \ - ada/sem_type.ads ada/sem_type.adb ada/sem_util.ads ada/sinfo.ads \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads + ada/targparm.ads ada/tbuild.ads 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_util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \ +ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \ + ada/csets.ads ada/debug.ads ada/debug_a.ads ada/debug_a.adb \ + ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \ + ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads \ + ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \ + ada/exp_util.adb ada/expander.ads ada/fname.ads ada/freeze.ads \ + ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-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_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \ + ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \ + ada/sem_dist.ads ada/sem_elab.ads ada/sem_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/sprint.ads \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/validsw.ads ada/widechar.ads + +ada/sem_smem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.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_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \ - ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads 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/sem.ads ada/sem_ch8.ads \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_util.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \ - ada/styleg-c.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imgenu.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \ - ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/sem_vfpt.o : ada/alloc.ads ada/cstand.ads ada/einfo.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ - ada/opt.ads ada/rident.ads ada/sem_vfpt.ads ada/sem_vfpt.adb \ - ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ - ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/targparm.ads ada/ttypef.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \ - ada/nlists.ads ada/opt.ads ada/output.ads ada/sem.ads ada/sem_ch8.ads \ - ada/sem_util.ads ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ - ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads - -ada/s-except.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-except.ads ada/s-stalib.ads ada/s-traent.ads ada/unchconv.ads + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/sem_smem.ads \ + ada/sem_smem.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/s-exctab.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \ - ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \ - ada/s-htable.adb 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/unchconv.ads +ada/sem_type.o : ada/ada.ads ada/a-except.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_tss.ads ada/exp_util.ads \ + ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb 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/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \ + ada/sem.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_res.ads ada/sem_type.ads ada/sem_type.adb ada/sem_util.ads \ + ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ + ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ + ada/urealp.ads ada/widechar.ads -ada/s-htable.o : ada/ada.ads ada/a-uncdea.ads ada/system.ads \ - ada/s-htable.ads ada/s-htable.adb +ada/sem_util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/casing.adb ada/checks.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/eval_fat.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/lib-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_cat.ads ada/sem_ch8.ads ada/sem_eval.ads \ + ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \ + ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \ + ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ + ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ + ada/widechar.ads -ada/s-imgenu.o : ada/system.ads ada/s-imgenu.ads ada/s-imgenu.adb \ - ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads +ada/sem_vfpt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/cstand.ads ada/debug.ads ada/einfo.ads \ + ada/einfo.adb ada/elists.ads ada/gnat.ads ada/g-htable.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \ + ada/rident.ads ada/sem_vfpt.ads ada/sem_vfpt.adb ada/sinfo.ads \ + ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tree_io.ads ada/ttypef.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads -ada/sinfo.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/sinfo.ads \ - ada/sinfo.adb ada/snames.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads +ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/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_tss.ads ada/exp_util.ads \ + ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \ + ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads \ + ada/namet.ads ada/namet.adb 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/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \ + ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \ + ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \ + ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/sinfo-cn.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/sinfo.ads \ - ada/sinfo-cn.ads ada/sinfo-cn.adb ada/snames.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ +ada/sinfo-cn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo-cn.ads \ + ada/sinfo-cn.adb ada/sinput.ads ada/snames.ads ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads -ada/sinput.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ - ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ - ada/output.ads ada/sinput.ads ada/sinput.adb ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ +ada/sinfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ - ada/unchdeal.ads - -ada/sinput-d.o : ada/alloc.ads ada/casing.ads ada/gnat.ads \ - ada/g-os_lib.ads ada/g-string.ads ada/osint.ads ada/osint-c.ads \ - ada/sinput.ads ada/sinput-d.ads ada/sinput-d.adb ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/sinput-l.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \ - ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/gnat.ads ada/g-dyntab.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads 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/sinfo.ads ada/sinput.ads \ - ada/sinput-l.ads ada/sinput-l.adb ada/snames.ads ada/style.ads \ - ada/styleg.ads ada/styleg-c.ads ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads +ada/sinput-d.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ + ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/osint.ads \ + ada/osint-c.ads ada/output.ads ada/sinput.ads ada/sinput-d.ads \ + ada/sinput-d.adb ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads -ada/s-mastop.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-except.ads ada/s-mastop.ads ada/s-mastop.adb ada/s-stalib.ads \ - ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads +ada/sinput-l.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/gnat.ads ada/g-dyntab.ads ada/g-dyntab.adb ada/g-hesorg.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.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/styleg-c.ads ada/stylesw.ads \ + ada/system.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/s-memory.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-memory.ads ada/s-memory.adb 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-traent.ads ada/unchconv.ads +ada/sinput.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ + ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/namet.adb \ + ada/opt.ads ada/output.ads ada/sinput.ads ada/sinput.adb ada/system.ads \ + ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads ada/snames.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \ - ada/snames.ads ada/snames.adb ada/system.ads ada/s-assert.ads \ - ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads - -ada/s-parame.o : ada/system.ads ada/s-parame.ads ada/s-parame.adb + ada/snames.ads ada/snames.adb ada/system.ads ada/s-exctab.ads \ + ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/sprint.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/gnat.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads ada/rtsfind.ads \ - ada/sinfo.ads ada/sinput.ads ada/sinput-d.ads ada/snames.ads \ - ada/sprint.ads ada/sprint.adb ada/stand.ads ada/stringt.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads \ + ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ + ada/einfo.adb ada/elists.ads ada/fname.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/output.adb \ + ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput-d.ads ada/snames.ads ada/sprint.ads ada/sprint.adb \ + ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \ + ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.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-traent.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/types.ads ada/uintp.ads \ - ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads - -ada/s-purexc.o : ada/system.ads ada/s-purexc.ads - -ada/s-secsta.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-parame.ads ada/s-secsta.ads ada/s-secsta.adb 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/unchconv.ads ada/unchdeal.ads - -ada/s-soflin.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-except.ads ada/s-mastop.ads ada/s-parame.ads ada/s-secsta.ads \ - ada/s-soflin.ads ada/s-soflin.adb ada/s-stache.ads ada/s-stalib.ads \ - ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads - -ada/s-sopco3.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco3.adb \ - ada/s-sopco4.ads ada/s-sopco5.ads ada/unchconv.ads - -ada/s-sopco4.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ - ada/s-sopco4.adb ada/s-sopco5.ads ada/unchconv.ads - -ada/s-sopco5.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ - ada/s-sopco5.ads ada/s-sopco5.adb ada/unchconv.ads - -ada/s-stache.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-parame.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stache.adb \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \ - ada/unchconv.ads - -ada/s-stalib.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-memory.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ - ada/s-stalib.adb ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \ - ada/unchconv.ads - -ada/s-stoele.o : ada/system.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/unchconv.ads - -ada/s-strcom.o : ada/system.ads ada/s-strcom.ads ada/s-strcom.adb \ - ada/unchconv.ads - -ada/s-strops.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-strops.ads ada/s-strops.adb ada/unchconv.ads - -ada/stand.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/namet.ads ada/stand.ads ada/stand.adb ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads - -ada/s-traceb.o : ada/system.ads ada/s-traceb.ads ada/s-traceb.adb + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb -ada/s-traent.o : ada/system.ads ada/s-traent.ads ada/s-traent.adb +ada/stand.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads ada/stand.ads \ + ada/stand.adb ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/stringt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \ - ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-assert.ads \ + ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \ ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads + ada/tree_io.ads ada/types.ads ada/types.adb ada/unchconv.ads \ + ada/unchdeal.ads -ada/style.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/csets.ads \ - ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/namet.ads ada/opt.ads ada/scans.ads ada/sinfo.ads ada/sinput.ads \ +ada/style.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ + ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/namet.adb \ + ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/scans.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \ ada/snames.ads ada/stand.ads ada/style.ads ada/styleg.ads \ ada/styleg.adb ada/styleg-c.ads ada/styleg-c.adb ada/stylesw.ads \ - ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/styleg.o : ada/alloc.ads ada/casing.ads ada/csets.ads ada/err_vars.ads \ - ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ - ada/opt.ads ada/scans.ads ada/sinput.ads ada/styleg.ads ada/styleg.adb \ - ada/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \ - ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/styleg-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \ + ada/err_vars.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \ + ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ + ada/stand.ads ada/styleg.ads ada/styleg-c.ads ada/styleg-c.adb \ + ada/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/styleg-c.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/csets.ads \ - ada/einfo.ads ada/err_vars.ads ada/namet.ads ada/sinfo.ads \ - ada/sinput.ads ada/snames.ads ada/stand.ads ada/styleg.ads \ - ada/styleg-c.ads ada/styleg-c.adb ada/stylesw.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ +ada/styleg.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \ + ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \ + ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ + ada/opt.ads ada/output.ads ada/scans.ads ada/sinput.ads ada/styleg.ads \ + ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-exctab.ads \ + ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \ ada/urealp.ads @@ -2925,19 +3778,6 @@ ada/stylesw.o : ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ ada/s-wchcon.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads -ada/s-unstyp.o : ada/system.ads ada/s-unstyp.ads - -ada/s-wchcnv.o : ada/interfac.ads ada/system.ads ada/s-wchcnv.ads \ - ada/s-wchcnv.adb ada/s-wchcon.ads ada/s-wchjis.ads - -ada/s-wchcon.o : ada/system.ads ada/s-wchcon.ads - -ada/s-wchjis.o : ada/system.ads ada/s-wchjis.ads ada/s-wchjis.adb - -ada/switch.o : ada/ada.ads ada/a-except.ads ada/switch.ads ada/switch.adb \ - ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-traent.ads \ - ada/s-unstyp.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads - ada/switch-b.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \ ada/opt.ads ada/osint.ads ada/switch.ads ada/switch-b.ads \ @@ -2948,13 +3788,20 @@ ada/switch-b.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \ ada/switch-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/lib.ads ada/opt.ads ada/osint.ads ada/prepcomp.ads \ - ada/stylesw.ads ada/switch.ads ada/switch-c.ads ada/switch-c.adb \ - ada/system.ads ada/s-exctab.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-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \ + ada/hostparm.ads ada/lib.ads ada/opt.ads ada/osint.ads ada/output.ads \ + ada/prepcomp.ads ada/stylesw.ads ada/switch.ads ada/switch-c.ads \ + ada/switch-c.adb ada/system.ads ada/s-exctab.ads ada/s-memory.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-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \ ada/unchconv.ads ada/unchdeal.ads ada/validsw.ads +ada/switch.o : ada/ada.ads ada/a-except.ads ada/switch.ads ada/switch.adb \ + ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.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-unstyp.ads ada/types.ads \ + ada/unchconv.ads ada/unchdeal.ads + ada/system.o : ada/system.ads ada/table.o : ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ @@ -2964,55 +3811,77 @@ ada/table.o : ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/targparm.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/csets.ads \ - ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \ - ada/rident.ads ada/system.ads ada/s-exctab.ads ada/s-imgenu.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-traent.ads \ - ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \ - ada/targparm.adb ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads + ada/debug.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ + ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \ + ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/targparm.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \ + ada/unchdeal.ads ada/widechar.ads -ada/tbuild.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/nmake.ads ada/restrict.ads \ - ada/rident.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-unstyp.ads \ - ada/table.ads ada/tbuild.ads ada/tbuild.adb ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/tbuild.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb 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/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-imgenu.ads \ + ada/s-memory.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-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads -ada/tree_gen.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \ - ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-os_lib.ads \ - ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \ - ada/namet.ads ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads \ - ada/repinfo.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \ - ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/tree_gen.ads ada/tree_gen.adb ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads +ada/tree_gen.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads ada/fname.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads ada/opt.ads \ + ada/osint.ads ada/osint-c.ads ada/output.ads ada/repinfo.ads \ + ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_gen.ads ada/tree_gen.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/tree_io.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \ ada/g-os_lib.ads ada/g-string.ads ada/output.ads ada/system.ads \ - ada/s-exctab.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-unstyp.ads \ - ada/tree_io.ads ada/tree_io.adb ada/types.ads ada/unchconv.ads \ - ada/unchdeal.ads + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.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-unstyp.ads ada/tree_io.ads ada/tree_io.adb \ + ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/treepr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ - ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \ - ada/lib.ads ada/namet.ads ada/nlists.ads ada/output.ads \ - ada/sem_mech.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \ - ada/s-imgenu.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.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/fname.ads ada/gnat.ads \ + ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \ + ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \ + ada/nlists.adb ada/opt.ads ada/output.ads ada/output.adb \ + ada/sem_mech.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ - ada/s-unstyp.ads ada/table.ads ada/treepr.ads ada/treepr.adb \ - ada/treeprs.ads ada/types.ads ada/uintp.ads ada/uname.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/treepr.ads ada/treepr.adb ada/treeprs.ads \ + ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/treeprs.o : ada/alloc.ads ada/sinfo.ads ada/system.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \ - ada/treeprs.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads +ada/treeprs.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/opt.ads ada/output.ads ada/sinfo.ads \ + ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ + ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/tree_io.ads ada/treeprs.ads ada/types.ads \ + ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/ttypef.o : ada/system.ads ada/ttypef.ads @@ -3020,39 +3889,51 @@ ada/ttypes.o : ada/get_targ.ads ada/system.ads ada/s-exctab.ads \ ada/s-stalib.ads ada/s-unstyp.ads ada/ttypes.ads ada/types.ads \ ada/unchconv.ads ada/unchdeal.ads -ada/types.o : ada/system.ads ada/s-assert.ads ada/s-carun8.ads \ - ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \ - ada/types.adb ada/unchconv.ads ada/unchdeal.ads +ada/types.o : ada/ada.ads ada/a-except.ads ada/system.ads ada/s-carun8.ads \ + ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.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-unstyp.ads ada/types.ads ada/types.adb \ + ada/unchconv.ads ada/unchdeal.ads ada/uintp.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \ ada/debug.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \ - ada/output.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ + ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ + ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ ada/unchconv.ads ada/unchdeal.ads -ada/uname.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \ - ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads \ - ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \ - ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads \ - ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \ - ada/uname.ads ada/uname.adb ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads +ada/uname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ + ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \ + ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \ + ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ + ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \ + ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \ + ada/s-memory.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-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/uname.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ + ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \ + ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/output.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-memory.ads \ + ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ + ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ + ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ + ada/urealp.adb + +ada/usage.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ - ada/hostparm.ads ada/opt.ads ada/output.ads ada/system.ads \ - ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ + ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \ + ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \ - ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \ - ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb - -ada/usage.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \ - ada/hostparm.ads ada/namet.ads ada/osint.ads ada/output.ads \ - ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \ - ada/s-wchcon.ads ada/table.ads ada/types.ads ada/unchconv.ads \ + ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \ ada/unchdeal.ads ada/usage.ads ada/usage.adb ada/validsw.o : ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \ diff --git a/gcc/ada/Makefile.generic b/gcc/ada/Makefile.generic index bdba19c5052..34e0d24af01 100644 --- a/gcc/ada/Makefile.generic +++ b/gcc/ada/Makefile.generic @@ -67,10 +67,6 @@ ifndef MAIN MAIN=ada endif -ifndef CC - CC=gcc -endif - ifndef ADA_SPEC ADA_SPEC=.ads endif @@ -157,7 +153,7 @@ $(compile_deps): force @$(MAKE) -C $(dir $(subst |,:,$(@:compile_%=%))) -f Makefile.$(notdir $@) internal-compile $(object_deps): force - @$(MAKE) -C $(dir $(@:object_%=%)) -f Makefile.$(notdir $@) internal-archive-objects ARCHIVE=$(ARCHIVE) + @$(MAKE) -C $(dir $(subst |,:,$(@:object_%=%))) -f Makefile.$(notdir $@) internal-archive-objects ARCHIVE=$(ARCHIVE) $(ada_deps): force @$(MAKE) -C $(dir $(subst |,:,$(@:ada_%=%))) -f Makefile.$(notdir $@) internal-ada diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in index 9aa5fa5e5e1..b20402c7f17 100644 --- a/gcc/ada/Makefile.in +++ b/gcc/ada/Makefile.in @@ -109,25 +109,7 @@ LS = ls RANLIB = ranlib # Test to use to see whether ranlib exists on the system. RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] -CC = cc -BISON = bison -BISONFLAGS = -ECHO = echo -LEX = flex -LEXFLAGS = -CHMOD = chmod -CP = cp -p -MV = mv -f -RM = rm -f -RMDIR = rm -rf -MKDIR = mkdir -p -AR = ar -AR_FLAGS = rc -# How to invoke ranlib. -RANLIB = ranlib -# Test to use to see whether ranlib exists on the system. -RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] SHELL = @SHELL@ PWD_COMMAND = $${PWDCMD-pwd} # How to copy preserving the date @@ -393,6 +375,8 @@ PREFIX_REAL_OBJS = ../prefix.o \ ../../libiberty/xstrdup.o \ ../../libiberty/xexit.o +LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/')) + # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT. # $(strip STRING) removes leading and trailing spaces from STRING. # If what's left is null then it's a match. @@ -468,7 +452,7 @@ ifeq ($(strip $(filter-out %86 sysv5uw%,$(arch) $(osys))),) PREFIX_OBJS=$(PREFIX_REAL_OBJS) SO_OPTS = -Wl,-h, GNATLIB_SHARED = gnatlib-shared-dual - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) endif ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),) @@ -479,6 +463,7 @@ ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -505,6 +490,7 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -542,6 +528,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -592,127 +579,6 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),) s-vxwork.ads<5pvxwork.ads \ a-taside.adb<1ataside.adb \ - CERT_LEVEL_B_TARGET_PAIRS=\ - a-tags.ads<1atags.ads \ - a-tags.adb<1atags.adb \ - a-except.adb<2aexcept.adb \ - a-except.ads<2aexcept.ads \ - a-excach.adb<2aexcach.adb \ - i-c.ads<1ic.ads \ - g-io.adb<2gio.adb \ - s-init.ads<2sinit.ads \ - s-init.adb<5zinit.adb \ - s-memory.adb<2smemory.adb \ - s-memory.ads<2smemory.ads \ - s-osinte.ads<2sosinte.ads \ - s-secsta.ads<2ssecsta.ads \ - s-secsta.adb<2ssecsta.adb \ - s-soflin.adb<2ssoflin.adb \ - s-soflin.ads<2ssoflin.ads \ - s-stalib.adb<1sstalib.adb \ - s-stalib.ads<1sstalib.ads \ - s-thrini.ads<2sthrini.ads \ - s-thrini.adb<5zthrini.adb \ - s-tiitho.adb<5ztiitho.adb \ - s-traceb.adb<2straceb.adb \ - s-traceb.ads<2straceb.ads \ - system.ads<5isystem.ads - - ifeq ($(strip $(filter-out yes,$(TRACE))),) - LIBGNAT_TARGET_PAIRS += \ - s-traces.adb<7straces.adb \ - s-trafor.adb<7strafor.adb \ - s-trafor.ads<7strafor.ads \ - s-tratas.adb<7stratas.adb \ - s-tfsetr.adb<5ztfsetr.adb - endif -endif - - -ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),) - LIBGNAT_TARGET_PAIRS = \ - a-sytaco.ads<4zsytaco.ads \ - a-sytaco.adb<4zsytaco.adb \ - a-intnam.ads<4zintnam.ads \ - a-numaux.ads<4znumaux.ads \ - s-inmaop.adb<7sinmaop.adb \ - s-interr.adb<5zinterr.adb \ - s-intman.adb<5zintman.adb \ - s-osinte.adb<5zosinte.adb \ - s-osinte.ads<5zosinte.ads \ - s-osprim.adb<5zosprim.adb \ - s-parame.ads<5yparame.ads \ - s-taprop.adb<5ztaprop.adb \ - s-taspri.ads<5ztaspri.ads \ - s-tpopsp.adb<5ztpopsp.adb \ - s-vxwork.ads<5pvxwork.ads \ - g-soccon.ads<3zsoccon.ads \ - g-socthi.ads<3zsocthi.ads \ - g-socthi.adb<3zsocthi.adb \ - system.ads<5ysystem.ads - - TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb - - EXTRA_HIE_NONE_TARGET_PAIRS= \ - system.ads<50system.ads - - EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads - EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o - EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o - EXTRA_GNATRTL_TASKING_OBJS=i-vthrea.o s-tpae65.o s-vxwork.o - HIE_RAVEN_TARGET_PAIRS=\ - $(HIE_NONE_TARGET_PAIRS) \ - a-reatim.ads<1areatim.ads \ - a-reatim.adb<1areatim.adb \ - a-retide.adb<1aretide.adb \ - a-interr.adb<1ainterr.adb \ - s-interr.ads<1sinterr.ads \ - s-interr.adb<1sinterr.adb \ - s-taskin.ads<1staskin.ads \ - s-taskin.adb<1staskin.adb \ - s-tarest.adb<1starest.adb \ - s-tposen.ads<1stposen.ads \ - s-tposen.adb<1stposen.adb \ - s-osinte.adb<1sosinte.adb \ - s-taprop.ads<1staprop.ads \ - s-taprop.adb<1staprop.adb \ - s-taprob.ads<1staprob.ads \ - s-taprob.adb<1staprob.adb \ - a-sytaco.ads<1asytaco.ads \ - a-sytaco.adb<1asytaco.adb \ - a-intnam.ads<4zintnam.ads \ - s-osinte.ads<5zosinte.ads \ - s-parame.ads<5zparame.ads \ - s-taspri.ads<5ztaspri.ads \ - s-vxwork.ads<5pvxwork.ads \ - a-taside.adb<1ataside.adb \ - - CERT_LEVEL_B_TARGET_PAIRS=\ - a-tags.ads<1atags.ads \ - a-tags.adb<1atags.adb \ - a-except.adb<2aexcept.adb \ - a-except.ads<2aexcept.ads \ - a-excach.adb<2aexcach.adb \ - i-c.ads<1ic.ads \ - g-io.adb<2gio.adb \ - s-init.ads<2sinit.ads \ - s-init.adb<5zinit.adb \ - s-memory.adb<2smemory.adb \ - s-memory.ads<2smemory.ads \ - s-osinte.ads<2sosinte.ads \ - s-secsta.ads<2ssecsta.ads \ - s-secsta.adb<2ssecsta.adb \ - s-soflin.adb<2ssoflin.adb \ - s-soflin.ads<2ssoflin.ads \ - s-stalib.adb<1sstalib.adb \ - s-stalib.ads<1sstalib.ads \ - s-thrini.ads<2sthrini.ads \ - s-thrini.adb<5zthrini.adb \ - s-tiitho.adb<5ytiitho.adb \ - s-traceb.adb<2straceb.adb \ - s-traceb.ads<2straceb.ads \ - system.ads<5isystem.ads - ifeq ($(strip $(filter-out yes,$(TRACE))),) LIBGNAT_TARGET_PAIRS += \ s-traces.adb<7straces.adb \ @@ -728,8 +594,7 @@ ifeq ($(strip $(filter-out powerpc% unknown elf,$(targ))),) system.ads<59system.ads LIBGNAT_TARGET_PAIRS = \ - $(HIE_NONE_TARGET_PAIRS) \ - $(EXTRA_HIE_NONE_TARGET_PAIRS) + $(HIE_NONE_TARGET_PAIRS) endif ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),) @@ -737,8 +602,7 @@ ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),) system.ads<5rsystem.ads LIBGNAT_TARGET_PAIRS = \ - $(HIE_NONE_TARGET_PAIRS) \ - $(EXTRA_HIE_NONE_TARGET_PAIRS) + $(HIE_NONE_TARGET_PAIRS) endif ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),) @@ -749,6 +613,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -777,6 +642,7 @@ ifeq ($(strip $(filter-out xscale% coff wrs vx%,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -805,6 +671,7 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),) a-numaux.ads<4znumaux.ads \ s-inmaop.adb<7sinmaop.adb \ s-interr.adb<5zinterr.adb \ + s-intman.ads<5zintman.ads \ s-intman.adb<5zintman.adb \ s-osinte.adb<5zosinte.adb \ s-osinte.ads<5zosinte.ads \ @@ -852,7 +719,7 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),) GNATLIB_SHARED = gnatlib-shared-dual GMEM_LIB = gmemlib PREFIX_OBJS = $(PREFIX_REAL_OBJS) - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS = \ @@ -936,7 +803,7 @@ ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),) SO_OPTS = -Wl,-h, GNATLIB_SHARED = gnatlib-shared-dual PREFIX_OBJS = $(PREFIX_REAL_OBJS) - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) endif ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) @@ -945,7 +812,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) a-numaux.adb<86numaux.adb \ a-numaux.ads<86numaux.ads \ s-inmaop.adb<7sinmaop.adb \ - s-intman.adb<5lintman.adb \ + s-intman.adb<7sintman.adb \ s-mastop.adb<5omastop.adb \ s-osinte.adb<5iosinte.adb \ s-osinte.ads<5iosinte.ads \ @@ -962,7 +829,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) GNATLIB_SHARED = gnatlib-shared-dual GMEM_LIB = gmemlib PREFIX_OBJS = $(PREFIX_REAL_OBJS) - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS = \ @@ -970,7 +837,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) a-numaux.adb<86numaux.adb \ a-numaux.ads<86numaux.ads \ s-inmaop.adb<7sinmaop.adb \ - s-intman.adb<5lintman.adb \ + s-intman.adb<7sintman.adb \ s-mastop.adb<5omastop.adb \ s-osinte.adb<7sosinte.adb \ s-osinte.ads<5losinte.ads \ @@ -984,6 +851,25 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) endif endif +ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ + a-intnam.ads<45intnam.ads \ + g-soccon.ads<35soccon.ads \ + s-inmaop.adb<7sinmaop.adb \ + s-intman.adb<7sintman.adb \ + s-mastop.adb<5omastop.adb \ + s-osinte.adb<55osinte.adb \ + s-osinte.ads<55osinte.ads \ + s-osprim.adb<7sosprim.adb \ + s-taprop.adb<7staprop.adb \ + s-taspri.ads<7staspri.ads \ + s-tpopsp.adb<7stpopsp.adb \ + system.ads<56system.ads + + THREADSLIB= + LIBRARY_VERSION := $(LIB_VERSION) +endif + ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),) ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),) LIBGNAT_TARGET_PAIRS = \ @@ -1035,7 +921,7 @@ ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),) MISCLIB = -lexc SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname, PREFIX_OBJS = $(PREFIX_REAL_OBJS) - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) endif ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),) @@ -1083,7 +969,7 @@ ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),) SO_OPTS = -Wl,+h, PREFIX_OBJS = $(PREFIX_REAL_OBJS) GNATLIB_SHARED = gnatlib-shared-dual - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS = \ @@ -1234,10 +1120,10 @@ ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),) THREADSLIB = -lpthread -lmach -lexc -lrt PREFIX_OBJS = $(PREFIX_REAL_OBJS) GNATLIB_SHARED = gnatlib-shared-default - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) endif -ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),) +ifeq ($(strip $(filter-out alpha% ia64 dec vms% openvms% alphavms%,$(host))),) soext = .exe @@ -1248,16 +1134,31 @@ soext = .exe endif ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),) -ifeq ($(strip $(filter-out alpha64% dec vms% openvms% alphavms%,$(targ))),) - LIBGNAT_TARGET_PAIRS_AUX = + +ifeq ($(strip $(filter-out ia64% hp vms% openvms%,$(targ))),) + LIBGNAT_TARGET_PAIRS_AUX = \ + s-osinte.adb<5xosinte.adb \ + s-osinte.ads<5xosinte.ads \ + s-parame.ads<5vparame.ads +else +ifeq ($(strip $(filter-out alpha64% dec hp vms% openvms% alphavms%,$(targ))),) + LIBGNAT_TARGET_PAIRS_AUX = \ + s-osinte.adb<5vosinte.adb \ + s-osinte.ads<5vosinte.ads \ + s-parame.ads<5vparame.ads else ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS_AUX = \ + s-osinte.adb<5vosinte.adb \ + s-osinte.ads<5vosinte.ads \ s-parame.ads<5xparame.ads else LIBGNAT_TARGET_PAIRS_AUX = \ + s-osinte.adb<5vosinte.adb \ + s-osinte.ads<5vosinte.ads \ s-parame.ads<5vparame.ads endif +endif endif LIBGNAT_TARGET_PAIRS = \ @@ -1266,6 +1167,7 @@ endif a-calend.ads<4vcalend.ads \ a-excpol.adb<4wexcpol.adb \ a-intnam.ads<4vintnam.ads \ + a-numaux.ads<4vnumaux.ads \ g-expect.adb<3vexpect.adb \ g-soccon.ads<3vsoccon.ads \ g-socthi.ads<3vsocthi.ads \ @@ -1275,12 +1177,11 @@ endif i-cpp.adb<6vcpp.adb \ interfac.ads<6vinterf.ads \ s-asthan.adb<5vasthan.adb \ + s-crtl.ads<5vcrtl.ads \ s-inmaop.adb<5vinmaop.adb \ s-interr.adb<5vinterr.adb \ s-intman.adb<5vintman.adb \ s-intman.ads<5vintman.ads \ - s-osinte.adb<5vosinte.adb \ - s-osinte.ads<5vosinte.ads \ s-osprim.adb<5vosprim.adb \ s-osprim.ads<5vosprim.ads \ s-taprop.adb<5vtaprop.adb \ @@ -1304,8 +1205,7 @@ endif ../../gnatlbr$(exeext) \ ,,/../gnatsym$(exeext) # This command transforms (YYYYMMDD) into YY,MMDD - GSMATCH_VERSION := $(shell grep "^ *Gnat_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/') - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/' -e 's/\./_/g')) + GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/') TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe endif @@ -1338,19 +1238,18 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),) GMEM_LIB = gmemlib PREFIX_OBJS = $(PREFIX_REAL_OBJS) EXTRA_GNATTOOLS = ../../gnatdll$(exeext) - GNAT_WRAPPER_TOOL = ../../gnat_wrapper$(exeext) EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o soext = .dll GNATLIB_SHARED = gnatlib-shared-win32 - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) endif ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),) LIBGNAT_TARGET_PAIRS = \ a-intnam.ads<4lintnam.ads \ s-inmaop.adb<7sinmaop.adb \ - s-intman.adb<5lintman.adb \ + s-intman.adb<7sintman.adb \ s-osinte.ads<5iosinte.ads \ s-osinte.adb<5iosinte.adb \ s-osprim.adb<7sosprim.adb \ @@ -1364,7 +1263,28 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),) THREADSLIB=-lpthread GNATLIB_SHARED=gnatlib-shared-dual PREFIX_OBJS=$(PREFIX_REAL_OBJS) - LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/')) + LIBRARY_VERSION := $(LIB_VERSION) +endif + +ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ + a-intnam.ads<4lintnam.ads \ + s-inmaop.adb<7sinmaop.adb \ + s-intman.adb<7sintman.adb \ + s-osinte.ads<5iosinte.ads \ + s-osinte.adb<5iosinte.adb \ + s-osprim.adb<7sosprim.adb \ + s-taprop.adb<5itaprop.adb \ + s-tpopsp.adb<5atpopsp.adb \ + s-taspri.ads<5itaspri.ads \ + system.ads<5nsystem.ads + + TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb + MISCLIB= + THREADSLIB=-lpthread + GNATLIB_SHARED=gnatlib-shared-dual + PREFIX_OBJS=$(PREFIX_REAL_OBJS) + LIBRARY_VERSION := $(LIB_VERSION) endif # The runtime library for gnat comprises two directories. One contains the @@ -1519,80 +1439,6 @@ RAVEN_OBJS = \ a-sytaco.o \ a-taside.o $(EXTRA_RAVEN_OBJS) - -# Files which are needed for the cert level B runtime - -COMPILABLE_CERT_LEVEL_B_SOURCES = \ -$(COMPILABLE_HIE_SOURCES) \ - a-except.adb \ - a-except.ads \ - a-exctra.ads \ - a-exctra.adb \ - s-init.adb \ - s-init.ads \ - s-memory.adb \ - s-memory.ads \ - s-osinte.ads \ - s-soflin.adb \ - s-soflin.ads \ - s-stalib.adb \ - s-stalib.ads \ - s-thrini.adb \ - s-thrini.ads \ - s-assert.adb \ - s-assert.ads \ - s-exnint.adb \ - s-exnint.ads \ - s-strops.adb \ - s-strops.ads \ - s-thread.adb \ - s-thread.ads \ - s-traceb.adb \ - s-traceb.ads \ - s-traent.ads \ - s-traent.adb \ - g-debuti.ads \ - g-debuti.adb \ - g-io.adb \ - g-io.ads \ - $(EXTRA_CERT_LEVEL_B_SOURCES) - -NON_COMPILABLE_CERT_LEVEL_B_SOURCES= \ - a-excach.adb \ - s-tiitho.adb \ - $(NON_COMPILABLE_HIE_SOURCES) - -CERT_LEVEL_B_SOURCES = \ -$(NON_COMPILABLE_CERT_LEVEL_B_SOURCES) \ -$(COMPILABLE_CERT_LEVEL_B_SOURCES) - -# Objects to generate for the cert level B run time - -CERT_LEVEL_B_OBJS = \ - $(HIE_OBJS) \ - a-except.o \ - a-excach.o \ - s-init.o \ - s-memory.o \ - s-soflin.o \ - s-stalib.o \ - s-tiitho.o \ - s-thrini.o \ - s-traceb.o \ - s-assert.o \ - s-exnint.o \ - s-strops.o \ - s-thread.o \ - g-debuti.o \ - g-io.o \ - $(EXTRA_CERT_LEVEL_B_OBJS) - -# C files for the cert level B run time (without the .c extension) - -CERT_LEVEL_B_C_FILES = \ -2raise \ -$(EXTRA_CERT_LEVEL_B_C_FILES) - # Default run time files ADA_INCLUDE_SRCS =\ @@ -1678,11 +1524,10 @@ gnattools2: ../stamp-tools TOOLSCASE=native \ ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \ ../../gnatls$(exeext) ../../gnatprep$(exeext) \ - ../../gnatpsta$(exeext) ../../gnatxref$(exeext) \ + ../../gnatxref$(exeext) \ ../../gnatfind$(exeext) ../../gnatname$(exeext) \ ../../gnatclean$(exeext) \ - ../../gprcmd$(exeext) ../../gpr2make$(exeext) \ - $(GNAT_WRAPPER_TOOL) + ../../gprcmd$(exeext) ../../gpr2make$(exeext) # These tools are only built for the native version. gnattools3: ../stamp-tools @@ -1735,12 +1580,6 @@ gnattools4: ../stamp-tools $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \ $(TOOLS_LIBS) -../../gnatpsta$(exeext): deftarg.o ../stamp-tools -# $(GNATMAKE) -c $(ADA_INCLUDES) gnatpsta --GCC="$(CC) $(ALL_ADAFLAGS)" -# $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatpsta -# $(GNATLINK) -v gnatpsta -o $@ --GCC="$(CC) $(ADA_INCLUDES)"\ -# ../targtyps.o deftarg.o $(TOOLS_LIBS) - ../../gnatxref$(exeext): ../stamp-tools $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)" $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref @@ -1779,12 +1618,6 @@ endif $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \ $(TOOLS_LIBS) -../../gnat_wrapper$(exeext): ../stamp-tools - $(GNATMAKE) -c -O2 -gnatpn $(ADA_INCLUDES) gnat_wrapper --GCC="$(CC) $(ALL_ADAFLAGS)" - $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnat_wrapper - $(GNATLINK) -v gnat_wrapper -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \ - $(TOOLS_LIBS) - ../../gprcmd$(exeext): ../stamp-tools $(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)" $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd @@ -2023,27 +1856,10 @@ rts-zfp: force RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \ COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" -$(GNATMAKE) -Prts-zfp/zfp.gpr --GCC="../../../xgcc -B../../../" + cd rts-zfp/adalib/ ; $(AR) r libgnat.a *.o $(RM) rts-zfp/adalib/*.o $(CHMOD) a-wx rts-zfp/adalib/*.ali - -rts-cert: force -# First compile the Ada files ... - $(MAKE) $(FLAGS_TO_PASS) prepare-rts \ - RTS_NAME=cert RTS_SRCS="$(CERT_LEVEL_B_SOURCES)" \ - RTS_TARGET_PAIRS="$(CERT_LEVEL_B_TARGET_PAIRS)" \ - COMPILABLE_SOURCES="$(COMPILABLE_CERT_LEVEL_B_SOURCES)" - -$(GNATMAKE) -Prts-cert/cert.gpr --GCC="../../../xgcc -B../../../" - $(CHMOD) a-wx rts-cert/adalib/*.ali -# ... then the C files. This section will eventually be removed. - $(foreach f,$(CERT_LEVEL_B_C_FILES), \ - $(CP) $(fsrcpfx)$(f).c rts-cert/adainclude/ ;) - cd rts-cert/adalib ; \ - $(foreach f,$(CERT_LEVEL_B_C_FILES), \ - ../../../$(GCC_FOR_TARGET) -B../../../ $(TARGET_LIBGCC2_CFLAGS) \ - $(ALL_CFLAGS) $(GNATLIBCFLAGS_FOR_C) -c ../adainclude/$(f).c \ - -I../adainclude $(INCLUDES_FOR_SUBDIR) -I../../../ ;) \ - $(AR) $(AR_FLAGS) libgnat$(arext) \ - $(addsuffix .o,$(CERT_LEVEL_B_C_FILES)) + $(CHMOD) a-wx rts-zfp/adalib/libgnat.a rts-none: force $(MAKE) $(FLAGS_TO_PASS) prepare-rts \ @@ -2061,7 +1877,10 @@ rts-ravenscar: force COMPILABLE_SOURCES="$(COMPILABLE_RAVEN_SOURCES)" -$(GNATMAKE) -Prts-ravenscar/ravenscar.gpr \ --GCC="../../../xgcc -B../../../" + cd rts-ravenscar/adalib/ ; $(AR) r libgnat.a *.o + $(RM) rts-ravenscar/adalib/*.o $(CHMOD) a-wx rts-ravenscar/adalib/*.ali + $(CHMOD) a-wx rts-ravenscar/adalib/libgnat.a # Warning: this target assumes that LIBRARY_VERSION has been set correctly. gnatlib-shared-default: diff --git a/gcc/ada/Makefile.prolog b/gcc/ada/Makefile.prolog index 5766fa98ae1..1aaff294617 100644 --- a/gcc/ada/Makefile.prolog +++ b/gcc/ada/Makefile.prolog @@ -39,6 +39,7 @@ C_EXT:=.c CXX_EXT:=.cc AR_EXT=.a OBJ_EXT=.o +CC=gcc # Default target is to build (compile/bind/link) # Target build is defined in Makefile.generic diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index f44db99ba00..0fabb1d0ebd 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -1,5 +1,5 @@ # Makefile.rtl for GNU Ada Compiler (GNAT). -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. #This file is part of GCC. @@ -38,6 +38,7 @@ GNATRTL_TASKING_OBJS= \ g-boubuf$(objext) \ g-boumai$(objext) \ g-semaph$(objext) \ + g-signal$(objext) \ g-thread$(objext) \ s-asthan$(objext) \ s-inmaop$(objext) \ @@ -86,6 +87,7 @@ GNATRTL_NONTASKING_OBJS= \ a-diocst$(objext) \ a-direio$(objext) \ a-einuoc$(objext) \ + a-elchha$(objext) \ a-except$(objext) \ a-exctra$(objext) \ a-filico$(objext) \ @@ -281,6 +283,7 @@ GNATRTL_NONTASKING_OBJS= \ s-caun32$(objext) \ s-caun64$(objext) \ s-chepoo$(objext) \ + s-crtl$(objext) \ s-crc32$(objext) \ s-direio$(objext) \ s-errrep$(objext) \ diff --git a/gcc/ada/a-direio.adb b/gcc/ada/a-direio.adb index 310e24f6102..3c5743bc439 100644 --- a/gcc/ada/a-direio.adb +++ b/gcc/ada/a-direio.adb @@ -38,6 +38,7 @@ with Interfaces.C_Streams; use Interfaces.C_Streams; with System; use System; +with System.CRTL; with System.File_Control_Block; with System.File_IO; with System.Direct_IO; @@ -65,6 +66,8 @@ package body Ada.Direct_IO is function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode); function To_DIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); + use type System.CRTL.size_t; + ----------- -- Close -- ----------- diff --git a/gcc/ada/a-elchha.adb b/gcc/ada/a-elchha.adb new file mode 100644 index 00000000000..6e2da234a4b --- /dev/null +++ b/gcc/ada/a-elchha.adb @@ -0,0 +1,165 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- A D A . E X C E P T I O N S . L A S T _ C H A N C E _ H A N D L E R -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2003 Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- Default version for most targets + +procedure Ada.Exceptions.Last_Chance_Handler + (Except : Exception_Occurrence) +is + procedure Unhandled_Terminate; + pragma No_Return (Unhandled_Terminate); + pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate"); + -- Perform system dependent shutdown code + + function Tailored_Exception_Information + (X : Exception_Occurrence) return String; + -- Exception information to be output in the case of automatic tracing + -- requested through GNAT.Exception_Traces. + -- + -- This is the same as Exception_Information if no backtrace decorator + -- is currently in place. Otherwise, this is Exception_Information with + -- the call chain raw addresses replaced by the result of a call to the + -- current decorator provided with the call chain addresses. + + pragma Import + (Ada, Tailored_Exception_Information, + "__gnat_tailored_exception_information"); + + procedure Tailored_Exception_Information + (X : Exception_Occurrence; + Buff : in out String; + Last : in out Integer); + -- Procedural version of the above function. Instead of returning the + -- result, this one is put in Buff (Buff'first .. Buff'first + Last) + + procedure To_Stderr (S : String); + pragma Import (Ada, To_Stderr, "__gnat_to_stderr"); + -- Little routine to output string to stderr + + Nline : constant String := String'(1 => ASCII.LF); + -- Convenient shortcut + + Msg : constant String := Except.Msg (1 .. Except.Msg_Length); + + Max_Static_Exc_Info : constant := 1024; + -- This should be enough for most exception information cases + -- even though tailoring introduces some uncertainty. The + -- name+message should not exceed 320 chars, so that leaves at + -- least 35 backtrace slots (each slot needs 19 chars for + -- representing a 64 bit address). + + subtype Exc_Info_Type is String (1 .. Max_Static_Exc_Info); + type Str_Ptr is access Exc_Info_Type; + Exc_Info : Str_Ptr; + Exc_Info_Last : Natural := 0; + -- Buffer that is allocated to store the tailored exception + -- information while Adafinal is run. This buffer is allocated + -- on the heap only when it is needed. It is better to allocate + -- on the heap than on the stack since stack overflows are more + -- common than heap overflows. + + procedure Tailored_Exception_Information + (X : Exception_Occurrence; + Buff : in out String; + Last : in out Integer) + is + Info : constant String := Tailored_Exception_Information (X); + begin + Last := Info'Last; + Buff (1 .. Last) := Info; + end Tailored_Exception_Information; + +begin + -- First allocate & store the exception info in a buffer when + -- we know it will be needed. This needs to be done before + -- Adafinal because it implicitly uses the secondary stack. + + if Except.Id.Full_Name.all (1) /= '_' + and then Except.Num_Tracebacks /= 0 + then + Exc_Info := new Exc_Info_Type; + if Exc_Info /= null then + Tailored_Exception_Information + (Except, Exc_Info.all, Exc_Info_Last); + end if; + end if; + + -- Let's shutdown the runtime now. The rest of the procedure + -- needs to be careful not to use anything that would require + -- runtime support. In particular, functions returning strings + -- are banned since the sec stack is no longer functional. + System.Standard_Library.Adafinal; + + -- Check for special case of raising _ABORT_SIGNAL, which is not + -- really an exception at all. We recognize this by the fact that + -- it is the only exception whose name starts with underscore. + + if Except.Id.Full_Name.all (1) = '_' then + To_Stderr (Nline); + To_Stderr ("Execution terminated by abort of environment task"); + To_Stderr (Nline); + + -- If no tracebacks, we print the unhandled exception in the old style + -- (i.e. the style used before ZCX was implemented). We do this to + -- retain compatibility. + + elsif Except.Num_Tracebacks = 0 then + To_Stderr (Nline); + To_Stderr ("raised "); + To_Stderr (Except.Id.Full_Name.all (1 .. Except.Id.Name_Length - 1)); + + if Msg'Length /= 0 then + To_Stderr (" : "); + To_Stderr (Msg); + end if; + + To_Stderr (Nline); + + -- Traceback exists + + else + -- Note we can have this whole information output twice if + -- this occurrence gets reraised up to here. + + To_Stderr (Nline); + To_Stderr ("Execution terminated by unhandled exception"); + To_Stderr (Nline); + To_Stderr (Exc_Info (1 .. Exc_Info_Last)); + end if; + + Unhandled_Terminate; +end Ada.Exceptions.Last_Chance_Handler; diff --git a/gcc/ada/a-elchha.ads b/gcc/ada/a-elchha.ads new file mode 100644 index 00000000000..7efbe0f5558 --- /dev/null +++ b/gcc/ada/a-elchha.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- A D A . E X C E P T I O N S . L A S T _ C H A N C E _ H A N D L E R -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2003 Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- Last chance handler. Unhandled exceptions are passed to this +-- routine. + +procedure Ada.Exceptions.Last_Chance_Handler + (Except : Exception_Occurrence); +pragma Export (C, + Last_Chance_Handler, + "__gnat_last_chance_handler"); +pragma No_Return (Last_Chance_Handler); diff --git a/gcc/ada/a-except.adb b/gcc/ada/a-except.adb index d6a6f5ff3c6..cf12af818c7 100644 --- a/gcc/ada/a-except.adb +++ b/gcc/ada/a-except.adb @@ -859,6 +859,8 @@ package body Ada.Exceptions is ------------------------- procedure Raise_Current_Excep (E : Exception_Id) is + pragma Inspection_Point (E); + -- This is so the debugger can reliably inspect the parameter begin Process_Raise_Exception (E => E, From_Signal_Handler => False); end Raise_Current_Excep; diff --git a/gcc/ada/a-exexda.adb b/gcc/ada/a-exexda.adb index b88d643092f..214d5348ca3 100644 --- a/gcc/ada/a-exexda.adb +++ b/gcc/ada/a-exexda.adb @@ -41,9 +41,8 @@ package body Exception_Data is ----------------------- function Address_Image (A : System.Address) return String; - -- Returns at string of the form 0xhhhhhhhhh for 32-bit addresses - -- or 0xhhhhhhhhhhhhhhhh for 64-bit addresses. Hex characters are - -- in lower case. + -- Returns at string of the form 0xhhhhhhhhh for an address, with + -- leading zeros suppressed. Hex characters a-f are in lower case. procedure Append_Info_Nat (N : Natural; @@ -66,22 +65,19 @@ package body Exception_Data is -- we then use three intermediate functions : function Basic_Exception_Information - (X : Exception_Occurrence) - return String; + (X : Exception_Occurrence) return String; -- Returns the basic exception information string associated with a -- given exception occurrence. This is the common part shared by both -- Exception_Information and Tailored_Exception_Infomation. function Basic_Exception_Traceback - (X : Exception_Occurrence) - return String; + (X : Exception_Occurrence) return String; -- Returns an image of the complete call chain associated with an -- exception occurence in its most basic form, that is as a raw sequence -- of hexadecimal binary addresses. function Tailored_Exception_Traceback - (X : Exception_Occurrence) - return String; + (X : Exception_Occurrence) return String; -- Returns an image of the complete call chain associated with an -- exception occurrence, either in its basic form if no decorator is -- in place, or as formatted by the decorator otherwise. @@ -121,10 +117,11 @@ package body Exception_Data is begin P := S'Last; N := To_Integer (A); - while N /= 0 loop + loop S (P) := H (Integer (N mod 16)); P := P - 1; N := N / 16; + exit when N = 0; end loop; S (P - 1) := '0'; @@ -184,8 +181,7 @@ package body Exception_Data is --------------------------------- function Basic_Exception_Information - (X : Exception_Occurrence) - return String + (X : Exception_Occurrence) return String is Name : constant String := Exception_Name (X); Msg : constant String := Exception_Message (X); @@ -251,8 +247,7 @@ package body Exception_Data is ------------------------------- function Basic_Exception_Traceback - (X : Exception_Occurrence) - return String + (X : Exception_Occurrence) return String is Info_Maxlen : constant Natural := 35 + X.Num_Tracebacks * 19; -- Maximum length of the information string we are building, with : @@ -460,8 +455,7 @@ package body Exception_Data is ---------------------------------- function Tailored_Exception_Traceback - (X : Exception_Occurrence) - return String + (X : Exception_Occurrence) return String is -- We indeed reference the decorator *wrapper* from here and not the -- decorator itself. The purpose of the local variable Wrapper is to @@ -491,8 +485,7 @@ package body Exception_Data is ------------------------------------ function Tailored_Exception_Information - (X : Exception_Occurrence) - return String + (X : Exception_Occurrence) return String is -- The tailored exception information is simply the basic information -- associated with the tailored call chain backtrace. diff --git a/gcc/ada/a-exextr.adb b/gcc/ada/a-exextr.adb index 0ddb2934885..938f04b06e6 100644 --- a/gcc/ada/a-exextr.adb +++ b/gcc/ada/a-exextr.adb @@ -33,6 +33,11 @@ with Unchecked_Conversion; +pragma Warnings (Off); +with Ada.Exceptions.Last_Chance_Handler; +pragma Warnings (On); +-- Bring last chance handler into closure + separate (Ada.Exceptions) package body Exception_Traces is @@ -50,6 +55,14 @@ package body Exception_Traces is pragma Export (Ada, Raise_Hook_Initialized, "__gnat_exception_actions_initialized"); + procedure Last_Chance_Handler + (Except : Exception_Occurrence); + pragma Import + (C, Last_Chance_Handler, "__gnat_last_chance_handler"); + pragma No_Return (Last_Chance_Handler); + -- Users can replace the default version of this routine, + -- Ada.Exceptions.Last_Chance_Handler. + function To_Action is new Unchecked_Conversion (Raise_Action, Exception_Action); @@ -95,11 +108,6 @@ package body Exception_Traces is pragma Propagate_Exceptions; - procedure Unhandled_Terminate; - pragma No_Return (Unhandled_Terminate); - pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate"); - -- Perform system dependent shutdown code - ---------------------- -- Notify_Exception -- ---------------------- @@ -186,89 +194,8 @@ package body Exception_Traces is -- could be overwritten if an exception is raised during finalization -- (even if that exception is caught). - Msg : constant String := Excep.Msg (1 .. Excep.Msg_Length); - - Max_Static_Exc_Info : constant := 1024; - -- That should be enough for most exception information cases - -- eventhough tailorising introduces some uncertainty. the - -- name+message should not exceed 320 chars, so that leaves at - -- least 35 backtrace slots (each slot needs 19 chars for - -- representing a 64 bit address). - -- And what happens on overflow ??? - - subtype Exc_Info_Type is String (1 .. Max_Static_Exc_Info); - type Str_Ptr is access Exc_Info_Type; - Exc_Info : Str_Ptr; - Exc_Info_Last : Natural := 0; - -- Buffer that is allocated to store the tailored exception - -- information while Adafinal is run. This buffer is allocated - -- on the heap only when it is needed. It is better to allocate - -- on the heap than on the stack since stack overflows are more - -- common that heap overflows. - - -- Start of processing for Unhandled_Exception_Terminate - begin - -- First allocate & store the exception info in a buffer when - -- we know it will be needed. This needs to be done before - -- Adafinal because it implicitly uses the secondary stack. - - if Excep.Id.Full_Name.all (1) /= '_' - and then Excep.Num_Tracebacks /= 0 - then - Exc_Info := new Exc_Info_Type; - if Exc_Info /= null then - Tailored_Exception_Information - (Excep.all, Exc_Info.all, Exc_Info_Last); - end if; - end if; - - -- Let's shutdown the runtime now. The rest of the procedure - -- needs to be careful not to use anything that would require - -- runtime support. In particular, function returing strings - -- are banned since the sec stack is not functional anymore - - System.Standard_Library.Adafinal; - - -- Check for special case of raising _ABORT_SIGNAL, which is not - -- really an exception at all. We recognize this by the fact that - -- it is the only exception whose name starts with underscore. - - if Excep.Id.Full_Name.all (1) = '_' then - To_Stderr (Nline); - To_Stderr ("Execution terminated by abort of environment task"); - To_Stderr (Nline); - - -- If no tracebacks, we print the unhandled exception in the old style - -- (i.e. the style used before ZCX was implemented). We do this to - -- retain compatibility, especially with the nightly scripts, but - -- this can be removed at some point ??? - - elsif Excep.Num_Tracebacks = 0 then - To_Stderr (Nline); - To_Stderr ("raised "); - To_Stderr (Excep.Id.Full_Name.all (1 .. Excep.Id.Name_Length - 1)); - - if Msg'Length /= 0 then - To_Stderr (" : "); - To_Stderr (Msg); - end if; - - To_Stderr (Nline); - - else - -- Traceback exists - - -- Note we can have this whole information output twice if - -- this occurrence gets reraised up to here. - - To_Stderr (Nline); - To_Stderr ("Execution terminated by unhandled exception"); - To_Stderr (Nline); - To_Stderr (Exc_Info (1 .. Exc_Info_Last)); - end if; - - Unhandled_Terminate; + Last_Chance_Handler (Excep.all); end Unhandled_Exception_Terminate; --------------- diff --git a/gcc/ada/a-sequio.adb b/gcc/ada/a-sequio.adb index 90b543a7b03..7218763a5a4 100644 --- a/gcc/ada/a-sequio.adb +++ b/gcc/ada/a-sequio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -38,6 +38,7 @@ with Interfaces.C_Streams; use Interfaces.C_Streams; with System; +with System.CRTL; with System.File_Control_Block; with System.File_IO; with System.Storage_Elements; @@ -58,6 +59,8 @@ package body Ada.Sequential_IO is function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode); function To_SIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); + use type System.CRTL.size_t; + ----------- -- Close -- ----------- diff --git a/gcc/ada/a-ststio.adb b/gcc/ada/a-ststio.adb index 8df6a379ba9..2d5db6196fc 100644 --- a/gcc/ada/a-ststio.adb +++ b/gcc/ada/a-ststio.adb @@ -35,6 +35,7 @@ with Interfaces.C_Streams; use Interfaces.C_Streams; with System; use System; with System.File_IO; with System.Soft_Links; +with System.CRTL; with Unchecked_Conversion; with Unchecked_Deallocation; @@ -382,8 +383,11 @@ package body Ada.Streams.Stream_IO is ------------------ procedure Set_Position (File : in File_Type) is + use type System.CRTL.long; begin - if fseek (File.Stream, long (File.Index) - 1, SEEK_SET) /= 0 then + if fseek (File.Stream, + System.CRTL.long (File.Index) - 1, SEEK_SET) /= 0 + then raise Use_Error; end if; end Set_Position; diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb index b61ebd3c80a..98766ce9bf3 100644 --- a/gcc/ada/a-textio.adb +++ b/gcc/ada/a-textio.adb @@ -35,6 +35,7 @@ with Ada.Streams; use Ada.Streams; with Interfaces.C_Streams; use Interfaces.C_Streams; with System; with System.File_IO; +with System.CRTL; with Unchecked_Conversion; with Unchecked_Deallocation; @@ -51,6 +52,8 @@ package body Ada.Text_IO is function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); use type FCB.File_Mode; + use type System.CRTL.size_t; + ------------------- -- AFCB_Allocate -- ------------------- diff --git a/gcc/ada/a-tiinau.adb b/gcc/ada/a-tiinau.adb index f9d7ce0052a..03977710a50 100644 --- a/gcc/ada/a-tiinau.adb +++ b/gcc/ada/a-tiinau.adb @@ -167,6 +167,9 @@ package body Ada.Text_IO.Integer_Aux is Load_Digits (File, Buf, Ptr, Loaded); if Loaded then + + -- Deal with based literal (note : is ok replacement for #) + Load (File, Buf, Ptr, '#', ':', Loaded); if Loaded then @@ -175,6 +178,8 @@ package body Ada.Text_IO.Integer_Aux is Load (File, Buf, Ptr, Buf (Hash_Loc)); end if; + -- Deal with exponent + Load (File, Buf, Ptr, 'E', 'e', Loaded); if Loaded then diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb index 50b1202796d..621f4bd30ff 100644 --- a/gcc/ada/a-witeio.adb +++ b/gcc/ada/a-witeio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,6 +36,7 @@ with Ada.Streams; use Ada.Streams; with Interfaces.C_Streams; use Interfaces.C_Streams; with System; +with System.CRTL; with System.File_IO; with System.WCh_Cnv; use System.WCh_Cnv; with System.WCh_Con; use System.WCh_Con; @@ -55,6 +56,8 @@ package body Ada.Wide_Text_IO is function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); use type FCB.File_Mode; + use type System.CRTL.size_t; + WC_Encoding : Character; pragma Import (C, WC_Encoding, "__gl_wc_encoding"); diff --git a/gcc/ada/ada-tree.def b/gcc/ada/ada-tree.def index 9b3b1cdf9bd..08a69acd21f 100644 --- a/gcc/ada/ada-tree.def +++ b/gcc/ada/ada-tree.def @@ -37,7 +37,7 @@ DEFTREECODE (TRANSFORM_EXPR, "transform_expr", 'e', 0) by operand 0 at the alignment given by operand 1 and return the address of the resulting memory. */ -DEFTREECODE (ALLOCATE_EXPR, "allocate_expr", 's', 2) +DEFTREECODE (ALLOCATE_EXPR, "allocate_expr", '2', 2) /* A type that is an unconstrained array itself. This node is never passed to GCC. TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE @@ -77,3 +77,11 @@ DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_expr", '1', 1) ??? This should be redone at some point. */ DEFTREECODE (GNAT_LOOP_ID, "gnat_loop_id", 'x', 0) + +/* Here are the tree codes for the statement types known to Ada. These + must be at the end of this file to allow IS_STMT to work. + + We start with an expression statement, whose only operand is an + expression, EXPR_STMT_EXPR, Execution of the statement means evaluation of + the expression (such as a MODIFY_EXPR) and discarding its result. */ +DEFTREECODE (EXPR_STMT, "expr_stmt_expr", 's', 1) diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h index 9f1675a2c23..d7767e274e4 100644 --- a/gcc/ada/ada-tree.h +++ b/gcc/ada/ada-tree.h @@ -72,10 +72,14 @@ struct lang_type GTY(()) #define TYPE_FAT_POINTER_P(NODE) \ (TREE_CODE (NODE) == RECORD_TYPE && TYPE_IS_FAT_POINTER_P (NODE)) -/* For integral types, nonzero if this is a packed array type. Such - types should not be extended to a larger size. */ +/* For integral types and array types, nonzero if this is a packed array type. + Such types should not be extended to a larger size. */ #define TYPE_PACKED_ARRAY_TYPE_P(NODE) TYPE_LANG_FLAG_0 (NODE) +#define TYPE_IS_PACKED_ARRAY_TYPE_P(NODE) \ + ((TREE_CODE (NODE) == INTEGER_TYPE || TREE_CODE (NODE) == ARRAY_TYPE) \ + && TYPE_PACKED_ARRAY_TYPE_P (NODE)) + /* For INTEGER_TYPE, nonzero if this is a modular type with a modulus that is not equal to two to the power of its mode's size. */ #define TYPE_MODULAR_P(NODE) TYPE_LANG_FLAG_1 (INTEGER_TYPE_CHECK (NODE)) @@ -174,14 +178,14 @@ struct lang_type GTY(()) #define TYPE_INDEX_TYPE(NODE) \ (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic) #define SET_TYPE_INDEX_TYPE(NODE, X) \ - (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) + (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *) (X)) /* For an INTEGER_TYPE with TYPE_VAX_FLOATING_POINT_P, stores the Digits_Value. */ -#define TYPE_DIGITS_VALUE(NODE) \ - ((long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))) +#define TYPE_DIGITS_VALUE(NODE) \ + (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic) #define SET_TYPE_DIGITS_VALUE(NODE, X) \ - (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(size_t)(X)) + (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *) (X)) /* For INTEGER_TYPE, stores the RM_Size of the type. */ #define TYPE_RM_SIZE_INT(NODE) TYPE_VALUES (INTEGER_TYPE_CHECK (NODE)) @@ -271,7 +275,17 @@ struct lang_type GTY(()) discriminant number. */ #define DECL_DISCRIMINANT_NUMBER(NODE) DECL_INITIAL (FIELD_DECL_CHECK (NODE)) -/* This is a horrible kludge to store the loop_id of a loop into a tree - node. We need to find some other place to store it! */ +/* This is the loop id for a GNAT_LOOP_ID node. */ #define TREE_LOOP_ID(NODE) \ - (((union lang_tree_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id) + ((union lang_tree_node *) TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id + +/* Define fields and macros for statements. + + Start by defining which tree codes are used for statements. */ +#define IS_STMT(NODE) (TREE_CODE_CLASS (TREE_CODE (NODE)) == 's') + +/* We store the Sloc in statement nodes. */ +#define TREE_SLOC(NODE) TREE_COMPLEXITY (STMT_CHECK (NODE)) + +/* There is just one field in an EXPR_STMT: the expression. */ +#define EXPR_STMT_EXPR(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXPR_STMT, 0) diff --git a/gcc/ada/adadecode.c b/gcc/ada/adadecode.c index 928b838ab19..fe0253ee09f 100644 --- a/gcc/ada/adadecode.c +++ b/gcc/ada/adadecode.c @@ -35,15 +35,16 @@ #include "system.h" #else #include +#include +#define ISDIGIT(c) isdigit(c) #define PARMS(ARGS) ARGS #endif -#include "ctype.h" #include "adadecode.h" -static void add_verbose PARAMS ((const char *, char *)); -static int has_prefix PARAMS ((const char *, const char *)); -static int has_suffix PARAMS ((const char *, const char *)); +static void add_verbose (const char *, char *); +static int has_prefix (const char *, const char *); +static int has_suffix (const char *, const char *); /* This is a safe version of strcpy that can be used with overlapped pointers. Does nothing if s2 <= s1. */ @@ -55,9 +56,7 @@ static int verbose_info; /* Add TEXT to end of ADA_NAME, putting a leading " (" or ", ", depending on VERBOSE_INFO. */ -static void add_verbose (text, ada_name) - const char *text; - char *ada_name; +static void add_verbose (const char *text, char *ada_name) { strcat (ada_name, verbose_info ? ", " : " ("); strcat (ada_name, text); @@ -68,9 +67,7 @@ static void add_verbose (text, ada_name) /* Returns 1 if NAME starts with PREFIX. */ static int -has_prefix (name, prefix) - const char *name; - const char *prefix; +has_prefix (const char *name, const char *prefix) { return strncmp (name, prefix, strlen (prefix)) == 0; } @@ -78,9 +75,7 @@ has_prefix (name, prefix) /* Returns 1 if NAME ends with SUFFIX. */ static int -has_suffix (name, suffix) - const char *name; - const char *suffix; +has_suffix (const char *name, const char *suffix) { int nlen = strlen (name); int slen = strlen (suffix); @@ -147,10 +142,7 @@ ostrcpy (char *s1, char *s2) x__Oexpon "**" */ void -__gnat_decode (coded_name, ada_name, verbose) - const char *coded_name; - char *ada_name; - int verbose; +__gnat_decode (const char *coded_name, char *ada_name, int verbose) { int lib_subprog = 0; int overloaded = 0; @@ -216,7 +208,7 @@ __gnat_decode (coded_name, ada_name, verbose) int n_digits = 0; if (len > 1) - while (isdigit ((int) ada_name[(int) len - 1 - n_digits])) + while (ISDIGIT ((int) ada_name[(int) len - 1 - n_digits])) n_digits++; /* Check if we have $ or __ before digits. */ @@ -322,8 +314,7 @@ __gnat_decode (coded_name, ada_name, verbose) } char * -ada_demangle (coded_name) - const char *coded_name; +ada_demangle (const char *coded_name) { char ada_name[2048]; diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index c5a1cddced6..b7130d8fbb1 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -50,6 +50,10 @@ #endif /* VxWorks */ +#ifdef VMS +#define _POSIX_EXIT 1 +#endif + #ifdef IN_RTS #include "tconfig.h" #include "tsystem.h" @@ -57,6 +61,9 @@ #include #include #include +#ifdef VMS +#include +#endif /* We don't have libiberty, so use malloc. */ #define xmalloc(S) malloc (S) @@ -425,7 +432,7 @@ __gnat_try_lock (char *dir, char *file) /* Return the maximum file name length. */ int -__gnat_get_maximum_file_name_length () +__gnat_get_maximum_file_name_length (void) { #if defined (MSDOS) return 8; @@ -442,7 +449,7 @@ __gnat_get_maximum_file_name_length () /* Return nonzero if file names are case sensitive. */ int -__gnat_get_file_names_case_sensitive () +__gnat_get_file_names_case_sensitive (void) { #if defined (__EMX__) || defined (MSDOS) || defined (VMS) || defined (WINNT) return 0; @@ -452,7 +459,7 @@ __gnat_get_file_names_case_sensitive () } char -__gnat_get_default_identifier_character_set () +__gnat_get_default_identifier_character_set (void) { #if defined (__EMX__) || defined (MSDOS) return 'p'; @@ -660,7 +667,7 @@ __gnat_open_new_temp (char *path, int fmode) strcpy (path, "GNAT-XXXXXX"); -#if defined (linux) && !defined (__vxworks) +#if (defined (__FreeBSD__) || defined (linux)) && !defined (__vxworks) return mkstemp (path); #elif defined (__Lynx__) mktemp (path); @@ -735,7 +742,7 @@ __gnat_tmp_name (char *tmp_filename) free (pname); } -#elif defined (linux) +#elif defined (linux) || defined (__FreeBSD__) #define MAX_SAFE_PATH 1000 char *tmpdir = getenv ("TMPDIR"); @@ -782,7 +789,7 @@ __gnat_readdir (DIR *dirp, char *buffer) /* Returns 1 if readdir is thread safe, 0 otherwise. */ int -__gnat_readdir_is_thread_safe () +__gnat_readdir_is_thread_safe (void) { #ifdef HAVE_READDIR_R return 1; @@ -1270,7 +1277,7 @@ __gnat_set_env_value (char *name, char *value) key. */ char * -__gnat_get_libraries_from_registry () +__gnat_get_libraries_from_registry (void) { char *result = (char *) ""; @@ -1332,7 +1339,10 @@ __gnat_stat (char *name, struct stat *statbuf) terminated by a directory separator except if just after a drive name. */ int name_len = strlen (name); char last_char = name[name_len - 1]; - char win32_name[4096]; + char win32_name[GNAT_MAX_PATH_LEN + 2]; + + if (name_len > GNAT_MAX_PATH_LEN) + return -1; strcpy (win32_name, name); @@ -1463,8 +1473,13 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED) #ifdef VMS /* Defined in VMS header files. */ +#if defined (__ALPHA) +#define fork() (decc$$alloc_vfork_blocks() >= 0 ? \ + LIB$GET_CURRENT_INVO_CONTEXT (decc$$get_vfork_jmpbuf()) : -1) +#elif defined (__IA64) #define fork() (decc$$alloc_vfork_blocks() >= 0 ? \ - LIB$GET_CURRENT_INVO_CONTEXT (decc$$get_vfork_jmpbuf()) : -1) + LIB$I64_GET_CURR_INVO_CONTEXT(decc$$get_vfork_jmpbuf()) : -1) +#endif #endif #if defined (sun) && defined (__SVR4) @@ -1816,12 +1831,7 @@ __gnat_waitpid (int pid) void __gnat_os_exit (int status) { -#ifdef VMS - /* Exit without changing 0 to 1. */ - __posix_exit (status); -#else exit (status); -#endif } /* Locate a regular file, give a Path value. */ @@ -2299,13 +2309,13 @@ __gnat_to_canonical_file_list_init } char * -__gnat_to_canonical_file_list_next () +__gnat_to_canonical_file_list_next (void) { return (char *) ""; } void -__gnat_to_canonical_file_list_free () +__gnat_to_canonical_file_list_free (void) { } @@ -2340,7 +2350,7 @@ __gnat_to_host_file_spec (char *filespec) } void -__gnat_adjust_os_resource_limits () +__gnat_adjust_os_resource_limits (void) { } @@ -2455,14 +2465,15 @@ __gnat_copy_attribs (char *from, char *to, int mode) extern void __gnat_install_locks (void (*) (void), void (*) (void)); /* This function offers a hook for libgnarl to set the - locking subprograms for libgcc_eh. */ + locking subprograms for libgcc_eh. + This is only needed on OpenVMS, since other platforms use standard + --enable-threads=posix option, or similar. */ void -__gnatlib_install_locks (lock, unlock) - void (*lock) (void) ATTRIBUTE_UNUSED; - void (*unlock) (void) ATTRIBUTE_UNUSED; +__gnatlib_install_locks (void (*lock) (void) ATTRIBUTE_UNUSED, + void (*unlock) (void) ATTRIBUTE_UNUSED) { -#ifdef IN_RTS +#if defined (IN_RTS) && defined (VMS) __gnat_install_locks (lock, unlock); /* There is a bootstrap path issue if adaint is build with this symbol unresolved for the stage1 compiler. Since the compiler @@ -2470,3 +2481,9 @@ __gnatlib_install_locks (lock, unlock) a no-op in this case. */ #endif } + +int +__gnat_lseek (int fd, long offset, int whence) +{ + return (int) lseek (fd, offset, whence); +} diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index 5ce5d68ba2d..33c2bdcba95 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h @@ -140,6 +140,7 @@ extern int __gnat_expect_poll (int *, int, int, int *); extern void __gnat_set_binary_mode (int); extern void __gnat_set_text_mode (int); extern char *__gnat_ttyname (int); +extern int __gnat_lseek (int, long, int); #ifdef __MINGW32__ extern void __gnat_plist_init (void); diff --git a/gcc/ada/argv.c b/gcc/ada/argv.c index d0ba12d9ee5..4f78ac21198 100644 --- a/gcc/ada/argv.c +++ b/gcc/ada/argv.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2002 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -71,28 +71,25 @@ const char **gnat_envp = (const char **) 0; #endif int -__gnat_arg_count () +__gnat_arg_count (void) { return gnat_argc; } int -__gnat_len_arg (arg_num) - int arg_num; +__gnat_len_arg (int arg_num) { return strlen (gnat_argv[arg_num]); } void -__gnat_fill_arg (a, i) - char *a; - int i; +__gnat_fill_arg (char *a, int i) { strncpy (a, gnat_argv[i], strlen(gnat_argv[i])); } int -__gnat_env_count () +__gnat_env_count (void) { int i; @@ -102,16 +99,13 @@ __gnat_env_count () } int -__gnat_len_env (env_num) - int env_num; +__gnat_len_env (int env_num) { return strlen (gnat_envp[env_num]); } void -__gnat_fill_env (a, i) - char *a; - int i; +__gnat_fill_env (char *a, int i) { strncpy (a, gnat_envp[i], strlen (gnat_envp[i])); } diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index e27a63fa445..65d2056da31 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -347,6 +347,35 @@ package body Atree is Table_Increment => Alloc.Orig_Nodes_Increment, Table_Name => "Orig_Nodes"); + ---------------------------------------- + -- Global_Variables for New_Copy_Tree -- + ---------------------------------------- + + -- These global variables are used by New_Copy_Tree. See description + -- of the body of this subprogram for details. Global variables can be + -- safely used by New_Copy_Tree, since there is no case of a recursive + -- call from the processing inside New_Copy_Tree. + + NCT_Hash_Threshhold : constant := 20; + -- If there are more than this number of pairs of entries in the + -- map, then Hash_Tables_Used will be set, and the hash tables will + -- be initialized and used for the searches. + + NCT_Hash_Tables_Used : Boolean := False; + -- Set to True if hash tables are in use + + NCT_Table_Entries : Nat; + -- Count entries in table to see if threshhold is reached + + NCT_Hash_Table_Setup : Boolean := False; + -- Set to True if hash table contains data. We set this True if we + -- setup the hash table with data, and leave it set permanently + -- from then on, this is a signal that second and subsequent users + -- of the hash table must clear the old entries before reuse. + + subtype NCT_Header_Num is Int range 0 .. 511; + -- Defines range of headers in hash tables (512 headers) + ----------------------- -- Local Subprograms -- ----------------------- @@ -838,6 +867,7 @@ package body Atree is pragma Warnings (Off, Dummy); begin + Node_Count := 0; Atree_Private_Part.Nodes.Init; Orig_Nodes.Init; @@ -852,6 +882,11 @@ package body Atree is Dummy := New_Node (N_Error, No_Location); Set_Name1 (Error, Error_Name); Set_Error_Posted (Error, True); + + -- Set global variables for New_Copy_Tree: + NCT_Hash_Tables_Used := False; + NCT_Table_Entries := 0; + NCT_Hash_Table_Setup := False; end Initialize; -------------------------- @@ -958,29 +993,6 @@ package body Atree is -- (because setting up a hash table for only a few entries takes -- more time than it saves. - -- Global variables are safe for this purpose, since there is no case - -- of a recursive call from the processing inside New_Copy_Tree. - - NCT_Hash_Threshhold : constant := 20; - -- If there are more than this number of pairs of entries in the - -- map, then Hash_Tables_Used will be set, and the hash tables will - -- be initialized and used for the searches. - - NCT_Hash_Tables_Used : Boolean := False; - -- Set to True if hash tables are in use - - NCT_Table_Entries : Nat; - -- Count entries in table to see if threshhold is reached - - NCT_Hash_Table_Setup : Boolean := False; - -- Set to True if hash table contains data. We set this True if we - -- setup the hash table with data, and leave it set permanently - -- from then on, this is a signal that second and subsequent users - -- of the hash table must clear the old entries before reuse. - - subtype NCT_Header_Num is Int range 0 .. 511; - -- Defines range of headers in hash tables (512 headers) - function New_Copy_Hash (E : Entity_Id) return NCT_Header_Num; -- Hash function used for hash operations diff --git a/gcc/ada/aux-io.c b/gcc/ada/aux-io.c index 8185f2e033b..3ff9f3ed0f8 100644 --- a/gcc/ada/aux-io.c +++ b/gcc/ada/aux-io.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2001 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -43,29 +43,29 @@ /* Function wrappers are needed to access the values from Ada which are defined as C macros. */ -FILE *c_stdin PARAMS ((void)); -FILE *c_stdout PARAMS ((void)); -FILE *c_stderr PARAMS ((void)); -int seek_set_function PARAMS ((void)); -int seek_end_function PARAMS ((void)); -void *null_function PARAMS ((void)); -int c_fileno PARAMS ((FILE *)); +FILE *c_stdin (void); +FILE *c_stdout (void); +FILE *c_stderr (void); +int seek_set_function (void); +int seek_end_function (void); +void *null_function (void); +int c_fileno (FILE *); FILE * -c_stdin () -{ - return stdin; +c_stdin (void) +{ + return stdin; } FILE * -c_stdout () -{ +c_stdout (void) +{ return stdout; } FILE * -c_stderr () -{ +c_stderr (void) +{ return stderr; } @@ -75,26 +75,25 @@ c_stderr () #define SEEK_END 2 /* Set file pointer to the size of the file plus offset */ #endif -int -seek_set_function () -{ - return SEEK_SET; +int +seek_set_function (void) +{ + return SEEK_SET; } -int -seek_end_function () -{ - return SEEK_END; +int +seek_end_function (void) +{ + return SEEK_END; } -void *null_function () -{ - return NULL; +void *null_function (void) +{ + return NULL; } -int -c_fileno (s) - FILE *s; -{ - return fileno (s); +int +c_fileno (FILE *s) +{ + return fileno (s); } diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 5725f9eca21..ede3f8b2097 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -270,6 +270,12 @@ package body Back_End is Opt.No_Stdinc := True; Scan_Back_End_Switches (Argv); + -- We must recognize -nostdlib to suppress visibility on the + -- standard GNAT RTL objects. + + elsif Argv (Argv'First + 1 .. Argv'Last) = "nostdlib" then + Opt.No_Stdlib := True; + elsif Is_Front_End_Switch (Argv) then Scan_Front_End_Switches (Argv); diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 8db6a302ef0..56b2915ef6f 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -1774,22 +1774,18 @@ package body Bindgen is end if; end loop; - -- Add a "-Ldir" for each directory in the object path. We skip this - -- in Configurable_Run_Time mode, where we want more precise control - -- of exactly what goes into the resulting object file + -- Add a "-Ldir" for each directory in the object path - if not Configurable_Run_Time_Mode then - for J in 1 .. Nb_Dir_In_Obj_Search_Path loop - declare - Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J); - begin - Name_Len := 0; - Add_Str_To_Name_Buffer ("-L"); - Add_Str_To_Name_Buffer (Dir.all); - Write_Linker_Option; - end; - end loop; - end if; + for J in 1 .. Nb_Dir_In_Obj_Search_Path loop + declare + Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J); + begin + Name_Len := 0; + Add_Str_To_Name_Buffer ("-L"); + Add_Str_To_Name_Buffer (Dir.all); + Write_Linker_Option; + end; + end loop; -- Sort linker options @@ -1845,7 +1841,7 @@ package body Bindgen is -- files. The reason for this decision is that libraries referenced -- by internal routines may reference these standard library entries. - if not (Configurable_Run_Time_Mode or else Opt.No_Stdlib) then + if not Opt.No_Stdlib then Name_Len := 0; if Opt.Shared_Libgnat then @@ -1894,8 +1890,7 @@ package body Bindgen is --------------------- procedure Gen_Output_File (Filename : String) is - Public_Version : constant Boolean := Gnat_Version_Type = "PUBLIC "; - -- Set true if this is the public version of GNAT + Is_Public_Version : constant Boolean := Get_Gnat_Build_Type = Public; begin -- Acquire settings for Interrupt_State pragmas @@ -1929,7 +1924,7 @@ package body Bindgen is -- Get the time stamp of the former bind for public version warning - if Public_Version then + if Is_Public_Version then Record_Time_From_Last_Bind; end if; @@ -1944,7 +1939,7 @@ package body Bindgen is -- Periodically issue a warning when the public version is used on -- big projects - if Public_Version then + if Is_Public_Version then Public_Version_Warning; end if; end Gen_Output_File; diff --git a/gcc/ada/bld-io.adb b/gcc/ada/bld-io.adb index 51c14cbc7ef..7bd01e6ac6d 100644 --- a/gcc/ada/bld-io.adb +++ b/gcc/ada/bld-io.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002 Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,6 +132,7 @@ package body Bld.IO is ----------- procedure Flush is + Last : Natural; begin if Lines (Current).Length /= 0 then Osint.Fail ("INTERNAL ERROR: flushing before end of line: """ & @@ -141,7 +142,18 @@ package body Bld.IO is for J in 1 .. Current - 1 loop if not Lines (J).Suppressed then - Text_IO.Put_Line (File, Lines (J).Value (1 .. Lines (J).Length)); + Last := Lines (J).Length; + + -- The last character of a line cannot be a back slash ('\'), + -- otherwise make has a problem. The only real place were it + -- should happen is for directory names on Windows, and then + -- this terminal back slash is not needed. + + if Last > 0 and then Lines (J).Value (Last) = '\' then + Last := Last - 1; + end if; + + Text_IO.Put_Line (File, Lines (J).Value (1 .. Last)); end if; end loop; diff --git a/gcc/ada/bld.adb b/gcc/ada/bld.adb index 07add38e2e0..492f205ec61 100644 --- a/gcc/ada/bld.adb +++ b/gcc/ada/bld.adb @@ -1559,9 +1559,9 @@ package body Bld is Put ("src.list_file:=" & "$(strip $(shell gprcmd to_absolute $("); Put (Project_Name); - Put (".base_dir) $("); + Put (".base_dir) '$("); Put_Attribute (Project, Pkg, Item_Name, No_Name); - Put_Line (")))"); + Put_Line (")'))"); if In_Case then if Source_List_File_Declaration = False then @@ -1595,9 +1595,9 @@ package body Bld is Put (".obj_dir:=" & "$(strip $(shell gprcmd to_absolute $("); Put (Project_Name); - Put (".base_dir) $("); + Put (".base_dir) '$("); Put_Attribute (Project, Pkg, Item_Name, No_Name); - Put_Line (")))"); + Put_Line (")'))"); elsif Item_Name = Snames.Name_Exec_Dir then @@ -1611,9 +1611,9 @@ package body Bld is Put ("EXEC_DIR:=" & "$(strip $(shell gprcmd to_absolute $("); Put (Project_Name); - Put (".base_dir) $("); + Put (".base_dir) '$("); Put_Attribute (Project, Pkg, Item_Name, No_Name); - Put_Line (")))"); + Put_Line (")'))"); elsif Item_Name = Snames.Name_Main then @@ -2595,6 +2595,25 @@ package body Bld is -- Include some utility functions and saved all reserved -- env. vars. by including Makefile.prolog. + New_Line; + + -- First, if MAKE_ROOT is not defined, try to get GNAT prefix + + Put (" ifeq ($("); + Put (MAKE_ROOT); + Put ("),)"); + New_Line; + + Put (" MAKE_ROOT=$(shell gprcmd prefix)"); + New_Line; + + Put (" endif"); + New_Line; + + New_Line; + + -- If MAKE_ROOT is still not defined, then fail + Put (" ifeq ($("); Put (MAKE_ROOT); Put ("),)"); diff --git a/gcc/ada/cal.c b/gcc/ada/cal.c index 31d39834afc..8f8930e24eb 100644 --- a/gcc/ada/cal.c +++ b/gcc/ada/cal.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2002, Free Software Foundation, Inc. * + * Copyright (C) 1992-2003, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -94,7 +94,7 @@ __gnat_duration_to_timeval (long sec, long usec, struct timeval *t) what time_t is on the target. */ long -gnat_time () +gnat_time (void) { return time (0); } diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 04a4c048d75..2adb5f73ba2 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -1183,6 +1183,26 @@ package body Checks is if No (DconS) then return; end if; + + -- A further optimization: if T_Typ is derived from S_Typ + -- without imposing a constraint, no check is needed. + + if Nkind (Original_Node (Parent (T_Typ))) = + N_Full_Type_Declaration + then + declare + Type_Def : Node_Id := + Type_Definition + (Original_Node (Parent (T_Typ))); + begin + if Nkind (Type_Def) = N_Derived_Type_Definition + and then Is_Entity_Name (Subtype_Indication (Type_Def)) + and then Entity (Subtype_Indication (Type_Def)) = S_Typ + then + return; + end if; + end; + end if; end if; DconT := First_Elmt (Discriminant_Constraint (T_Typ)); @@ -4758,13 +4778,16 @@ package body Checks is -- At the library level, we need to ensure that the -- type of the object is elaborated before the check - -- itself is emitted. + -- itself is emitted. This is only done if the object + -- is in the current compilation unit, otherwise the + -- type is frozen and elaborated in its unit. if Is_Itype (Exptyp) and then Ekind (Cunit_Entity (Current_Sem_Unit)) = E_Package and then not In_Package_Body (Cunit_Entity (Current_Sem_Unit)) + and then In_Open_Scopes (Scope (Exptyp)) then Ref_Node := Make_Itype_Reference (Sloc (Ck_Node)); Set_Itype (Ref_Node, Exptyp); diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c index 1316455c86a..8e4c7cba596 100644 --- a/gcc/ada/cio.c +++ b/gcc/ada/cio.c @@ -52,7 +52,7 @@ #endif int -get_char () +get_char (void) { #ifdef VMS return decc$getchar(); @@ -62,7 +62,7 @@ get_char () } int -get_int () +get_int (void) { int x; @@ -71,8 +71,7 @@ get_int () } void -put_int (x) - int x; +put_int (int x) { /* Use fprintf rather than printf, since the latter is unbuffered on vxworks */ @@ -80,22 +79,19 @@ put_int (x) } void -put_int_stderr (x) - int x; +put_int_stderr (int x) { fprintf (stderr, "%d", x); } void -put_char (c) - int c; +put_char (int c) { putchar (c); } void -put_char_stderr (c) - int c; +put_char_stderr (int c) { fputc (c, stderr); } @@ -103,8 +99,7 @@ put_char_stderr (c) #ifdef __vxworks char * -mktemp (template) - char *template; +mktemp (char *template) { return tmpnam (NULL); } diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb index ecc0f855294..69302f77171 100644 --- a/gcc/ada/comperr.adb +++ b/gcc/ada/comperr.adb @@ -80,12 +80,6 @@ package body Comperr is -- the FSF version of GNAT, but there are specializations for -- the GNATPRO and Public releases by Ada Core Technologies. - Public_Version : constant Boolean := Gnat_Version_Type = "PUBLIC "; - -- Set True for the public version of GNAT - - GNATPRO_Version : constant Boolean := Gnat_Version_Type = "GNATPRO"; - -- Set True for the GNATPRO version of GNAT - procedure End_Line; -- Add blanks up to column 76, and then a final vertical bar @@ -99,6 +93,9 @@ package body Comperr is Write_Eol; end End_Line; + Is_Public_Version : constant Boolean := Get_Gnat_Build_Type = Public; + Is_FSF_Version : constant Boolean := Get_Gnat_Build_Type = FSF; + -- Start of processing for Compiler_Abort begin @@ -264,7 +261,13 @@ package body Comperr is -- Otherwise we use the standard fixed text else - if Public_Version or GNATPRO_Version then + if Is_FSF_Version then + Write_Str + ("| Please submit a bug report; see" & + " http://gcc.gnu.org/bugs.html."); + End_Line; + + else Write_Str ("| Please submit bug report by email " & "to report@gnat.com."); @@ -274,15 +277,9 @@ package body Comperr is ("| Use a subject line meaningful to you" & " and us to track the bug."); End_Line; - - else - Write_Str - ("| Please submit a bug report; see" & - " http://gcc.gnu.org/bugs.html."); - End_Line; end if; - if GNATPRO_Version then + if not (Is_Public_Version or Is_FSF_Version) then Write_Str ("| (include your customer number #nnn " & "in the subject line)."); @@ -307,7 +304,7 @@ package body Comperr is ("| (concatenated together with no headers between files)."); End_Line; - if Public_Version then + if Is_Public_Version then Write_Str ("| (use plain ASCII or MIME attachment)."); End_Line; @@ -317,7 +314,7 @@ package body Comperr is "for submitting bugs."); End_Line; - elsif GNATPRO_Version then + elsif not Is_FSF_Version then Write_Str ("| (use plain ASCII or MIME attachment, or FTP " & "to your customer directory)."); diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 93b84a86f27..c79d6027f4b 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -33,10 +33,12 @@ with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; +with Output; use Output; with Targparm; use Targparm; with Tbuild; use Tbuild; with Ttypes; use Ttypes; with Ttypef; use Ttypef; +with Scn; with Sem_Mech; use Sem_Mech; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; @@ -102,8 +104,7 @@ package body CStand is function Make_Formal (Typ : Entity_Id; - Formal_Name : String) - return Entity_Id; + Formal_Name : String) return Entity_Id; -- Construct entity for subprogram formal with given name and type function Make_Integer (V : Uint) return Node_Id; @@ -116,10 +117,12 @@ package body CStand is -- Build entity for standard operator with given name and type. function New_Standard_Entity - (New_Node_Kind : Node_Kind := N_Defining_Identifier) - return Entity_Id; + (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id; -- Builds a new entity for Standard + procedure Print_Standard; + -- Print representation of package Standard if switch set + procedure Set_Integer_Bounds (Id : Entity_Id; Typ : Entity_Id; @@ -255,10 +258,10 @@ package body CStand is -- by Initialize_Standard in the semantics module. procedure Create_Standard is - Decl_S : List_Id; + Decl_S : List_Id := New_List; -- List of declarations in Standard - Decl_A : List_Id; + Decl_A : List_Id := New_List; -- List of declarations in ASCII Decl : Node_Id; @@ -293,7 +296,9 @@ package body CStand is -- Start of processing for Create_Standard begin - Decl_S := New_List; + -- Initialize scanner for internal scans of literals + + Scn.Initialize_Scanner (No_Unit, Internal_Source_File); -- First step is to create defining identifiers for each entity @@ -410,7 +415,6 @@ package body CStand is declare LIS : Nat; - begin if Debug_Flag_M then LIS := 64; @@ -653,7 +657,6 @@ package body CStand is Set_Defining_Unit_Name (Pspec, Standard_Entity (S_ASCII)); Set_Ekind (Standard_Entity (S_ASCII), E_Package); - Decl_A := New_List; -- for ASCII declarations Set_Visible_Declarations (Pspec, Decl_A); -- Create control character definitions in package ASCII. Note that @@ -787,6 +790,18 @@ package body CStand is Set_Prim_Alignment (Any_Access); Make_Name (Any_Access, "an access type"); + Any_Character := New_Standard_Entity; + Set_Ekind (Any_Character, E_Enumeration_Type); + Set_Scope (Any_Character, Standard_Standard); + Set_Etype (Any_Character, Any_Character); + Set_Is_Unsigned_Type (Any_Character); + Set_Is_Character_Type (Any_Character); + Init_Esize (Any_Character, Standard_Character_Size); + Init_RM_Size (Any_Character, 8); + Set_Prim_Alignment (Any_Character); + Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character)); + Make_Name (Any_Character, "a character type"); + Any_Array := New_Standard_Entity; Set_Ekind (Any_Array, E_String_Type); Set_Scope (Any_Array, Standard_Standard); @@ -806,18 +821,6 @@ package body CStand is Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean)); Make_Name (Any_Boolean, "a boolean type"); - Any_Character := New_Standard_Entity; - Set_Ekind (Any_Character, E_Enumeration_Type); - Set_Scope (Any_Character, Standard_Standard); - Set_Etype (Any_Character, Any_Character); - Set_Is_Unsigned_Type (Any_Character); - Set_Is_Character_Type (Any_Character); - Init_Esize (Any_Character, Standard_Character_Size); - Init_RM_Size (Any_Character, 8); - Set_Prim_Alignment (Any_Character); - Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character)); - Make_Name (Any_Character, "a character type"); - Any_Composite := New_Standard_Entity; Set_Ekind (Any_Composite, E_Array_Type); Set_Scope (Any_Composite, Standard_Standard); @@ -1004,9 +1007,9 @@ package body CStand is -- delta and size values depend on the mode set in system.ads. Build_Duration : declare - Dlo : Uint; - Dhi : Uint; - Delta_Val : Ureal; + Dlo : Uint; + Dhi : Uint; + Delta_Val : Ureal; begin -- In 32 bit mode, the size is 32 bits, and the delta and @@ -1026,18 +1029,16 @@ package body CStand is Delta_Val := UR_From_Components (Uint_1, Uint_9, 10); end if; - Decl := - Make_Full_Type_Declaration (Stloc, - Defining_Identifier => Standard_Duration, - Type_Definition => - Make_Ordinary_Fixed_Point_Definition (Stloc, + Tdef_Node := Make_Ordinary_Fixed_Point_Definition (Stloc, Delta_Expression => Make_Real_Literal (Stloc, Delta_Val), Real_Range_Specification => Make_Real_Range_Specification (Stloc, Low_Bound => Make_Real_Literal (Stloc, Realval => Dlo * Delta_Val), High_Bound => Make_Real_Literal (Stloc, - Realval => Dhi * Delta_Val)))); + Realval => Dhi * Delta_Val))); + + Set_Type_Definition (Parent (Standard_Duration), Tdef_Node); Set_Ekind (Standard_Duration, E_Ordinary_Fixed_Point_Type); Set_Etype (Standard_Duration, Standard_Duration); @@ -1053,7 +1054,7 @@ package body CStand is Set_Small_Value (Standard_Duration, Delta_Val); Set_Scalar_Range (Standard_Duration, Real_Range_Specification - (Type_Definition (Decl))); + (Type_Definition (Parent (Standard_Duration)))); -- Normally it does not matter that nodes in package Standard are -- not marked as analyzed. The Scalar_Range of the fixed-point @@ -1243,6 +1244,12 @@ package body CStand is -- The Error node has an Etype of Any_Type to help error recovery Set_Etype (Error, Any_Type); + + -- Print representation of standard if switch set + + if Opt.Print_Standard then + Print_Standard; + end if; end Create_Standard; ------------------------------------ @@ -1314,8 +1321,7 @@ package body CStand is function Make_Formal (Typ : Entity_Id; - Formal_Name : String) - return Entity_Id + Formal_Name : String) return Entity_Id is Formal : Entity_Id; @@ -1337,7 +1343,6 @@ package body CStand is function Make_Integer (V : Uint) return Node_Id is N : constant Node_Id := Make_Integer_Literal (Stloc, V); - begin Set_Is_Static_Expression (N); return N; @@ -1387,8 +1392,7 @@ package body CStand is ------------------------- function New_Standard_Entity - (New_Node_Kind : Node_Kind := N_Defining_Identifier) - return Entity_Id + (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id is E : constant Entity_Id := New_Entity (New_Node_Kind, Stloc); @@ -1417,6 +1421,249 @@ package body CStand is return E; end New_Standard_Entity; + -------------------- + -- Print_Standard -- + -------------------- + + procedure Print_Standard is + + procedure P (Item : String) renames Output.Write_Line; + -- Short-hand, since we do a lot of line writes here! + + procedure P_Int_Range (Size : Pos); + -- Prints the range of an integer based on its Size + + procedure P_Float_Range (Id : Entity_Id); + -- Prints the bounds range for the given float type entity + + ------------------- + -- P_Float_Range -- + ------------------- + + procedure P_Float_Range (Id : Entity_Id) is + Digs : constant Nat := UI_To_Int (Digits_Value (Id)); + + begin + Write_Str (" range "); + + if Vax_Float (Id) then + if Digs = VAXFF_Digits then + Write_Str (VAXFF_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (VAXFF_Last'Universal_Literal_String); + + elsif Digs = VAXDF_Digits then + Write_Str (VAXDF_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (VAXDF_Last'Universal_Literal_String); + + else + pragma Assert (Digs = VAXGF_Digits); + + Write_Str (VAXGF_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (VAXGF_Last'Universal_Literal_String); + end if; + + elsif Is_AAMP_Float (Id) then + if Digs = AAMPS_Digits then + Write_Str (AAMPS_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (AAMPS_Last'Universal_Literal_String); + + else + pragma Assert (Digs = AAMPL_Digits); + Write_Str (AAMPL_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (AAMPL_Last'Universal_Literal_String); + end if; + + elsif Digs = IEEES_Digits then + Write_Str (IEEES_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (IEEES_Last'Universal_Literal_String); + + + elsif Digs = IEEEL_Digits then + Write_Str (IEEEL_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (IEEEL_Last'Universal_Literal_String); + + else + pragma Assert (Digs = IEEEX_Digits); + + Write_Str (IEEEX_First'Universal_Literal_String); + Write_Str (" .. "); + Write_Str (IEEEX_Last'Universal_Literal_String); + end if; + + Write_Str (";"); + Write_Eol; + end P_Float_Range; + + ----------------- + -- P_Int_Range -- + ----------------- + + procedure P_Int_Range (Size : Pos) is + begin + Write_Str (" is range -(2 **"); + Write_Int (Size - 1); + Write_Str (")"); + Write_Str (" .. +(2 **"); + Write_Int (Size - 1); + Write_Str (" - 1);"); + Write_Eol; + end P_Int_Range; + + -- Start of processing for Print_Standard + + begin + P ("-- Representation of package Standard"); + Write_Eol; + P ("-- This is not accurate Ada, since new base types cannot be "); + P ("-- created, but the listing shows the target dependent"); + P ("-- characteristics of the Standard types for this compiler"); + Write_Eol; + + P ("package Standard is"); + P ("pragma Pure(Standard);"); + Write_Eol; + + P (" type Boolean is (False, True);"); + P (" for Boolean'Size use 1;"); + P (" for Boolean use (False => 0, True => 1);"); + Write_Eol; + + -- Integer types + + Write_Str (" type Integer"); + P_Int_Range (Standard_Integer_Size); + Write_Str (" for Integer'Size use "); + Write_Int (Standard_Integer_Size); + P (";"); + Write_Eol; + + P (" subtype Natural is Integer range 0 .. Integer'Last;"); + P (" subtype Positive is Integer range 1 .. Integer'Last;"); + Write_Eol; + + Write_Str (" type Short_Short_Integer"); + P_Int_Range (Standard_Short_Short_Integer_Size); + Write_Str (" for Short_Short_Integer'Size use "); + Write_Int (Standard_Short_Short_Integer_Size); + P (";"); + Write_Eol; + + Write_Str (" type Short_Integer"); + P_Int_Range (Standard_Short_Integer_Size); + Write_Str (" for Short_Integer'Size use "); + Write_Int (Standard_Short_Integer_Size); + P (";"); + Write_Eol; + + Write_Str (" type Long_Integer"); + P_Int_Range (Standard_Long_Integer_Size); + Write_Str (" for Long_Integer'Size use "); + Write_Int (Standard_Long_Integer_Size); + P (";"); + Write_Eol; + + Write_Str (" type Long_Long_Integer"); + P_Int_Range (Standard_Long_Long_Integer_Size); + Write_Str (" for Long_Long_Integer'Size use "); + Write_Int (Standard_Long_Long_Integer_Size); + P (";"); + Write_Eol; + + -- Floating point types + + Write_Str (" type Short_Float is digits "); + Write_Int (Standard_Short_Float_Digits); + Write_Eol; + P_Float_Range (Standard_Short_Float); + Write_Str (" for Short_Float'Size use "); + Write_Int (Standard_Short_Float_Size); + P (";"); + Write_Eol; + + Write_Str (" type Float is digits "); + Write_Int (Standard_Float_Digits); + Write_Eol; + P_Float_Range (Standard_Float); + Write_Str (" for Float'Size use "); + Write_Int (Standard_Float_Size); + P (";"); + Write_Eol; + + Write_Str (" type Long_Float is digits "); + Write_Int (Standard_Long_Float_Digits); + Write_Eol; + P_Float_Range (Standard_Long_Float); + Write_Str (" for Long_Float'Size use "); + Write_Int (Standard_Long_Float_Size); + P (";"); + Write_Eol; + + Write_Str (" type Long_Long_Float is digits "); + Write_Int (Standard_Long_Long_Float_Digits); + Write_Eol; + P_Float_Range (Standard_Long_Long_Float); + Write_Str (" for Long_Long_Float'Size use "); + Write_Int (Standard_Long_Long_Float_Size); + P (";"); + Write_Eol; + + P (" type Character is (...)"); + Write_Str (" for Character'Size use "); + Write_Int (Standard_Character_Size); + P (";"); + P (" -- See RM A.1(35) for details of this type"); + Write_Eol; + + P (" type Wide_Character is (...)"); + Write_Str (" for Wide_Character'Size use "); + Write_Int (Standard_Wide_Character_Size); + P (";"); + P (" -- See RM A.1(36) for details of this type"); + Write_Eol; + + P (" type String is array (Positive range <>) of Character;"); + P (" pragma Pack (String);"); + Write_Eol; + + P (" type Wide_String is array (Positive range <>)" & + " of Wide_Character;"); + P (" pragma Pack (Wide_String);"); + Write_Eol; + + -- Here it's OK to use the Duration type of the host compiler since + -- the implementation of Duration in GNAT is target independent. + + if Duration_32_Bits_On_Target then + P (" type Duration is delta 0.020"); + P (" range -((2 ** 31 - 1) * 0.020) .."); + P (" +((2 ** 31 - 1) * 0.020);"); + P (" for Duration'Small use 0.020;"); + else + P (" type Duration is delta 0.000000001"); + P (" range -((2 ** 63 - 1) * 0.000000001) .."); + P (" +((2 ** 63 - 1) * 0.000000001);"); + P (" for Duration'Small use 0.000000001;"); + end if; + + Write_Eol; + + P (" Constraint_Error : exception;"); + P (" Program_Error : exception;"); + P (" Storage_Error : exception;"); + P (" Tasking_Error : exception;"); + P (" Numeric_Error : exception renames Constraint_Error;"); + Write_Eol; + + P ("end Standard;"); + end Print_Standard; + ---------------------- -- Set_Float_Bounds -- ---------------------- diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c index f56cfff44bd..7001f847b57 100644 --- a/gcc/ada/cstreams.c +++ b/gcc/ada/cstreams.c @@ -76,29 +76,25 @@ #endif int -__gnat_feof (stream) - FILE *stream; +__gnat_feof (FILE *stream) { return (feof (stream)); } int -__gnat_ferror (stream) - FILE *stream; +__gnat_ferror (FILE *stream) { return (ferror (stream)); } int -__gnat_fileno (stream) - FILE *stream; +__gnat_fileno (FILE *stream) { return (fileno (stream)); } int -__gnat_is_regular_file_fd (fd) - int fd; +__gnat_is_regular_file_fd (int fd) { int ret; struct stat statbuf; @@ -179,9 +175,9 @@ __gnat_full_name (char *nam, char *buffer) #elif defined (MSDOS) _fixpath (nam, buffer); -#elif defined (sgi) +#elif defined (sgi) || defined (__FreeBSD__) - /* Use realpath function which resolves links and references to .. and .. + /* Use realpath function which resolves links and references to . and .. on those Unix systems that support it. Note that GNU/Linux provides it but cannot handle more than 5 symbolic links in a full name, so we use the getcwd approach instead. */ diff --git a/gcc/ada/ctrl_c.c b/gcc/ada/ctrl_c.c index 22d00667275..20dd8811007 100644 --- a/gcc/ada/ctrl_c.c +++ b/gcc/ada/ctrl_c.c @@ -132,7 +132,7 @@ __gnat_install_int_handler (void (*proc) (void)) } void -__gnat_uninstall_int_handler () +__gnat_uninstall_int_handler (void) { if (sigint_intercepted != NULL) SetConsoleCtrlHandler (__gnat_int_handler, FALSE); @@ -150,7 +150,7 @@ __gnat_install_int_handler (void (*proc) (void) __attribute__ ((unused))) } void -__gnat_uninstall_int_handler () +__gnat_uninstall_int_handler (void) { } #endif diff --git a/gcc/ada/cuintp.c b/gcc/ada/cuintp.c index 80ed5b588bf..f83f5184ee6 100644 --- a/gcc/ada/cuintp.c +++ b/gcc/ada/cuintp.c @@ -57,14 +57,12 @@ resulting node. */ tree -UI_To_gnu (Input, type) - Uint Input; - tree type; +UI_To_gnu (Uint Input, tree type) { tree gnu_ret; if (Input <= Uint_Direct_Last) - gnu_ret = convert (type, build_int_2 (Input - Uint_Direct_Bias, + gnu_ret = convert (type, build_int_2 (Input - Uint_Direct_Bias, Input < Uint_Direct_Bias ? -1 : 0)); else { diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 09ec0dccd49..3c6a67f5ac0 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -338,7 +338,9 @@ package body Debug is -- dz Print source of package Standard. Normally the source print out -- does not include package Standard, even if the -df switch is set. -- This switch forces output of the source recreated from the internal - -- tree built for Standard. + -- tree built for Standard. Note that this differs from -gnatS in + -- that it prints from the actual tree using the normal Sprint + -- circuitry for printing trees. -- dA Forces output of representation information, including full -- information for all internal type and object entities, as well diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index bbad5b50e46..85bd27bf274 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -82,42 +82,34 @@ static struct incomplete Entity_Id full_type; } *defer_incomplete_list = 0; -static tree substitution_list PARAMS ((Entity_Id, Entity_Id, - tree, int)); -static int allocatable_size_p PARAMS ((tree, int)); -static struct attrib *build_attr_list PARAMS ((Entity_Id)); -static tree elaborate_expression PARAMS ((Node_Id, Entity_Id, tree, - int, int, int)); -static int is_variable_size PARAMS ((tree)); -static tree elaborate_expression_1 PARAMS ((Node_Id, Entity_Id, tree, - tree, int, int)); -static tree make_packable_type PARAMS ((tree)); -static tree maybe_pad_type PARAMS ((tree, tree, unsigned int, - Entity_Id, const char *, int, - int, int)); -static tree gnat_to_gnu_field PARAMS ((Entity_Id, tree, int, int)); -static void components_to_record PARAMS ((tree, Node_Id, tree, int, - int, tree *, int, int)); -static int compare_field_bitpos PARAMS ((const PTR, const PTR)); -static Uint annotate_value PARAMS ((tree)); -static void annotate_rep PARAMS ((Entity_Id, tree)); -static tree compute_field_positions PARAMS ((tree, tree, tree, tree, - unsigned int)); -static tree validate_size PARAMS ((Uint, tree, Entity_Id, - enum tree_code, int, int)); -static void set_rm_size PARAMS ((Uint, tree, Entity_Id)); -static tree make_type_from_size PARAMS ((tree, tree, int)); -static unsigned int validate_alignment PARAMS ((Uint, Entity_Id, - unsigned int)); -static void check_ok_for_atomic PARAMS ((tree, Entity_Id, int)); +static tree substitution_list (Entity_Id, Entity_Id, tree, int); +static int allocatable_size_p (tree, int); +static struct attrib *build_attr_list (Entity_Id); +static tree elaborate_expression (Node_Id, Entity_Id, tree, int, int, int); +static int is_variable_size (tree); +static tree elaborate_expression_1 (Node_Id, Entity_Id, tree, tree, int, int); +static tree make_packable_type (tree); +static tree maybe_pad_type (tree, tree, unsigned int, Entity_Id, const char *, + int, int, int); +static tree gnat_to_gnu_field (Entity_Id, tree, int, int); +static void components_to_record (tree, Node_Id, tree, int, int, tree *, + int, int); +static int compare_field_bitpos (const PTR, const PTR); +static Uint annotate_value (tree); +static void annotate_rep (Entity_Id, tree); +static tree compute_field_positions (tree, tree, tree, tree, unsigned int); +static tree validate_size (Uint, tree, Entity_Id, enum tree_code, int, int); +static void set_rm_size (Uint, tree, Entity_Id); +static tree make_type_from_size (tree, tree, int); +static unsigned int validate_alignment (Uint, Entity_Id, unsigned int); +static void check_ok_for_atomic (tree, Entity_Id, int); /* Given GNAT_ENTITY, an entity in the incoming GNAT tree, return a GCC type corresponding to that entity. GNAT_ENTITY is assumed to refer to an Ada type. */ tree -gnat_to_gnu_type (gnat_entity) - Entity_Id gnat_entity; +gnat_to_gnu_type (Entity_Id gnat_entity) { tree gnu_decl; @@ -146,10 +138,7 @@ gnat_to_gnu_type (gnat_entity) the code. */ tree -gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) - Entity_Id gnat_entity; - tree gnu_expr; - int definition; +gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) { tree gnu_entity_id; tree gnu_type = 0; @@ -177,7 +166,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) && UI_Is_In_Int_Range (Esize (gnat_entity))) ? MIN (UI_To_Int (Esize (gnat_entity)), IN (kind, Float_Kind) - ? LONG_DOUBLE_TYPE_SIZE + ? fp_prec_to_size (LONG_DOUBLE_TYPE_SIZE) : IN (kind, Access_Kind) ? POINTER_SIZE * 2 : LONG_LONG_TYPE_SIZE) : LONG_LONG_TYPE_SIZE); @@ -946,7 +935,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) gnu_expr = build_component_ref (gnu_expr, NULL_TREE, - TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr)))); + TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))), 0); } if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST @@ -990,7 +979,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) (build_binary_op (MODIFY_EXPR, NULL_TREE, build_component_ref (gnu_new_var, NULL_TREE, - TYPE_FIELDS (gnu_new_type)), + TYPE_FIELDS (gnu_new_type), 0), gnu_expr)); gnu_type = build_reference_type (gnu_type); @@ -998,7 +987,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) = build_unary_op (ADDR_EXPR, gnu_type, build_component_ref (gnu_new_var, NULL_TREE, - TYPE_FIELDS (gnu_new_type))); + TYPE_FIELDS (gnu_new_type), 0)); gnu_size = 0; used_by_ref = 1; @@ -1348,14 +1337,15 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) gnu_type = make_signed_type (esize); TYPE_VAX_FLOATING_POINT_P (gnu_type) = 1; SET_TYPE_DIGITS_VALUE (gnu_type, - UI_To_Int (Digits_Value (gnat_entity))); + UI_To_gnu (Digits_Value (gnat_entity), + sizetype)); break; } /* The type of the Low and High bounds can be our type if this is a type from Standard, so set them at the end of the function. */ gnu_type = make_node (REAL_TYPE); - TYPE_PRECISION (gnu_type) = esize; + TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize); layout_type (gnu_type); break; @@ -1367,8 +1357,6 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) } { - enum machine_mode mode; - if (definition == 0 && Present (Ancestor_Subtype (gnat_entity)) && ! In_Extended_Main_Code_Unit (Ancestor_Subtype (gnat_entity)) @@ -1377,15 +1365,9 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) gnat_to_gnu_entity (Ancestor_Subtype (gnat_entity), gnu_expr, definition); - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - (GET_MODE_WIDER_MODE (mode) != VOIDmode - && GET_MODE_BITSIZE (GET_MODE_WIDER_MODE (mode)) <= esize); - mode = GET_MODE_WIDER_MODE (mode)) - ; - gnu_type = make_node (REAL_TYPE); TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity)); - TYPE_PRECISION (gnu_type) = GET_MODE_BITSIZE (mode); + TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize); TYPE_MIN_VALUE (gnu_type) = convert (TREE_TYPE (gnu_type), @@ -1571,8 +1553,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) tem = gnat_to_gnu_type (Component_Type (gnat_entity)); /* Get and validate any specified Component_Size, but if Packed, - ignore it since the front end will have taken care of it. Also, - allow sizes not a multiple of Storage_Unit if packed. */ + ignore it since the front end will have taken care of it. */ gnu_comp_size = validate_size (Component_Size (gnat_entity), tem, gnat_entity, @@ -1895,8 +1876,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) } /* Get and validate any specified Component_Size, but if Packed, - ignore it since the front end will have taken care of it. Also, - allow sizes not a multiple of Storage_Unit if packed. */ + ignore it since the front end will have taken care of it. */ gnu_comp_size = validate_size (Component_Size (gnat_entity), gnu_type, gnat_entity, @@ -2004,6 +1984,8 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) debug_no_type_hash = 0; TYPE_CONVENTION_FORTRAN_P (gnu_type) = (Convention (gnat_entity) == Convention_Fortran); + TYPE_PACKED_ARRAY_TYPE_P (gnu_type) + = Is_Packed_Array_Type (gnat_entity); /* If our size depends on a placeholder and the maximum size doesn't overflow, use it. */ @@ -3536,6 +3518,13 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) if (! global_bindings_p ()) pure_flag = 0; + /* A subprogram (something that doesn't return anything) shouldn't + be considered Pure since there would be no reason for such a + subprogram. Note that procedures with Out (or In Out) parameters + have already been converted into a function with a return type. */ + if (TREE_CODE (gnu_return_type) == VOID_TYPE) + pure_flag = 0; + gnu_type = build_qualified_type (gnu_type, (TYPE_QUALS (gnu_type) @@ -4030,8 +4019,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) be elaborated at the point of its definition, but do nothing else. */ void -elaborate_entity (gnat_entity) - Entity_Id gnat_entity; +elaborate_entity (Entity_Id gnat_entity) { switch (Ekind (gnat_entity)) { @@ -4102,8 +4090,7 @@ elaborate_entity (gnat_entity) any entities on its entity chain similarly. */ void -mark_out_of_scope (gnat_entity) - Entity_Id gnat_entity; +mark_out_of_scope (Entity_Id gnat_entity) { Entity_Id gnat_sub_entity; unsigned int kind = Ekind (gnat_entity); @@ -4146,11 +4133,10 @@ mark_out_of_scope (gnat_entity) DEFINITION is as in gnat_to_gnu_entity. */ static tree -substitution_list (gnat_subtype, gnat_type, gnu_list, definition) - Entity_Id gnat_subtype; - Entity_Id gnat_type; - tree gnu_list; - int definition; +substitution_list (Entity_Id gnat_subtype, + Entity_Id gnat_type, + tree gnu_list, + int definition) { Entity_Id gnat_discrim; Node_Id gnat_value; @@ -4184,7 +4170,7 @@ static GTY((length ("max_gnat_nodes"))) tree * dummy_node_table; /* Initialize the above table. */ void -init_dummy_type () +init_dummy_type (void) { Node_Id gnat_node; @@ -4199,8 +4185,7 @@ init_dummy_type () /* Make a dummy type corresponding to GNAT_TYPE. */ tree -make_dummy_type (gnat_type) - Entity_Id gnat_type; +make_dummy_type (Entity_Id gnat_type) { Entity_Id gnat_underlying; tree gnu_type; @@ -4246,9 +4231,7 @@ make_dummy_type (gnat_type) done with a static allocation. */ static int -allocatable_size_p (gnu_size, static_p) - tree gnu_size; - int static_p; +allocatable_size_p (tree gnu_size, int static_p) { HOST_WIDE_INT our_size; @@ -4272,8 +4255,7 @@ allocatable_size_p (gnu_size, static_p) /* Return a list of attributes for GNAT_ENTITY, if any. */ static struct attrib * -build_attr_list (gnat_entity) - Entity_Id gnat_entity; +build_attr_list (Entity_Id gnat_entity) { struct attrib *attr_list = 0; Node_Id gnat_temp; @@ -4345,8 +4327,7 @@ build_attr_list (gnat_entity) /* Get the unpadded version of a GNAT type. */ tree -get_unpadded_type (gnat_entity) - Entity_Id gnat_entity; +get_unpadded_type (Entity_Id gnat_entity) { tree type = gnat_to_gnu_type (gnat_entity); @@ -4359,9 +4340,7 @@ get_unpadded_type (gnat_entity) /* Called when we need to protect a variable object using a save_expr. */ tree -maybe_variable (gnu_operand, gnat_node) - tree gnu_operand; - Node_Id gnat_node; +maybe_variable (tree gnu_operand, Node_Id gnat_node) { if (TREE_CONSTANT (gnu_operand) || TREE_READONLY (gnu_operand) || TREE_CODE (gnu_operand) == SAVE_EXPR @@ -4390,14 +4369,12 @@ maybe_variable (gnu_operand, gnat_node) purposes even if it isn't needed for code generation. */ static tree -elaborate_expression (gnat_expr, gnat_entity, gnu_name, definition, - need_value, need_debug) - Node_Id gnat_expr; - Entity_Id gnat_entity; - tree gnu_name; - int definition; - int need_value; - int need_debug; +elaborate_expression (Node_Id gnat_expr, + Entity_Id gnat_entity, + tree gnu_name, + int definition, + int need_value, + int need_debug) { tree gnu_expr; @@ -4432,14 +4409,12 @@ elaborate_expression (gnat_expr, gnat_entity, gnu_name, definition, /* Similar, but take a GNU expression. */ static tree -elaborate_expression_1 (gnat_expr, gnat_entity, gnu_expr, gnu_name, definition, - need_debug) - Node_Id gnat_expr; - Entity_Id gnat_entity; - tree gnu_expr; - tree gnu_name; - int definition; - int need_debug; +elaborate_expression_1 (Node_Id gnat_expr, + Entity_Id gnat_entity, + tree gnu_expr, + tree gnu_name, + int definition, + int need_debug) { tree gnu_decl = 0; /* Strip any conversions to see if the expression is a readonly variable. @@ -4507,10 +4482,7 @@ elaborate_expression_1 (gnat_expr, gnat_entity, gnu_expr, gnu_name, definition, position so that it is aligned to ALIGN bits and is SIZE bytes long. */ tree -make_aligning_type (type, align, size) - tree type; - int align; - tree size; +make_aligning_type (tree type, int align, tree size) { tree record_type = make_node (RECORD_TYPE); tree place = build (PLACEHOLDER_EXPR, record_type); @@ -4561,8 +4533,7 @@ make_aligning_type (type, align, size) return the new type. If not, return the original type. */ static tree -make_packable_type (type) - tree type; +make_packable_type (tree type) { tree new_type = make_node (TREE_CODE (type)); tree field_list = NULL_TREE; @@ -4638,16 +4609,14 @@ make_packable_type (type) type. */ static tree -maybe_pad_type (type, size, align, gnat_entity, name_trailer, - is_user_type, definition, same_rm_size) - tree type; - tree size; - unsigned int align; - Entity_Id gnat_entity; - const char *name_trailer; - int is_user_type; - int definition; - int same_rm_size; +maybe_pad_type (tree type, + tree size, + unsigned int align, + Entity_Id gnat_entity, + const char *name_trailer, + int is_user_type, + int definition, + int same_rm_size) { tree orig_size = TYPE_SIZE (type); tree record; @@ -4823,9 +4792,7 @@ maybe_pad_type (type, size, align, gnat_entity, name_trailer, the value passed against the list of choices. */ tree -choices_to_gnu (operand, choices) - tree operand; - Node_Id choices; +choices_to_gnu (tree operand, Node_Id choices) { Node_Id choice; Node_Id gnat_temp; @@ -4917,11 +4884,10 @@ choices_to_gnu (operand, choices) DEFINITION is nonzero if this field is for a record being defined. */ static tree -gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition) - Entity_Id gnat_field; - tree gnu_record_type; - int packed; - int definition; +gnat_to_gnu_field (Entity_Id gnat_field, + tree gnu_record_type, + int packed, + int definition) { tree gnu_field_id = get_entity_name (gnat_field); tree gnu_field_type = gnat_to_gnu_type (Etype (gnat_field)); @@ -4951,10 +4917,14 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition) gnu_size = validate_size (Esize (gnat_field), gnu_field_type, gnat_field, FIELD_DECL, 0, 1); - /* If the field's type is a left-justified modular type, make the field - the type of the inner object unless it is aliases. We don't need - the the wrapper here and it can prevent packing. */ - if (! Is_Aliased (gnat_field) && TREE_CODE (gnu_field_type) == RECORD_TYPE + /* If the field's type is left-justified modular, the wrapper can prevent + packing so we make the field the type of the inner object unless the + situation forbids it. We may not do that when the field is addressable_p, + typically because in that case this field may later be passed by-ref for + a formal argument expecting the left justification. The condition below + is then matching the addressable_p code for COMPONENT_REF. */ + if (! Is_Aliased (gnat_field) && flag_strict_aliasing + && TREE_CODE (gnu_field_type) == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_field_type)) gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type)); @@ -5077,17 +5047,6 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition) if (Is_Atomic (gnat_field)) check_ok_for_atomic (gnu_field_type, gnat_field, 0); - - if (gnu_pos != 0 && TYPE_MODE (gnu_field_type) == BLKmode - && (! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_pos, - bitsize_unit_node))) - && TYPE_MODE (gnu_field_type) == BLKmode) - { - post_error_ne ("fields of& must start at storage unit boundary", - First_Bit (Component_Clause (gnat_field)), - Etype (gnat_field)); - gnu_pos = 0; - } } /* If the record has rep clauses and this is the tag field, make a rep @@ -5099,17 +5058,6 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition) gnu_size = TYPE_SIZE (gnu_field_type); } - /* If a size is specified and this is a BLKmode field, it must be an - integral number of bytes. */ - if (gnu_size != 0 && TYPE_MODE (gnu_field_type) == BLKmode - && ! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_size, - bitsize_unit_node))) - { - post_error_ne ("size of fields of& must be multiple of a storage unit", - gnat_field, Etype (gnat_field)); - gnu_pos = gnu_size = 0; - } - /* We need to make the size the maximum for the type if it is self-referential and an unconstrained type. In that case, we can't pack the field since we can't make a copy to align it. */ @@ -5166,8 +5114,7 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition) of variable size or is a record that has a field such a field. */ static int -is_variable_size (type) - tree type; +is_variable_size (tree type) { tree field; @@ -5222,16 +5169,14 @@ is_variable_size (type) fields of the record and then the record type is finished. */ static void -components_to_record (gnu_record_type, component_list, gnu_field_list, packed, - definition, p_gnu_rep_list, cancel_alignment, all_rep) - tree gnu_record_type; - Node_Id component_list; - tree gnu_field_list; - int packed; - int definition; - tree *p_gnu_rep_list; - int cancel_alignment; - int all_rep; +components_to_record (tree gnu_record_type, + Node_Id component_list, + tree gnu_field_list, + int packed, + int definition, + tree *p_gnu_rep_list, + int cancel_alignment, + int all_rep) { Node_Id component_decl; Entity_Id gnat_field; @@ -5371,11 +5316,11 @@ components_to_record (gnu_record_type, component_list, gnu_field_list, packed, gnu_variant_list = gnu_field; } - /* We can delete any empty variants from the end. This may leave none - left. Note we cannot delete variants from anywhere else. */ - while (gnu_variant_list != 0 - && TYPE_FIELDS (TREE_TYPE (gnu_variant_list)) == 0) - gnu_variant_list = TREE_CHAIN (gnu_variant_list); + /* We use to delete the empty variants from the end. However, + we no longer do that because we need them to generate complete + debugging information for the variant record. Otherwise, + the union type definition will be missing the fields associated + to these empty variants. */ /* Only make the QUAL_UNION_TYPE if there are any non-empty variants. */ if (gnu_variant_list != 0) @@ -5495,9 +5440,7 @@ components_to_record (gnu_record_type, component_list, gnu_field_list, packed, bit positions and ordinals of the two fields. */ static int -compare_field_bitpos (rt1, rt2) - const PTR rt1; - const PTR rt2; +compare_field_bitpos (const PTR rt1, const PTR rt2) { tree *t1 = (tree *) rt1; tree *t2 = (tree *) rt2; @@ -5517,8 +5460,7 @@ compare_field_bitpos (rt1, rt2) in the GNAT tree. */ static Uint -annotate_value (gnu_size) - tree gnu_size; +annotate_value (tree gnu_size) { int len = TREE_CODE_LENGTH (TREE_CODE (gnu_size)); TCode tcode; @@ -5656,9 +5598,7 @@ annotate_value (gnu_size) used by Gigi. */ static void -annotate_rep (gnat_entity, gnu_type) - Entity_Id gnat_entity; - tree gnu_type; +annotate_rep (Entity_Id gnat_entity, tree gnu_type) { tree gnu_list; tree gnu_entry; @@ -5736,12 +5676,11 @@ annotate_rep (gnat_entity, gnu_type) so far. */ static tree -compute_field_positions (gnu_type, gnu_list, gnu_pos, gnu_bitpos, offset_align) - tree gnu_type; - tree gnu_list; - tree gnu_pos; - tree gnu_bitpos; - unsigned int offset_align; +compute_field_positions (tree gnu_type, + tree gnu_list, + tree gnu_pos, + tree gnu_bitpos, + unsigned int offset_align) { tree gnu_field; tree gnu_result = gnu_list; @@ -5785,13 +5724,12 @@ compute_field_positions (gnu_type, gnu_list, gnu_pos, gnu_bitpos, offset_align) it means that a size of zero should be treated as an unspecified size. */ static tree -validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok) - Uint uint_size; - tree gnu_type; - Entity_Id gnat_object; - enum tree_code kind; - int component_p; - int zero_ok; +validate_size (Uint uint_size, + tree gnu_type, + Entity_Id gnat_object, + enum tree_code kind, + int component_p, + int zero_ok) { Node_Id gnat_error_node; tree type_size @@ -5808,11 +5746,6 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok) else gnat_error_node = gnat_object; - /* Don't give errors on packed array types; we'll be giving the error on - the type itself soon enough. */ - if (Is_Packed_Array_Type (gnat_object)) - gnat_error_node = Empty; - /* Return 0 if no size was specified, either because Esize was not Present or the specified size was zero. */ if (No (uint_size) || uint_size == No_Uint) @@ -5847,11 +5780,11 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok) return 0; } - /* If this is an integral type, the front-end has verified the size, so we - need not do it here (which would entail checking against the bounds). - However, if this is an aliased object, it may not be smaller than the - type of the object. */ - if (INTEGRAL_TYPE_P (gnu_type) && ! TYPE_PACKED_ARRAY_TYPE_P (gnu_type) + /* If this is an integral type or a packed array type, the front-end has + verified the size, so we need not do it here (which would entail + checking against the bounds). However, if this is an aliased object, it + may not be smaller than the type of the object. */ + if ((INTEGRAL_TYPE_P (gnu_type) || TYPE_IS_PACKED_ARRAY_TYPE_P (gnu_type)) && ! (kind == VAR_DECL && Is_Aliased (gnat_object))) return size; @@ -5904,10 +5837,7 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok) routine is only called for types. */ static void -set_rm_size (uint_size, gnu_type, gnat_entity) - Uint uint_size; - tree gnu_type; - Entity_Id gnat_entity; +set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) { /* Only give an error if a Value_Size clause was explicitly given. Otherwise, we'd be duplicating an error on the Size clause. */ @@ -5981,10 +5911,7 @@ set_rm_size (uint_size, gnu_type, gnat_entity) we are making a biased type. */ static tree -make_type_from_size (type, size_tree, biased_p) - tree type; - tree size_tree; - int biased_p; +make_type_from_size (tree type, tree size_tree, int biased_p) { tree new_type; unsigned HOST_WIDE_INT size; @@ -6054,10 +5981,7 @@ make_type_from_size (type, size_tree, biased_p) valid, return it. Otherwise, give an error and return ALIGN. */ static unsigned int -validate_alignment (alignment, gnat_entity, align) - Uint alignment; - Entity_Id gnat_entity; - unsigned int align; +validate_alignment (Uint alignment, Entity_Id gnat_entity, unsigned int align) { Node_Id gnat_error_node = gnat_entity; unsigned int new_align; @@ -6102,10 +6026,7 @@ validate_alignment (alignment, gnat_entity, align) if we require atomic components. */ static void -check_ok_for_atomic (object, gnat_entity, comp_p) - tree object; - Entity_Id gnat_entity; - int comp_p; +check_ok_for_atomic (tree object, Entity_Id gnat_entity, int comp_p) { Node_Id gnat_error_point = gnat_entity; Node_Id gnat_node; @@ -6181,8 +6102,7 @@ check_ok_for_atomic (object, gnat_entity, comp_p) changed. */ tree -gnat_substitute_in_type (t, f, r) - tree t, f, r; +gnat_substitute_in_type (tree t, tree f, tree r) { tree new = t; tree tem; @@ -6403,8 +6323,7 @@ gnat_substitute_in_type (t, f, r) needed to represent the object. */ tree -rm_size (gnu_type) - tree gnu_type; +rm_size (tree gnu_type) { /* For integer types, this is the precision. For record types, we store the size explicitly. For other types, this is just the size. */ @@ -6433,9 +6352,7 @@ rm_size (gnu_type) and the specified suffix. */ tree -create_concat_name (gnat_entity, suffix) - Entity_Id gnat_entity; - const char *suffix; +create_concat_name (Entity_Id gnat_entity, const char *suffix) { const char *str = (suffix == 0 ? "" : suffix); String_Template temp = {1, strlen (str)}; @@ -6473,8 +6390,7 @@ create_concat_name (gnat_entity, suffix) Otherwise, return the name. */ tree -get_entity_name (gnat_entity) - Entity_Id gnat_entity; +get_entity_name (Entity_Id gnat_entity) { Get_Encoded_Name (gnat_entity); return get_identifier (Name_Buffer); @@ -6485,9 +6401,7 @@ get_entity_name (gnat_entity) the name in GNU_ID and SUFFIX. */ tree -concat_id_with_name (gnu_id, suffix) - tree gnu_id; - const char *suffix; +concat_id_with_name (tree gnu_id, const char *suffix) { int len = IDENTIFIER_LENGTH (gnu_id); diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 6eac0d78359..f1a9afa7317 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -80,7 +80,6 @@ package body Einfo is -- Hiding_Loop_Variable Node8 -- Mechanism Uint8 (but returns Mechanism_Type) -- Normalized_First_Bit Uint8 - -- Non_Limited_Views Elist8 -- Class_Wide_Type Node9 -- Current_Value Node9 @@ -303,6 +302,7 @@ package body Einfo is -- Is_CPP_Class Flag74 -- Has_Non_Standard_Rep Flag75 -- Is_Constructor Flag76 + -- Is_Thread_Body Flag77 -- Is_Tag Flag78 -- Has_All_Calls_Remote Flag79 -- Is_Constr_Subt_For_U_Nominal Flag80 @@ -421,7 +421,6 @@ package body Einfo is -- Remaining flags are currently unused and available - -- (unused) Flag77 -- (unused) Flag136 -- (unused) Flag183 @@ -1641,6 +1640,11 @@ package body Einfo is return Flag55 (Id); end Is_Tagged_Type; + function Is_Thread_Body (Id : E) return B is + begin + return Flag77 (Id); + end Is_Thread_Body; + function Is_True_Constant (Id : E) return B is begin return Flag163 (Id); @@ -1798,17 +1802,10 @@ package body Einfo is function Non_Limited_View (Id : E) return E is begin pragma Assert (False - or else Ekind (Id) = E_Incomplete_Type - or else Ekind (Id) = E_Package); + or else Ekind (Id) = E_Incomplete_Type); return Node17 (Id); end Non_Limited_View; - function Non_Limited_Views (Id : E) return L is - begin - pragma Assert (Ekind (Id) = E_Package); - return Elist8 (Id); - end Non_Limited_Views; - function Nonzero_Is_True (Id : E) return B is begin pragma Assert (Root_Type (Id) = Standard_Boolean); @@ -2845,7 +2842,7 @@ package body Einfo is begin pragma Assert (Is_Type (Id) - or else Ekind (Id) = E_Package); + or else Ekind (Id) = E_Package); Set_Flag159 (Id, V); end Set_From_With_Type; @@ -3589,6 +3586,11 @@ package body Einfo is Set_Flag55 (Id, V); end Set_Is_Tagged_Type; + procedure Set_Is_Thread_Body (Id : E; V : B := True) is + begin + Set_Flag77 (Id, V); + end Set_Is_Thread_Body; + procedure Set_Is_True_Constant (Id : E; V : B := True) is begin Set_Flag163 (Id, V); @@ -3741,18 +3743,11 @@ package body Einfo is procedure Set_Non_Limited_View (Id : E; V : E) is pragma Assert (False - or else Ekind (Id) = E_Incomplete_Type - or else Ekind (Id) = E_Package); + or else Ekind (Id) = E_Incomplete_Type); begin Set_Node17 (Id, V); end Set_Non_Limited_View; - procedure Set_Non_Limited_Views (Id : E; V : L) is - begin - pragma Assert (Ekind (Id) = E_Package); - Set_Elist8 (Id, V); - end Set_Non_Limited_Views; - procedure Set_Nonzero_Is_True (Id : E; V : B := True) is begin pragma Assert @@ -6214,6 +6209,7 @@ package body Einfo is W ("Is_Statically_Allocated", Flag28 (Id)); W ("Is_Tag", Flag78 (Id)); W ("Is_Tagged_Type", Flag55 (Id)); + W ("Is_Thread_Body", Flag77 (Id)); W ("Is_True_Constant", Flag163 (Id)); W ("Is_Unchecked_Union", Flag117 (Id)); W ("Is_Unsigned_Type", Flag144 (Id)); diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 3f8b227fd6d..07aa13fa406 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -930,7 +930,7 @@ package Einfo is -- the record that is the fat pointer representation of an RAST. -- Esize (Uint12) --- Present in all types and subtypes, an also for components, constants, +-- Present in all types and subtypes, and also for components, constants, -- and variables. Contains the Object_Size of the type or of the object. -- A value of zero indicates that the value is not yet known. -- @@ -1162,6 +1162,9 @@ package Einfo is -- types, i.e. record types (Java classes) that hold pointers to each -- other. If such a type is an access type, it has no explicit freeze -- node, so that the back-end does not attempt to elaborate it. +-- Currently this flag is also used to implement Ada0Y (AI-50217). +-- It will be renamed to From_Limited_With after removal of the current +-- GNAT with_type clause??? -- Full_View (Node11) -- Present in all type and subtype entities and in deferred constants. @@ -1660,9 +1663,9 @@ package Einfo is -- Is_Bit_Packed_Array (Flag122) [implementation base type only] -- Present in all entities. This flag is set for a packed array -- type that is bit packed (i.e. the component size is known by the --- front end and is in the range 1-7, 9-15, or 17-31). Is_Packed is --- always set if Is_Bit_Packed_Array is set, but it is possible for --- Is_Packed to be set without Is_Bit_Packed_Array or the case of an +-- front end and is in the range 1-7, 9-15, 17-31, or 33-63). Is_Packed +-- is always set if Is_Bit_Packed_Array is set, but it is possible for +-- Is_Packed to be set without Is_Bit_Packed_Array for the case of an -- array having one or more index types that are enumeration types -- with non-standard enumeration representations. @@ -2276,6 +2279,10 @@ package Einfo is -- Is_Task_Type (synthesized) -- Applies to all entities, true for task types and subtypes +-- Is_Thread_Body (Flag77) +-- Applies to subprogram entities. Set if a valid Thread_Body pragma +-- applies to this subprogram, which is thus a thread body. + -- Is_True_Constant (Flag163) -- This flag is set in constants and variables which have an initial -- value specified but which are never assigned, partially or in the @@ -2381,8 +2388,7 @@ package Einfo is -- Present in non-generic package entities that are not instances. -- The elements of this list are the shadow entities created for the -- types and local packages that are declared in a package that appears --- in a limited_with clause. This list and Non_Limited_Views are built --- at the same time, and their elements are in one-one correspondence. +-- in a limited_with clause (Ada0Y: AI-50217) -- Lit_Indexes (Node15) -- Present in enumeration types and subtypes. Non-empty only for the @@ -2551,14 +2557,9 @@ package Einfo is -- is other than a power of 2. -- Non_Limited_View (Node17) --- Present in incomplete types, and local packages that are the --- shadow entities created when analyzing a limited_with_clause. --- Points to the definining entity in the original declaration. - --- Non_Limited_Views (Elist8) --- Present in non-generic packages that are not instances. The elements --- of this list are defining identifiers for types and local packages --- declared within a package that appears in a limited_with clause. +-- Present in incomplete types that are the shadow entities created +-- when analyzing a limited_with_clause (Ada0Y: AI-50217). Points to +-- the defining entity in the original declaration. -- Nonzero_Is_True (Flag162) [base type only] -- Present in enumeration types. True if any non-zero value is to be @@ -2832,7 +2833,7 @@ package Einfo is -- Present in all type and subtype entities. Contains the value of -- type'Size as defined in the RM. See also the Esize field and -- and the description on "Handling of Type'Size Values". A value --- of zero for in this field for a non-discrete type means that +-- of zero in this field for a non-discrete type means that -- the front end has not yet determined the size value. For the -- case of a discrete type, this field is always set by the front -- end and zero is a legitimate value for a type with one value. @@ -4258,6 +4259,7 @@ package Einfo is -- Is_Overriding_Operation (Flag39) (non-generic case only) -- Is_Private_Descendant (Flag53) -- Is_Pure (Flag44) + -- Is_Thread_Body (Flag77) (non-generic case only) -- Is_Visible_Child_Unit (Flag116) -- Needs_No_Actuals (Flag22) -- Return_Present (Flag54) @@ -4388,7 +4390,6 @@ package Einfo is -- E_Package -- E_Generic_Package -- Dependent_Instances (Elist8) (for an instance) - -- Non_Limited_Views (Elist8) (non-generic, not instance) -- Renaming_Map (Uint9) -- Handler_Records (List10) (non-generic case only) -- Generic_Homonym (Node11) (generic case only) @@ -4503,6 +4504,7 @@ package Einfo is -- Is_Overriding_Operation (Flag39) (non-generic case only) -- Is_Private_Descendant (Flag53) -- Is_Pure (Flag44) + -- Is_Thread_Body (Flag77) (non-generic case only) -- Is_Valued_Procedure (Flag127) -- Is_Visible_Child_Unit (Flag116) -- Needs_No_Actuals (Flag22) @@ -5124,6 +5126,7 @@ package Einfo is function Is_Statically_Allocated (Id : E) return B; function Is_Tag (Id : E) return B; function Is_Tagged_Type (Id : E) return B; + function Is_Thread_Body (Id : E) return B; function Is_True_Constant (Id : E) return B; function Is_Unchecked_Union (Id : E) return B; function Is_Unsigned_Type (Id : E) return B; @@ -5152,7 +5155,6 @@ package Einfo is function No_Return (Id : E) return B; function Non_Binary_Modulus (Id : E) return B; function Non_Limited_View (Id : E) return E; - function Non_Limited_Views (Id : E) return L; function Nonzero_Is_True (Id : E) return B; function Normalized_First_Bit (Id : E) return U; function Normalized_Position (Id : E) return U; @@ -5597,6 +5599,7 @@ package Einfo is procedure Set_Is_Statically_Allocated (Id : E; V : B := True); procedure Set_Is_Tag (Id : E; V : B := True); procedure Set_Is_Tagged_Type (Id : E; V : B := True); + procedure Set_Is_Thread_Body (Id : E; V : B := True); procedure Set_Is_True_Constant (Id : E; V : B := True); procedure Set_Is_Unchecked_Union (Id : E; V : B := True); procedure Set_Is_Unsigned_Type (Id : E; V : B := True); @@ -5624,7 +5627,6 @@ package Einfo is procedure Set_No_Return (Id : E; V : B := True); procedure Set_Non_Binary_Modulus (Id : E; V : B := True); procedure Set_Non_Limited_View (Id : E; V : E); - procedure Set_Non_Limited_Views (Id : E; V : L); procedure Set_Nonzero_Is_True (Id : E; V : B := True); procedure Set_Normalized_First_Bit (Id : E; V : U); procedure Set_Normalized_Position (Id : E; V : U); @@ -6120,6 +6122,7 @@ package Einfo is pragma Inline (Is_Subprogram); pragma Inline (Is_Tag); pragma Inline (Is_Tagged_Type); + pragma Inline (Is_Thread_Body); pragma Inline (Is_True_Constant); pragma Inline (Is_Task_Type); pragma Inline (Is_Type); @@ -6150,7 +6153,6 @@ package Einfo is pragma Inline (No_Return); pragma Inline (Non_Binary_Modulus); pragma Inline (Non_Limited_View); - pragma Inline (Non_Limited_Views); pragma Inline (Nonzero_Is_True); pragma Inline (Normalized_First_Bit); pragma Inline (Normalized_Position); @@ -6428,6 +6430,7 @@ package Einfo is pragma Inline (Set_Is_Statically_Allocated); pragma Inline (Set_Is_Tag); pragma Inline (Set_Is_Tagged_Type); + pragma Inline (Set_Is_Thread_Body); pragma Inline (Set_Is_True_Constant); pragma Inline (Set_Is_Unchecked_Union); pragma Inline (Set_Is_Unsigned_Type); @@ -6455,7 +6458,6 @@ package Einfo is pragma Inline (Set_No_Return); pragma Inline (Set_Non_Binary_Modulus); pragma Inline (Set_Non_Limited_View); - pragma Inline (Set_Non_Limited_Views); pragma Inline (Set_Nonzero_Is_True); pragma Inline (Set_Normalized_First_Bit); pragma Inline (Set_Normalized_Position); diff --git a/gcc/ada/einfo.h b/gcc/ada/einfo.h deleted file mode 100644 index f9b0a8a41fa..00000000000 --- a/gcc/ada/einfo.h +++ /dev/null @@ -1,1814 +0,0 @@ -/*--------------------------------------------------------------------------*/ -/* */ -/* GNAT COMPILER COMPONENTS */ -/* */ -/* E I N F O */ -/* */ -/* C Header File */ -/* */ -/* Copyright (C) 1992-2003 Free Software Foundation, Inc. */ -/* */ -/* GNAT is 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 2, 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 COPYING. If not, write */ -/* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, */ -/* MA 02111-1307, USA. */ -/* */ -/* As a special exception, if other files instantiate generics from this */ -/* unit, or you link this unit with other files to produce an executable, */ -/* this unit does not by itself cause the resulting executable to be */ -/* covered by the GNU General Public License. This exception does not */ -/* however invalidate any other reasons why the executable file might be */ -/* covered by the GNU Public License. */ -/* */ -/* GNAT was originally developed by the GNAT team at New York University. */ -/* Extensive contributions were provided by Ada Core Technologies Inc. */ -/* */ -/*--------------------------------------------------------------------------*/ - - #define E_Void 0 - #define E_Variable 1 - #define E_Component 2 - #define E_Constant 3 - #define E_Discriminant 4 - #define E_Loop_Parameter 5 - #define E_In_Parameter 6 - #define E_Out_Parameter 7 - #define E_In_Out_Parameter 8 - #define E_Generic_In_Out_Parameter 9 - #define E_Generic_In_Parameter 10 - #define E_Named_Integer 11 - #define E_Named_Real 12 - #define E_Enumeration_Type 13 - #define E_Enumeration_Subtype 14 - #define E_Signed_Integer_Type 15 - #define E_Signed_Integer_Subtype 16 - #define E_Modular_Integer_Type 17 - #define E_Modular_Integer_Subtype 18 - #define E_Ordinary_Fixed_Point_Type 19 - #define E_Ordinary_Fixed_Point_Subtype 20 - #define E_Decimal_Fixed_Point_Type 21 - #define E_Decimal_Fixed_Point_Subtype 22 - #define E_Floating_Point_Type 23 - #define E_Floating_Point_Subtype 24 - #define E_Access_Type 25 - #define E_Access_Subtype 26 - #define E_Access_Attribute_Type 27 - #define E_Allocator_Type 28 - #define E_General_Access_Type 29 - #define E_Access_Subprogram_Type 30 - #define E_Access_Protected_Subprogram_Type 31 - #define E_Anonymous_Access_Type 32 - #define E_Array_Type 33 - #define E_Array_Subtype 34 - #define E_String_Type 35 - #define E_String_Subtype 36 - #define E_String_Literal_Subtype 37 - #define E_Class_Wide_Type 38 - #define E_Class_Wide_Subtype 39 - #define E_Record_Type 40 - #define E_Record_Subtype 41 - #define E_Record_Type_With_Private 42 - #define E_Record_Subtype_With_Private 43 - #define E_Private_Type 44 - #define E_Private_Subtype 45 - #define E_Limited_Private_Type 46 - #define E_Limited_Private_Subtype 47 - #define E_Incomplete_Type 48 - #define E_Task_Type 49 - #define E_Task_Subtype 50 - #define E_Protected_Type 51 - #define E_Protected_Subtype 52 - #define E_Exception_Type 53 - #define E_Subprogram_Type 54 - #define E_Enumeration_Literal 55 - #define E_Function 56 - #define E_Operator 57 - #define E_Procedure 58 - #define E_Entry 59 - #define E_Entry_Family 60 - #define E_Block 61 - #define E_Entry_Index_Parameter 62 - #define E_Exception 63 - #define E_Generic_Function 64 - #define E_Generic_Procedure 65 - #define E_Generic_Package 66 - #define E_Label 67 - #define E_Loop 68 - #define E_Package 69 - #define E_Package_Body 70 - #define E_Protected_Object 71 - #define E_Protected_Body 72 - #define E_Task_Body 73 - #define E_Subprogram_Body 74 - - SUBTYPE (Access_Kind, Entity_Kind, - E_Access_Type, E_Anonymous_Access_Type) - - SUBTYPE (Array_Kind, Entity_Kind, - E_Array_Type, E_String_Literal_Subtype) - - SUBTYPE (Class_Wide_Kind, Entity_Kind, - E_Class_Wide_Type, E_Class_Wide_Subtype) - - SUBTYPE (Composite_Kind, Entity_Kind, - E_Array_Type, E_Protected_Subtype) - - SUBTYPE (Concurrent_Kind, Entity_Kind, - E_Task_Type, E_Protected_Subtype) - - SUBTYPE (Concurrent_Body_Kind, Entity_Kind, - E_Protected_Body, E_Task_Body) - - SUBTYPE (Decimal_Fixed_Point_Kind, Entity_Kind, - E_Decimal_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Digits_Kind, Entity_Kind, - E_Decimal_Fixed_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Discrete_Kind, Entity_Kind, - E_Enumeration_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Discrete_Or_Fixed_Point_Kind, Entity_Kind, - E_Enumeration_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Elementary_Kind, Entity_Kind, - E_Enumeration_Type, E_Anonymous_Access_Type) - - SUBTYPE (Enumeration_Kind, Entity_Kind, - E_Enumeration_Type, E_Enumeration_Subtype) - - SUBTYPE (Entry_Kind, Entity_Kind, - E_Entry, E_Entry_Family) - - SUBTYPE (Fixed_Point_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Float_Kind, Entity_Kind, - E_Floating_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Formal_Kind, Entity_Kind, - E_In_Parameter, E_In_Out_Parameter) - - SUBTYPE (Generic_Subprogram_Kind, Entity_Kind, - E_Generic_Function, E_Generic_Procedure) - - SUBTYPE (Generic_Unit_Kind, Entity_Kind, - E_Generic_Function, E_Generic_Package) - - SUBTYPE (Incomplete_Or_Private_Kind, Entity_Kind, - E_Record_Type_With_Private, E_Incomplete_Type) - - SUBTYPE (Integer_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Modular_Integer_Kind, Entity_Kind, - E_Modular_Integer_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Named_Kind, Entity_Kind, - E_Named_Integer, E_Named_Real) - - SUBTYPE (Numeric_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Floating_Point_Subtype) - - SUBTYPE (Object_Kind, Entity_Kind, - E_Variable, E_Generic_In_Parameter) - - SUBTYPE (Ordinary_Fixed_Point_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Ordinary_Fixed_Point_Subtype) - - SUBTYPE (Overloadable_Kind, Entity_Kind, - E_Enumeration_Literal, E_Entry) - - SUBTYPE (Private_Kind, Entity_Kind, - E_Record_Type_With_Private, E_Limited_Private_Subtype) - - SUBTYPE (Protected_Kind, Entity_Kind, - E_Protected_Type, E_Protected_Subtype) - - SUBTYPE (Real_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Record_Kind, Entity_Kind, - E_Class_Wide_Type, E_Record_Subtype_With_Private) - - SUBTYPE (Scalar_Kind, Entity_Kind, - E_Enumeration_Type, E_Floating_Point_Subtype) - - SUBTYPE (String_Kind, Entity_Kind, - E_String_Type, E_String_Literal_Subtype) - - SUBTYPE (Subprogram_Kind, Entity_Kind, - E_Function, E_Procedure) - - SUBTYPE (Signed_Integer_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Signed_Integer_Subtype) - - SUBTYPE (Task_Kind, Entity_Kind, - E_Task_Type, E_Task_Subtype) - - SUBTYPE (Type_Kind, Entity_Kind, - E_Enumeration_Type, E_Subprogram_Type) - - typedef char Component_Alignment_Kind; - #define Calign_Default 0 - #define Calign_Component_Size 1 - #define Calign_Component_Size_4 2 - #define Calign_Storage_Unit 3 - - typedef Boolean B; - typedef Component_Alignment_Kind C; - typedef Entity_Id E; - typedef Mechanism_Type M; - typedef Node_Id N; - typedef Uint U; - typedef Ureal R; - typedef Elist_Id L; - typedef List_Id S; - - INLINE L Accept_Address (E Id); - INLINE E Access_Disp_Table (E Id); - INLINE E Actual_Subtype (E Id); - INLINE B Address_Taken (E Id); - INLINE E Alias (E Id); - INLINE U Alignment (E Id); - INLINE E Associated_Final_Chain (E Id); - INLINE E Associated_Formal_Package (E Id); - INLINE N Associated_Node_For_Itype (E Id); - INLINE E Associated_Storage_Pool (E Id); - INLINE N Barrier_Function (E Id); - INLINE N Block_Node (E Id); - INLINE E Body_Entity (E Id); - INLINE B Body_Needed_For_SAL (E Id); - INLINE E CR_Discriminant (E Id); - INLINE B C_Pass_By_Copy (E Id); - INLINE B Can_Never_Be_Null (E Id); - INLINE B Checks_May_Be_Suppressed (E Id); - INLINE E Class_Wide_Type (E Id); - INLINE E Cloned_Subtype (E Id); - - #define Component_Alignment einfo__component_alignment - C Component_Alignment (E Id); - - INLINE N Component_Clause (E Id); - INLINE U Component_Bit_Offset (E Id); - INLINE U Component_Size (E Id); - INLINE E Component_Type (E Id); - INLINE E Corresponding_Concurrent_Type (E Id); - INLINE E Corresponding_Discriminant (E Id); - INLINE E Corresponding_Equality (E Id); - INLINE E Corresponding_Record_Type (E Id); - INLINE E Corresponding_Remote_Type (E Id); - INLINE N Current_Value (E Id); - INLINE B Debug_Info_Off (E Id); - INLINE E Debug_Renaming_Link (E Id); - INLINE E DTC_Entity (E Id); - INLINE U DT_Entry_Count (E Id); - INLINE U DT_Position (E Id); - INLINE E Default_Expr_Function (E Id); - INLINE B Default_Expressions_Processed (E Id); - INLINE N Default_Value (E Id); - INLINE B Delay_Cleanups (E Id); - INLINE B Delay_Subprogram_Descriptors (E Id); - INLINE R Delta_Value (E Id); - INLINE L Dependent_Instances (E Id); - INLINE B Depends_On_Private (E Id); - INLINE U Digits_Value (E Id); - INLINE E Directly_Designated_Type (E Id); - INLINE B Discard_Names (E Id); - INLINE E Discriminal (E Id); - INLINE E Discriminal_Link (E Id); - INLINE E Discriminant_Checking_Func (E Id); - INLINE L Discriminant_Constraint (E Id); - INLINE N Discriminant_Default_Value (E Id); - INLINE U Discriminant_Number (E Id); - INLINE B Elaborate_All_Desirable (E Id); - INLINE E Elaboration_Entity (E Id); - INLINE B Elaboration_Entity_Required (E Id); - INLINE E Enclosing_Scope (E Id); - INLINE B Entry_Accepted (E Id); - INLINE E Entry_Bodies_Array (E Id); - INLINE E Entry_Cancel_Parameter (E Id); - INLINE E Entry_Component (E Id); - INLINE E Entry_Formal (E Id); - INLINE E Entry_Index_Constant (E Id); - INLINE E Entry_Index_Type (E Id); - INLINE E Entry_Parameters_Type (E Id); - INLINE E Enum_Pos_To_Rep (E Id); - INLINE U Enumeration_Pos (E Id); - INLINE U Enumeration_Rep (E Id); - INLINE N Enumeration_Rep_Expr (E Id); - INLINE E Equivalent_Type (E Id); - INLINE U Esize (E Id); - INLINE U Exception_Code (E Id); - INLINE E Extra_Accessibility (E Id); - INLINE E Extra_Constrained (E Id); - INLINE E Extra_Formal (E Id); - INLINE E Finalization_Chain_Entity (E Id); - - #define Finalize_Storage_Only einfo__finalize_storage_only - B Finalize_Storage_Only (E Id); - - INLINE E First_Entity (E Id); - INLINE N First_Index (E Id); - INLINE E First_Literal (E Id); - INLINE E First_Optional_Parameter (E Id); - INLINE E First_Private_Entity (E Id); - INLINE N First_Rep_Item (E Id); - INLINE N Freeze_Node (E Id); - INLINE B From_With_Type (E Id); - INLINE E Full_View (E Id); - INLINE B Function_Returns_With_DSP (E Id); - INLINE E Generic_Homonym (E Id); - INLINE L Generic_Renamings (E Id); - INLINE S Handler_Records (E Id); - INLINE B Has_Aliased_Components (E Id); - INLINE B Has_Alignment_Clause (E Id); - INLINE B Has_All_Calls_Remote (E Id); - INLINE B Has_Atomic_Components (E Id); - INLINE B Has_Biased_Representation (E Id); - INLINE B Has_Completion (E Id); - INLINE B Has_Completion_In_Body (E Id); - INLINE B Has_Complex_Representation (E Id); - INLINE B Has_Component_Size_Clause (E Id); - INLINE B Has_Contiguous_Rep (E Id); - INLINE B Has_Controlled_Component (E Id); - INLINE B Has_Controlling_Result (E Id); - INLINE B Has_Convention_Pragma (E Id); - INLINE B Has_Delayed_Freeze (E Id); - INLINE B Has_Discriminants (E Id); - INLINE B Has_Enumeration_Rep_Clause (E Id); - INLINE B Has_Exit (E Id); - INLINE B Has_External_Tag_Rep_Clause (E Id); - INLINE B Has_Fully_Qualified_Name (E Id); - INLINE B Has_Gigi_Rep_Item (E Id); - INLINE B Has_Homonym (E Id); - - #define Has_Interrupt_Handler einfo__has_interrupt_handler - B Has_Interrupt_Handler (E Id); - - INLINE B Has_Machine_Radix_Clause (E Id); - INLINE B Has_Master_Entity (E Id); - INLINE B Has_Missing_Return (E Id); - INLINE B Has_Nested_Block_With_Handler (E Id); - INLINE B Has_Forward_Instantiation (E Id); - INLINE B Has_Non_Standard_Rep (E Id); - INLINE B Has_Object_Size_Clause (E Id); - INLINE B Has_Per_Object_Constraint (E Id); - INLINE B Has_Pragma_Controlled (E Id); - INLINE B Has_Pragma_Elaborate_Body (E Id); - INLINE B Has_Pragma_Inline (E Id); - INLINE B Has_Pragma_Pack (E Id); - INLINE B Has_Pragma_Pure_Function (E Id); - INLINE B Has_Pragma_Unreferenced (E Id); - INLINE B Has_Primitive_Operations (E Id); - INLINE B Has_Qualified_Name (E Id); - INLINE B Has_Record_Rep_Clause (E Id); - INLINE B Has_Recursive_Call (E Id); - INLINE B Has_Size_Clause (E Id); - INLINE B Has_Small_Clause (E Id); - INLINE B Has_Specified_Layout (E Id); - INLINE B Has_Storage_Size_Clause (E Id); - INLINE B Has_Subprogram_Descriptor (E Id); - INLINE B Has_Task (E Id); - INLINE B Has_Unchecked_Union (E Id); - INLINE B Has_Unknown_Discriminants (E Id); - INLINE B Has_Volatile_Components (E Id); - INLINE B Has_Xref_Entry (E Id); - INLINE E Hiding_Loop_Variable (E Id); - INLINE E Homonym (E Id); - INLINE B In_Package_Body (E Id); - INLINE B In_Private_Part (E Id); - INLINE B In_Use (E Id); - INLINE L Inner_Instances (E Id); - INLINE N Interface_Name (E Id); - INLINE B Is_AST_Entry (E Id); - INLINE B Is_Abstract (E Id); - INLINE B Is_Access_Constant (E Id); - INLINE B Is_Aliased (E Id); - INLINE B Is_Asynchronous (E Id); - INLINE B Is_Atomic (E Id); - INLINE B Is_Bit_Packed_Array (E Id); - INLINE B Is_CPP_Class (E Id); - INLINE B Is_Called (E Id); - INLINE B Is_Character_Type (E Id); - INLINE B Is_Child_Unit (E Id); - INLINE B Is_Class_Wide_Equivalent_Type (E Id); - INLINE B Is_Compilation_Unit (E Id); - INLINE B Is_Completely_Hidden (E Id); - INLINE B Is_Constr_Subt_For_UN_Aliased (E Id); - INLINE B Is_Constr_Subt_For_U_Nominal (E Id); - INLINE B Is_Constrained (E Id); - INLINE B Is_Constructor (E Id); - INLINE B Is_Controlled (E Id); - INLINE B Is_Controlling_Formal (E Id); - INLINE B Is_Discrim_SO_Function (E Id); - INLINE B Is_Dispatching_Operation (E Id); - INLINE B Is_Eliminated (E Id); - INLINE B Is_Entry_Formal (E Id); - INLINE B Is_Exported (E Id); - INLINE B Is_First_Subtype (E Id); - INLINE B Is_For_Access_Subtype (E Id); - INLINE B Is_Frozen (E Id); - INLINE B Is_Generic_Instance (E Id); - INLINE B Is_Hidden (E Id); - INLINE B Is_Hidden_Open_Scope (E Id); - INLINE B Is_Immediately_Visible (E Id); - INLINE B Is_Imported (E Id); - INLINE B Is_Inlined (E Id); - INLINE B Is_Instantiated (E Id); - INLINE B Is_Internal (E Id); - INLINE B Is_Interrupt_Handler (E Id); - INLINE B Is_Intrinsic_Subprogram (E Id); - INLINE B Is_Itype (E Id); - INLINE B Is_Known_Non_Null (E Id); - INLINE B Is_Known_Valid (E Id); - INLINE B Is_Limited_Composite (E Id); - INLINE B Is_Machine_Code_Subprogram (E Id); - INLINE B Is_Non_Static_Subtype (E Id); - INLINE B Is_Null_Init_Proc (E Id); - INLINE B Is_Optional_Parameter (E Id); - INLINE B Is_Package_Body_Entity (E Id); - INLINE B Is_Packed (E Id); - INLINE B Is_Packed_Array_Type (E Id); - INLINE B Is_Potentially_Use_Visible (E Id); - INLINE B Is_Preelaborated (E Id); - INLINE B Is_Private_Composite (E Id); - INLINE B Is_Private_Descendant (E Id); - INLINE B Is_Psected (E Id); - INLINE B Is_Public (E Id); - INLINE B Is_Pure (E Id); - INLINE B Is_Remote_Call_Interface (E Id); - INLINE B Is_Remote_Types (E Id); - INLINE B Is_Renaming_Of_Object (E Id); - INLINE B Is_Shared_Passive (E Id); - INLINE B Is_Statically_Allocated (E Id); - INLINE B Is_Tag (E Id); - INLINE B Is_Tagged_Type (E Id); - INLINE B Is_True_Constant (E Id); - INLINE B Is_Unchecked_Union (E Id); - INLINE B Is_Unsigned_Type (E Id); - INLINE B Is_VMS_Exception (E Id); - INLINE B Is_Valued_Procedure (E Id); - INLINE B Is_Visible_Child_Unit (E Id); - - #define Is_Volatile einfo__is_volatile - B Is_Volatile (E Id); - - #define Is_Wrapper_Package einfo__is_wrapper_package - B Is_Wrapper_Package (E Id); - - INLINE B Kill_Elaboration_Checks (E Id); - INLINE B Kill_Range_Checks (E Id); - INLINE B Kill_Tag_Checks (E Id); - INLINE E Last_Entity (E Id); - INLINE L Limited_Views (E Id); - INLINE E Lit_Indexes (E Id); - INLINE E Lit_Strings (E Id); - INLINE B Machine_Radix_10 (E Id); - INLINE E Master_Id (E Id); - INLINE B Materialize_Entity (E Id); - INLINE M Mechanism (E Id); - INLINE U Modulus (E Id); - INLINE B Needs_Debug_Info (E Id); - INLINE B Needs_No_Actuals (E Id); - INLINE B Never_Set_In_Source (E Id); - INLINE E Next_Inlined_Subprogram (E Id); - INLINE B No_Pool_Assigned (E Id); - INLINE B No_Return (E Id); - INLINE B Non_Binary_Modulus (E Id); - INLINE E Non_Limited_View (E Id); - INLINE L Non_Limited_Views (E Id); - INLINE B Nonzero_Is_True (E Id); - INLINE U Normalized_First_Bit (E Id); - INLINE U Normalized_Position (E Id); - INLINE U Normalized_Position_Max (E Id); - INLINE E Object_Ref (E Id); - INLINE E Original_Array_Type (E Id); - INLINE E Original_Record_Component (E Id); - INLINE E Packed_Array_Type (E Id); - INLINE E Parent_Subtype (E Id); - INLINE L Primitive_Operations (E Id); - INLINE E Prival (E Id); - INLINE L Privals_Chain (E Id); - INLINE L Private_Dependents (E Id); - INLINE N Private_View (E Id); - INLINE E Protected_Body_Subprogram (E Id); - INLINE E Protected_Formal (E Id); - INLINE E Protected_Operation (E Id); - INLINE U RM_Size (E Id); - INLINE B Reachable (E Id); - INLINE B Referenced (E Id); - INLINE B Referenced_As_LHS (E Id); - INLINE N Referenced_Object (E Id); - INLINE N Register_Exception_Call (E Id); - INLINE E Related_Array_Object (E Id); - INLINE E Related_Instance (E Id); - INLINE N Renamed_Entity (E Id); - INLINE N Renamed_Object (E Id); - INLINE U Renaming_Map (E Id); - INLINE B Return_Present (E Id); - INLINE B Returns_By_Ref (E Id); - INLINE B Reverse_Bit_Order (E Id); - INLINE N Scalar_Range (E Id); - INLINE U Scale_Value (E Id); - INLINE U Scope_Depth_Value (E Id); - INLINE B Sec_Stack_Needed_For_Return (E Id); - INLINE S Shadow_Entities (E Id); - INLINE E Shared_Var_Assign_Proc (E Id); - INLINE E Shared_Var_Read_Proc (E Id); - INLINE N Size_Check_Code (E Id); - INLINE B Size_Known_At_Compile_Time (E Id); - INLINE B Size_Depends_On_Discriminant (E Id); - INLINE R Small_Value (E Id); - INLINE E Spec_Entity (E Id); - INLINE E Storage_Size_Variable (E Id); - INLINE L Stored_Constraint (E Id); - INLINE B Strict_Alignment (E Id); - INLINE U String_Literal_Length (E Id); - INLINE N String_Literal_Low_Bound (E Id); - INLINE B Suppress_Elaboration_Warnings (E Id); - INLINE B Suppress_Init_Proc (E Id); - INLINE B Suppress_Style_Checks (E Id); - INLINE B Treat_As_Volatile (E Id); - INLINE E Underlying_Full_View (E Id); - INLINE N Unset_Reference (E Id); - INLINE B Uses_Sec_Stack (E Id); - INLINE B Vax_Float (E Id); - INLINE B Warnings_Off (E Id); - INLINE B Is_Access_Type (E Id); - INLINE B Is_Array_Type (E Id); - INLINE B Is_Class_Wide_Type (E Id); - INLINE B Is_Composite_Type (E Id); - INLINE B Is_Concurrent_Body (E Id); - INLINE B Is_Concurrent_Record_Type (E Id); - INLINE B Is_Concurrent_Type (E Id); - INLINE B Is_Decimal_Fixed_Point_Type (E Id); - INLINE B Is_Digits_Type (E Id); - INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id); - INLINE B Is_Discrete_Type (E Id); - INLINE B Is_Elementary_Type (E Id); - INLINE B Is_Entry (E Id); - INLINE B Is_Enumeration_Type (E Id); - INLINE B Is_Fixed_Point_Type (E Id); - INLINE B Is_Floating_Point_Type (E Id); - INLINE B Is_Formal (E Id); - INLINE B Is_Formal_Subprogram (E Id); - INLINE B Is_Generic_Actual_Type (E Id); - INLINE B Is_Generic_Unit (E Id); - INLINE B Is_Generic_Type (E Id); - INLINE B Is_Generic_Subprogram (E Id); - INLINE B Is_Incomplete_Or_Private_Type (E Id); - INLINE B Is_Integer_Type (E Id); - INLINE B Is_Limited_Record (E Id); - INLINE B Is_Modular_Integer_Type (E Id); - INLINE B Is_Named_Number (E Id); - INLINE B Is_Numeric_Type (E Id); - INLINE B Is_Object (E Id); - INLINE B Is_Ordinary_Fixed_Point_Type (E Id); - INLINE B Is_Overloadable (E Id); - INLINE B Is_Overriding_Operation (E Id); - INLINE B Is_Private_Type (E Id); - INLINE B Is_Protected_Type (E Id); - INLINE B Is_Real_Type (E Id); - INLINE B Is_Record_Type (E Id); - INLINE B Is_Scalar_Type (E Id); - INLINE B Is_Signed_Integer_Type (E Id); - INLINE B Is_Subprogram (E Id); - INLINE B Is_Task_Type (E Id); - INLINE B Is_Type (E Id); - - #define Address_Clause einfo__address_clause - N Address_Clause (E Id); - - #define Alignment_Clause einfo__alignment_clause - N Alignment_Clause (E Id); - - #define Ancestor_Subtype einfo__ancestor_subtype - E Ancestor_Subtype (E Id); - - #define Base_Type einfo__base_type - E Base_Type (E Id); - - #define Constant_Value einfo__constant_value - N Constant_Value (E Id); - - #define Declaration_Node einfo__declaration_node - N Declaration_Node (E Id); - - #define Designated_Type einfo__designated_type - E Designated_Type (E Id); - - #define Enclosing_Dynamic_Scope einfo__enclosing_dynamic_scope - E Enclosing_Dynamic_Scope (E Id); - - #define First_Component einfo__first_component - E First_Component (E Id); - - #define First_Discriminant einfo__first_discriminant - E First_Discriminant (E Id); - - #define First_Formal einfo__first_formal - E First_Formal (E Id); - - #define First_Stored_Discriminant einfo__first_stored_discriminant - E First_Stored_Discriminant (E Id); - - #define First_Subtype einfo__first_subtype - E First_Subtype (E Id); - - #define Has_Attach_Handler einfo__has_attach_handler - B Has_Attach_Handler (E Id); - - #define Has_Entries einfo__has_entries - B Has_Entries (E Id); - - #define Has_Foreign_Convention einfo__has_foreign_convention - B Has_Foreign_Convention (E Id); - - #define Has_Private_Ancestor einfo__has_private_ancestor - B Has_Private_Ancestor (E Id); - - INLINE B Has_Private_Declaration (E Id); - - #define Implementation_Base_Type einfo__implementation_base_type - E Implementation_Base_Type (E Id); - - #define Is_Always_Inlined einfo__is_always_inlined - B Is_Always_Inlined (E Id); - - #define Is_Boolean_Type einfo__is_boolean_type - B Is_Boolean_Type (E Id); - - #define Is_By_Copy_Type einfo__is_by_copy_type - B Is_By_Copy_Type (E Id); - - #define Is_By_Reference_Type einfo__is_by_reference_type - B Is_By_Reference_Type (E Id); - - #define Is_Derived_Type einfo__is_derived_type - B Is_Derived_Type (E Id); - - #define Is_Dynamic_Scope einfo__is_dynamic_scope - B Is_Dynamic_Scope (E Id); - - #define Is_Indefinite_Subtype einfo__is_indefinite_subtype - B Is_Indefinite_Subtype (E Id); - - #define Is_Limited_Type einfo__is_limited_type - B Is_Limited_Type (E Id); - - #define Is_Package einfo__is_package - B Is_Package (E Id); - - #define Is_Protected_Private einfo__is_protected_private - B Is_Protected_Private (E Id); - - #define Is_Protected_Record_Type einfo__is_protected_record_type - B Is_Protected_Record_Type (E Id); - - #define Is_Return_By_Reference_Type einfo__is_return_by_reference_type - B Is_Return_By_Reference_Type (E Id); - - #define Is_String_Type einfo__is_string_type - B Is_String_Type (E Id); - - #define Is_Task_Record_Type einfo__is_task_record_type - B Is_Task_Record_Type (E Id); - - #define Next_Component einfo__next_component - E Next_Component (E Id); - - #define Next_Discriminant einfo__next_discriminant - E Next_Discriminant (E Id); - - #define Next_Formal einfo__next_formal - E Next_Formal (E Id); - - #define Next_Formal_With_Extras einfo__next_formal_with_extras - E Next_Formal_With_Extras (E Id); - - INLINE E Next_Literal (E Id); - - #define Next_Stored_Discriminant einfo__next_stored_discriminant - E Next_Stored_Discriminant (E Id); - - #define Number_Dimensions einfo__number_dimensions - Pos Number_Dimensions (E Id); - - #define Number_Discriminants einfo__number_discriminants - Pos Number_Discriminants (E Id); - - #define Number_Entries einfo__number_entries - Nat Number_Entries (E Id); - - #define Number_Formals einfo__number_formals - Pos Number_Formals (E Id); - - INLINE Formal_Kind Parameter_Mode (E Id); - - #define Root_Type einfo__root_type - E Root_Type (E Id); - - #define Scope_Depth_Set einfo__scope_depth_set - B Scope_Depth_Set (E Id); - - #define Size_Clause einfo__size_clause - N Size_Clause (E Id); - - #define Tag_Component einfo__tag_component - E Tag_Component (E Id); - - #define Type_High_Bound einfo__type_high_bound - N Type_High_Bound (E Id); - - #define Type_Low_Bound einfo__type_low_bound - N Type_Low_Bound (E Id); - - #define Underlying_Type einfo__underlying_type - E Underlying_Type (E Id); - - #define Known_Alignment einfo__known_alignment - B Known_Alignment (Entity_Id E); - - #define Known_Component_Bit_Offset einfo__known_component_bit_offset - B Known_Component_Bit_Offset (Entity_Id E); - - #define Known_Component_Size einfo__known_component_size - B Known_Component_Size (Entity_Id E); - - #define Known_Esize einfo__known_esize - B Known_Esize (Entity_Id E); - - #define Known_Normalized_First_Bit einfo__known_normalized_first_bit - B Known_Normalized_First_Bit (Entity_Id E); - - #define Known_Normalized_Position einfo__known_normalized_position - B Known_Normalized_Position (Entity_Id E); - - #define Known_Normalized_Position_Max einfo__known_normalized_position_max - B Known_Normalized_Position_Max (Entity_Id E); - - #define Known_RM_Size einfo__known_rm_size - B Known_RM_Size (Entity_Id E); - - #define Known_Static_Component_Bit_Offset einfo__known_static_component_bit_offset - B Known_Static_Component_Bit_Offset (Entity_Id E); - - #define Known_Static_Component_Size einfo__known_static_component_size - B Known_Static_Component_Size (Entity_Id E); - - #define Known_Static_Esize einfo__known_static_esize - B Known_Static_Esize (Entity_Id E); - - #define Known_Static_Normalized_First_Bit einfo__known_static_normalized_first_bit - B Known_Static_Normalized_First_Bit (Entity_Id E); - - #define Known_Static_Normalized_Position einfo__known_static_normalized_position - B Known_Static_Normalized_Position (Entity_Id E); - - #define Known_Static_Normalized_Position_Max einfo__known_static_normalized_position_max - B Known_Static_Normalized_Position_Max (Entity_Id E); - - #define Known_Static_RM_Size einfo__known_static_rm_size - B Known_Static_RM_Size (Entity_Id E); - - #define Unknown_Alignment einfo__unknown_alignment - B Unknown_Alignment (Entity_Id E); - - #define Unknown_Component_Bit_Offset einfo__unknown_component_bit_offset - B Unknown_Component_Bit_Offset (Entity_Id E); - - #define Unknown_Component_Size einfo__unknown_component_size - B Unknown_Component_Size (Entity_Id E); - - #define Unknown_Esize einfo__unknown_esize - B Unknown_Esize (Entity_Id E); - - #define Unknown_Normalized_First_Bit einfo__unknown_normalized_first_bit - B Unknown_Normalized_First_Bit (Entity_Id E); - - #define Unknown_Normalized_Position einfo__unknown_normalized_position - B Unknown_Normalized_Position (Entity_Id E); - - #define Unknown_Normalized_Position_Max einfo__unknown_normalized_position_max - B Unknown_Normalized_Position_Max (Entity_Id E); - - #define Unknown_RM_Size einfo__unknown_rm_size - B Unknown_RM_Size (Entity_Id E); - - - INLINE L Accept_Address (E Id) - { return Elist21 (Id); } - - INLINE E Access_Disp_Table (E Id) - { return Node16 (Implementation_Base_Type (Id)); } - - INLINE E Actual_Subtype (E Id) - { return Node17 (Id); } - - INLINE B Address_Taken (E Id) - { return Flag104 (Id); } - - INLINE E Alias (E Id) - { return Node18 (Id); } - - INLINE U Alignment (E Id) - { return Uint14 (Id); } - - INLINE E Associated_Final_Chain (E Id) - { return Node23 (Id); } - - INLINE E Associated_Formal_Package (E Id) - { return Node12 (Id); } - - INLINE N Associated_Node_For_Itype (E Id) - { return Node8 (Id); } - - INLINE E Associated_Storage_Pool (E Id) - { return Node22 (Root_Type (Id)); } - - INLINE N Barrier_Function (E Id) - { return Node12 (Id); } - - INLINE N Block_Node (E Id) - { return Node11 (Id); } - - INLINE E Body_Entity (E Id) - { return Node19 (Id); } - - INLINE B Body_Needed_For_SAL (E Id) - { return Flag40 (Id); } - - INLINE B C_Pass_By_Copy (E Id) - { return Flag125 (Implementation_Base_Type (Id)); } - - INLINE B Can_Never_Be_Null (E Id) - { return Flag38 (Id); } - - INLINE B Checks_May_Be_Suppressed (E Id) - { return Flag31 (Id); } - - INLINE E Class_Wide_Type (E Id) - { return Node9 (Id); } - - INLINE E Cloned_Subtype (E Id) - { return Node16 (Id); } - - INLINE U Component_Bit_Offset (E Id) - { return Uint11 (Id); } - - INLINE N Component_Clause (E Id) - { return Node13 (Id); } - - INLINE U Component_Size (E Id) - { return Uint22 (Implementation_Base_Type (Id)); } - - INLINE E Component_Type (E Id) - { return Node20 (Implementation_Base_Type (Id)); } - - INLINE E Corresponding_Concurrent_Type (E Id) - { return Node18 (Id); } - - INLINE E Corresponding_Discriminant (E Id) - { return Node19 (Id); } - - INLINE E Corresponding_Equality (E Id) - { return Node13 (Id); } - - INLINE E Corresponding_Record_Type (E Id) - { return Node18 (Id); } - - INLINE E Corresponding_Remote_Type (E Id) - { return Node22 (Id); } - - INLINE N Current_Value (E Id) - { return Node9 (Id); } - - INLINE E CR_Discriminant (E Id) - { return Node23 (Id); } - - INLINE B Debug_Info_Off (E Id) - { return Flag166 (Id); } - - INLINE E Debug_Renaming_Link (E Id) - { return Node13 (Id); } - - INLINE E Default_Expr_Function (E Id) - { return Node21 (Id); } - - INLINE B Default_Expressions_Processed (E Id) - { return Flag108 (Id); } - - INLINE N Default_Value (E Id) - { return Node20 (Id); } - - INLINE B Delay_Cleanups (E Id) - { return Flag114 (Id); } - - INLINE B Delay_Subprogram_Descriptors (E Id) - { return Flag50 (Id); } - - INLINE R Delta_Value (E Id) - { return Ureal18 (Id); } - - INLINE L Dependent_Instances (E Id) - { return Elist8 (Id); } - - INLINE B Depends_On_Private (E Id) - { return Flag14 (Id); } - - INLINE U Digits_Value (E Id) - { return Uint17 (Id); } - - INLINE E Directly_Designated_Type (E Id) - { return Node20 (Id); } - - INLINE B Discard_Names (E Id) - { return Flag88 (Id); } - - INLINE E Discriminal (E Id) - { return Node17 (Id); } - - INLINE N Discriminal_Link (E Id) - { return Node10 (Id); } - - INLINE E Discriminant_Checking_Func (E Id) - { return Node20 (Id); } - - INLINE L Discriminant_Constraint (E Id) - { return Elist21 (Id); } - - INLINE N Discriminant_Default_Value (E Id) - { return Node20 (Id); } - - INLINE U Discriminant_Number (E Id) - { return Uint15 (Id); } - - INLINE U DT_Entry_Count (E Id) - { return Uint15 (Id); } - - INLINE U DT_Position (E Id) - { return Uint15 (Id); } - - INLINE E DTC_Entity (E Id) - { return Node16 (Id); } - - INLINE B Elaborate_All_Desirable (E Id) - { return Flag146 (Id); } - - INLINE E Elaboration_Entity (E Id) - { return Node13 (Id); } - - INLINE B Elaboration_Entity_Required (E Id) - { return Flag174 (Id); } - - INLINE E Enclosing_Scope (E Id) - { return Node18 (Id); } - - INLINE B Entry_Accepted (E Id) - { return Flag152 (Id); } - - INLINE E Entry_Bodies_Array (E Id) - { return Node15 (Id); } - - INLINE E Entry_Cancel_Parameter (E Id) - { return Node23 (Id); } - - INLINE E Entry_Component (E Id) - { return Node11 (Id); } - - INLINE E Entry_Formal (E Id) - { return Node16 (Id); } - - INLINE N Entry_Index_Constant (E Id) - { return Node18 (Id); } - - INLINE E Entry_Parameters_Type (E Id) - { return Node15 (Id); } - - INLINE E Enum_Pos_To_Rep (E Id) - { return Node23 (Id); } - - INLINE Uint Enumeration_Pos (E Id) - { return Uint11 (Id); } - - INLINE U Enumeration_Rep (E Id) - { return Uint12 (Id); } - - INLINE N Enumeration_Rep_Expr (E Id) - { return Node22 (Id); } - - INLINE E Equivalent_Type (E Id) - { return Node18 (Id); } - - INLINE Uint Esize (E Id) - { return Uint12 (Id); } - - INLINE Uint Exception_Code (E Id) - { return Uint22 (Id); } - - INLINE E Extra_Accessibility (E Id) - { return Node13 (Id); } - - INLINE E Extra_Constrained (E Id) - { return Node23 (Id); } - - INLINE E Extra_Formal (E Id) - { return Node15 (Id); } - - INLINE E Finalization_Chain_Entity (E Id) - { return Node19 (Id); } - - INLINE E First_Entity (E Id) - { return Node17 (Id); } - - INLINE N First_Index (E Id) - { return Node17 (Id); } - - INLINE E First_Literal (E Id) - { return Node17 (Id); } - - INLINE E First_Optional_Parameter (E Id) - { return Node14 (Id); } - - INLINE E First_Private_Entity (E Id) - { return Node16 (Id); } - - INLINE E First_Rep_Item (E Id) - { return Node6 (Id); } - - INLINE N Freeze_Node (E Id) - { return Node7 (Id); } - - INLINE B From_With_Type (E Id) - { return Flag159 (Id); } - - INLINE E Full_View (E Id) - { return Node11 (Id); } - - INLINE B Function_Returns_With_DSP (E Id) - { return Flag169 (Id); } - - INLINE E Generic_Homonym (E Id) - { return Node11 (Id); } - - INLINE L Generic_Renamings (E Id) - { return Elist23 (Id); } - - INLINE S Handler_Records (E Id) - { return List10 (Id); } - - INLINE B Has_Aliased_Components (E Id) - { return Flag135 (Implementation_Base_Type (Id)); } - - INLINE B Has_Alignment_Clause (E Id) - { return Flag46 (Id); } - - INLINE B Has_All_Calls_Remote (E Id) - { return Flag79 (Id); } - - INLINE B Has_Atomic_Components (E Id) - { return Flag86 (Implementation_Base_Type (Id)); } - - INLINE B Has_Biased_Representation (E Id) - { return Flag139 (Id); } - - INLINE B Has_Completion (E Id) - { return Flag26 (Id); } - - INLINE B Has_Completion_In_Body (E Id) - { return Flag71 (Id); } - - INLINE B Has_Complex_Representation (E Id) - { return Flag140 (Implementation_Base_Type (Id)); } - - INLINE B Has_Component_Size_Clause (E Id) - { return Flag68 (Implementation_Base_Type (Id)); } - - INLINE B Has_Controlled_Component (E Id) - { return Flag43 (Base_Type (Id)); } - - INLINE B Has_Contiguous_Rep (E Id) - { return Flag181 (Id); } - - INLINE B Has_Controlling_Result (E Id) - { return Flag98 (Id); } - - INLINE B Has_Convention_Pragma (E Id) - { return Flag119 (Id); } - - INLINE B Has_Delayed_Freeze (E Id) - { return Flag18 (Id); } - - INLINE B Has_Discriminants (E Id) - { return Flag5 (Id); } - - INLINE B Has_Enumeration_Rep_Clause (E Id) - { return Flag66 (Id); } - - INLINE B Has_Exit (E Id) - { return Flag47 (Id); } - - INLINE B Has_External_Tag_Rep_Clause (E Id) - { return Flag110 (Id); } - - INLINE B Has_Forward_Instantiation (E Id) - { return Flag175 (Id); } - - INLINE B Has_Fully_Qualified_Name (E Id) - { return Flag173 (Id); } - - INLINE B Has_Gigi_Rep_Item (E Id) - { return Flag82 (Id); } - - INLINE B Has_Homonym (E Id) - { return Flag56 (Id); } - - INLINE B Has_Machine_Radix_Clause (E Id) - { return Flag83 (Id); } - - INLINE B Has_Master_Entity (E Id) - { return Flag21 (Id); } - - INLINE B Has_Missing_Return (E Id) - { return Flag142 (Id); } - - INLINE B Has_Nested_Block_With_Handler (E Id) - { return Flag101 (Id); } - - INLINE B Has_Non_Standard_Rep (E Id) - { return Flag75 (Implementation_Base_Type (Id)); } - - INLINE B Has_Object_Size_Clause (E Id) - { return Flag172 (Id); } - - INLINE B Has_Per_Object_Constraint (E Id) - { return Flag154 (Id); } - - INLINE B Has_Pragma_Controlled (E Id) - { return Flag27 (Implementation_Base_Type (Id)); } - - INLINE B Has_Pragma_Elaborate_Body (E Id) - { return Flag150 (Id); } - - INLINE B Has_Pragma_Inline (E Id) - { return Flag157 (Id); } - - INLINE B Has_Pragma_Pack (E Id) - { return Flag121 (Implementation_Base_Type (Id)); } - - INLINE B Has_Pragma_Pure_Function (E Id) - { return Flag179 (Id); } - - INLINE B Has_Pragma_Unreferenced (E Id) - { return Flag180 (Id); } - - INLINE B Has_Primitive_Operations (E Id) - { return Flag120 (Base_Type (Id)); } - - INLINE B Has_Private_Declaration (E Id) - { return Flag155 (Id); } - - INLINE B Has_Qualified_Name (E Id) - { return Flag161 (Id); } - - INLINE B Has_Record_Rep_Clause (E Id) - { return Flag65 (Implementation_Base_Type (Id)); } - - INLINE B Has_Recursive_Call (E Id) - { return Flag143 (Id); } - - INLINE B Has_Size_Clause (E Id) - { return Flag29 (Id); } - - INLINE B Has_Small_Clause (E Id) - { return Flag67 (Id); } - - INLINE B Has_Specified_Layout (E Id) - { return Flag100 (Implementation_Base_Type (Id)); } - - INLINE B Has_Storage_Size_Clause (E Id) - { return Flag23 (Implementation_Base_Type (Id)); } - - INLINE B Has_Subprogram_Descriptor (E Id) - { return Flag93 (Id); } - - INLINE B Has_Task (E Id) - { return Flag30 (Base_Type (Id)); } - - INLINE B Has_Unchecked_Union (E Id) - { return Flag123 (Base_Type (Id)); } - - INLINE B Has_Unknown_Discriminants (E Id) - { return Flag72 (Id); } - - INLINE B Has_Volatile_Components (E Id) - { return Flag87 (Implementation_Base_Type (Id)); } - - INLINE B Has_Xref_Entry (E Id) - { return Flag182 (Implementation_Base_Type (Id)); } - - INLINE E Hiding_Loop_Variable (E Id) - { return Node8 (Id); } - - INLINE E Homonym (E Id) - { return Node4 (Id); } - - INLINE B In_Package_Body (E Id) - { return Flag48 (Id); } - - INLINE B In_Private_Part (E Id) - { return Flag45 (Id); } - - INLINE B In_Use (E Id) - { return Flag8 (Id); } - - INLINE L Inner_Instances (E Id) - { return Elist23 (Id); } - - INLINE N Interface_Name (E Id) - { return Node21 (Id); } - - INLINE B Is_Abstract (E Id) - { return Flag19 (Id); } - - INLINE B Is_Access_Constant (E Id) - { return Flag69 (Id); } - - INLINE B Is_Aliased (E Id) - { return Flag15 (Id); } - - INLINE B Is_AST_Entry (E Id) - { return Flag132 (Id); } - - INLINE B Is_Asynchronous (E Id) - { return Flag81 (Id); } - - INLINE B Is_Atomic (E Id) - { return Flag85 (Id); } - - INLINE B Is_Bit_Packed_Array (E Id) - { return Flag122 (Implementation_Base_Type (Id)); } - - INLINE B Is_Called (E Id) - { return Flag102 (Id); } - - INLINE B Is_Character_Type (E Id) - { return Flag63 (Id); } - - INLINE B Is_Child_Unit (E Id) - { return Flag73 (Id); } - - INLINE B Is_Class_Wide_Equivalent_Type (E Id) - { return Flag35 (Id); } - - INLINE B Is_Compilation_Unit (E Id) - { return Flag149 (Id); } - - INLINE B Is_Completely_Hidden (E Id) - { return Flag103 (Id); } - - INLINE B Is_Constr_Subt_For_U_Nominal (E Id) - { return Flag80 (Id); } - - INLINE B Is_Constr_Subt_For_UN_Aliased (E Id) - { return Flag141 (Id); } - - INLINE B Is_Constrained (E Id) - { return Flag12 (Id); } - - INLINE B Is_Constructor (E Id) - { return Flag76 (Id); } - - INLINE B Is_Controlled (E Id) - { return Flag42 (Base_Type (Id)); } - - INLINE B Is_Controlling_Formal (E Id) - { return Flag97 (Id); } - - INLINE B Is_CPP_Class (E Id) - { return Flag74 (Id); } - - INLINE B Is_Discrim_SO_Function (E Id) - { return Flag176 (Id); } - - INLINE B Is_Dispatching_Operation (E Id) - { return Flag6 (Id); } - - INLINE B Is_Eliminated (E Id) - { return Flag124 (Id); } - - INLINE B Is_Entry_Formal (E Id) - { return Flag52 (Id); } - - INLINE B Is_Exported (E Id) - { return Flag99 (Id); } - - INLINE B Is_First_Subtype (E Id) - { return Flag70 (Id); } - - INLINE B Is_For_Access_Subtype (E Id) - { return Flag118 (Id); } - - INLINE B Is_Formal_Subprogram (E Id) - { return Flag111 (Id); } - - INLINE B Is_Frozen (E Id) - { return Flag4 (Id); } - - INLINE B Is_Generic_Actual_Type (E Id) - { return Flag94 (Id); } - - INLINE B Is_Generic_Instance (E Id) - { return Flag130 (Id); } - - INLINE B Is_Generic_Type (E Id) - { return Flag13 (Id); } - - INLINE B Is_Hidden (E Id) - { return Flag57 (Id); } - - INLINE B Is_Hidden_Open_Scope (E Id) - { return Flag171 (Id); } - - INLINE B Is_Immediately_Visible (E Id) - { return Flag7 (Id); } - - INLINE B Is_Imported (E Id) - { return Flag24 (Id); } - - INLINE B Is_Inlined (E Id) - { return Flag11 (Id); } - - INLINE B Is_Instantiated (E Id) - { return Flag126 (Id); } - - INLINE B Is_Internal (E Id) - { return Flag17 (Id); } - - INLINE B Is_Interrupt_Handler (E Id) - { return Flag89 (Id); } - - INLINE B Is_Intrinsic_Subprogram (E Id) - { return Flag64 (Id); } - - INLINE B Is_Itype (E Id) - { return Flag91 (Id); } - - INLINE B Is_Known_Non_Null (E Id) - { return Flag37 (Id); } - - INLINE B Is_Known_Valid (E Id) - { return Flag170 (Id); } - - INLINE B Is_Limited_Composite (E Id) - { return Flag106 (Id); } - - INLINE B Is_Limited_Record (E Id) - { return Flag25 (Id); } - - INLINE B Is_Machine_Code_Subprogram (E Id) - { return Flag137 (Id); } - - INLINE B Is_Non_Static_Subtype (E Id) - { return Flag109 (Id); } - - INLINE B Is_Null_Init_Proc (E Id) - { return Flag178 (Id); } - - INLINE B Is_Optional_Parameter (E Id) - { return Flag134 (Id); } - - INLINE B Is_Overriding_Operation (E Id) - { return Flag39 (Id); } - - INLINE B Is_Package_Body_Entity (E Id) - { return Flag160 (Id); } - - INLINE B Is_Packed (E Id) - { return Flag51 (Implementation_Base_Type (Id)); } - - INLINE B Is_Packed_Array_Type (E Id) - { return Flag138 (Id); } - - INLINE B Is_Potentially_Use_Visible (E Id) - { return Flag9 (Id); } - - INLINE B Is_Preelaborated (E Id) - { return Flag59 (Id); } - - INLINE B Is_Private_Composite (E Id) - { return Flag107 (Id); } - - INLINE B Is_Private_Descendant (E Id) - { return Flag53 (Id); } - - INLINE B Is_Psected (E Id) - { return Flag153 (Id); } - - INLINE B Is_Public (E Id) - { return Flag10 (Id); } - - INLINE B Is_Pure (E Id) - { return Flag44 (Id); } - - INLINE B Is_Remote_Call_Interface (E Id) - { return Flag62 (Id); } - - INLINE B Is_Remote_Types (E Id) - { return Flag61 (Id); } - - INLINE B Is_Renaming_Of_Object (E Id) - { return Flag112 (Id); } - - INLINE B Is_Shared_Passive (E Id) - { return Flag60 (Id); } - - INLINE B Is_Statically_Allocated (E Id) - { return Flag28 (Id); } - - INLINE B Is_Tag (E Id) - { return Flag78 (Id); } - - INLINE B Is_Tagged_Type (E Id) - { return Flag55 (Id); } - - INLINE B Is_True_Constant (E Id) - { return Flag163 (Id); } - - INLINE B Is_Unchecked_Union (E Id) - { return Flag117 (Id); } - - INLINE B Is_Unsigned_Type (E Id) - { return Flag144 (Id); } - - INLINE B Is_Valued_Procedure (E Id) - { return Flag127 (Id); } - - INLINE B Is_Visible_Child_Unit (E Id) - { return Flag116 (Id); } - - INLINE B Is_VMS_Exception (E Id) - { return Flag133 (Id); } - - INLINE B Kill_Elaboration_Checks (E Id) - { return Flag32 (Id); } - - INLINE B Kill_Range_Checks (E Id) - { return Flag33 (Id); } - - INLINE B Kill_Tag_Checks (E Id) - { return Flag34 (Id); } - - INLINE E Last_Entity (E Id) - { return Node20 (Id); } - - INLINE L Limited_Views (E Id) - { return Elist23 (Id); } - - INLINE E Lit_Indexes (E Id) - { return Node15 (Id); } - - INLINE E Lit_Strings (E Id) - { return Node16 (Id); } - - INLINE B Machine_Radix_10 (E Id) - { return Flag84 (Id); } - - INLINE E Master_Id (E Id) - { return Node17 (Id); } - - INLINE B Materialize_Entity (E Id) - { return Flag168 (Id); } - - INLINE M Mechanism (E Id) - { return UI_To_Int (Uint8 (Id)); } - - INLINE Uint Modulus (E Id) - { return Uint17 (Base_Type (Id)); } - - INLINE B Needs_Debug_Info (E Id) - { return Flag147 (Id); } - - INLINE B Needs_No_Actuals (E Id) - { return Flag22 (Id); } - - INLINE B Never_Set_In_Source (E Id) - { return Flag115 (Id); } - - INLINE E Next_Inlined_Subprogram (E Id) - { return Node12 (Id); } - - INLINE B No_Pool_Assigned (E Id) - { return Flag131 (Root_Type (Id)); } - - INLINE B No_Return (E Id) - { return Flag113 (Id); } - - INLINE B Non_Binary_Modulus (E Id) - { return Flag58 (Base_Type (Id)); } - - INLINE E Non_Limited_View (E Id) - { return Node17 (Id); } - - INLINE L Non_Limited_Views (E Id) - { return Elist8 (Id); } - - INLINE B Nonzero_Is_True (E Id) - { return Flag162 (Base_Type (Id)); } - - INLINE U Normalized_First_Bit (E Id) - { return Uint8 (Id); } - - INLINE U Normalized_Position (E Id) - { return Uint14 (Id); } - - INLINE U Normalized_Position_Max (E Id) - { return Uint10 (Id); } - - INLINE E Object_Ref (E Id) - { return Node17 (Id); } - - INLINE E Original_Array_Type (E Id) - { return Node21 (Id); } - - INLINE E Original_Record_Component (E Id) - { return Node22 (Id); } - - INLINE E Packed_Array_Type (E Id) - { return Node23 (Id); } - - INLINE E Parent_Subtype (E Id) - { return Node19 (Id); } - - INLINE L Primitive_Operations (E Id) - { return Elist15 (Id); } - - INLINE E Prival (E Id) - { return Node17 (Id); } - - INLINE L Privals_Chain (E Id) - { return Elist23 (Id); } - - INLINE L Private_Dependents (E Id) - { return Elist18 (Id); } - - INLINE N Private_View (E Id) - { return Node22 (Id); } - - INLINE E Protected_Body_Subprogram (E Id) - { return Node11 (Id); } - - INLINE E Protected_Formal (E Id) - { return Node22 (Id); } - - INLINE N Protected_Operation (E Id) - { return Node23 (Id); } - - INLINE B Reachable (E Id) - { return Flag49 (Id); } - - INLINE B Referenced (E Id) - { return Flag156 (Id); } - - INLINE B Referenced_As_LHS (E Id) - { return Flag36 (Id); } - - INLINE N Referenced_Object (E Id) - { return Node10 (Id); } - - INLINE N Register_Exception_Call (E Id) - { return Node20 (Id); } - - INLINE E Related_Array_Object (E Id) - { return Node19 (Id); } - - INLINE E Related_Instance (E Id) - { return Node15 (Id); } - - INLINE N Renamed_Entity (E Id) - { return Node18 (Id); } - - INLINE N Renamed_Object (E Id) - { return Node18 (Id); } - - INLINE U Renaming_Map (E Id) - { return Uint9 (Id); } - - INLINE B Return_Present (E Id) - { return Flag54 (Id); } - - INLINE B Returns_By_Ref (E Id) - { return Flag90 (Id); } - - INLINE B Reverse_Bit_Order (E Id) - { return Flag164 (Base_Type (Id)); } - - INLINE U RM_Size (E Id) - { return Uint13 (Id); } - - INLINE N Scalar_Range (E Id) - { return Node20 (Id); } - - INLINE U Scale_Value (E Id) - { return Uint15 (Id); } - - INLINE U Scope_Depth_Value (E Id) - { return Uint22 (Id); } - - INLINE B Sec_Stack_Needed_For_Return (E Id) - { return Flag167 (Id); } - - INLINE S Shadow_Entities (E Id) - { return List14 (Id); } - - INLINE E Shared_Var_Assign_Proc (E Id) - { return Node22 (Id); } - - INLINE E Shared_Var_Read_Proc (E Id) - { return Node15 (Id); } - - INLINE N Size_Check_Code (E Id) - { return Node19 (Id); } - - INLINE B Size_Depends_On_Discriminant (E Id) - { return Flag177 (Id); } - - INLINE B Size_Known_At_Compile_Time (E Id) - { return Flag92 (Id); } - - INLINE R Small_Value (E Id) - { return Ureal21 (Id); } - - INLINE E Spec_Entity (E Id) - { return Node19 (Id); } - - INLINE E Storage_Size_Variable (E Id) - { return Node15 (Implementation_Base_Type (Id)); } - - INLINE L Stored_Constraint (E Id) - { return Elist23 (Id); } - - INLINE B Strict_Alignment (E Id) - { return Flag145 (Implementation_Base_Type (Id)); } - - INLINE U String_Literal_Length (E Id) - { return Uint16 (Id); } - - INLINE N String_Literal_Low_Bound (E Id) - { return Node15 (Id); } - - INLINE B Suppress_Elaboration_Warnings (E Id) - { return Flag148 (Id); } - - INLINE B Suppress_Init_Proc (E Id) - { return Flag105 (Base_Type (Id)); } - - INLINE B Suppress_Style_Checks (E Id) - { return Flag165 (Id); } - - INLINE B Treat_As_Volatile (E Id) - { return Flag41 (Id); } - - INLINE E Underlying_Full_View (E Id) - { return Node19 (Id); } - - INLINE N Unset_Reference (E Id) - { return Node16 (Id); } - - INLINE B Uses_Sec_Stack (E Id) - { return Flag95 (Id); } - - INLINE B Vax_Float (E Id) - { return Flag151 (Base_Type (Id)); } - - INLINE B Warnings_Off (E Id) - { return Flag96 (Id); } - - INLINE B Is_Access_Type (E Id) - { return IN (Ekind (Id), Access_Kind); } - - INLINE B Is_Array_Type (E Id) - { return IN (Ekind (Id), Array_Kind); } - - INLINE B Is_Class_Wide_Type (E Id) - { return IN (Ekind (Id), Class_Wide_Kind); } - - INLINE B Is_Composite_Type (E Id) - { return IN (Ekind (Id), Composite_Kind); } - - INLINE B Is_Concurrent_Body (E Id) - { return IN (Ekind (Id), Concurrent_Body_Kind); } - - INLINE B Is_Concurrent_Record_Type (E Id) - { return Flag20 (Id); } - - INLINE B Is_Concurrent_Type (E Id) - { return IN (Ekind (Id), Concurrent_Kind); } - - INLINE B Is_Decimal_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Decimal_Fixed_Point_Kind); } - - INLINE B Is_Digits_Type (E Id) - { return IN (Ekind (Id), Digits_Kind); } - - INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Discrete_Or_Fixed_Point_Kind); } - - INLINE B Is_Discrete_Type (E Id) - { return IN (Ekind (Id), Discrete_Kind); } - - INLINE B Is_Elementary_Type (E Id) - { return IN (Ekind (Id), Elementary_Kind); } - - INLINE B Is_Entry (E Id) - { return IN (Ekind (Id), Entry_Kind); } - - INLINE B Is_Enumeration_Type (E Id) - { return IN (Ekind (Id), Enumeration_Kind); } - - INLINE B Is_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Fixed_Point_Kind); } - - INLINE B Is_Floating_Point_Type (E Id) - { return IN (Ekind (Id), Float_Kind); } - - INLINE B Is_Formal (E Id) - { return IN (Ekind (Id), Formal_Kind); } - - INLINE B Is_Generic_Subprogram (E Id) - { return IN (Ekind (Id), Generic_Subprogram_Kind); } - - INLINE B Is_Generic_Unit (E Id) - { return IN (Ekind (Id), Generic_Unit_Kind); } - - INLINE B Is_Incomplete_Or_Private_Type (E Id) - { return IN (Ekind (Id), Incomplete_Or_Private_Kind); } - - INLINE B Is_Integer_Type (E Id) - { return IN (Ekind (Id), Integer_Kind); } - - INLINE B Is_Modular_Integer_Type (E Id) - { return IN (Ekind (Id), Modular_Integer_Kind); } - - INLINE B Is_Named_Number (E Id) - { return IN (Ekind (Id), Named_Kind); } - - INLINE B Is_Numeric_Type (E Id) - { return IN (Ekind (Id), Numeric_Kind); } - - INLINE B Is_Object (E Id) - { return IN (Ekind (Id), Object_Kind); } - - INLINE B Is_Ordinary_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Ordinary_Fixed_Point_Kind); } - - INLINE B Is_Overloadable (E Id) - { return IN (Ekind (Id), Overloadable_Kind); } - - INLINE B Is_Private_Type (E Id) - { return IN (Ekind (Id), Private_Kind); } - - INLINE B Is_Protected_Type (E Id) - { return IN (Ekind (Id), Protected_Kind); } - - INLINE B Is_Real_Type (E Id) - { return IN (Ekind (Id), Real_Kind); } - - INLINE B Is_Record_Type (E Id) - { return IN (Ekind (Id), Record_Kind); } - - INLINE B Is_Scalar_Type (E Id) - { return IN (Ekind (Id), Scalar_Kind); } - - INLINE B Is_Signed_Integer_Type (E Id) - { return IN (Ekind (Id), Signed_Integer_Kind); } - - INLINE B Is_Subprogram (E Id) - { return IN (Ekind (Id), Subprogram_Kind); } - - INLINE B Is_Task_Type (E Id) - { return IN (Ekind (Id), Task_Kind); } - - INLINE B Is_Type (E Id) - { return IN (Ekind (Id), Type_Kind); } - - INLINE N Entry_Index_Type (E Id) - { return Etype (Discrete_Subtype_Definition (Parent (Id))); } - - INLINE Node_Id Next_Index (Node_Id Id) - { return Next (Id); } - - INLINE E Next_Literal (E Id) - { return Next (Id); } - - INLINE Formal_Kind Parameter_Mode (E Id) - { return Ekind (Id); } - -/* End of einfo.h (C version of Einfo package specification) */ diff --git a/gcc/ada/errno.c b/gcc/ada/errno.c index c1b8ec9485a..fc6964b4ec2 100644 --- a/gcc/ada/errno.c +++ b/gcc/ada/errno.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2001 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is 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,14 +42,13 @@ #include int -__get_errno() +__get_errno(void) { return errno; } void -__set_errno(err) - int err; +__set_errno(int err) { errno = err; } diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index fb1142e2cd4..fb1cc76909a 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -1408,6 +1408,12 @@ package body Errout is Warnings.Table (Warnings.Last).Start := Source_Ptr'First; Warnings.Table (Warnings.Last).Stop := Source_Ptr'Last; end if; + + -- Set the error nodes to Empty to avoid uninitialized variable + -- references for saves/restores/moves. + + Error_Msg_Node_1 := Empty; + Error_Msg_Node_2 := Empty; end Initialize; ----------------- diff --git a/gcc/ada/exit.c b/gcc/ada/exit.c index dbb54a1a919..2f21067faac 100644 --- a/gcc/ada/exit.c +++ b/gcc/ada/exit.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2001 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -50,8 +50,7 @@ int gnat_exit_status = 0; void -__gnat_set_exit_status (i) - int i; +__gnat_set_exit_status (int i) { gnat_exit_status = i; } diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 0985ead93a7..9c233995c8f 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -33,6 +33,7 @@ with Expander; use Expander; with Exp_Util; use Exp_Util; with Exp_Ch3; use Exp_Ch3; with Exp_Ch7; use Exp_Ch7; +with Exp_Ch9; use Exp_Ch9; with Freeze; use Freeze; with Hostparm; use Hostparm; with Itypes; use Itypes; @@ -70,6 +71,10 @@ package body Exp_Aggr is -- statement of variant part will usually be small and probably in near -- sorted order. + function Has_Default_Init_Comps (N : Node_Id) return Boolean; + -- N is an aggregate (record or array). Checks the presence of default + -- initialization (<>) in any component (Ada0Y: AI-287) + ------------------------------------------------------ -- Local subprograms for Record Aggregate Expansion -- ------------------------------------------------------ @@ -97,12 +102,12 @@ package body Exp_Aggr is -- assignments component per component. function Build_Record_Aggr_Code - (N : Node_Id; - Typ : Entity_Id; - Target : Node_Id; - Flist : Node_Id := Empty; - Obj : Entity_Id := Empty) - return List_Id; + (N : Node_Id; + Typ : Entity_Id; + Target : Node_Id; + Flist : Node_Id := Empty; + Obj : Entity_Id := Empty; + Is_Limited_Ancestor_Expansion : Boolean := False) return List_Id; -- N is an N_Aggregate or a N_Extension_Aggregate. Typ is the type -- of the aggregate. Target is an expression containing the -- location on which the component by component assignments will @@ -113,6 +118,8 @@ package body Exp_Aggr is -- object declaration and dynamic allocation cases, it contains -- an entity that allows to know if the value being created needs to be -- attached to the final list in case of pragma finalize_Storage_Only. + -- Is_Limited_Ancestor_Expansion indicates that the function has been + -- called recursively to expand the limited ancestor to avoid copying it. function Has_Mutable_Components (Typ : Entity_Id) return Boolean; -- Return true if one of the component is of a discriminated type with @@ -164,12 +171,12 @@ package body Exp_Aggr is function Build_Array_Aggr_Code (N : Node_Id; + Ctype : Entity_Id; Index : Node_Id; Into : Node_Id; Scalar_Comp : Boolean; Indices : List_Id := No_List; - Flist : Node_Id := Empty) - return List_Id; + Flist : Node_Id := Empty) return List_Id; -- This recursive routine returns a list of statements containing the -- loops and assignments that are needed for the expansion of the array -- aggregate N. @@ -200,8 +207,7 @@ package body Exp_Aggr is Typ : Entity_Id; Target : Node_Id; Flist : Node_Id := Empty; - Obj : Entity_Id := Empty) - return List_Id; + Obj : Entity_Id := Empty) return List_Id; -- N is a nested (record or array) aggregate that has been marked -- with 'Delay_Expansion'. Typ is the expected type of the -- aggregate and Target is a (duplicable) expression that will @@ -218,8 +224,7 @@ package body Exp_Aggr is function Make_OK_Assignment_Statement (Sloc : Source_Ptr; Name : Node_Id; - Expression : Node_Id) - return Node_Id; + Expression : Node_Id) return Node_Id; -- This is like Make_Assignment_Statement, except that Assignment_OK -- is set in the left operand. All assignments built by this unit -- use this routine. This is needed to deal with assignments to @@ -394,12 +399,12 @@ package body Exp_Aggr is function Build_Array_Aggr_Code (N : Node_Id; + Ctype : Entity_Id; Index : Node_Id; Into : Node_Id; Scalar_Comp : Boolean; Indices : List_Id := No_List; - Flist : Node_Id := Empty) - return List_Id + Flist : Node_Id := Empty) return List_Id is Loc : constant Source_Ptr := Sloc (N); Index_Base : constant Entity_Id := Base_Type (Etype (Index)); @@ -428,6 +433,9 @@ package body Exp_Aggr is -- Into (Indices, Ind) := Expr; -- -- Otherwise we call Build_Code recursively. + -- + -- Ada0Y (AI-287): In case of default initialized component, Expr is + -- empty and we generate a call to the corresponding IP subprogram. function Gen_Loop (L, H : Node_Id; Expr : Node_Id) return List_Id; -- Nodes L and H must be side-effect free expressions. @@ -654,7 +662,13 @@ package body Exp_Aggr is Res : List_Id; begin - if Nkind (Parent (Expr)) = N_Component_Association + -- Ada0Y (AI-287): Do nothing else in case of default initialized + -- component + + if not Present (Expr) then + return Lis; + + elsif Nkind (Parent (Expr)) = N_Component_Association and then Present (Loop_Actions (Parent (Expr))) then Append_List (Lis, Loop_Actions (Parent (Expr))); @@ -690,15 +704,20 @@ package body Exp_Aggr is F := Find_Final_List (Current_Scope); end if; else - F := 0; + F := Empty; end if; if Present (Next_Index (Index)) then return Add_Loop_Actions ( Build_Array_Aggr_Code - (Expr, Next_Index (Index), - Into, Scalar_Comp, New_Indices, F)); + (N => Expr, + Ctype => Ctype, + Index => Next_Index (Index), + Into => Into, + Scalar_Comp => Scalar_Comp, + Indices => New_Indices, + Flist => F)); end if; -- If we get here then we are at a bottom-level (sub-)aggregate @@ -711,7 +730,12 @@ package body Exp_Aggr is Set_Assignment_OK (Indexed_Comp); - if Nkind (Expr) = N_Qualified_Expression then + -- Ada0Y (AI-287): In case of default initialized component, Expr + -- is not present (and therefore we also initialize Expr_Q to empty) + + if not Present (Expr) then + Expr_Q := Empty; + elsif Nkind (Expr) = N_Qualified_Expression then Expr_Q := Expression (Expr); else Expr_Q := Expr; @@ -721,34 +745,49 @@ package body Exp_Aggr is and then Etype (N) /= Any_Composite then Comp_Type := Component_Type (Etype (N)); + pragma Assert (Comp_Type = Ctype); -- AI-287 elsif Present (Next (First (New_Indices))) then - -- This is a multidimensional array. Recover the component - -- type from the outermost aggregate, because subaggregates - -- do not have an assigned type. + -- Ada0Y (AI-287): Do nothing in case of default initialized + -- component because we have received the component type in + -- the formal parameter Ctype. + -- ??? I have added some assert pragmas to check if this new + -- formal can be used to replace this code in all cases. - declare - P : Node_Id := Parent (Expr); + if Present (Expr) then - begin - while Present (P) loop + -- This is a multidimensional array. Recover the component + -- type from the outermost aggregate, because subaggregates + -- do not have an assigned type. - if Nkind (P) = N_Aggregate - and then Present (Etype (P)) - then - Comp_Type := Component_Type (Etype (P)); - exit; + declare + P : Node_Id := Parent (Expr); - else - P := Parent (P); - end if; - end loop; - end; + begin + while Present (P) loop + + if Nkind (P) = N_Aggregate + and then Present (Etype (P)) + then + Comp_Type := Component_Type (Etype (P)); + exit; + + else + P := Parent (P); + end if; + end loop; + pragma Assert (Comp_Type = Ctype); -- AI-287 + end; + end if; end if; - if Nkind (Expr_Q) = N_Aggregate - or else Nkind (Expr_Q) = N_Extension_Aggregate + -- Ada0Y (AI-287): We only analyze the expression in case of non + -- default initialized components (otherwise Expr_Q is not present) + + if Present (Expr_Q) + and then (Nkind (Expr_Q) = N_Aggregate + or else Nkind (Expr_Q) = N_Extension_Aggregate) then -- At this stage the Expression may not have been -- analyzed yet because the array aggregate code has not @@ -769,59 +808,73 @@ package body Exp_Aggr is end if; end if; - -- Now generate the assignment with no associated controlled - -- actions since the target of the assignment may not have - -- been initialized, it is not possible to Finalize it as - -- expected by normal controlled assignment. The rest of the - -- controlled actions are done manually with the proper - -- finalization list coming from the context. + -- Ada0Y (AI-287): In case of default initialized component, call + -- the initialization subprogram associated with the component type - A := - Make_OK_Assignment_Statement (Loc, - Name => Indexed_Comp, - Expression => New_Copy_Tree (Expr)); + if not Present (Expr) then - if Present (Comp_Type) and then Controlled_Type (Comp_Type) then - Set_No_Ctrl_Actions (A); - end if; + Append_List_To (L, + Build_Initialization_Call (Loc, + Id_Ref => Indexed_Comp, + Typ => Ctype, + With_Default_Init => True)); - Append_To (L, A); + else - -- Adjust the tag if tagged (because of possible view - -- conversions), unless compiling for the Java VM - -- where tags are implicit. + -- Now generate the assignment with no associated controlled + -- actions since the target of the assignment may not have + -- been initialized, it is not possible to Finalize it as + -- expected by normal controlled assignment. The rest of the + -- controlled actions are done manually with the proper + -- finalization list coming from the context. - if Present (Comp_Type) - and then Is_Tagged_Type (Comp_Type) - and then not Java_VM - then A := Make_OK_Assignment_Statement (Loc, - Name => - Make_Selected_Component (Loc, - Prefix => New_Copy_Tree (Indexed_Comp), - Selector_Name => - New_Reference_To (Tag_Component (Comp_Type), Loc)), + Name => Indexed_Comp, + Expression => New_Copy_Tree (Expr)); - Expression => - Unchecked_Convert_To (RTE (RE_Tag), - New_Reference_To ( - Access_Disp_Table (Comp_Type), Loc))); + if Present (Comp_Type) and then Controlled_Type (Comp_Type) then + Set_No_Ctrl_Actions (A); + end if; Append_To (L, A); - end if; - -- Adjust and Attach the component to the proper final list - -- which can be the controller of the outer record object or - -- the final list associated with the scope + -- Adjust the tag if tagged (because of possible view + -- conversions), unless compiling for the Java VM + -- where tags are implicit. - if Present (Comp_Type) and then Controlled_Type (Comp_Type) then - Append_List_To (L, - Make_Adjust_Call ( - Ref => New_Copy_Tree (Indexed_Comp), - Typ => Comp_Type, - Flist_Ref => F, - With_Attach => Make_Integer_Literal (Loc, 1))); + if Present (Comp_Type) + and then Is_Tagged_Type (Comp_Type) + and then not Java_VM + then + A := + Make_OK_Assignment_Statement (Loc, + Name => + Make_Selected_Component (Loc, + Prefix => New_Copy_Tree (Indexed_Comp), + Selector_Name => + New_Reference_To (Tag_Component (Comp_Type), Loc)), + + Expression => + Unchecked_Convert_To (RTE (RE_Tag), + New_Reference_To ( + Access_Disp_Table (Comp_Type), Loc))); + + Append_To (L, A); + end if; + + -- Adjust and Attach the component to the proper final list + -- which can be the controller of the outer record object or + -- the final list associated with the scope + + if Present (Comp_Type) and then Controlled_Type (Comp_Type) then + Append_List_To (L, + Make_Adjust_Call ( + Ref => New_Copy_Tree (Indexed_Comp), + Typ => Comp_Type, + Flist_Ref => F, + With_Attach => Make_Integer_Literal (Loc, 1))); + end if; end if; return Add_Loop_Actions (L); @@ -855,21 +908,29 @@ package body Exp_Aggr is if Empty_Range (L, H) then Append_To (S, Make_Null_Statement (Loc)); - -- The expression must be type-checked even though no component - -- of the aggregate will have this value. This is done only for - -- actual components of the array, not for subaggregates. Do the - -- check on a copy, because the expression may be shared among - -- several choices, some of which might be non-null. + -- Ada0Y (AI-287): Nothing else need to be done in case of + -- default initialized component - if Present (Etype (N)) - and then Is_Array_Type (Etype (N)) - and then No (Next_Index (Index)) - then - Expander_Mode_Save_And_Set (False); - Tcopy := New_Copy_Tree (Expr); - Set_Parent (Tcopy, N); - Analyze_And_Resolve (Tcopy, Component_Type (Etype (N))); - Expander_Mode_Restore; + if not Present (Expr) then + null; + + else + -- The expression must be type-checked even though no component + -- of the aggregate will have this value. This is done only for + -- actual components of the array, not for subaggregates. Do + -- the check on a copy, because the expression may be shared + -- among several choices, some of which might be non-null. + + if Present (Etype (N)) + and then Is_Array_Type (Etype (N)) + and then No (Next_Index (Index)) + then + Expander_Mode_Save_And_Set (False); + Tcopy := New_Copy_Tree (Expr); + Set_Parent (Tcopy, N); + Analyze_And_Resolve (Tcopy, Component_Type (Etype (N))); + Expander_Mode_Restore; + end if; end if; return S; @@ -889,6 +950,7 @@ package body Exp_Aggr is and then Local_Compile_Time_Known_Value (H) and then Local_Expr_Value (H) - Local_Expr_Value (L) <= 2 then + Append_List_To (S, Gen_Assign (New_Copy_Tree (L), Expr)); Append_List_To (S, Gen_Assign (Add (1, To => L), Expr)); @@ -1082,7 +1144,8 @@ package body Exp_Aggr is Expr : Node_Id; Typ : Entity_Id; - Others_Expr : Node_Id := Empty; + Others_Expr : Node_Id := Empty; + Others_Mbox_Present : Boolean := False; Aggr_L : constant Node_Id := Low_Bound (Aggregate_Bounds (N)); Aggr_H : constant Node_Id := High_Bound (Aggregate_Bounds (N)); @@ -1094,8 +1157,8 @@ package body Exp_Aggr is Aggr_High : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_H); -- After Duplicate_Subexpr these are side-effect free. - Low : Node_Id; - High : Node_Id; + Low : Node_Id; + High : Node_Id; Nb_Choices : Nat := 0; Table : Case_Table_Type (1 .. Number_Of_Choices (N)); @@ -1142,7 +1205,12 @@ package body Exp_Aggr is while Present (Choice) loop if Nkind (Choice) = N_Others_Choice then Set_Loop_Actions (Assoc, New_List); - Others_Expr := Expression (Assoc); + + if Box_Present (Assoc) then + Others_Mbox_Present := True; + else + Others_Expr := Expression (Assoc); + end if; exit; end if; @@ -1153,9 +1221,15 @@ package body Exp_Aggr is end if; Nb_Choices := Nb_Choices + 1; - Table (Nb_Choices) := (Choice_Lo => Low, - Choice_Hi => High, - Choice_Node => Expression (Assoc)); + if Box_Present (Assoc) then + Table (Nb_Choices) := (Choice_Lo => Low, + Choice_Hi => High, + Choice_Node => Empty); + else + Table (Nb_Choices) := (Choice_Lo => Low, + Choice_Hi => High, + Choice_Node => Expression (Assoc)); + end if; Next (Choice); end loop; @@ -1183,7 +1257,7 @@ package body Exp_Aggr is -- We don't need to generate loops over empty gaps, but if there is -- a single empty range we must analyze the expression for semantics - if Present (Others_Expr) then + if Present (Others_Expr) or else Others_Mbox_Present then declare First : Boolean := True; @@ -1252,12 +1326,21 @@ package body Exp_Aggr is if Present (Component_Associations (N)) then Assoc := Last (Component_Associations (N)); - Expr := Expression (Assoc); - Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L), - Aggr_High, - Expr), - To => New_Code); + -- Ada0Y (AI-287) + if Box_Present (Assoc) then + Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L), + Aggr_High, + Empty), + To => New_Code); + else + Expr := Expression (Assoc); + + Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L), + Aggr_High, + Expr), -- AI-287 + To => New_Code); + end if; end if; end if; @@ -1269,12 +1352,12 @@ package body Exp_Aggr is ---------------------------- function Build_Record_Aggr_Code - (N : Node_Id; - Typ : Entity_Id; - Target : Node_Id; - Flist : Node_Id := Empty; - Obj : Entity_Id := Empty) - return List_Id + (N : Node_Id; + Typ : Entity_Id; + Target : Node_Id; + Flist : Node_Id := Empty; + Obj : Entity_Id := Empty; + Is_Limited_Ancestor_Expansion : Boolean := False) return List_Id is Loc : constant Source_Ptr := Sloc (N); L : constant List_Id := New_List; @@ -1325,8 +1408,7 @@ package body Exp_Aggr is Typ : Entity_Id; F : Node_Id; Attach : Node_Id; - Init_Pr : Boolean) - return List_Id; + Init_Pr : Boolean) return List_Id; -- returns the list of statements necessary to initialize the internal -- controller of the (possible) ancestor typ into target and attach -- it to finalization list F. Init_Pr conditions the call to the @@ -1522,8 +1604,7 @@ package body Exp_Aggr is Typ : Entity_Id; F : Node_Id; Attach : Node_Id; - Init_Pr : Boolean) - return List_Id + Init_Pr : Boolean) return List_Id is L : constant List_Id := New_List; Ref : Node_Id; @@ -1540,20 +1621,58 @@ package body Exp_Aggr is Selector_Name => Make_Identifier (Loc, Name_uController)); Set_Assignment_OK (Ref); - if Init_Pr then - Append_List_To (L, - Build_Initialization_Call (Loc, - Id_Ref => Ref, - Typ => RTE (RE_Record_Controller), - In_Init_Proc => Within_Init_Proc)); - end if; + -- Ada0Y (AI-287): Give support to default initialization of limited + -- types and components + + if (Nkind (Target) = N_Identifier + and then Present (Etype (Target)) + and then Is_Limited_Type (Etype (Target))) + or else (Nkind (Target) = N_Selected_Component + and then Present (Etype (Selector_Name (Target))) + and then Is_Limited_Type (Etype (Selector_Name (Target)))) + or else (Nkind (Target) = N_Unchecked_Type_Conversion + and then Present (Etype (Target)) + and then Is_Limited_Type (Etype (Target))) + or else (Nkind (Target) = N_Unchecked_Expression + and then Nkind (Expression (Target)) = N_Indexed_Component + and then Present (Etype (Prefix (Expression (Target)))) + and then Is_Limited_Type + (Etype (Prefix (Expression (Target))))) + then - Append_To (L, - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (Find_Prim_Op (RTE (RE_Record_Controller), - Name_Initialize), Loc), - Parameter_Associations => New_List (New_Copy_Tree (Ref)))); + if Init_Pr then + Append_List_To (L, + Build_Initialization_Call (Loc, + Id_Ref => Ref, + Typ => RTE (RE_Limited_Record_Controller), + In_Init_Proc => Within_Init_Proc)); + end if; + + Append_To (L, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (Find_Prim_Op (RTE (RE_Limited_Record_Controller), + Name_Initialize), Loc), + Parameter_Associations => New_List (New_Copy_Tree (Ref)))); + + else + if Init_Pr then + Append_List_To (L, + Build_Initialization_Call (Loc, + Id_Ref => Ref, + Typ => RTE (RE_Record_Controller), + In_Init_Proc => Within_Init_Proc)); + end if; + + Append_To (L, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To (Find_Prim_Op (RTE (RE_Record_Controller), + Name_Initialize), Loc), + Parameter_Associations => New_List (New_Copy_Tree (Ref)))); + + end if; Append_To (L, Make_Attach_Call ( @@ -1636,11 +1755,22 @@ package body Exp_Aggr is Ref := Convert_To (Init_Typ, New_Copy_Tree (Target)); Set_Assignment_OK (Ref); - Append_List_To (Start_L, - Build_Initialization_Call (Loc, - Id_Ref => Ref, - Typ => Init_Typ, - In_Init_Proc => Within_Init_Proc)); + if Has_Default_Init_Comps (N) + or else Has_Task (Base_Type (Init_Typ)) + then + Append_List_To (Start_L, + Build_Initialization_Call (Loc, + Id_Ref => Ref, + Typ => Init_Typ, + In_Init_Proc => Within_Init_Proc, + With_Default_Init => True)); + else + Append_List_To (Start_L, + Build_Initialization_Call (Loc, + Id_Ref => Ref, + Typ => Init_Typ, + In_Init_Proc => Within_Init_Proc)); + end if; if Is_Constrained (Entity (A)) and then Has_Discriminants (Entity (A)) @@ -1648,6 +1778,21 @@ package body Exp_Aggr is Check_Ancestor_Discriminants (Entity (A)); end if; + -- Ada0Y (AI-287): If the ancestor part is a limited type, a + -- recursive call expands the ancestor. + + elsif Is_Limited_Type (Etype (A)) then + Ancestor_Is_Expression := True; + + Append_List_To (Start_L, + Build_Record_Aggr_Code ( + N => Expression (A), + Typ => Etype (Expression (A)), + Target => Target, + Flist => Flist, + Obj => Obj, + Is_Limited_Ancestor_Expansion => True)); + -- If the ancestor part is an expression "E", we generate -- T(tmp) := E; @@ -1767,6 +1912,52 @@ package body Exp_Aggr is while Present (Comp) loop Selector := Entity (First (Choices (Comp))); + -- Ada0Y (AI-287): Default initialization of a limited component + + if Box_Present (Comp) + and then Is_Limited_Type (Etype (Selector)) + then + + -- Ada0Y (AI-287): If the component type has tasks then generate + -- the activation chain and master entities (except in case of an + -- allocator because in that case these entities are generated + -- by Build_Task_Allocate_Block_With_Init_Stmts) + + declare + Ctype : Entity_Id := Etype (Selector); + Inside_Allocator : Boolean := False; + P : Node_Id := Parent (N); + + begin + if Is_Task_Type (Ctype) or else Has_Task (Ctype) then + while Present (P) loop + if Nkind (P) = N_Allocator then + Inside_Allocator := True; + exit; + end if; + + P := Parent (P); + end loop; + + if not Inside_Init_Proc and not Inside_Allocator then + Build_Activation_Chain_Entity (N); + Build_Master_Entity (Etype (N)); + end if; + end if; + end; + + Append_List_To (L, + Build_Initialization_Call (Loc, + Id_Ref => Make_Selected_Component (Loc, + Prefix => New_Copy_Tree (Target), + Selector_Name => New_Occurrence_Of (Selector, + Loc)), + Typ => Etype (Selector), + With_Default_Init => True)); + + goto Next_Comp; + end if; + -- ??? if Ekind (Selector) /= E_Discriminant @@ -1900,6 +2091,8 @@ package body Exp_Aggr is end; end if; + <> + Next (Comp); end loop; @@ -1997,7 +2190,9 @@ package body Exp_Aggr is -- In the Has_Controlled component case, all the intermediate -- controllers must be initialized - if Has_Controlled_Component (Typ) then + if Has_Controlled_Component (Typ) + and not Is_Limited_Ancestor_Expansion + then declare Inner_Typ : Entity_Id; Outer_Typ : Entity_Id; @@ -2135,10 +2330,26 @@ package body Exp_Aggr is Access_Type : constant Entity_Id := Etype (Temp); begin - Insert_Actions_After (Decl, - Late_Expansion (Aggr, Typ, Occ, - Find_Final_List (Access_Type), - Associated_Final_Chain (Base_Type (Access_Type)))); + if Has_Default_Init_Comps (Aggr) then + declare + L : constant List_Id := New_List; + Init_Stmts : List_Id; + + begin + Init_Stmts := Late_Expansion (Aggr, Typ, Occ, + Find_Final_List (Access_Type), + Associated_Final_Chain (Base_Type (Access_Type))); + + Build_Task_Allocate_Block_With_Init_Stmts (L, Aggr, Init_Stmts); + Insert_Actions_After (Decl, L); + end; + + else + Insert_Actions_After (Decl, + Late_Expansion (Aggr, Typ, Occ, + Find_Final_List (Access_Type), + Associated_Final_Chain (Base_Type (Access_Type)))); + end if; end Convert_Aggr_In_Allocator; -------------------------------- @@ -2359,10 +2570,9 @@ package body Exp_Aggr is Typ : constant Entity_Id := Etype (N); function Flatten - (N : Node_Id; - Ix : Node_Id; - Ixb : Node_Id) - return Boolean; + (N : Node_Id; + Ix : Node_Id; + Ixb : Node_Id) return Boolean; -- Convert the aggregate into a purely positional form if possible. function Is_Flat (N : Node_Id; Dims : Int) return Boolean; @@ -2373,10 +2583,9 @@ package body Exp_Aggr is ------------- function Flatten - (N : Node_Id; - Ix : Node_Id; - Ixb : Node_Id) - return Boolean + (N : Node_Id; + Ix : Node_Id; + Ixb : Node_Id) return Boolean is Loc : constant Source_Ptr := Sloc (N); Blo : constant Node_Id := Type_Low_Bound (Etype (Ixb)); @@ -2643,6 +2852,14 @@ package body Exp_Aggr is -- Start of processing for Convert_To_Positional begin + -- Ada0Y (AI-287): Do not convert in case of default initialized + -- components because in this case will need to call the corresponding + -- IP procedure. + + if Has_Default_Init_Comps (N) then + return; + end if; + if Is_Flat (N, Number_Dimensions (Typ)) then return; end if; @@ -3764,14 +3981,19 @@ package body Exp_Aggr is (N, Sec_Stack => Has_Controlled_Component (Typ)); end if; - Maybe_In_Place_OK := - Comes_From_Source (N) - and then Nkind (Parent (N)) = N_Assignment_Statement - and then not Is_Bit_Packed_Array (Typ) - and then not Has_Controlled_Component (Typ) - and then In_Place_Assign_OK; + if Has_Default_Init_Comps (N) then + Maybe_In_Place_OK := False; + else + Maybe_In_Place_OK := + Comes_From_Source (N) + and then Nkind (Parent (N)) = N_Assignment_Statement + and then not Is_Bit_Packed_Array (Typ) + and then not Has_Controlled_Component (Typ) + and then In_Place_Assign_OK; + end if; - if Comes_From_Source (Parent (N)) + if not Has_Default_Init_Comps (N) + and then Comes_From_Source (Parent (N)) and then Nkind (Parent (N)) = N_Object_Declaration and then not Must_Slide (N, Typ) and then N = Expression (Parent (N)) @@ -3875,6 +4097,15 @@ package body Exp_Aggr is Target := New_Reference_To (Tmp, Loc); else + + if Has_Default_Init_Comps (N) then + + -- Ada0Y (AI-287): This case has not been analyzed??? + + pragma Assert (False); + null; + end if; + -- Name in assignment is explicit dereference. Target := New_Copy (Tmp); @@ -3882,6 +4113,7 @@ package body Exp_Aggr is Aggr_Code := Build_Array_Aggr_Code (N, + Ctype => Ctyp, Index => First_Index (Typ), Into => Target, Scalar_Comp => Is_Scalar_Type (Ctyp)); @@ -4082,6 +4314,12 @@ package body Exp_Aggr is then Convert_To_Assignments (N, Typ); + -- Ada0Y (AI-287): In case of default initialized components we convert + -- the aggregate into assignments. + + elsif Has_Default_Init_Comps (N) then + Convert_To_Assignments (N, Typ); + elsif Has_Delayed_Nested_Aggregate_Or_Tagged_Comps then Convert_To_Assignments (N, Typ); @@ -4402,6 +4640,53 @@ package body Exp_Aggr is end if; end Expand_Record_Aggregate; + ---------------------------- + -- Has_Default_Init_Comps -- + ---------------------------- + + function Has_Default_Init_Comps (N : Node_Id) return Boolean is + Comps : constant List_Id := Component_Associations (N); + C : Node_Id; + Expr : Node_Id; + begin + pragma Assert (Nkind (N) = N_Aggregate + or else Nkind (N) = N_Extension_Aggregate); + + if No (Comps) then + return False; + end if; + + -- Check if any direct component has default initialized components + + C := First (Comps); + while Present (C) loop + if Box_Present (C) then + return True; + end if; + + Next (C); + end loop; + + -- Recursive call in case of aggregate expression + + C := First (Comps); + while Present (C) loop + Expr := Expression (C); + + if Present (Expr) + and then (Nkind (Expr) = N_Aggregate + or else Nkind (Expr) = N_Extension_Aggregate) + and then Has_Default_Init_Comps (Expr) + then + return True; + end if; + + Next (C); + end loop; + + return False; + end Has_Default_Init_Comps; + -------------------------- -- Is_Delayed_Aggregate -- -------------------------- @@ -4432,21 +4717,23 @@ package body Exp_Aggr is Typ : Entity_Id; Target : Node_Id; Flist : Node_Id := Empty; - Obj : Entity_Id := Empty) - return List_Id - is + Obj : Entity_Id := Empty) return List_Id is begin if Is_Record_Type (Etype (N)) then return Build_Record_Aggr_Code (N, Typ, Target, Flist, Obj); - else + elsif Is_Array_Type (Etype (N)) then return Build_Array_Aggr_Code - (N, - First_Index (Typ), - Target, - Is_Scalar_Type (Component_Type (Typ)), - No_List, - Flist); + (N => N, + Ctype => Component_Type (Etype (N)), + Index => First_Index (Typ), + Into => Target, + Scalar_Comp => Is_Scalar_Type (Component_Type (Typ)), + Indices => No_List, + Flist => Flist); + else + pragma Assert (False); + return New_List; end if; end Late_Expansion; @@ -4457,8 +4744,7 @@ package body Exp_Aggr is function Make_OK_Assignment_Statement (Sloc : Source_Ptr; Name : Node_Id; - Expression : Node_Id) - return Node_Id + Expression : Node_Id) return Node_Id is begin Set_Assignment_OK (Name); diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 7a5d7737f02..f296a6f60cf 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -907,8 +907,9 @@ package body Exp_Attr is if Pent = Standard_Standard or else Pent = Standard_ASCII then - Name_Buffer (1 .. Library_Version'Length) := Library_Version; - Name_Len := Library_Version'Length; + Name_Buffer (1 .. Verbose_Library_Version'Length) := + Verbose_Library_Version; + Name_Len := Verbose_Library_Version'Length; Rewrite (N, Make_String_Literal (Loc, Strval => String_From_Name_Buffer)); diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index a6d058d11a4..1cb9328655c 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -56,6 +56,7 @@ with Sem_Res; use Sem_Res; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Stand; use Stand; +with Stringt; use Stringt; with Snames; use Snames; with Tbuild; use Tbuild; with Ttypes; use Ttypes; @@ -1032,13 +1033,14 @@ package body Exp_Ch3 is -- end; function Build_Initialization_Call - (Loc : Source_Ptr; - Id_Ref : Node_Id; - Typ : Entity_Id; - In_Init_Proc : Boolean := False; - Enclos_Type : Entity_Id := Empty; - Discr_Map : Elist_Id := New_Elmt_List) - return List_Id + (Loc : Source_Ptr; + Id_Ref : Node_Id; + Typ : Entity_Id; + In_Init_Proc : Boolean := False; + Enclos_Type : Entity_Id := Empty; + Discr_Map : Elist_Id := New_Elmt_List; + With_Default_Init : Boolean := False) + return List_Id is First_Arg : Node_Id; Args : List_Id; @@ -1076,7 +1078,6 @@ package body Exp_Ch3 is -- honest. Actually it isn't quite type honest, because there can be -- conflicts of views in the private type case. That is why we set -- Conversion_OK in the conversion node. - if (Is_Record_Type (Typ) or else Is_Array_Type (Typ) or else Is_Private_Type (Typ)) @@ -1110,12 +1111,28 @@ package body Exp_Ch3 is Append_To (Args, Make_Identifier (Loc, Name_uChain)); - Decls := Build_Task_Image_Decls (Loc, Id_Ref, Enclos_Type); - Decl := Last (Decls); + -- Ada0Y (AI-287): In case of default initialized components + -- with tasks, we generate a null string actual parameter. + -- This is just a workaround that must be improved later??? + + if With_Default_Init then + declare + S : String_Id; + Null_String : Node_Id; + begin + Start_String; + S := End_String; + Null_String := Make_String_Literal (Loc, Strval => S); + Append_To (Args, Null_String); + end; + else + Decls := Build_Task_Image_Decls (Loc, Id_Ref, Enclos_Type); + Decl := Last (Decls); - Append_To (Args, - New_Occurrence_Of (Defining_Identifier (Decl), Loc)); - Append_List (Decls, Res); + Append_To (Args, + New_Occurrence_Of (Defining_Identifier (Decl), Loc)); + Append_List (Decls, Res); + end if; else Decls := No_List; @@ -1202,7 +1219,22 @@ package body Exp_Ch3 is end if; end if; - Append_To (Args, Arg); + -- Ada0Y (AI-287) In case of default initialized components, we + -- need to generate the corresponding selected component node + -- to access the discriminant value. In other cases this is not + -- required because we are inside the init proc and we use the + -- corresponding formal. + + if With_Default_Init + and then Nkind (Id_Ref) = N_Selected_Component + then + Append_To (Args, + Make_Selected_Component (Loc, + Prefix => New_Copy_Tree (Prefix (Id_Ref)), + Selector_Name => Arg)); + else + Append_To (Args, Arg); + end if; Next_Discriminant (Discr); end loop; @@ -3428,8 +3460,8 @@ package body Exp_Ch3 is -- initialize scalars mode, and these types are treated specially -- and do not need initialization procedures. - elsif Base = Standard_String - or else Base = Standard_Wide_String + elsif Root_Type (Base) = Standard_String + or else Root_Type (Base) = Standard_Wide_String then null; diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads index 6d94e1a714b..7de6498a696 100644 --- a/gcc/ada/exp_ch3.ads +++ b/gcc/ada/exp_ch3.ads @@ -52,13 +52,14 @@ package Exp_Ch3 is -- and the discriminant checking functions are inserted after this node. function Build_Initialization_Call - (Loc : Source_Ptr; - Id_Ref : Node_Id; - Typ : Entity_Id; - In_Init_Proc : Boolean := False; - Enclos_Type : Entity_Id := Empty; - Discr_Map : Elist_Id := New_Elmt_List) - return List_Id; + (Loc : Source_Ptr; + Id_Ref : Node_Id; + Typ : Entity_Id; + In_Init_Proc : Boolean := False; + Enclos_Type : Entity_Id := Empty; + Discr_Map : Elist_Id := New_Elmt_List; + With_Default_Init : Boolean := False) + return List_Id; -- Builds a call to the initialization procedure of the Id entity. Id_Ref -- is either a new reference to Id (for record fields), or an indexed -- component (for array elements). Loc is the source location for the @@ -76,6 +77,10 @@ package Exp_Ch3 is -- entry families bounded by discriminants, protected type discriminants -- can appear within expressions in array bounds (not as stand-alone -- identifiers) and a general replacement is necessary. + -- + -- Ada0Y (AI-287): With_Default_Init is used to indicate that the initia- + -- lization call corresponds to a default initialized component of an + -- aggregate. procedure Freeze_Type (N : Node_Id); -- This procedure executes the freezing actions associated with the given diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 30be4d754f2..192e89805d4 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -1472,7 +1472,7 @@ package body Exp_Ch4 is -- their base type, Ind_Typ their index type, and Arr_Typ the original -- array type to which the concatenantion operator applies, then the -- following subprogram is constructed: - -- + -- [function Cnn (S1 : Base_Typ; ...; Sn : Base_Typ) return Base_Typ is -- L : Ind_Typ; -- begin @@ -1489,7 +1489,7 @@ package body Exp_Ch4 is -- else -- return Sn; -- end if; - -- + -- declare -- P : Ind_Typ; -- H : Ind_Typ := @@ -1516,9 +1516,9 @@ package body Exp_Ch4 is -- P := Ind_Typ'Succ (P); -- end loop; -- end if; - -- + -- ... - -- + -- if Sn'Length /= 0 then -- P := Sn'First; -- loop @@ -1528,7 +1528,7 @@ package body Exp_Ch4 is -- P := Ind_Typ'Succ (P); -- end loop; -- end if; - -- + -- return R; -- end; -- end Cnn;] @@ -1598,7 +1598,9 @@ package body Exp_Ch4 is -- Builds reference to identifier L. function L_Pos return Node_Id; - -- Builds expression Ind_Typ'Pos (L). + -- Builds expression Integer_Type'(Ind_Typ'Pos (L)). + -- We qualify the expression to avoid universal_integer computations + -- whenever possible, in the expression for the upper bound H. function L_Succ return Node_Id; -- Builds expression Ind_Typ'Succ (L). @@ -1743,12 +1745,31 @@ package body Exp_Ch4 is ----------- function L_Pos return Node_Id is + Target_Type : Entity_Id; + begin + -- If the index type is an enumeration type, the computation + -- can be done in standard integer. Otherwise, choose a large + -- enough integer type. + + if Is_Enumeration_Type (Ind_Typ) + or else Root_Type (Ind_Typ) = Standard_Integer + or else Root_Type (Ind_Typ) = Standard_Short_Integer + or else Root_Type (Ind_Typ) = Standard_Short_Short_Integer + then + Target_Type := Standard_Integer; + else + Target_Type := Root_Type (Ind_Typ); + end if; + return - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Ind_Typ, Loc), - Attribute_Name => Name_Pos, - Expressions => New_List (L)); + Make_Qualified_Expression (Loc, + Subtype_Mark => New_Reference_To (Target_Type, Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Ind_Typ, Loc), + Attribute_Name => Name_Pos, + Expressions => New_List (L))); end L_Pos; ------------ @@ -3713,7 +3734,8 @@ package body Exp_Ch4 is exit when Chars (Node (Prim)) = Name_Op_Eq and then Etype (First_Formal (Node (Prim))) = Etype (Next_Formal (First_Formal (Node (Prim)))) - and then Etype (Node (Prim)) = Standard_Boolean; + and then + Base_Type (Etype (Node (Prim))) = Standard_Boolean; Next_Elmt (Prim); pragma Assert (Present (Prim)); @@ -5311,11 +5333,37 @@ package body Exp_Ch4 is Pfx : constant Node_Id := Prefix (N); Ptp : Entity_Id := Etype (Pfx); + function Is_Procedure_Actual (N : Node_Id) return Boolean; + -- Check whether context is a procedure call, in which case + -- expansion of a bit-packed slice is deferred until the call + -- itself is expanded. + procedure Make_Temporary; -- Create a named variable for the value of the slice, in -- cases where the back-end cannot handle it properly, e.g. -- when packed types or unaligned slices are involved. + ------------------------- + -- Is_Procedure_Actual -- + ------------------------- + + function Is_Procedure_Actual (N : Node_Id) return Boolean is + Par : Node_Id := Parent (N); + + begin + while Present (Par) + and then Nkind (Par) not in N_Statement_Other_Than_Procedure_Call + loop + if Nkind (Par) = N_Procedure_Call_Statement then + return True; + else + Par := Parent (Par); + end if; + end loop; + + return False; + end Is_Procedure_Actual; + -------------------- -- Make_Temporary -- -------------------- @@ -5400,26 +5448,35 @@ package body Exp_Ch4 is -- is caught elsewhere, and the expansion would intefere -- with generating the error message). - if Is_Packed (Typ) - and then Nkind (Parent (N)) /= N_Assignment_Statement - and then (Nkind (Parent (Parent (N))) /= N_Assignment_Statement - or else - Parent (N) /= Name (Parent (Parent (N)))) - and then Nkind (Parent (N)) /= N_Indexed_Component - and then not Is_Renamed_Object (N) - and then Nkind (Parent (N)) /= N_Procedure_Call_Statement - and then (Nkind (Parent (N)) /= N_Attribute_Reference - or else - Attribute_Name (Parent (N)) /= Name_Address) + if not Is_Packed (Typ) then + + -- Apply transformation for actuals of a function call, + -- where Expand_Actuals is not used. + + if Nkind (Parent (N)) = N_Function_Call + and then Is_Possibly_Unaligned_Slice (N) + then + Make_Temporary; + end if; + + elsif Nkind (Parent (N)) = N_Assignment_Statement + or else (Nkind (Parent (Parent (N))) = N_Assignment_Statement + and then Parent (N) = Name (Parent (Parent (N)))) then - Make_Temporary; + return; - -- Same transformation for actuals in a function call, where - -- Expand_Actuals is not used. + elsif Nkind (Parent (N)) = N_Indexed_Component + or else Is_Renamed_Object (N) + or else Is_Procedure_Actual (N) + then + return; - elsif Nkind (Parent (N)) = N_Function_Call - and then Is_Possibly_Unaligned_Slice (N) + elsif (Nkind (Parent (N)) = N_Attribute_Reference + and then Attribute_Name (Parent (N)) = Name_Address) then + return; + + else Make_Temporary; end if; end Expand_N_Slice; diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 5fd2dc9c512..a257b274ce0 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -91,8 +91,9 @@ package body Exp_Ch5 is procedure Expand_Assign_Record (N : Node_Id); -- N is an assignment of a non-tagged record value. This routine handles - -- the special cases and checks required for such assignments, including - -- change of representation. + -- the case where the assignment must be made component by component, + -- either because the target is not byte aligned, or there is a change + -- of representation. function Make_Tag_Ctrl_Assignment (N : Node_Id) return List_Id; -- Generate the necessary code for controlled and Tagged assignment, @@ -101,13 +102,41 @@ package body Exp_Ch5 is -- pointers which are not 'part of the value' and must not be changed -- upon assignment. N is the original Assignment node. + function Possible_Bit_Aligned_Component (N : Node_Id) return Boolean; + -- This function is used in processing the assignment of a record or + -- indexed component. The back end can handle such assignments fine + -- if the objects involved are small (64-bits or less) records or + -- scalar items (including bit-packed arrays represented with modular + -- types) or are both aligned on a byte boundary (starting on a byte + -- boundary, and occupying an integral number of bytes). + -- + -- However, problems arise for records larger than 64 bits, or for + -- arrays (other than bit-packed arrays represented with a modular + -- type) if the component starts on a non-byte boundary, or does + -- not occupy an integral number of bytes (i.e. there are some bits + -- possibly shared with fields at the start or beginning of the + -- component). The back end cannot handle loading and storing such + -- components in a single operation. + -- + -- This function is used to detect the troublesome situation. it is + -- conservative in the sense that it produces True unless it knows + -- for sure that the component is safe (as outlined in the first + -- paragraph above). The code generation for record and array + -- assignment checks for trouble using this function, and if so + -- the assignment is generated component-wise, which the back end + -- is required to handle correctly. + -- + -- Note that in GNAT 3, the back end will reject such components + -- anyway, so the hard work in checking for this case is wasted + -- in GNAT 3, but it's harmless, so it is easier to do it in + -- all cases, rather than conditionalize it in GNAT 5 or beyond. + ------------------------------ -- Change_Of_Representation -- ------------------------------ function Change_Of_Representation (N : Node_Id) return Boolean is Rhs : constant Node_Id := Expression (N); - begin return Nkind (Rhs) = N_Type_Conversion @@ -351,6 +380,14 @@ package body Exp_Ch5 is R_Type := Get_Actual_Subtype (Act_Rhs); Loop_Required := True; + -- We require a loop if the left side is possibly bit unaligned + + elsif Possible_Bit_Aligned_Component (Lhs) + or else + Possible_Bit_Aligned_Component (Rhs) + then + Loop_Required := True; + -- Arrays with controlled components are expanded into a loop -- to force calls to adjust at the component level. @@ -982,19 +1019,41 @@ package body Exp_Ch5 is -- by field assignments. procedure Expand_Assign_Record (N : Node_Id) is + Lhs : constant Node_Id := Name (N); + Rhs : Node_Id := Expression (N); + begin - if not Change_Of_Representation (N) then + -- If change of representation, then extract the real right hand + -- side from the type conversion, and proceed with component-wise + -- assignment, since the two types are not the same as far as the + -- back end is concerned. + + if Change_Of_Representation (N) then + Rhs := Expression (Rhs); + + -- If this may be a case of a large bit aligned component, then + -- proceed with component-wise assignment, to avoid possible + -- clobbering of other components sharing bits in the first or + -- last byte of the component to be assigned. + + elsif Possible_Bit_Aligned_Component (Lhs) + or + Possible_Bit_Aligned_Component (Rhs) + then + null; + + -- If neither condition met, then nothing special to do, the back end + -- can handle assignment of the entire component as a single entity. + + else return; end if; - -- At this stage we know that the right hand side is a conversion + -- At this stage we know that we must do a component wise assignment declare Loc : constant Source_Ptr := Sloc (N); - Lhs : constant Node_Id := Name (N); - Rhs : constant Node_Id := Expression (Expression (N)); - R_Rec : constant Node_Id := Expression (Expression (N)); - R_Typ : constant Entity_Id := Base_Type (Etype (R_Rec)); + R_Typ : constant Entity_Id := Base_Type (Etype (Rhs)); L_Typ : constant Entity_Id := Base_Type (Etype (Lhs)); Decl : constant Node_Id := Declaration_Node (R_Typ); RDef : Node_Id; @@ -1002,8 +1061,7 @@ package body Exp_Ch5 is function Find_Component (Typ : Entity_Id; - Comp : Entity_Id) - return Entity_Id; + Comp : Entity_Id) return Entity_Id; -- Find the component with the given name in the underlying record -- declaration for Typ. We need to use the actual entity because -- the type may be private and resolution by identifier alone would @@ -1027,9 +1085,7 @@ package body Exp_Ch5 is function Find_Component (Typ : Entity_Id; - Comp : Entity_Id) - return Entity_Id - + Comp : Entity_Id) return Entity_Id is Utyp : constant Entity_Id := Underlying_Type (Typ); C : Entity_Id; @@ -3175,4 +3231,96 @@ package body Exp_Ch5 is return Empty_List; end Make_Tag_Ctrl_Assignment; + ------------------------------------ + -- Possible_Bit_Aligned_Component -- + ------------------------------------ + + function Possible_Bit_Aligned_Component (N : Node_Id) return Boolean is + begin + case Nkind (N) is + + -- Case of indexed component + + when N_Indexed_Component => + declare + P : constant Node_Id := Prefix (N); + Ptyp : constant Entity_Id := Etype (P); + + begin + -- If we know the component size and it is less than 64, then + -- we are definitely OK. The back end always does assignment + -- of misaligned small objects correctly. + + if Known_Static_Component_Size (Ptyp) + and then Component_Size (Ptyp) <= 64 + then + return False; + + -- Otherwise, we need to test the prefix, to see if we are + -- indexing from a possibly unaligned component. + + else + return Possible_Bit_Aligned_Component (P); + end if; + end; + + -- Case of selected component + + when N_Selected_Component => + declare + P : constant Node_Id := Prefix (N); + Comp : constant Entity_Id := Entity (Selector_Name (N)); + + begin + -- If there is no component clause, then we are in the clear + -- since the back end will never misalign a large component + -- unless it is forced to do so. In the clear means we need + -- only the recursive test on the prefix. + + if No (Component_Clause (Comp)) then + return Possible_Bit_Aligned_Component (P); + + -- Otherwise we have a component clause, which means that + -- the Esize and Normalized_First_Bit fields are set and + -- contain static values known at compile time. + + else + -- If we know that we have a small (64 bits or less) record + -- or bit-packed array, then everything is fine, since the + -- back end can handle these cases correctly. + + if Esize (Comp) <= 64 + and then (Is_Record_Type (Etype (Comp)) + or else + Is_Bit_Packed_Array (Etype (Comp))) + then + return False; + + -- Otherwise if the component is not byte aligned, we + -- know we have the nasty unaligned case. + + elsif Normalized_First_Bit (Comp) /= Uint_0 + or else Esize (Comp) mod System_Storage_Unit /= Uint_0 + then + return True; + + -- If we are large and byte aligned, then OK at this level + -- but we still need to test our prefix recursively. + + else + return Possible_Bit_Aligned_Component (P); + end if; + end if; + end; + + -- If we have neither a record nor array component, it means that + -- we have fallen off the top testing prefixes recursively, and + -- we now have a stand alone object, where we don't have a problem + + when others => + return False; + + end case; + end Possible_Bit_Aligned_Component; + end Exp_Ch5; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index d51aaa8ece4..cad54ac7ba8 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -59,12 +59,14 @@ with Sem_Ch12; use Sem_Ch12; with Sem_Ch13; use Sem_Ch13; with Sem_Disp; use Sem_Disp; with Sem_Dist; use Sem_Dist; +with Sem_Eval; use Sem_Eval; with Sem_Res; use Sem_Res; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Snames; use Snames; with Stand; use Stand; with Tbuild; use Tbuild; +with Ttypes; use Ttypes; with Uintp; use Uintp; with Validsw; use Validsw; @@ -539,9 +541,15 @@ package body Exp_Ch6 is if Nkind (Actual) = N_Type_Conversion then V_Typ := Etype (Expression (Actual)); - Var := Make_Var (Expression (Actual)); - Crep := not Same_Representation - (Etype (Formal), Etype (Expression (Actual))); + + -- If the formal is an (in-)out parameter, capture the name + -- of the variable in order to build the post-call assignment. + + Var := Make_Var (Expression (Actual)); + + Crep := not Same_Representation + (Etype (Formal), Etype (Expression (Actual))); + else V_Typ := Etype (Actual); Var := Make_Var (Actual); @@ -1521,8 +1529,16 @@ package body Exp_Ch6 is if Validity_Checks_On then if Ekind (Formal) = E_In_Parameter and then Validity_Check_In_Params - and then Is_Entity_Name (Actual) then + -- If the actual is an indexed component of a packed + -- type, it has not been expanded yet. It will be + -- copied in the validity code that follows, and has + -- to be expanded appropriately, so reanalyze it. + + if Nkind (Actual) = N_Indexed_Component then + Set_Analyzed (Actual, False); + end if; + Ensure_Valid (Actual); elsif Ekind (Formal) = E_In_Out_Parameter @@ -1925,6 +1941,7 @@ package body Exp_Ch6 is Bod : Node_Id; Must_Inline : Boolean := False; Spec : constant Node_Id := Unit_Declaration_Node (Subp); + Scop : constant Entity_Id := Scope (Subp); begin -- Verify that the body to inline has already been seen, @@ -1938,6 +1955,26 @@ package body Exp_Ch6 is then Must_Inline := False; + -- If this an inherited function that returns a private + -- type, do not inline if the full view is an unconstrained + -- array, because such calls cannot be inlined. + + elsif Present (Orig_Subp) + and then Is_Array_Type (Etype (Orig_Subp)) + and then not Is_Constrained (Etype (Orig_Subp)) + then + Must_Inline := False; + + -- If the subprogram comes from an instance in the same + -- unit, and the instance is not yet frozen, inlining might + -- trigger order-of-elaboration problems in gigi. + + elsif Is_Generic_Instance (Scop) + and then Present (Freeze_Node (Scop)) + and then not Analyzed (Freeze_Node (Scop)) + then + Must_Inline := False; + else Bod := Body_To_Inline (Spec); @@ -2515,7 +2552,8 @@ package body Exp_Ch6 is Temp_Typ := Etype (A); end if; - -- Comments needed here ??? + -- If the actual is a simple name or a literal, no need to + -- create a temporary, object can be used directly. if (Is_Entity_Name (A) and then @@ -2849,6 +2887,8 @@ package body Exp_Ch6 is -- Reset Pure indication if any parameter has root type System.Address + -- Wrap thread body + procedure Expand_N_Subprogram_Body (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); H : constant Node_Id := Handled_Statement_Sequence (N); @@ -2866,6 +2906,9 @@ package body Exp_Ch6 is -- the latter test is not critical, it does not matter if we add a -- few extra returns, since they get eliminated anyway later on. + procedure Expand_Thread_Body; + -- Perform required expansion of a thread body + ---------------- -- Add_Return -- ---------------- @@ -2882,6 +2925,168 @@ package body Exp_Ch6 is end if; end Add_Return; + ------------------------ + -- Expand_Thread_Body -- + ------------------------ + + -- The required expansion of a thread body is as follows + + -- procedure is + + -- _Secondary_Stack : aliased + -- Storage_Elements.Storage_Array + -- (1 .. Storage_Offset (Sec_Stack_Size)); + -- for _Secondary_Stack'Alignment use Standard'Maximum_Alignment; + + -- _Process_ATSD : aliased System.Threads.ATSD; + + -- begin + -- System.Threads.Thread_Body_Enter; + -- (_Secondary_Stack'Address, + -- _Secondary_Stack'Length, + -- _Process_ATSD'Address); + + -- declare + -- + -- begin + -- + -- + -- end; + + -- System.Threads.Thread_Body_Leave; + + -- exception + -- when E : others => + -- System.Threads.Thread_Body_Exceptional_Exit (E); + -- end; + + -- Note the exception handler is omitted if pragma Restriction + -- No_Exception_Handlers is currently active. + + procedure Expand_Thread_Body is + User_Decls : constant List_Id := Declarations (N); + Sec_Stack_Len : Node_Id; + + TB_Pragma : constant Node_Id := + Get_Rep_Pragma (Spec_Id, Name_Thread_Body); + + Ent_SS : Entity_Id; + Ent_ATSD : Entity_Id; + Ent_EO : Entity_Id; + + Decl_SS : Node_Id; + Decl_ATSD : Node_Id; + + Excep_Handlers : List_Id; + + begin + New_Scope (Spec_Id); + + -- Get proper setting for secondary stack size + + if List_Length (Pragma_Argument_Associations (TB_Pragma)) = 2 then + Sec_Stack_Len := + Expression (Last (Pragma_Argument_Associations (TB_Pragma))); + else + Sec_Stack_Len := + Make_Integer_Literal (Loc, + Intval => + Expr_Value + (Constant_Value (RTE (RE_Default_Secondary_Stack_Size)))); + end if; + + Sec_Stack_Len := Convert_To (RTE (RE_Storage_Offset), Sec_Stack_Len); + + -- Build and set declarations for the wrapped thread body + + Ent_SS := Make_Defining_Identifier (Loc, Name_uSecondary_Stack); + Ent_ATSD := Make_Defining_Identifier (Loc, Name_uProcess_ATSD); + + Decl_SS := + Make_Object_Declaration (Loc, + Defining_Identifier => Ent_SS, + Aliased_Present => True, + Object_Definition => + Make_Subtype_Indication (Loc, + Subtype_Mark => + New_Occurrence_Of (RTE (RE_Storage_Array), Loc), + Constraint => + Make_Index_Or_Discriminant_Constraint (Loc, + Constraints => New_List ( + Make_Range (Loc, + Low_Bound => Make_Integer_Literal (Loc, 1), + High_Bound => Sec_Stack_Len))))); + + Decl_ATSD := + Make_Object_Declaration (Loc, + Defining_Identifier => Ent_ATSD, + Aliased_Present => True, + Object_Definition => New_Occurrence_Of (RTE (RE_ATSD), Loc)); + + Set_Declarations (N, New_List (Decl_SS, Decl_ATSD)); + Analyze (Decl_SS); + Analyze (Decl_ATSD); + Set_Alignment (Ent_SS, UI_From_Int (Maximum_Alignment)); + + -- Create new exception handler + + if Restrictions (No_Exception_Handlers) then + Excep_Handlers := No_List; + + else + Check_Restriction (No_Exception_Handlers, N); + + Ent_EO := Make_Defining_Identifier (Loc, Name_uE); + + Excep_Handlers := New_List ( + Make_Exception_Handler (Loc, + Choice_Parameter => Ent_EO, + Exception_Choices => New_List ( + Make_Others_Choice (Loc)), + Statements => New_List ( + Make_Procedure_Call_Statement (Loc, + Name => + New_Occurrence_Of + (RTE (RE_Thread_Body_Exceptional_Exit), Loc), + Parameter_Associations => New_List ( + New_Occurrence_Of (Ent_EO, Loc)))))); + end if; + + -- Now build new handled statement sequence and analyze it + + Set_Handled_Statement_Sequence (N, + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List ( + + Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (RTE (RE_Thread_Body_Enter), Loc), + Parameter_Associations => New_List ( + + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Ent_SS, Loc), + Attribute_Name => Name_Address), + + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Ent_SS, Loc), + Attribute_Name => Name_Length), + + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Ent_ATSD, Loc), + Attribute_Name => Name_Address))), + + Make_Block_Statement (Loc, + Declarations => User_Decls, + Handled_Statement_Sequence => H), + + Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (RTE (RE_Thread_Body_Leave), Loc))), + + Exception_Handlers => Excep_Handlers)); + + Analyze (Handled_Statement_Sequence (N)); + End_Scope; + end Expand_Thread_Body; + -- Start of processing for Expand_N_Subprogram_Body begin @@ -3150,6 +3355,12 @@ package body Exp_Ch6 is end; end if; + -- Deal with thread body + + if Is_Thread_Body (Spec_Id) then + Expand_Thread_Body; + end if; + -- If the subprogram does not have pending instantiations, then we -- must generate the subprogram descriptor now, since the code for -- the subprogram is complete, and this is our last chance. However diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index f9844cd3b33..e9e80532048 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1074,6 +1074,76 @@ package body Exp_Ch7 is if No (Wrap_Node) then null; + elsif Nkind (Wrap_Node) = N_Iteration_Scheme then + + -- Create a declaration followed by an assignment, so that + -- the assignment can have its own transient scope. + -- We generate the equivalent of: + + -- type Ptr is access all expr_type; + -- Var : Ptr; + -- begin + -- Var := Expr'reference; + -- end; + + -- This closely resembles what is done in Remove_Side_Effect, + -- but it has to be done here, before the analysis of the call + -- is completed. + + declare + Ptr_Typ : constant Entity_Id := + Make_Defining_Identifier (Loc, + Chars => New_Internal_Name ('A')); + Ptr : constant Entity_Id := + Make_Defining_Identifier (Loc, + Chars => New_Internal_Name ('T')); + + Expr_Type : constant Entity_Id := Etype (N); + New_Expr : constant Node_Id := Relocate_Node (N); + Decl : Node_Id; + Ptr_Typ_Decl : Node_Id; + Stmt : Node_Id; + + begin + Ptr_Typ_Decl := + Make_Full_Type_Declaration (Loc, + Defining_Identifier => Ptr_Typ, + Type_Definition => + Make_Access_To_Object_Definition (Loc, + All_Present => True, + Subtype_Indication => + New_Reference_To (Expr_Type, Loc))); + + Decl := + Make_Object_Declaration (Loc, + Defining_Identifier => Ptr, + Object_Definition => New_Occurrence_Of (Ptr_Typ, Loc)); + + Set_Etype (Ptr, Ptr_Typ); + Stmt := + Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of (Ptr, Loc), + Expression => Make_Reference (Loc, New_Expr)); + + Set_Analyzed (New_Expr, False); + + Insert_List_Before_And_Analyze + (Parent (Wrap_Node), + New_List ( + Ptr_Typ_Decl, + Decl, + Make_Block_Statement (Loc, + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, + New_List (Stmt))))); + + Rewrite (N, + Make_Explicit_Dereference (Loc, + Prefix => New_Reference_To (Ptr, Loc))); + Analyze_And_Resolve (N, Expr_Type); + + end; + -- Transient scope is required else @@ -1815,14 +1885,12 @@ package body Exp_Ch7 is return The_Parent; end if; - -- ??? No scheme yet for "for I in Expression'Range loop" - -- ??? the current scheme for Expression wrapping doesn't apply - -- ??? because a RANGE is NOT an expression. Tricky problem... - -- ??? while this problem is not solved we have a potential for - -- ??? leak and unfinalized intermediate objects here. + -- If the expression is within the iteration scheme of a loop, + -- we must create a declaration for it, followed by an assignment + -- in order to have a usable statement to wrap. when N_Loop_Parameter_Specification => - return Empty; + return Parent (The_Parent); -- The following nodes contains "dummy calls" which don't -- need to be wrapped. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 08c824dcedd..f8bf7f80a6c 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -69,8 +69,7 @@ package body Exp_Ch9 is (Sloc : Source_Ptr; Ent : Entity_Id; Index : Node_Id; - Tsk : Entity_Id) - return Node_Id; + Tsk : Entity_Id) return Node_Id; -- Compute the index position for an entry call. Tsk is the target -- task. If the bounds of some entry family depend on discriminants, -- the expression computed by this function uses the discriminants @@ -79,8 +78,7 @@ package body Exp_Ch9 is function Index_Constant_Declaration (N : Node_Id; Index_Id : Entity_Id; - Prot : Entity_Id) - return List_Id; + Prot : Entity_Id) return List_Id; -- For an entry family and its barrier function, we define a local entity -- that maps the index in the call into the entry index into the object: -- @@ -105,23 +103,20 @@ package body Exp_Ch9 is function Build_Barrier_Function (N : Node_Id; Ent : Entity_Id; - Pid : Node_Id) - return Node_Id; + Pid : Node_Id) return Node_Id; -- Build the function body returning the value of the barrier expression -- for the specified entry body. function Build_Barrier_Function_Specification (Def_Id : Entity_Id; - Loc : Source_Ptr) - return Node_Id; + Loc : Source_Ptr) return Node_Id; -- Build a specification for a function implementing -- the protected entry barrier of the specified entry body. function Build_Corresponding_Record (N : Node_Id; Ctyp : Node_Id; - Loc : Source_Ptr) - return Node_Id; + Loc : Source_Ptr) return Node_Id; -- Common to tasks and protected types. Copy discriminant specifications, -- build record declaration. N is the type declaration, Ctyp is the -- concurrent entity (task type or protected type). @@ -129,40 +124,33 @@ package body Exp_Ch9 is function Build_Entry_Count_Expression (Concurrent_Type : Node_Id; Component_List : List_Id; - Loc : Source_Ptr) - return Node_Id; + Loc : Source_Ptr) return Node_Id; -- Compute number of entries for concurrent object. This is a count of -- simple entries, followed by an expression that computes the length -- of the range of each entry family. A single array with that size is -- allocated for each concurrent object of the type. - function Build_Find_Body_Index - (Typ : Entity_Id) - return Node_Id; + function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id; -- Build the function that translates the entry index in the call -- (which depends on the size of entry families) into an index into the -- Entry_Bodies_Array, to determine the body and barrier function used -- in a protected entry call. A pointer to this function appears in every -- protected object. - function Build_Find_Body_Index_Spec - (Typ : Entity_Id) - return Node_Id; - -- Build subprogram declaration for previous one. + function Build_Find_Body_Index_Spec (Typ : Entity_Id) return Node_Id; + -- Build subprogram declaration for previous one function Build_Protected_Entry - (N : Node_Id; - Ent : Entity_Id; - Pid : Node_Id) - return Node_Id; + (N : Node_Id; + Ent : Entity_Id; + Pid : Node_Id) return Node_Id; -- Build the procedure implementing the statement sequence of -- the specified entry body. function Build_Protected_Entry_Specification (Def_Id : Entity_Id; Ent_Id : Entity_Id; - Loc : Source_Ptr) - return Node_Id; + Loc : Source_Ptr) return Node_Id; -- Build a specification for a procedure implementing -- the statement sequence of the specified entry body. -- Add attributes associating it with the entry defining identifier @@ -171,8 +159,7 @@ package body Exp_Ch9 is function Build_Protected_Subprogram_Body (N : Node_Id; Pid : Node_Id; - N_Op_Spec : Node_Id) - return Node_Id; + N_Op_Spec : Node_Id) return Node_Id; -- This function is used to construct the protected version of a protected -- subprogram. Its statement sequence first defers abortion, then locks -- the associated protected object, and then enters a block that contains @@ -185,8 +172,7 @@ package body Exp_Ch9 is (N : Node_Id; Obj_Type : Entity_Id; Unprotected : Boolean := False; - Ident : Entity_Id) - return List_Id; + Ident : Entity_Id) return List_Id; -- Utility shared by Build_Protected_Sub_Spec and Expand_Access_Protected_ -- Subprogram_Type. Builds signature of protected subprogram, adding the -- formal that corresponds to the object itself. For an access to protected @@ -197,8 +183,7 @@ package body Exp_Ch9 is function Build_Selected_Name (Prefix, Selector : Name_Id; - Append_Char : Character := ' ') - return Name_Id; + Append_Char : Character := ' ') return Name_Id; -- Build a name in the form of Prefix__Selector, with an optional -- character appended. This is used for internal subprograms generated -- for operations of protected types, including barrier functions. In @@ -227,9 +212,8 @@ package body Exp_Ch9 is -- value type that is associated with the task type. function Build_Unprotected_Subprogram_Body - (N : Node_Id; - Pid : Node_Id) - return Node_Id; + (N : Node_Id; + Pid : Node_Id) return Node_Id; -- This routine constructs the unprotected version of a protected -- subprogram body, which is contains all of the code in the -- original, unexpanded body. This is the version of the protected @@ -248,8 +232,7 @@ package body Exp_Ch9 is (Loc : Source_Ptr; Hi : Node_Id; Lo : Node_Id; - Ttyp : Entity_Id) - return Node_Id; + Ttyp : Entity_Id) return Node_Id; -- Compute (Hi - Lo) for two entry family indices. Hi is the index in -- an accept statement, or the upper bound in the discrete subtype of -- an entry declaration. Lo is the corresponding lower bound. Ttyp is @@ -259,8 +242,7 @@ package body Exp_Ch9 is (Loc : Source_Ptr; Hi : Node_Id; Lo : Node_Id; - Ttyp : Entity_Id) - return Node_Id; + Ttyp : Entity_Id) return Node_Id; -- Compute (Hi - Lo) + 1 Max 0, to determine the number of entries in -- a family, and handle properly the superflat case. This is equivalent -- to the use of 'Length on the index type, but must use Family_Offset @@ -275,9 +257,8 @@ package body Exp_Ch9 is -- the entry name, and the entry family index. function Find_Task_Or_Protected_Pragma - (T : Node_Id; - P : Name_Id) - return Node_Id; + (T : Node_Id; + P : Name_Id) return Node_Id; -- Searches the task or protected definition T for the first occurrence -- of the pragma whose name is given by P. The caller has ensured that -- the pragma is present in the task definition. A special case is that @@ -302,8 +283,7 @@ package body Exp_Ch9 is (Sloc : Source_Ptr; Ent : Entity_Id; Index : Node_Id; - Tsk : Entity_Id) - return Node_Id + Tsk : Entity_Id) return Node_Id is Ttyp : constant Entity_Id := Etype (Tsk); Expr : Node_Id; @@ -746,8 +726,7 @@ package body Exp_Ch9 is function Build_Barrier_Function (N : Node_Id; Ent : Entity_Id; - Pid : Node_Id) - return Node_Id + Pid : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Ent_Formals : constant Node_Id := Entry_Body_Formal_Part (N); @@ -816,8 +795,7 @@ package body Exp_Ch9 is function Build_Barrier_Function_Specification (Def_Id : Entity_Id; - Loc : Source_Ptr) - return Node_Id + Loc : Source_Ptr) return Node_Id is begin return Make_Function_Specification (Loc, @@ -841,9 +819,8 @@ package body Exp_Ch9 is -------------------------- function Build_Call_With_Task - (N : Node_Id; - E : Entity_Id) - return Node_Id + (N : Node_Id; + E : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); @@ -861,8 +838,7 @@ package body Exp_Ch9 is function Build_Corresponding_Record (N : Node_Id; Ctyp : Entity_Id; - Loc : Source_Ptr) - return Node_Id + Loc : Source_Ptr) return Node_Id is Rec_Ent : constant Entity_Id := Make_Defining_Identifier @@ -941,8 +917,7 @@ package body Exp_Ch9 is function Build_Entry_Count_Expression (Concurrent_Type : Node_Id; Component_List : List_Id; - Loc : Source_Ptr) - return Node_Id + Loc : Source_Ptr) return Node_Id is Eindx : Nat; Ent : Entity_Id; @@ -999,10 +974,7 @@ package body Exp_Ch9 is -- Build_Find_Body_Index -- --------------------------- - function Build_Find_Body_Index - (Typ : Entity_Id) - return Node_Id - is + function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Typ); Ent : Entity_Id; E_Typ : Entity_Id; @@ -1192,10 +1164,7 @@ package body Exp_Ch9 is -- Build_Find_Body_Index_Spec -- -------------------------------- - function Build_Find_Body_Index_Spec - (Typ : Entity_Id) - return Node_Id - is + function Build_Find_Body_Index_Spec (Typ : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Typ); Id : constant Entity_Id := Make_Defining_Identifier (Loc, @@ -1285,10 +1254,9 @@ package body Exp_Ch9 is --------------------------- function Build_Protected_Entry - (N : Node_Id; - Ent : Entity_Id; - Pid : Node_Id) - return Node_Id + (N : Node_Id; + Ent : Entity_Id; + Pid : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Op_Decls : constant List_Id := New_List; @@ -1401,8 +1369,7 @@ package body Exp_Ch9 is function Build_Protected_Entry_Specification (Def_Id : Entity_Id; Ent_Id : Entity_Id; - Loc : Source_Ptr) - return Node_Id + Loc : Source_Ptr) return Node_Id is P : Entity_Id; @@ -1440,8 +1407,7 @@ package body Exp_Ch9 is (N : Node_Id; Obj_Type : Entity_Id; Unprotected : Boolean := False; - Ident : Entity_Id) - return List_Id + Ident : Entity_Id) return List_Id is Loc : constant Source_Ptr := Sloc (N); Formal : Entity_Id; @@ -1494,8 +1460,7 @@ package body Exp_Ch9 is function Build_Protected_Sub_Specification (N : Node_Id; Prottyp : Entity_Id; - Unprotected : Boolean := False) - return Node_Id + Unprotected : Boolean := False) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Decl : Node_Id; @@ -1556,8 +1521,7 @@ package body Exp_Ch9 is function Build_Protected_Subprogram_Body (N : Node_Id; Pid : Node_Id; - N_Op_Spec : Node_Id) - return Node_Id + N_Op_Spec : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Op_Spec : Node_Id; @@ -1573,9 +1537,8 @@ package body Exp_Ch9 is Service_Name : Node_Id; Service_Stmt : Node_Id; R : Node_Id; - Return_Stmt : Node_Id := Empty; - Pre_Stmts : List_Id := No_List; - -- Initializations to avoid spurious warnings from GCC3. + Return_Stmt : Node_Id := Empty; -- init to avoid gcc 3 warning + Pre_Stmts : List_Id := No_List; -- init to avoid gcc 3 warning Stmts : List_Id; Object_Parm : Node_Id; Exc_Safe : Boolean; @@ -1906,7 +1869,6 @@ package body Exp_Ch9 is then Add_Shared_Var_Lock_Procs (N); end if; - end Build_Protected_Subprogram_Call; ------------------------- @@ -1915,8 +1877,7 @@ package body Exp_Ch9 is function Build_Selected_Name (Prefix, Selector : Name_Id; - Append_Char : Character := ' ') - return Name_Id + Append_Char : Character := ' ') return Name_Id is Select_Buffer : String (1 .. Hostparm.Max_Name_Length); Select_Len : Natural; @@ -2336,7 +2297,6 @@ package body Exp_Ch9 is Analyze (N); end; - end Build_Simple_Entry_Call; -------------------------------- @@ -2352,7 +2312,7 @@ package body Exp_Ch9 is begin -- Get the activation chain entity. Except in the case of a package - -- body, this is in the node that was passed. For a package body, we + -- body, this is in the node that w as passed. For a package body, we -- have to find the corresponding package declaration node. if Nkind (N) = N_Package_Body then @@ -2424,7 +2384,6 @@ package body Exp_Ch9 is Analyze (Call); Check_Task_Activation (N); end if; - end Build_Task_Activation_Call; ------------------------------- @@ -2492,9 +2451,63 @@ package body Exp_Ch9 is Append_To (Actions, Block); Set_Activation_Chain_Entity (Block, Chain); - end Build_Task_Allocate_Block; + ----------------------------------------------- + -- Build_Task_Allocate_Block_With_Init_Stmts -- + ----------------------------------------------- + + procedure Build_Task_Allocate_Block_With_Init_Stmts + (Actions : List_Id; + N : Node_Id; + Init_Stmts : List_Id) + is + Loc : constant Source_Ptr := Sloc (N); + Chain : constant Entity_Id := + Make_Defining_Identifier (Loc, Name_uChain); + Blkent : Entity_Id; + Block : Node_Id; + + begin + Blkent := Make_Defining_Identifier (Loc, New_Internal_Name ('A')); + + Append_To (Init_Stmts, + Make_Procedure_Call_Statement (Loc, + Name => New_Reference_To (RTE (RE_Activate_Tasks), Loc), + Parameter_Associations => New_List ( + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Chain, Loc), + Attribute_Name => Name_Unchecked_Access)))); + + Block := + Make_Block_Statement (Loc, + Identifier => New_Reference_To (Blkent, Loc), + Declarations => New_List ( + + -- _Chain : Activation_Chain; + + Make_Object_Declaration (Loc, + Defining_Identifier => Chain, + Aliased_Present => True, + Object_Definition => + New_Reference_To (RTE (RE_Activation_Chain), Loc))), + + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, Init_Stmts), + + Has_Created_Identifier => True, + Is_Task_Allocation_Block => True); + + Append_To (Actions, + Make_Implicit_Label_Declaration (Loc, + Defining_Identifier => Blkent, + Label_Construct => Block)); + + Append_To (Actions, Block); + + Set_Activation_Chain_Entity (Block, Chain); + end Build_Task_Allocate_Block_With_Init_Stmts; + ----------------------------------- -- Build_Task_Proc_Specification -- ----------------------------------- @@ -2531,7 +2544,6 @@ package body Exp_Ch9 is Subtype_Mark => New_Reference_To (Corresponding_Record_Type (T), Loc))))); - end Build_Task_Proc_Specification; --------------------------------------- @@ -2539,9 +2551,8 @@ package body Exp_Ch9 is --------------------------------------- function Build_Unprotected_Subprogram_Body - (N : Node_Id; - Pid : Node_Id) - return Node_Id + (N : Node_Id; + Pid : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); N_Op_Spec : Node_Id; @@ -2563,7 +2574,6 @@ package body Exp_Ch9 is Declarations => Op_Decls, Handled_Statement_Sequence => Handled_Statement_Sequence (N)); - end Build_Unprotected_Subprogram_Body; ---------------------------- @@ -2800,9 +2810,8 @@ package body Exp_Ch9 is ------------------------ function Convert_Concurrent - (N : Node_Id; - Typ : Entity_Id) - return Node_Id + (N : Node_Id; + Typ : Entity_Id) return Node_Id is begin if not Is_Concurrent_Type (Typ) then @@ -2822,8 +2831,7 @@ package body Exp_Ch9 is (Sloc : Source_Ptr; Ent : Entity_Id; Index : Node_Id; - Ttyp : Entity_Id) - return Node_Id + Ttyp : Entity_Id) return Node_Id is Expr : Node_Id; Num : Node_Id; @@ -4550,7 +4558,6 @@ package body Exp_Ch9 is Set_Privals (Dec, Next_Op, Loc); Set_Discriminals (Dec); end if; - end Expand_N_Entry_Body; ----------------------------------- @@ -6049,7 +6056,6 @@ package body Exp_Ch9 is Make_Aggregate (Loc, Expressions => New_List (Null_Body, Expr))); Num_Accept := Num_Accept + 1; - end Add_Accept; ---------------------------- @@ -7716,8 +7722,7 @@ package body Exp_Ch9 is (Loc : Source_Ptr; Hi : Node_Id; Lo : Node_Id; - Ttyp : Entity_Id) - return Node_Id + Ttyp : Entity_Id) return Node_Id is function Convert_Discriminant_Ref (Bound : Node_Id) return Node_Id; -- If one of the bounds is a reference to a discriminant, replace @@ -7790,8 +7795,7 @@ package body Exp_Ch9 is (Loc : Source_Ptr; Hi : Node_Id; Lo : Node_Id; - Ttyp : Entity_Id) - return Node_Id + Ttyp : Entity_Id) return Node_Id is Ityp : Entity_Id; @@ -7820,9 +7824,8 @@ package body Exp_Ch9 is ----------------------------------- function Find_Task_Or_Protected_Pragma - (T : Node_Id; - P : Name_Id) - return Node_Id + (T : Node_Id; + P : Name_Id) return Node_Id is N : Node_Id; @@ -7898,8 +7901,7 @@ package body Exp_Ch9 is function Index_Constant_Declaration (N : Node_Id; Index_Id : Entity_Id; - Prot : Entity_Id) - return List_Id + Prot : Entity_Id) return List_Id is Loc : constant Source_Ptr := Sloc (N); Decls : constant List_Id := New_List; @@ -8003,8 +8005,7 @@ package body Exp_Ch9 is -------------------------------- function Make_Initialize_Protection - (Protect_Rec : Entity_Id) - return List_Id + (Protect_Rec : Entity_Id) return List_Id is Loc : constant Source_Ptr := Sloc (Protect_Rec); P_Arr : Entity_Id; diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads index 76a888ed6d7..72060781470 100644 --- a/gcc/ada/exp_ch9.ads +++ b/gcc/ada/exp_ch9.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -164,6 +164,15 @@ package Exp_Ch9 is -- the Master_Id of the access type as the _Master parameter, and _Chain -- (defined above) as the _Chain parameter. + procedure Build_Task_Allocate_Block_With_Init_Stmts + (Actions : List_Id; + N : Node_Id; + Init_Stmts : List_Id); + -- Ada0Y (AI-287): Similar to previous routine, but used to expand alloca- + -- ted aggregates with default initialized components. Init_Stmts contains + -- the list of statements required to initialize the allocated aggregate. + -- It replaces the call to Init (Args) done by Build_Task_Allocate_Block. + function Concurrent_Ref (N : Node_Id) return Node_Id; -- Given the name of a concurrent object (task or protected object), or -- the name of an access to a concurrent object, this function returns an diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index c9ba3be354f..0d203b6d289 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -922,10 +922,11 @@ package body Exp_Disp is -- Register_Tag (Dt_Ptr); - -- Skip this if routine not available + -- Skip this if routine not available, or in No_Run_Time mode if RTE_Available (RE_Register_Tag) and then Is_RTE (Generalized_Tag, RE_Tag) + and then not No_Run_Time_Mode then Append_To (Elab_Code, Make_Procedure_Call_Statement (Loc, diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 7cc74834745..6c3911c740d 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -3510,7 +3510,7 @@ package body Exp_Util is Make_Object_Declaration (Loc, Defining_Identifier => Def_Id, Object_Definition => New_Reference_To (Exp_Type, Loc), - Constant_Present => True, + Constant_Present => not Is_Variable (Exp), Expression => Relocate_Node (Exp)); Set_Assignment_OK (E); diff --git a/gcc/ada/expect.c b/gcc/ada/expect.c index 3a86ffdf87c..54952268517 100644 --- a/gcc/ada/expect.c +++ b/gcc/ada/expect.c @@ -72,7 +72,7 @@ __gnat_kill (int pid, int sig) } int -__gnat_expect_fork () +__gnat_expect_fork (void) { return 0; } @@ -159,7 +159,7 @@ __gnat_pipe (int *fd) } int -__gnat_expect_fork () +__gnat_expect_fork (void) { return -1; } @@ -299,7 +299,7 @@ __gnat_pipe (int *fd) } int -__gnat_expect_fork () +__gnat_expect_fork (void) { return fork (); } @@ -406,7 +406,7 @@ __gnat_pipe (int *fd) } int -__gnat_expect_fork () +__gnat_expect_fork (void) { return -1; } diff --git a/gcc/ada/final.c b/gcc/ada/final.c index 0fda97b98ee..c17c6769b52 100644 --- a/gcc/ada/final.c +++ b/gcc/ada/final.c @@ -38,6 +38,6 @@ extern void __gnat_finalize (void); where finalization is required. */ void -__gnat_finalize () +__gnat_finalize (void) { } diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb index f65d88781a0..0c7ec893ce2 100644 --- a/gcc/ada/fmap.adb +++ b/gcc/ada/fmap.adb @@ -292,7 +292,7 @@ package body Fmap is then Write_Str ("warning: mapping file """); Write_Str (File_Name); - Write_Line (""" is incorrectly formated"); + Write_Line (""" is incorrectly formatted"); Empty_Tables; return; end if; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 18f77f04283..812ea693e52 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -124,7 +124,12 @@ package body Freeze is -- a subprogram type (i.e. an access to a subprogram). function Is_Fully_Defined (T : Entity_Id) return Boolean; - -- true if T is not private, or has a full view. + -- True if T is not private and has no private components, or has a full + -- view. Used to determine whether the designated type of an access type + -- should be frozen when the access type is frozen. This is done when an + -- allocator is frozen, or an expression that may involve attributes of + -- the designated type. Otherwise freezing the access type does not freeze + -- the designated type. procedure Process_Default_Expressions (E : Entity_Id; @@ -1812,16 +1817,19 @@ package body Freeze is -- fields with component clauses, where we must check the size. -- This is not done till the freeze point, since for fixed-point -- types, we do not know the size until the type is frozen. + -- Similar processing applies to bit packed arrays. if Is_First_Subtype (Rec) then Comp := First_Component (Rec); while Present (Comp) loop if Present (Component_Clause (Comp)) - and then Is_Fixed_Point_Type (Etype (Comp)) + and then (Is_Fixed_Point_Type (Etype (Comp)) + or else + Is_Bit_Packed_Array (Etype (Comp))) then Check_Size - (Component_Clause (Comp), + (Component_Name (Component_Clause (Comp)), Etype (Comp), Esize (Comp), Junk); @@ -2377,6 +2385,29 @@ package body Freeze is end if; end if; + -- For bit-packed arrays, check the size + + if Is_Bit_Packed_Array (E) + and then Known_Esize (E) + then + declare + Discard : Boolean; + SizC : constant Node_Id := Size_Clause (E); + + begin + -- It is not clear if it is possible to have no size + -- clause at this stage, but this is not worth worrying + -- about. Post the error on the entity name in the size + -- clause if present, else on the type entity itself. + + if Present (SizC) then + Check_Size (Name (SizC), E, Esize (E), Discard); + else + Check_Size (E, E, Esize (E), Discard); + end if; + end; + end if; + -- Check one common case of a size given where the array -- needs to be packed, but was not so the size cannot be -- honored. This would of course be caught by the backend, @@ -4246,15 +4277,38 @@ package body Freeze is -- Is_Fully_Defined -- ----------------------- - -- Should this be in Sem_Util ??? - function Is_Fully_Defined (T : Entity_Id) return Boolean is begin if Ekind (T) = E_Class_Wide_Type then return Is_Fully_Defined (Etype (T)); - else - return not Is_Private_Type (T) - or else Present (Full_View (Base_Type (T))); + + elsif Is_Array_Type (T) then + return Is_Fully_Defined (Component_Type (T)); + + elsif Is_Record_Type (T) + and not Is_Private_Type (T) + then + -- Verify that the record type has no components with + -- private types without completion. + + declare + Comp : Entity_Id; + + begin + Comp := First_Component (T); + + while Present (Comp) loop + if not Is_Fully_Defined (Etype (Comp)) then + return False; + end if; + + Next_Component (Comp); + end loop; + return True; + end; + + else return not Is_Private_Type (T) + or else Present (Full_View (Base_Type (T))); end if; end Is_Fully_Defined; diff --git a/gcc/ada/g-awk.adb b/gcc/ada/g-awk.adb index 3396daac0e1..cece7e6de48 100644 --- a/gcc/ada/g-awk.adb +++ b/gcc/ada/g-awk.adb @@ -873,8 +873,7 @@ package body GNAT.AWK is Callbacks : Callback_Mode := None; Session : Session_Type := Current_Session) is - Filter_Active : Boolean; - Quit : Boolean; + Quit : Boolean; begin Open (Separators, Filename, Session); @@ -884,7 +883,12 @@ package body GNAT.AWK is Split_Line (Session); if Callbacks in Only .. Pass_Through then - Filter_Active := Apply_Filters (Session); + declare + Discard : Boolean; + pragma Unreferenced (Discard); + begin + Discard := Apply_Filters (Session); + end; end if; if Callbacks /= Only then diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb index ef853da04e9..4eeae1af222 100644 --- a/gcc/ada/g-debpoo.adb +++ b/gcc/ada/g-debpoo.adb @@ -116,7 +116,7 @@ package body GNAT.Debug_Pools is return Tracebacks_Array_Access; function Hash (T : Tracebacks_Array_Access) return Header; function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean; - pragma Inline (Set_Next, Next, Get_Key, Equal, Hash); + pragma Inline (Set_Next, Next, Get_Key, Hash); -- Subprograms required for instantiation of the htable. See GNAT.HTable. package Backtrace_Htable is new GNAT.HTable.Static_HTable @@ -374,7 +374,6 @@ package body GNAT.Debug_Pools is function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean is use Ada.Exceptions.Traceback; - begin return K1.all = K2.all; end Equal; diff --git a/gcc/ada/g-debuti.adb b/gcc/ada/g-debuti.adb index 1c1e29d7304..8e4480ab50b 100644 --- a/gcc/ada/g-debuti.adb +++ b/gcc/ada/g-debuti.adb @@ -39,9 +39,11 @@ package body GNAT.Debug_Utilities is H : constant array (0 .. 15) of Character := "0123456789ABCDEF"; -- Table of hex digits - -------------------------- - -- Image (address case) -- - -------------------------- + ----------- + -- Image -- + ----------- + + -- Address case function Image (A : Address) return Image_String is S : Image_String; @@ -71,9 +73,11 @@ package body GNAT.Debug_Utilities is return S; end Image; - ------------------------- - -- Image (string case) -- - ------------------------- + ----------- + -- Image -- + ----------- + + -- String case function Image (S : String) return String is W : String (1 .. 2 * S'Length + 2); diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb index ca200ebf843..321b81244c4 100644 --- a/gcc/ada/g-dirope.adb +++ b/gcc/ada/g-dirope.adb @@ -123,11 +123,17 @@ package body GNAT.Directory_Operations is Base_Name.Path (Cut_Start - Offset .. Cut_End - Offset); -- Here we use Base_Name.Path to keep the original casing + Has_Drive_Letter : constant Boolean := + OS_Lib.Path_Separator /= ':'; + -- If Path separator is not ':' then we are on a DOS based OS + -- where this character is used as a drive letter separator. + begin if BN = "." or else BN = ".." then return ""; - elsif BN'Length > 2 + elsif Has_Drive_Letter + and then BN'Length > 2 and then Characters.Handling.Is_Letter (BN (BN'First)) and then BN (BN'First + 1) = ':' then diff --git a/gcc/ada/g-memdum.adb b/gcc/ada/g-memdum.adb index fd2167c4a63..92f08392e47 100644 --- a/gcc/ada/g-memdum.adb +++ b/gcc/ada/g-memdum.adb @@ -66,7 +66,7 @@ package body GNAT.Memory_Dump is Line_Buf : String (1 .. Line_Len); - Hex : array (0 .. 15) of Character := "0123456789ABCDEF"; + Hex : constant array (0 .. 15) of Character := "0123456789ABCDEF"; type Char_Ptr is access all Character; diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb index 24f6297b639..d568d364a7a 100644 --- a/gcc/ada/g-os_lib.adb +++ b/gcc/ada/g-os_lib.adb @@ -32,6 +32,7 @@ ------------------------------------------------------------------------------ with System.Case_Util; +with System.CRTL; with System.Soft_Links; with Unchecked_Conversion; with System; use System; @@ -82,8 +83,7 @@ package body GNAT.OS_Lib is function To_Path_String_Access (Path_Addr : Address; - Path_Len : Integer) - return String_Access; + Path_Len : Integer) return String_Access; -- Converts a C String to an Ada String. We could do this making use of -- Interfaces.C.Strings but we prefer not to import that entire package @@ -143,8 +143,7 @@ package body GNAT.OS_Lib is ----------------------------- function Argument_String_To_List - (Arg_String : String) - return Argument_List_Access + (Arg_String : String) return Argument_List_Access is Max_Args : constant Integer := Arg_String'Length; New_Argv : Argument_List (1 .. Max_Args); @@ -397,8 +396,7 @@ package body GNAT.OS_Lib is function Copy_Attributes (From, To : System.Address; - Mode : Integer) - return Integer; + Mode : Integer) return Integer; pragma Import (C, Copy_Attributes, "__gnat_copy_attribs"); -- Mode = 0 - copy only time stamps. -- Mode = 1 - copy time stamps and read/write/execute attributes @@ -558,8 +556,7 @@ package body GNAT.OS_Lib is function Copy_Attributes (From, To : System.Address; - Mode : Integer) - return Integer; + Mode : Integer) return Integer; pragma Import (C, Copy_Attributes, "__gnat_copy_attribs"); -- Mode = 0 - copy only time stamps. -- Mode = 1 - copy time stamps and read/write/execute attributes @@ -611,13 +608,11 @@ package body GNAT.OS_Lib is function Create_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is function C_Create_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; pragma Import (C, C_Create_File, "__gnat_open_create"); begin @@ -626,8 +621,7 @@ package body GNAT.OS_Lib is function Create_File (Name : String; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is C_Name : String (1 .. Name'Length + 1); @@ -643,13 +637,11 @@ package body GNAT.OS_Lib is function Create_New_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is function C_Create_New_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; pragma Import (C, C_Create_New_File, "__gnat_open_new"); begin @@ -658,8 +650,7 @@ package body GNAT.OS_Lib is function Create_New_File (Name : String; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is C_Name : String (1 .. Name'Length + 1); @@ -679,8 +670,7 @@ package body GNAT.OS_Lib is is function Open_New_Temp (Name : System.Address; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; pragma Import (C, Open_New_Temp, "__gnat_open_new_temp"); begin @@ -1225,8 +1215,7 @@ package body GNAT.OS_Lib is ------------------------- function Locate_Exec_On_Path - (Exec_Name : String) - return String_Access + (Exec_Name : String) return String_Access is function Locate_Exec_On_Path (C_Exec_Name : Address) return Address; pragma Import (C, Locate_Exec_On_Path, "__gnat_locate_exec_on_path"); @@ -1262,8 +1251,7 @@ package body GNAT.OS_Lib is function Locate_Regular_File (File_Name : C_File_Name; - Path : C_File_Name) - return String_Access + Path : C_File_Name) return String_Access is function Locate_Regular_File (C_File_Name, Path_Val : Address) return Address; @@ -1291,8 +1279,7 @@ package body GNAT.OS_Lib is function Locate_Regular_File (File_Name : String; - Path : String) - return String_Access + Path : String) return String_Access is C_File_Name : String (1 .. File_Name'Length + 1); C_Path : String (1 .. Path'Length + 1); @@ -1313,8 +1300,7 @@ package body GNAT.OS_Lib is function Non_Blocking_Spawn (Program_Name : String; - Args : Argument_List) - return Process_Id + Args : Argument_List) return Process_Id is Junk : Integer; Pid : Process_Id; @@ -1428,8 +1414,7 @@ package body GNAT.OS_Lib is (Name : String; Directory : String := ""; Resolve_Links : Boolean := True; - Case_Sensitive : Boolean := True) - return String + Case_Sensitive : Boolean := True) return String is Max_Path : Integer; pragma Import (C, Max_Path, "__gnat_max_path_len"); @@ -1465,13 +1450,11 @@ package body GNAT.OS_Lib is function Readlink (Path : System.Address; Buf : System.Address; - Bufsiz : Integer) - return Integer; + Bufsiz : Integer) return Integer; pragma Import (C, Readlink, "__gnat_readlink"); function To_Canonical_File_Spec - (Host_File : System.Address) - return System.Address; + (Host_File : System.Address) return System.Address; pragma Import (C, To_Canonical_File_Spec, "__gnat_to_canonical_file_spec"); @@ -1909,13 +1892,11 @@ package body GNAT.OS_Lib is function Open_Read (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is function C_Open_Read (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; pragma Import (C, C_Open_Read, "__gnat_open_read"); begin @@ -1924,8 +1905,7 @@ package body GNAT.OS_Lib is function Open_Read (Name : String; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is C_Name : String (1 .. Name'Length + 1); @@ -1941,13 +1921,11 @@ package body GNAT.OS_Lib is function Open_Read_Write (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is function C_Open_Read_Write (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; pragma Import (C, C_Open_Read_Write, "__gnat_open_rw"); begin @@ -1956,8 +1934,7 @@ package body GNAT.OS_Lib is function Open_Read_Write (Name : String; - Fmode : Mode) - return File_Descriptor + Fmode : Mode) return File_Descriptor is C_Name : String (1 .. Name'Length + 1); @@ -1967,6 +1944,20 @@ package body GNAT.OS_Lib is return Open_Read_Write (C_Name (C_Name'First)'Address, Fmode); end Open_Read_Write; + ---------- + -- Read -- + ---------- + + function Read + (FD : File_Descriptor; + A : System.Address; + N : Integer) return Integer + is + begin + return Integer (System.CRTL.read + (System.CRTL.int (FD), System.CRTL.chars (A), System.CRTL.int (N))); + end Read; + ----------------- -- Rename_File -- ----------------- @@ -2031,8 +2022,7 @@ package body GNAT.OS_Lib is function Spawn (Program_Name : String; - Args : Argument_List) - return Integer + Args : Argument_List) return Integer is Junk : Process_Id; Result : Integer; @@ -2173,8 +2163,7 @@ package body GNAT.OS_Lib is function To_Path_String_Access (Path_Addr : Address; - Path_Len : Integer) - return String_Access + Path_Len : Integer) return String_Access is subtype Path_String is String (1 .. Path_Len); type Path_String_Access is access Path_String; @@ -2213,4 +2202,18 @@ package body GNAT.OS_Lib is Success := (Status = 0); end Wait_Process; + ----------- + -- Write -- + ----------- + + function Write + (FD : File_Descriptor; + A : System.Address; + N : Integer) return Integer + is + begin + return Integer (System.CRTL.write + (System.CRTL.int (FD), System.CRTL.chars (A), System.CRTL.int (N))); + end Write; + end GNAT.OS_Lib; diff --git a/gcc/ada/g-os_lib.ads b/gcc/ada/g-os_lib.ads index f7cf85bb3fc..8b317fdc2ca 100644 --- a/gcc/ada/g-os_lib.ads +++ b/gcc/ada/g-os_lib.ads @@ -175,31 +175,27 @@ pragma Elaborate_Body (OS_Lib); function Open_Read (Name : String; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; -- Open file Name for reading, returning file descriptor File descriptor -- returned is Invalid_FD if file cannot be opened. function Open_Read_Write (Name : String; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; -- Open file Name for both reading and writing, returning file -- descriptor. File descriptor returned is Invalid_FD if file cannot be -- opened. function Create_File (Name : String; - Fmode : Mode) - return File_Descriptor; + 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 function Create_New_File (Name : String; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; -- Create new file with given name for writing, returning file descriptor -- for subsequent use in Write calls. This differs from Create_File in -- that it fails if the file already exists. File descriptor returned is @@ -334,18 +330,14 @@ pragma Elaborate_Body (OS_Lib); function Read (FD : File_Descriptor; A : System.Address; - N : Integer) - return Integer; - pragma Import (C, Read, "read"); + N : Integer) return Integer; -- Read N bytes to address A from file referenced by FD. Returned value -- is count of bytes actually read, which can be less than N at EOF. function Write (FD : File_Descriptor; A : System.Address; - N : Integer) - return Integer; - pragma Import (C, Write, "write"); + N : Integer) return Integer; -- Write N bytes from address A to file referenced by FD. The returned -- value is the number of bytes written, which can be less than N if -- a disk full condition was detected. @@ -359,7 +351,7 @@ pragma Elaborate_Body (OS_Lib); (FD : File_Descriptor; offset : Long_Integer; origin : Integer); - pragma Import (C, Lseek, "lseek"); + pragma Import (C, Lseek, "__gnat_lseek"); -- Sets the current file pointer to the indicated offset value, -- relative to the current position (origin = SEEK_CUR), end of -- file (origin = SEEK_END), or start of file (origin = SEEK_SET). @@ -379,8 +371,7 @@ pragma Elaborate_Body (OS_Lib); (Name : String; Directory : String := ""; Resolve_Links : Boolean := True; - Case_Sensitive : Boolean := True) - return String; + Case_Sensitive : Boolean := True) return String; -- Returns a file name as an absolute path name, resolving all relative -- directories, and symbolic links. The parameter Directory is a fully -- resolved path name for a directory, or the empty string (the default). @@ -416,15 +407,21 @@ pragma Elaborate_Body (OS_Lib); function Is_Absolute_Path (Name : String) return Boolean; -- Returns True if Name is an absolute path name, i.e. it designates - -- a directory absolutely, rather than relative to another directory. + -- a file or a directory absolutely, rather than relative to another + -- directory. function Is_Regular_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing - -- regular file. Returns True if so, False otherwise. + -- regular file. Returns True if so, False otherwise. Name may be an + -- absolute path name or a relative path name, including a simple file + -- name. If it is a relative path name, it is relative to the current + -- working directory. function Is_Directory (Name : String) return Boolean; -- Determines if the given string, Name, is the name of a directory. - -- Returns True if so, False otherwise. + -- Returns True if so, False otherwise. Name may be an absolute path + -- name or a relative path name, including a simple file name. If it is + -- a relative path name, it is relative to the current working directory. function Is_Readable_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing @@ -452,8 +449,7 @@ pragma Elaborate_Body (OS_Lib); -- span file systems and may refer to directories. function Locate_Exec_On_Path - (Exec_Name : String) - return String_Access; + (Exec_Name : String) return String_Access; -- Try to locate an executable whose name is given by Exec_Name in the -- directories listed in the environment Path. If the Exec_Name doesn't -- have the executable suffix, it will be appended before the search. @@ -464,8 +460,7 @@ pragma Elaborate_Body (OS_Lib); function Locate_Regular_File (File_Name : String; - Path : String) - return String_Access; + Path : String) return String_Access; -- Try to locate a regular file whose name is given by File_Name in the -- directories listed in Path. If a file is found, its full pathname is -- returned; otherwise, a null pointer is returned. If the File_Name given @@ -505,25 +500,23 @@ pragma Elaborate_Body (OS_Lib); -- This subtype is used to document that a parameter is the address -- of a null-terminated string containing the name of a file. + -- All the following functions need comments ??? + function Open_Read (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; function Open_Read_Write (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; function Create_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; function Create_New_File (Name : C_File_Name; - Fmode : Mode) - return File_Descriptor; + Fmode : Mode) return File_Descriptor; procedure Delete_File (Name : C_File_Name; Success : out Boolean); diff --git a/gcc/ada/g-signal.adb b/gcc/ada/g-signal.adb new file mode 100644 index 00000000000..605b3e72f91 --- /dev/null +++ b/gcc/ada/g-signal.adb @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUNTIME COMPONENTS -- +-- -- +-- G N A T . S I G N A L S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2003 Free Software Foundation, Inc. -- +-- -- +-- GNAT is 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 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +with System.Interrupts; + +package body GNAT.Signals is + + package SI renames System.Interrupts; + + ------------------ + -- Block_Signal -- + ------------------ + + procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID) is + begin + SI.Block_Interrupt (SI.Interrupt_ID (Signal)); + end Block_Signal; + + ---------------- + -- Is_Blocked -- + ---------------- + + function Is_Blocked + (Signal : Ada.Interrupts.Interrupt_ID) + return Boolean + is + begin + return SI.Is_Blocked (SI.Interrupt_ID (Signal)); + end Is_Blocked; + + -------------------- + -- Unblock_Signal -- + -------------------- + + procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID) is + begin + SI.Unblock_Interrupt (SI.Interrupt_ID (Signal)); + end Unblock_Signal; + +end GNAT.Signals; + diff --git a/gcc/ada/g-signal.ads b/gcc/ada/g-signal.ads new file mode 100644 index 00000000000..6939fe27386 --- /dev/null +++ b/gcc/ada/g-signal.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUNTIME COMPONENTS -- +-- -- +-- G N A T . S I G N A L S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2003 Free Software Foundation, Inc. -- +-- -- +-- GNAT is 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 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +with Ada.Interrupts; + +-- This package provides operations for querying and setting the blocked +-- status of signals. + +-- This package is supported only on targets where Ada.Interrupts.Interrupt_ID +-- corresponds to software signals on the target, and where System.Interrupts +-- provides the ability to block and unblock signals. + +package GNAT.Signals is + + procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID); + -- Block "Signal" at the process level + + procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID); + -- Unblock "Signal" at the process level + + function Is_Blocked (Signal : Ada.Interrupts.Interrupt_ID) + return Boolean; + -- "Signal" blocked at the process level? + +end GNAT.Signals; diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads index 57a83743f1e..27841d8c9d2 100644 --- a/gcc/ada/g-socket.ads +++ b/gcc/ada/g-socket.ads @@ -54,6 +54,7 @@ with Ada.Exceptions; with Ada.Streams; +with Ada.Unchecked_Deallocation; with System; @@ -885,15 +886,15 @@ package GNAT.Sockets is function Stream (Socket : Socket_Type) return Stream_Access; - -- Associate a stream with a stream-based socket that is already - -- connected. + -- Create a stream associated with a stream-based socket that is + -- already connected. function Stream (Socket : Socket_Type; Send_To : Sock_Addr_Type) return Stream_Access; - -- Associate a stream with a datagram-based socket that is already - -- bound. Send_To is the socket address to which messages are + -- Create a stream associated with a datagram-based socket that is + -- already bound. Send_To is the socket address to which messages are -- being sent. function Get_Address @@ -902,6 +903,12 @@ package GNAT.Sockets is -- Return the socket address from which the last message was -- received. + procedure Free is new Ada.Unchecked_Deallocation + (Ada.Streams.Root_Stream_Type'Class, Stream_Access); + -- Destroy a stream created by one of the Stream functions above, + -- releasing the corresponding resources. The user is responsible + -- for calling this subprogram when the stream is not needed anymore. + type Socket_Set_Type is limited private; -- This type allows to manipulate sets of sockets. It allows to -- wait for events on multiple endpoints at one time. This is an diff --git a/gcc/ada/g-spipat.adb b/gcc/ada/g-spipat.adb index 3832a7603e8..2f499b8d3ec 100644 --- a/gcc/ada/g-spipat.adb +++ b/gcc/ada/g-spipat.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2002, Ada Core Technologies, Inc. -- +-- Copyright (C) 1998-2003, Ada Core Technologies, Inc. -- -- -- -- GNAT is 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,30 +343,28 @@ package body GNAT.Spitbol.Patterns is -- structure (i.e. it is a pattern that is guaranteed to match at least -- one character on success, and not to make any entries on the stack. - OK_For_Simple_Arbno : - array (Pattern_Code) of Boolean := ( - PC_Any_CS | - PC_Any_CH | - PC_Any_VF | - PC_Any_VP | - PC_Char | - PC_Len_Nat | - PC_NotAny_CS | - PC_NotAny_CH | - PC_NotAny_VF | - PC_NotAny_VP | - PC_Span_CS | - PC_Span_CH | - PC_Span_VF | - PC_Span_VP | - PC_String | - PC_String_2 | - PC_String_3 | - PC_String_4 | - PC_String_5 | - PC_String_6 => True, - - others => False); + OK_For_Simple_Arbno : constant array (Pattern_Code) of Boolean := + (PC_Any_CS | + PC_Any_CH | + PC_Any_VF | + PC_Any_VP | + PC_Char | + PC_Len_Nat | + PC_NotAny_CS | + PC_NotAny_CH | + PC_NotAny_VF | + PC_NotAny_VP | + PC_Span_CS | + PC_Span_CH | + PC_Span_VF | + PC_Span_VP | + PC_String | + PC_String_2 | + PC_String_3 | + PC_String_4 | + PC_String_5 | + PC_String_6 => True, + others => False); ------------------------------- -- The Pattern History Stack -- diff --git a/gcc/ada/g-table.adb b/gcc/ada/g-table.adb index 57f7c724058..e3eaa23b039 100644 --- a/gcc/ada/g-table.adb +++ b/gcc/ada/g-table.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2002 Ada Core Technologies, Inc. -- +-- Copyright (C) 1998-2003 Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -224,7 +224,7 @@ package body GNAT.Table is Item : Table_Component_Type) is begin - if Integer (Index) > Max then + if Integer (Index) > Last_Val then Set_Last (Index); end if; diff --git a/gcc/ada/g-thread.adb b/gcc/ada/g-thread.adb index 30367306b2f..1d71f379ed4 100644 --- a/gcc/ada/g-thread.adb +++ b/gcc/ada/g-thread.adb @@ -81,8 +81,7 @@ package body GNAT.Threads is (Code : Address; Parm : Void_Ptr; Size : Natural; - Prio : Integer) - return System.Address + Prio : Integer) return System.Address is TP : Tptr; @@ -108,7 +107,6 @@ package body GNAT.Threads is procedure Unregister_Thread is Self_Id : constant Tasking.Task_ID := Task_Primitives.Operations.Self; - begin Self_Id.Common.State := Tasking.Terminated; Destroy_TSD (Self_Id.Common.Compiler_Data); @@ -150,7 +148,6 @@ package body GNAT.Threads is procedure Destroy_Thread (Id : Address) is Tid : constant Task_Id := To_Id (Id); - begin Abort_Task (Tid); end Destroy_Thread; @@ -161,9 +158,7 @@ package body GNAT.Threads is procedure Get_Thread (Id : Address; Thread : Address) is use System.OS_Interface; - - Thr : Thread_Id_Ptr := To_Thread (Thread); - + Thr : constant Thread_Id_Ptr := To_Thread (Thread); begin Thr.all := Task_Primitives.Operations.Get_Thread_Id (To_Id (Id)); end Get_Thread; @@ -173,8 +168,7 @@ package body GNAT.Threads is ---------------- function To_Task_Id - (Id : System.Address) - return Ada.Task_Identification.Task_Id + (Id : System.Address) return Ada.Task_Identification.Task_Id is begin return To_Tid (Id); diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index 573d934b4ab..4d4467127bc 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -39,42 +39,42 @@ extern unsigned int largest_move_alignment; /* See if DECL has an RTL that is indirect via a pseudo-register or a memory location and replace it with an indirect reference if so. This improves the debugger's ability to display the value. */ -extern void adjust_decl_rtl PARAMS ((tree)); +extern void adjust_decl_rtl (tree); /* Record the current code position in GNAT_NODE. */ -extern void record_code_position PARAMS ((Node_Id)); +extern void record_code_position (Node_Id); /* Insert the code for GNAT_NODE at the position saved for that node. */ -extern void insert_code_for PARAMS ((Node_Id)); +extern void insert_code_for (Node_Id); /* Compute the alignment of the largest mode that can be used for copying objects. */ -extern void gnat_compute_largest_alignment PARAMS ((void)); +extern void gnat_compute_largest_alignment (void); /* Routine called by gcc for emitting a stack check. GNU_EXPR is the expression that contains the last address on the stack to check. */ -extern tree emit_stack_check PARAMS ((tree)); +extern tree emit_stack_check (tree); /* Make a TRANSFORM_EXPR to later expand GNAT_NODE into code. */ -extern tree make_transform_expr PARAMS ((Node_Id)); +extern tree make_transform_expr (Node_Id); /* Update the setjmp buffer BUF with the current stack pointer. We assume here that a __builtin_setjmp was done to BUF. */ -extern void update_setjmp_buf PARAMS ((tree)); +extern void update_setjmp_buf (tree); /* GNU_TYPE is a type. Determine if it should be passed by reference by default. */ -extern int default_pass_by_ref PARAMS ((tree)); +extern int default_pass_by_ref (tree); /* GNU_TYPE is the type of a subprogram parameter. Determine from the type if it should be passed by reference. */ -extern int must_pass_by_ref PARAMS ((tree)); +extern int must_pass_by_ref (tree); /* Elaboration routines for the front end. */ -extern void elab_all_gnat PARAMS ((void)); +extern void elab_all_gnat (void); /* Initialize DUMMY_NODE_TABLE. */ -extern void init_dummy_type PARAMS ((void)); +extern void init_dummy_type (void); /* Given GNAT_ENTITY, a GNAT defining identifier node, which denotes some Ada entity, this routine returns the equivalent GCC tree for that entity @@ -91,63 +91,63 @@ extern void init_dummy_type PARAMS ((void)); was not created previously. The value of 1 is normally used for a non-zero DEFINITION, but a value of 2 is used in special circumstances, defined in the code. */ -extern tree gnat_to_gnu_entity PARAMS ((Entity_Id, tree, int)); +extern tree gnat_to_gnu_entity (Entity_Id, tree, int); /* Given GNAT_ENTITY, an entity in the incoming GNAT tree, return a GCC type corresponding to that entity. GNAT_ENTITY is assumed to refer to an Ada type. */ -extern tree gnat_to_gnu_type PARAMS ((Entity_Id)); +extern tree gnat_to_gnu_type (Entity_Id); /* Given GNAT_ENTITY, elaborate all expressions that are required to be elaborated at the point of its definition, but do nothing else. */ -extern void elaborate_entity PARAMS ((Entity_Id)); +extern void elaborate_entity (Entity_Id); /* Mark GNAT_ENTITY as going out of scope at this point. Recursively mark any entities on its entity chain similarly. */ -extern void mark_out_of_scope PARAMS ((Entity_Id)); +extern void mark_out_of_scope (Entity_Id); /* Make a dummy type corresponding to GNAT_TYPE. */ -extern tree make_dummy_type PARAMS ((Entity_Id)); +extern tree make_dummy_type (Entity_Id); /* Get the unpadded version of a GNAT type. */ -extern tree get_unpadded_type PARAMS ((Entity_Id)); +extern tree get_unpadded_type (Entity_Id); /* Called when we need to protect a variable object using a save_expr. */ -extern tree maybe_variable PARAMS ((tree, Node_Id)); +extern tree maybe_variable (tree, Node_Id); /* Create a record type that contains a field of TYPE with a starting bit position so that it is aligned to ALIGN bits. */ /* Create a record type that contains a field of TYPE with a starting bit position so that it is aligned to ALIGN bits and is SIZE bytes long. */ -extern tree make_aligning_type PARAMS ((tree, int, tree)); +extern tree make_aligning_type (tree, int, tree); /* Given a GNU tree and a GNAT list of choices, generate an expression to test the value passed against the list of choices. */ -extern tree choices_to_gnu PARAMS ((tree, Node_Id)); +extern tree choices_to_gnu (tree, Node_Id); /* Given a type T, a FIELD_DECL F, and a replacement value R, return a new type with all size expressions that contain F updated by replacing F with R. This is identical to GCC's substitute_in_type except that it knows about TYPE_INDEX_TYPE. */ -extern tree gnat_substitute_in_type PARAMS ((tree, tree, tree)); +extern tree gnat_substitute_in_type (tree, tree, tree); /* Return the "RM size" of GNU_TYPE. This is the actual number of bits needed to represent the object. */ -extern tree rm_size PARAMS ((tree)); +extern tree rm_size (tree); /* Given GNU_ID, an IDENTIFIER_NODE containing a name and SUFFIX, a string, return a new IDENTIFIER_NODE that is the concatenation of the name in GNU_ID and SUFFIX. */ -extern tree concat_id_with_name PARAMS ((tree, const char *)); +extern tree concat_id_with_name (tree, const char *); /* Return the name to be used for GNAT_ENTITY. If a type, create a fully-qualified name, possibly with type information encoding. Otherwise, return the name. */ -extern tree get_entity_name PARAMS ((Entity_Id)); +extern tree get_entity_name (Entity_Id); /* Return a name for GNAT_ENTITY concatenated with two underscores and SUFFIX. */ -extern tree create_concat_name PARAMS ((Entity_Id, const char *)); +extern tree create_concat_name (Entity_Id, const char *); /* Flag indicating whether file names are discarded in exception messages */ extern int discard_file_names; @@ -168,81 +168,78 @@ extern GTY(()) tree gnu_block_stack; /* This is the main program of the back-end. It sets up all the table structures and then generates code. */ -extern void gigi PARAMS ((Node_Id, int, int, struct Node *, - Node_Id *, Node_Id *, - struct Elist_Header *, - struct Elmt_Item *, - struct String_Entry *, - Char_Code *, - struct List_Header *, - Int, char *, - Entity_Id, Entity_Id, Entity_Id, - Int)); +extern void gigi (Node_Id, int, int, struct Node *, Node_Id *, Node_Id *, + struct Elist_Header *, struct Elmt_Item *, + struct String_Entry *, Char_Code *, struct List_Header *, + Int, char *, Entity_Id, Entity_Id, Entity_Id, Int); /* This function is the driver of the GNAT to GCC tree transformation process. GNAT_NODE is the root of some gnat tree. It generates code for that part of the tree. */ -extern void gnat_to_code PARAMS ((Node_Id)); +extern void gnat_to_code (Node_Id); /* GNAT_NODE is the root of some GNAT tree. Return the root of the GCC tree corresponding to that GNAT tree. Normally, no code is generated; we just return an equivalent tree which is used elsewhere to generate code. */ -extern tree gnat_to_gnu PARAMS ((Node_Id)); +extern tree gnat_to_gnu (Node_Id); + +/* GNU_STMT is a statement. We generate code for that statement. */ +extern void gnat_expand_stmt (tree); /* Do the processing for the declaration of a GNAT_ENTITY, a type. If a separate Freeze node exists, delay the bulk of the processing. Otherwise make a GCC type for GNAT_ENTITY and set up the correspondance. */ -extern void process_type PARAMS ((Entity_Id)); +extern void process_type (Entity_Id); /* Determine the input_filename and the input_line from the source location (Sloc) of GNAT_NODE node. Set the global variable input_filename and input_line. If WRITE_NOTE_P is true, emit a line number note. */ -extern void set_lineno PARAMS ((Node_Id, int)); +extern void set_lineno (Node_Id, int); + +/* Likewise, but passed a Sloc. */ +extern void set_lineno_from_sloc (Source_Ptr, int); /* Post an error message. MSG is the error message, properly annotated. NODE is the node at which to post the error and the node to use for the "&" substitution. */ -extern void post_error PARAMS ((const char *, Node_Id)); +extern void post_error (const char *, Node_Id); /* Similar, but NODE is the node at which to post the error and ENT is the node to use for the "&" substitution. */ -extern void post_error_ne PARAMS ((const char *, Node_Id, Entity_Id)); +extern void post_error_ne (const char *, Node_Id, Entity_Id); /* Similar, but NODE is the node at which to post the error, ENT is the node to use for the "&" substitution, and N is the number to use for the ^. */ -extern void post_error_ne_num PARAMS ((const char *, Node_Id, Entity_Id, - int)); +extern void post_error_ne_num (const char *, Node_Id, Entity_Id, int); /* Similar to post_error_ne_num, but T is a GCC tree representing the number to write. If the tree represents a constant that fits within a host integer, the text inside curly brackets in MSG will be output (presumably including a '^'). Otherwise that text will not be output and the text inside square brackets will be output instead. */ -extern void post_error_ne_tree PARAMS ((const char *, Node_Id, Entity_Id, - tree)); +extern void post_error_ne_tree (const char *, Node_Id, Entity_Id, tree); /* Similar to post_error_ne_tree, except that NUM is a second integer to write in the message. */ -extern void post_error_ne_tree_2 PARAMS ((const char *, Node_Id, Entity_Id, - tree, int)); +extern void post_error_ne_tree_2 (const char *, Node_Id, Entity_Id, tree, int); /* Set the node for a second '&' in the error message. */ -extern void set_second_error_entity PARAMS ((Entity_Id)); +extern void set_second_error_entity (Entity_Id); /* Protect EXP from multiple evaluation. This may make a SAVE_EXPR. */ -extern tree protect_multiple_eval PARAMS ((tree)); +extern tree protect_multiple_eval (tree); /* Signal abort, with "Gigi abort" as the error label, and error_gnat_node as the relevant node that provides the location info for the error. The single parameter CODE is an integer code that is included in the additional error message generated. */ -extern void gigi_abort PARAMS ((int)) ATTRIBUTE_NORETURN; +extern void gigi_abort (int) ATTRIBUTE_NORETURN; /* Initialize the table that maps GNAT codes to GCC codes for simple binary and unary operations. */ -extern void init_code_table PARAMS ((void)); +extern void init_code_table (void); /* Current node being treated, in case gigi_abort or Check_Elaboration_Code called. */ @@ -252,7 +249,7 @@ extern Node_Id error_gnat_node; how to handle our new nodes and we take an extra argument that says whether to force evaluation of everything. */ -extern tree gnat_stabilize_reference PARAMS ((tree, int)); +extern tree gnat_stabilize_reference (tree, int); /* Highest number in the front-end node table. */ extern int max_gnat_nodes; @@ -380,18 +377,18 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; prototype and names as below. */ /* Returns non-zero if we are currently in the global binding level */ -extern int global_bindings_p PARAMS ((void)); +extern int global_bindings_p (void); /* Returns the list of declarations in the current level. Note that this list is in reverse order (it has to be so for back-end compatibility). */ -extern tree getdecls PARAMS ((void)); +extern tree getdecls (void); /* Nonzero if the current level needs to have a BLOCK made. */ -extern int kept_level_p PARAMS ((void)); +extern int kept_level_p (void); /* Enter a new binding level. The input parameter is ignored, but has to be specified for back-end compatibility. */ -extern void pushlevel PARAMS ((int)); +extern void pushlevel (int); /* Exit a binding level. Pop the level off, and restore the state of the identifier-decl mappings @@ -407,52 +404,52 @@ extern void pushlevel PARAMS ((int)); If REVERSE is nonzero, reverse the order of decls before putting them into the BLOCK. */ -extern tree poplevel PARAMS ((int,int, int)); +extern tree poplevel (int, int, int); /* Insert BLOCK at the end of the list of subblocks of the current binding level. This is used when a BIND_EXPR is expanded, to handle the BLOCK node inside the BIND_EXPR. */ -extern void insert_block PARAMS ((tree)); +extern void insert_block (tree); /* Set the BLOCK node for the innermost scope (the one we are currently in). */ -extern void set_block PARAMS ((tree)); +extern void set_block (tree); /* Records a ..._DECL node DECL as belonging to the current lexical scope. Returns the ..._DECL node. */ -extern tree pushdecl PARAMS ((tree)); +extern tree pushdecl (tree); /* Create the predefined scalar types such as `integer_type_node' needed in the gcc back-end and initialize the global binding level. */ -extern void gnat_init_decl_processing PARAMS ((void)); -extern void init_gigi_decls PARAMS ((tree, tree)); -extern void gnat_init_gcc_eh PARAMS ((void)); +extern void gnat_init_decl_processing (void); +extern void init_gigi_decls (tree, tree); +extern void gnat_init_gcc_eh (void); /* Return an integer type with the number of bits of precision given by PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise it is a signed type. */ -extern tree gnat_type_for_size PARAMS ((unsigned, int)); +extern tree gnat_type_for_size (unsigned, int); /* Return a data type that has machine mode MODE. UNSIGNEDP selects an unsigned type; otherwise a signed type is returned. */ -extern tree gnat_type_for_mode PARAMS ((enum machine_mode, int)); +extern tree gnat_type_for_mode (enum machine_mode, int); /* Return the unsigned version of a TYPE_NODE, a scalar type. */ -extern tree gnat_unsigned_type PARAMS ((tree)); +extern tree gnat_unsigned_type (tree); /* Return the signed version of a TYPE_NODE, a scalar type. */ -extern tree gnat_signed_type PARAMS ((tree)); +extern tree gnat_signed_type (tree); /* Return a type the same as TYPE except unsigned or signed according to UNSIGNEDP. */ -extern tree gnat_signed_or_unsigned_type PARAMS ((int, tree)); +extern tree gnat_signed_or_unsigned_type (int, tree); /* 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 conversions; callers should filter out those that are not permitted by the language being compiled. */ -extern tree convert PARAMS ((tree, tree)); +extern tree convert (tree, tree); /* Routines created solely for the tree translator's sake. Their prototypes can be changed as desired. */ @@ -462,18 +459,18 @@ extern tree convert PARAMS ((tree, tree)); GNAT_ENTITY. Such gnu tree node is always an ..._DECL node. If NO_CHECK is nonzero, the latter check is suppressed. If GNU_DECL is zero, a previous association is to be reset. */ -extern void save_gnu_tree PARAMS ((Entity_Id, tree, int)); +extern void save_gnu_tree (Entity_Id, tree, int); /* GNAT_ENTITY is a GNAT tree node for a defining identifier. Return the ..._DECL node that was associated with it. If there is no tree node associated with GNAT_ENTITY, abort. */ -extern tree get_gnu_tree PARAMS ((Entity_Id)); +extern tree get_gnu_tree (Entity_Id); /* Return nonzero if a GCC tree has been associated with GNAT_ENTITY. */ -extern int present_gnu_tree PARAMS ((Entity_Id)); +extern int present_gnu_tree (Entity_Id); /* Initialize tables for above routines. */ -extern void init_gnat_to_gnu PARAMS ((void)); +extern void init_gnat_to_gnu (void); /* Given a record type (RECORD_TYPE) and a chain of FIELD_DECL nodes (FIELDLIST), finish constructing the record or union type. @@ -481,7 +478,7 @@ extern void init_gnat_to_gnu PARAMS ((void)); layout_type but merely set the size and alignment ourselves. If DEFER_DEBUG is nonzero, do not call the debugging routines on this type; it will be done later. */ -extern void finish_record_type PARAMS ((tree, tree, int, int)); +extern void finish_record_type (tree, tree, int, int); /* Returns a FUNCTION_TYPE node. RETURN_TYPE is the type returned by the subprogram. If it is void_type_node, then we are dealing with a procedure, @@ -492,23 +489,21 @@ extern void finish_record_type PARAMS ((tree, tree, int, int)); object. RETURNS_BY_REF is nonzero if the function returns by reference. RETURNS_WITH_DSP is nonzero if the function is to return with a depressed stack pointer. */ -extern tree create_subprog_type PARAMS ((tree, tree, tree, int, int, - int)); +extern tree create_subprog_type (tree, tree, tree, int, int, int); /* Return a copy of TYPE, but safe to modify in any way. */ -extern tree copy_type PARAMS ((tree)); +extern tree copy_type (tree); /* Return an INTEGER_TYPE of SIZETYPE with range MIN to MAX and whose TYPE_INDEX_TYPE is INDEX. */ -extern tree create_index_type PARAMS ((tree, tree, tree)); +extern tree create_index_type (tree, tree, tree); /* Return a TYPE_DECL node. TYPE_NAME gives the name of the type (a character string) and TYPE is a ..._TYPE node giving its data type. ARTIFICIAL_P is nonzero if this is a declaration that was generated by the compiler. DEBUG_INFO_P is nonzero if we need to write debugging information about this type. */ -extern tree create_type_decl PARAMS ((tree, tree, struct attrib *, - int, int)); +extern tree create_type_decl (tree, tree, struct attrib *, int, int); /* Returns a GCC VAR_DECL node. VAR_NAME gives the name of the variable. ASM_NAME is its assembler name (if provided). TYPE is @@ -524,36 +519,35 @@ extern tree create_type_decl PARAMS ((tree, tree, struct attrib *, definition: no storage is to be allocated for the variable here). STATIC_FLAG is only relevant when not at top level. In that case it indicates whether to always allocate storage to the variable. */ -extern tree create_var_decl PARAMS ((tree, tree, tree, tree, int, - int, int, int, - struct attrib *)); +extern tree create_var_decl (tree, tree, tree, tree, int, int, int, int, + struct attrib *); /* Given a DECL and ATTR_LIST, apply the listed attributes. */ -extern void process_attributes PARAMS ((tree, struct attrib *)); +extern void process_attributes (tree, struct attrib *); /* Obtain any pending elaborations and clear the old list. */ -extern tree get_pending_elaborations PARAMS ((void)); +extern tree get_pending_elaborations (void); /* Return nonzero if there are pending elaborations. */ -extern int pending_elaborations_p PARAMS ((void)); +extern int pending_elaborations_p (void); /* Save a copy of the current pending elaboration list and make a new one. */ -extern void push_pending_elaborations PARAMS ((void)); +extern void push_pending_elaborations (void); /* Pop the stack of pending elaborations. */ -extern void pop_pending_elaborations PARAMS ((void)); +extern void pop_pending_elaborations (void); /* Return the current position in pending_elaborations so we can insert elaborations after that point. */ -extern tree get_elaboration_location PARAMS ((void)); +extern tree get_elaboration_location (void); /* Insert the current elaborations after ELAB, which is in some elaboration list. */ -extern void insert_elaboration_list PARAMS ((tree)); +extern void insert_elaboration_list (tree); /* Add some pending elaborations to the current list. */ -extern void add_pending_elaborations PARAMS ((tree, tree)); +extern void add_pending_elaborations (tree, tree); /* Returns a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if @@ -561,14 +555,13 @@ extern void add_pending_elaborations PARAMS ((tree, tree)); it is the specified size for this field. If POS is nonzero, it is the bit position. If ADDRESSABLE is nonzero, it means we are allowed to take the address of this field for aliasing purposes. */ -extern tree create_field_decl PARAMS ((tree, tree, tree, int, - tree, tree, int)); +extern tree create_field_decl (tree, tree, tree, int, tree, tree, int); /* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter, PARAM_TYPE is its type. READONLY is nonzero if the parameter is readonly (either an IN parameter or an address of a pass-by-ref parameter). */ -extern tree create_param_decl PARAMS ((tree, tree, int)); +extern tree create_param_decl (tree, tree, int); /* Returns a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram, ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE @@ -577,25 +570,25 @@ extern tree create_param_decl PARAMS ((tree, tree, int)); INLINE_FLAG, PUBLIC_FLAG, and EXTERN_FLAG are used to set the appropriate fields in the FUNCTION_DECL. */ -extern tree create_subprog_decl PARAMS ((tree, tree, tree, tree, int, - int, int, struct attrib *)); +extern tree create_subprog_decl (tree, tree, tree, tree, int, int, int, + struct attrib *); /* Returns a LABEL_DECL node for LABEL_NAME. */ -extern tree create_label_decl PARAMS ((tree)); +extern tree create_label_decl (tree); /* Set up the framework for generating code for SUBPROG_DECL, a subprogram body. This routine needs to be invoked before processing the declarations appearing in the subprogram. */ -extern void begin_subprog_body PARAMS ((tree)); +extern void begin_subprog_body (tree); /* Finish the definition of the current subprogram and compile it all the way to assembler language output. */ -extern void end_subprog_body PARAMS ((void)); +extern void end_subprog_body (void); /* Build a template of type TEMPLATE_TYPE from the array bounds of ARRAY_TYPE. EXPR is an expression that we can use to locate any PLACEHOLDER_EXPRs. Return a constructor for the template. */ -extern tree build_template PARAMS ((tree, tree, tree)); +extern tree build_template (tree, tree, tree); /* Build a VMS descriptor from a Mechanism_Type, which must specify a descriptor type, and the GCC type of an object. Each FIELD_DECL @@ -604,8 +597,7 @@ extern tree build_template PARAMS ((tree, tree, tree)); to print out an error message if the mechanism cannot be applied to an object of that type and also for the name. */ -extern tree build_vms_descriptor PARAMS ((tree, Mechanism_Type, - Entity_Id)); +extern tree build_vms_descriptor (tree, Mechanism_Type, Entity_Id); /* Build a type to be used to represent an aliased object whose nominal type is an unconstrained array. This consists of a RECORD_TYPE containing @@ -613,32 +605,32 @@ extern tree build_vms_descriptor PARAMS ((tree, Mechanism_Type, ARRAY_TYPE. If ARRAY_TYPE is that of the unconstrained array, this is used to represent an arbitrary unconstrained object. Use NAME as the name of the record. */ -extern tree build_unc_object_type PARAMS ((tree, tree, tree)); +extern tree build_unc_object_type (tree, tree, tree); /* Update anything previously pointing to OLD_TYPE to point to NEW_TYPE. In the normal case this is just two adjustments, but we have more to do if NEW is an UNCONSTRAINED_ARRAY_TYPE. */ -extern void update_pointer_to PARAMS ((tree, tree)); +extern void update_pointer_to (tree, tree); /* 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 minimum (if ! MAX_P) possible value of the discriminant. */ -extern tree max_size PARAMS ((tree, int)); +extern tree max_size (tree, int); /* Remove all conversions that are done in EXP. This includes converting from a padded type or to a left-justified modular type. If TRUE_ADDRESS is nonzero, always return the address of the containing object even if the address is not bit-aligned. */ -extern tree remove_conversions PARAMS ((tree, int)); +extern tree remove_conversions (tree, int); /* If EXP's type is an UNCONSTRAINED_ARRAY_TYPE, return an expression that refers to the underlying array. If its type has TYPE_CONTAINS_TEMPLATE_P, likewise return an expression pointing to the underlying array. */ -extern tree maybe_unconstrained_array PARAMS ((tree)); +extern tree maybe_unconstrained_array (tree); /* Return an expression that does an unchecked converstion of EXPR to TYPE. If NOTRUNC_P is set, truncation operations should be suppressed. */ -extern tree unchecked_convert PARAMS ((tree, tree, int)); +extern tree unchecked_convert (tree, tree, int); /* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical operation. @@ -652,55 +644,55 @@ extern tree unchecked_convert PARAMS ((tree, tree, int)); The resulting type should always be the same as the input type. This function is simpler than the corresponding C version since the only possible operands will be things of Boolean type. */ -extern tree gnat_truthvalue_conversion PARAMS((tree)); +extern tree gnat_truthvalue_conversion (tree); /* Return the base type of TYPE. */ -extern tree get_base_type PARAMS((tree)); +extern tree get_base_type (tree); /* Likewise, but only return types known at Ada source. */ -extern tree get_ada_base_type PARAMS((tree)); +extern tree get_ada_base_type (tree); /* EXP is a GCC tree representing an address. See if we can find how strictly the object at that address is aligned. Return that alignment strictly the object at that address is aligned. Return that alignment in bits. If we don't know anything about the alignment, return 0. */ -extern unsigned int known_alignment PARAMS((tree)); +extern unsigned int known_alignment (tree); /* Make a binary operation of kind OP_CODE. RESULT_TYPE is the type desired for the result. Usually the operation is to be performed in that type. For MODIFY_EXPR and ARRAY_REF, RESULT_TYPE may be 0 in which case the type to be used will be derived from the operands. */ -extern tree build_binary_op PARAMS((enum tree_code, tree, tree, tree)); +extern tree build_binary_op (enum tree_code, tree, tree, tree); /* Similar, but make unary operation. */ -extern tree build_unary_op PARAMS((enum tree_code, tree, tree)); +extern tree build_unary_op (enum tree_code, tree, tree); /* Similar, but for COND_EXPR. */ -extern tree build_cond_expr PARAMS((tree, tree, tree, tree)); +extern tree build_cond_expr (tree, tree, tree, tree); /* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return the CALL_EXPR. */ -extern tree build_call_1_expr PARAMS((tree, tree)); +extern tree build_call_1_expr (tree, tree); /* Build a CALL_EXPR to call FUNDECL with two argument, ARG1 & ARG2. Return the CALL_EXPR. */ -extern tree build_call_2_expr PARAMS((tree, tree, tree)); +extern tree build_call_2_expr (tree, tree, tree); /* Likewise to call FUNDECL with no arguments. */ -extern tree build_call_0_expr PARAMS((tree)); +extern tree build_call_0_expr (tree); /* Call a function that raises an exception and pass the line number and file name, if requested. MSG says which exception function to call. */ -extern tree build_call_raise PARAMS((int)); +extern tree build_call_raise (int); /* Return a CONSTRUCTOR of TYPE whose list is LIST. This is not the same as build_constructor in the language-independent tree.c. */ -extern tree gnat_build_constructor PARAMS((tree, tree)); +extern tree gnat_build_constructor (tree, tree); /* Return a COMPONENT_REF to access a field that is given by COMPONENT, an IDENTIFIER_NODE giving the name of the field, FIELD, a FIELD_DECL, - for the field, or both. */ -extern tree build_component_ref PARAMS((tree, tree, tree)); + for the field, or both. Don't fold the result if NO_FOLD_P. */ +extern tree build_component_ref (tree, tree, tree, int); /* Build a GCC tree to call an allocation or deallocation function. If GNU_OBJ is nonzero, it is an object to deallocate. Otherwise, @@ -709,8 +701,8 @@ extern tree build_component_ref PARAMS((tree, tree, tree)); GNU_SIZE is the size of the object and ALIGN is the alignment. GNAT_PROC, if present is a procedure to call and GNAT_POOL is the storage pool to use. If not preset, malloc and free will be used. */ -extern tree build_call_alloc_dealloc PARAMS((tree, tree, int, Entity_Id, - Entity_Id, Node_Id)); +extern tree build_call_alloc_dealloc (tree, tree, int, Entity_Id, + Entity_Id, Node_Id); /* Build a GCC tree to correspond to allocating an object of TYPE whose initial value if INIT, if INIT is nonzero. Convert the expression to @@ -718,37 +710,55 @@ extern tree build_call_alloc_dealloc PARAMS((tree, tree, int, Entity_Id, GNAT_PROC and GNAT_POOL optionally give the procedure to call and the storage pool to use. GNAT_NODE is used to provide an error location for restriction violations messages. */ -extern tree build_allocator PARAMS((tree, tree, tree, Entity_Id, - Entity_Id, Node_Id)); +extern tree build_allocator (tree, tree, tree, Entity_Id, Entity_Id, Node_Id); /* Fill in a VMS descriptor for EXPR and return a constructor for it. GNAT_FORMAL is how we find the descriptor record. */ -extern tree fill_vms_descriptor PARAMS((tree, Entity_Id)); +extern tree fill_vms_descriptor (tree, Entity_Id); /* Indicate that we need to make the address of EXPR_NODE and it therefore should not be allocated in a register. Return true if successful. */ -extern bool gnat_mark_addressable PARAMS((tree)); +extern bool gnat_mark_addressable (tree); + +/* This function is called by the front end to enumerate all the supported + modes for the machine. We pass a function which is called back with + the following integer parameters: + + FLOAT_P nonzero if this represents a floating-point mode + COMPLEX_P nonzero is this represents a complex mode + COUNT count of number of items, nonzero for vector mode + PRECISION number of bits in data representation + MANTISSA number of bits in mantissa, if FP and known, else zero. + SIZE number of bits used to store data + ALIGN number of bits to which mode is aligned. */ +extern void enumerate_modes (void (*f) (int, int, int, int, int, int, + unsigned int)); + +/* These are temporary function to deal with recent GCC changes related to + FP type sizes and precisions. */ +extern int fp_prec_to_size (int); +extern int fp_size_to_prec (int); /* These functions return the basic data type sizes and related parameters about the target machine. */ -extern Pos get_target_bits_per_unit PARAMS ((void)); -extern Pos get_target_bits_per_word PARAMS ((void)); -extern Pos get_target_char_size PARAMS ((void)); -extern Pos get_target_wchar_t_size PARAMS ((void)); -extern Pos get_target_short_size PARAMS ((void)); -extern Pos get_target_int_size PARAMS ((void)); -extern Pos get_target_long_size PARAMS ((void)); -extern Pos get_target_long_long_size PARAMS ((void)); -extern Pos get_target_float_size PARAMS ((void)); -extern Pos get_target_double_size PARAMS ((void)); -extern Pos get_target_long_double_size PARAMS ((void)); -extern Pos get_target_pointer_size PARAMS ((void)); -extern Pos get_target_maximum_alignment PARAMS ((void)); -extern Boolean get_target_no_dollar_in_label PARAMS ((void)); -extern Nat get_float_words_be PARAMS ((void)); -extern Nat get_words_be PARAMS ((void)); -extern Nat get_bytes_be PARAMS ((void)); -extern Nat get_bits_be PARAMS ((void)); -extern Nat get_strict_alignment PARAMS ((void)); +extern Pos get_target_bits_per_unit (void); +extern Pos get_target_bits_per_word (void); +extern Pos get_target_char_size (void); +extern Pos get_target_wchar_t_size (void); +extern Pos get_target_short_size (void); +extern Pos get_target_int_size (void); +extern Pos get_target_long_size (void); +extern Pos get_target_long_long_size (void); +extern Pos get_target_float_size (void); +extern Pos get_target_double_size (void); +extern Pos get_target_long_double_size (void); +extern Pos get_target_pointer_size (void); +extern Pos get_target_maximum_alignment (void); +extern Boolean get_target_no_dollar_in_label (void); +extern Nat get_float_words_be (void); +extern Nat get_words_be (void); +extern Nat get_bytes_be (void); +extern Nat get_bits_be (void); +extern Nat get_strict_alignment (void); diff --git a/gcc/ada/gmem.c b/gcc/ada/gmem.c index c21fa47c8ff..002f78f77be 100644 --- a/gcc/ada/gmem.c +++ b/gcc/ada/gmem.c @@ -75,7 +75,7 @@ convert_addresses (char *addrs[], int n_addr, void *buf, int *len); */ static void -gmem_read_backtrace () +gmem_read_backtrace (void) { fread (&cur_tb_len, sizeof (int), 1, gmemfile); fread (tracebk, sizeof (char *), cur_tb_len, gmemfile); @@ -120,8 +120,7 @@ void __gnat_gmem_a2l_initialize (char *exename) write an alloc/free information in buf to be processed by gnatmem */ void -__gnat_gmem_read_next (buf) - struct struct_storage_elmt *buf; +__gnat_gmem_read_next (struct struct_storage_elmt *buf) { void *addr; size_t size; diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index dcae02ee0b7..6f9b8a0f2c6 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -54,6 +54,7 @@ with Sem; with Sem_Ch8; with Sem_Ch12; with Sem_Ch13; +with Sem_Elim; with Sem_Eval; with Sem_Type; with Sinfo; use Sinfo; @@ -118,6 +119,7 @@ begin Sem_Ch8.Initialize; Sem_Ch12.Initialize; Sem_Ch13.Initialize; + Sem_Elim.Initialize; Sem_Eval.Initialize; Sem_Type.Init_Interp_Tables; diff --git a/gcc/ada/gnat_ug.texi b/gcc/ada/gnat_ug.texi index f631ca6e5c9..946da534211 100644 --- a/gcc/ada/gnat_ug.texi +++ b/gcc/ada/gnat_ug.texi @@ -79,7 +79,7 @@ @c %**end of header @copying -Copyright @copyright{} 1995-2002, Free Software Foundation +Copyright @copyright{} 1995-2003, Free Software Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 diff --git a/gcc/ada/gnat_ug_unx.texi b/gcc/ada/gnat_ug_unx.texi index e0924e4750f..484f5a75b19 100644 --- a/gcc/ada/gnat_ug_unx.texi +++ b/gcc/ada/gnat_ug_unx.texi @@ -65,7 +65,7 @@ @c %**end of header @copying -Copyright @copyright{} 1995-2002, Free Software Foundation +Copyright @copyright{} 1995-2003, Free Software Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 diff --git a/gcc/ada/gnat_ug_vms.texi b/gcc/ada/gnat_ug_vms.texi index e717a20fa1e..89bc0e17b49 100644 --- a/gcc/ada/gnat_ug_vms.texi +++ b/gcc/ada/gnat_ug_vms.texi @@ -65,7 +65,7 @@ @c %**end of header @copying -Copyright @copyright{} 1995-2002, Free Software Foundation +Copyright @copyright{} 1995-2003, Free Software Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 diff --git a/gcc/ada/gnat_ug_vxw.texi b/gcc/ada/gnat_ug_vxw.texi index 50d7c9dd9ba..8fb949d1c6e 100644 --- a/gcc/ada/gnat_ug_vxw.texi +++ b/gcc/ada/gnat_ug_vxw.texi @@ -65,7 +65,7 @@ @c %**end of header @copying -Copyright @copyright{} 1995-2002, Free Software Foundation +Copyright @copyright{} 1995-2003, Free Software Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 diff --git a/gcc/ada/gnat_ug_wnt.texi b/gcc/ada/gnat_ug_wnt.texi index 24390ffb555..1d799b2792f 100644 --- a/gcc/ada/gnat_ug_wnt.texi +++ b/gcc/ada/gnat_ug_wnt.texi @@ -65,7 +65,7 @@ @c %**end of header @copying -Copyright @copyright{} 1995-2002, Free Software Foundation +Copyright @copyright{} 1995-2003, Free Software Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 diff --git a/gcc/ada/gnat_wrapper.adb b/gcc/ada/gnat_wrapper.adb deleted file mode 100644 index 189cdc46ea1..00000000000 --- a/gcc/ada/gnat_wrapper.adb +++ /dev/null @@ -1,121 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- G N A T _ W R A P P E R -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- GNAT_Wrapper is to be used as the starter program for most of the GNAT --- executables. It sets up the working environment variables and calls the --- real executable which is to be found under the 'real' sub-directory. --- --- This avoids using the registry on Windows which is tricky to setup to run --- multiple compilers (GNAT Pro release and wavefronts for example) at the --- same time. - -with Ada.Command_Line; use Ada.Command_Line; -with GNAT.OS_Lib; use GNAT.OS_Lib; - -procedure GNAT_Wrapper is - DS : Character renames Directory_Separator; - PS : Character renames Path_Separator; - - procedure Split_Command; - -- Parse Actual_Name and set K and L variables (see below). - - Actual_Name : String_Access := new String'(Command_Name); - - K : Natural; - -- Index of the directory separator just before program name's first - -- character. - - L : Natural; - -- Index of the last character of the GNATPRO install directory. - - LD_LIBRARY_PATH : String_Access := Getenv ("LD_LIBRARY_PATH"); - PATH : String_Access := Getenv ("PATH"); - - ------------------- - -- Split_Command -- - ------------------- - - procedure Split_Command is - begin - K := Actual_Name'Last; - loop - exit when K = 0 - or else Actual_Name (K) = '\' or else Actual_Name (K) = '/'; - K := K - 1; - end loop; - end Split_Command; - -begin - Split_Command; - - if K = 0 then - -- No path information found, locate the program on the path. - declare - Old : String_Access := Actual_Name; - begin - Actual_Name := Locate_Exec_On_Path (Actual_Name.all); - Free (Old); - - Split_Command; - end; - end if; - - -- Skip 'bin' from directory above. GNAT binaries are always under - -- /bin directory. - - L := K - 4; - - declare - Prog : constant String := Actual_Name (K + 1 .. Actual_Name'Last); - Dir : constant String := Actual_Name (Actual_Name'First .. L - 1); - Real : constant String := Dir & DS & ".bin"; - Bin : constant String := Dir & DS & "bin"; - Args : Argument_List (1 .. Argument_Count); - Result : Integer; - - begin - Setenv ("GCC_ROOT", Dir); - Setenv ("GNAT_ROOT", Dir); - Setenv ("BINUTILS_ROOT", Dir); - Setenv ("LD_LIBRARY_PATH", Dir & DS & "lib" & PS & LD_LIBRARY_PATH.all); - Setenv ("PATH", Real & PS & Bin & PS & PATH.all); - - -- Call the right executable under "/.bin" - - for K in 1 .. Argument_Count loop - Args (K) := new String'(Argument (K)); - end loop; - - Normalize_Arguments (Args); - Result := Spawn (Real & DS & Prog, Args); - - for K in 1 .. Argument_Count loop - Free (Args (K)); - end loop; - - OS_Exit (Result); - end; -end GNAT_Wrapper; diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb index 45dda7404f2..d2378630825 100644 --- a/gcc/ada/gnatbind.adb +++ b/gcc/ada/gnatbind.adb @@ -471,7 +471,7 @@ begin -- Add System.Standard_Library to list to ensure that these files are -- included in the bind, even if not directly referenced from Ada code - -- This is suppressed if the configurable run-time requests it. + -- This is suppressed if the appropriate targparm switch is set. if not Suppress_Standard_Library_On_Target then Name_Buffer (1 .. 12) := "s-stalib.ali"; diff --git a/gcc/ada/gnatbl.c b/gcc/ada/gnatbl.c index 72f85169fd8..82284286676 100644 --- a/gcc/ada/gnatbl.c +++ b/gcc/ada/gnatbl.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2001 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -72,12 +72,11 @@ char *gcc_B_arg = 0; static int linkonly = 0; -static void addarg PARAMS ((char *)); -static void process_args PARAMS ((int *, char *[])); +static void addarg (char *); +static void process_args (int *, char *[]); static void -addarg (str) - char *str; +addarg (char *str) { int i; @@ -100,9 +99,7 @@ addarg (str) } static void -process_args (p_argc, argv) - int *p_argc; - char *argv[]; +process_args (int *p_argc, char *argv[]) { int i, j; @@ -199,12 +196,10 @@ process_args (p_argc, argv) } } } -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int i, j; int done_an_ali = 0; @@ -294,7 +289,7 @@ main (argc, argv) { if (done_an_ali) { - fprintf (stderr, + fprintf (stderr, "Sorry - cannot handle more than one ALI file\n"); exit (1); } @@ -328,7 +323,7 @@ main (argc, argv) exit (retcode); } } - else + else addarg (argv[i]); } #ifdef MSDOS diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb index 3e771e5a05d..7384cd353a3 100644 --- a/gcc/ada/gnatchop.adb +++ b/gcc/ada/gnatchop.adb @@ -37,11 +37,6 @@ with Hostparm; procedure Gnatchop is - Cwrite : constant String := - "GNATCHOP " & - Gnatvsn.Gnat_Version_String & - " Copyright 1998-2000, Ada Core Technologies Inc."; - Terminate_Program : exception; -- Used to terminate execution immediately @@ -57,9 +52,13 @@ procedure Gnatchop is Gnat_Cmd : String_Access; -- Command to execute the GNAT compiler - Gnat_Args : Argument_List_Access := new Argument_List' - (new String'("-c"), new String'("-x"), new String'("ada"), - new String'("-gnats"), new String'("-gnatu")); + Gnat_Args : Argument_List_Access := + new Argument_List' + (new String'("-c"), + new String'("-x"), + new String'("ada"), + new String'("-gnats"), + new String'("-gnatu")); -- Arguments used in Gnat_Cmd call EOF : constant Character := Character'Val (26); @@ -207,7 +206,7 @@ procedure Gnatchop is -- Local subprograms -- ----------------------- - procedure Error_Msg (Message : String); + procedure Error_Msg (Message : String; Warning : Boolean := False); -- Produce an error message on standard error output procedure File_Time_Stamp (Name : C_File_Name; Time : OS_Time); @@ -337,13 +336,16 @@ procedure Gnatchop is -- Error_Msg -- --------------- - procedure Error_Msg (Message : String) is + procedure Error_Msg (Message : String; Warning : Boolean := False) is begin Put_Line (Standard_Error, Message); - Set_Exit_Status (Failure); - if Exit_On_Error then - raise Terminate_Program; + if not Warning then + Set_Exit_Status (Failure); + + if Exit_On_Error then + raise Terminate_Program; + end if; end if; end Error_Msg; @@ -1107,6 +1109,7 @@ procedure Gnatchop is else Error_Msg ("-k# requires numeric parameter"); end if; + return False; end if; end loop; @@ -1126,23 +1129,31 @@ procedure Gnatchop is end; when 'p' => - Preserve_Mode := True; + Preserve_Mode := True; when 'q' => - Quiet_Mode := True; + Quiet_Mode := True; when 'r' => Source_References := True; when 'v' => - Verbose_Mode := True; - Put_Line (Standard_Error, Cwrite); + Verbose_Mode := True; + + -- Why is following written to standard error. Most other + -- tools write to standard output ??? + + Put (Standard_Error, "GNATCHOP "); + Put (Standard_Error, Gnatvsn.Gnat_Version_String); + Put_Line + (Standard_Error, + " Copyright 1998-2000, Ada Core Technologies Inc."); when 'w' => - Overwrite_Files := True; + Overwrite_Files := True; when 'x' => - Exit_On_Error := True; + Exit_On_Error := True; when others => null; @@ -1687,7 +1698,7 @@ begin if Unit.Last = 0 then if not Write_gnat_adc then - Error_Msg ("no compilation units found"); + Error_Msg ("no compilation units found", Warning => True); end if; goto No_Files_Written; @@ -1727,7 +1738,7 @@ begin declare Warnings_Msg : String := Warning_Count'Img & " warning(s)"; begin - Error_Msg (Warnings_Msg (2 .. Warnings_Msg'Last)); + Error_Msg (Warnings_Msg (2 .. Warnings_Msg'Last), Warning => True); end; end if; @@ -1739,7 +1750,7 @@ begin -- been written. if not Write_gnat_adc then - Error_Msg ("no source files written"); + Error_Msg ("no source files written", Warning => True); end if; return; diff --git a/gcc/ada/gnatlbr.adb b/gcc/ada/gnatlbr.adb index dd200508169..917f06416da 100644 --- a/gcc/ada/gnatlbr.adb +++ b/gcc/ada/gnatlbr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,11 +47,10 @@ 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 Sdefault; use Sdefault; with System; procedure GnatLbr is - pragma Ident (Gnat_Version_String); + pragma Ident (Gnat_Static_Version_String); type Lib_Mode is (None, Create, Set, Delete); Next_Arg : Integer; @@ -192,7 +191,7 @@ begin -- there are two. -- Include_Dirs := 0; - Include_Dir_Name := String_Access (Include_Dir_Default_Name); + Include_Dir_Name := new String'(Include_Dir_Default_Prefix); Get_Next_Dir_In_Path_Init (String_Access (Include_Dir_Name)); loop @@ -208,7 +207,7 @@ begin end loop; Object_Dirs := 0; - Object_Dir_Name := String_Access (Object_Dir_Default_Name); + Object_Dir_Name := new String'(Object_Dir_Default_Prefix); Get_Next_Dir_In_Path_Init (String_Access (Object_Dir_Name)); loop @@ -255,7 +254,8 @@ begin & F_ADC_File (1 .. F_ADC_File_Len)); Make_Args (6) := - new String'("LIBRARY_VERSION=" & '"' & Library_Version & '"'); + new String'("LIBRARY_VERSION=" & '"' & + Verbose_Library_Version & '"'); Make_Args (7) := new String'("-f"); diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 123cff59800..5d198c03144 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -42,6 +42,7 @@ with Types; with Ada.Command_Line; use Ada.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with Interfaces.C_Streams; use Interfaces.C_Streams; +with System.CRTL; procedure Gnatlink is pragma Ident (Gnatvsn.Gnat_Static_Version_String); @@ -619,6 +620,10 @@ procedure Gnatlink is GNAT_Shared : Boolean := False; -- Save state of -shared option. + Xlinker_Was_Previous : Boolean := False; + -- Indicate that "-Xlinker" was the option preceding the current + -- option. If True, then the current option is never suppressed. + -- Rollback data -- These data items are used to store current binder file context. @@ -766,6 +771,7 @@ procedure Gnatlink is ------------------------ procedure Store_File_Context is + use type System.CRTL.long; begin RB_Next_Line := Next_Line; RB_Nfirst := Nfirst; @@ -936,8 +942,17 @@ procedure Gnatlink is -- Process switches and options if Next_Line (Nfirst .. Nlast) /= End_Info then + Xlinker_Was_Previous := False; + loop - if Next_Line (Nfirst .. Nlast) = "-static" then + if Xlinker_Was_Previous + or else Next_Line (Nfirst .. Nlast) = "-Xlinker" + then + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := + new String'(Next_Line (Nfirst .. Nlast)); + + elsif Next_Line (Nfirst .. Nlast) = "-static" then GNAT_Static := True; elsif Next_Line (Nfirst .. Nlast) = "-shared" then @@ -946,9 +961,7 @@ procedure Gnatlink is -- Add binder options only if not already set on the command -- line. This rule is a way to control the linker options order. - elsif not Is_Option_Present (Next_Line (Nfirst .. Nlast)) - or else Next_Line (Nfirst .. Nlast) = "-Xlinker" - then + elsif not Is_Option_Present (Next_Line (Nfirst .. Nlast)) then if Nlast > Nfirst + 2 and then Next_Line (Nfirst .. Nfirst + 1) = "-L" then @@ -1125,6 +1138,8 @@ procedure Gnatlink is end if; end if; + Xlinker_Was_Previous := Next_Line (Nfirst .. Nlast) = "-Xlinker"; + Get_Next_Line; exit when Next_Line (Nfirst .. Nlast) = End_Info; diff --git a/gcc/ada/gnatmem.adb b/gcc/ada/gnatmem.adb index a852b26f8bc..8deca2e1873 100644 --- a/gcc/ada/gnatmem.adb +++ b/gcc/ada/gnatmem.adb @@ -228,7 +228,7 @@ procedure Gnatmem is procedure Usage is begin New_Line; - Put ("GNATMEM Pro "); + Put ("GNATMEM "); Put (Gnat_Version_String); Put_Line (" Copyright 1997-2003 Free Software Foundation, Inc."); New_Line; diff --git a/gcc/ada/gnatpsta.adb b/gcc/ada/gnatpsta.adb deleted file mode 100644 index 502445d355f..00000000000 --- a/gcc/ada/gnatpsta.adb +++ /dev/null @@ -1,373 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT SYSTEM UTILITIES -- --- -- --- G N A T P S T A -- --- -- --- B o d y -- --- -- --- Copyright (C) 1997-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- Program to print out listing of Standard package for the target (not --- the host) with all constants appearing explicitly. This is not really --- valid Ada, since one cannot really define new base types, but it is a --- helpful listing from a documentation point of view. - --- Note that special care has been taken to use the host parameters for --- integer and floating point sizes. - -with Ada.Text_IO; use Ada.Text_IO; -with Gnatvsn; -with Ttypef; use Ttypef; -with Ttypes; use Ttypes; -with Types; use Types; - -procedure GnatPsta is - pragma Ident (Gnatvsn.Gnat_Static_Version_String); - - procedure P (Item : String) renames Ada.Text_IO.Put_Line; - - procedure P_Int_Range (Size : Pos; Put_First : Boolean := True); - -- Prints the range of an integer based on its Size. If Put_First is - -- False, then skip the first bound. - - procedure P_Float_Range (Nb_Digits : Pos); - -- Prints the maximum range of a Float whose 'Digits is given by Nb_Digits - - ------------------- - -- P_Float_Range -- - ------------------- - - procedure P_Float_Range (Nb_Digits : Pos) is - begin - -- This routine assumes only IEEE floats. - -- ??? Should the following be adapted for OpenVMS ? - - case Nb_Digits is - when IEEES_Digits => - P (" range " & IEEES_First'Universal_Literal_String & " .. " & - IEEES_Last'Universal_Literal_String & ";"); - when IEEEL_Digits => - P (" range " & IEEEL_First'Universal_Literal_String & " .. " & - IEEEL_Last'Universal_Literal_String & ";"); - when IEEEX_Digits => - P (" range " & IEEEX_First'Universal_Literal_String & " .. " & - IEEEX_Last'Universal_Literal_String & ";"); - - when others => - P (";"); - end case; - - -- If one of the floating point types of the host computer has the - -- same digits as the target float we are processing, then print out - -- the float range using the host computer float type. - - if Nb_Digits = Short_Float'Digits then - P (" -- " & - Short_Float'First'Img & " .. " & Short_Float'Last'Img); - - elsif Nb_Digits = Float'Digits then - P (" -- " & - Float'First'Img & " .. " & Float'Last'Img); - - elsif Nb_Digits = Long_Float'Digits then - P (" -- " & - Long_Float'First'Img & " .. " & Long_Float'Last'Img); - - elsif Nb_Digits = Long_Long_Float'Digits then - P (" -- " & - Long_Long_Float'First'Img & " .. " & Long_Long_Float'Last'Img); - end if; - - New_Line; - end P_Float_Range; - - ----------------- - -- P_Int_Range -- - ----------------- - - procedure P_Int_Range (Size : Pos; Put_First : Boolean := True) is - begin - if Put_First then - Put (" is range -(2 **" & Pos'Image (Size - 1) & ")"); - end if; - P (" .. +(2 **" & Pos'Image (Size - 1) & " - 1);"); - end P_Int_Range; - --- Start of processing for GnatPsta - -begin - P ("package Standard is"); - P ("pragma Pure(Standard);"); - New_Line; - - P (" type Boolean is (False, True);"); - New_Line; - - -- Integer types - - Put (" type Integer"); - P_Int_Range (Standard_Integer_Size); - New_Line; - - Put (" subtype Natural is Integer range 0"); - P_Int_Range (Standard_Integer_Size, Put_First => False); - - Put (" subtype Positive is Integer range 1"); - P_Int_Range (Standard_Integer_Size, Put_First => False); - New_Line; - - Put (" type Short_Short_Integer"); - P_Int_Range (Standard_Short_Short_Integer_Size); - - Put (" type Short_Integer "); - P_Int_Range (Standard_Short_Integer_Size); - - Put (" type Long_Integer "); - P_Int_Range (Standard_Long_Integer_Size); - - Put (" type Long_Long_Integer "); - P_Int_Range (Standard_Long_Long_Integer_Size); - New_Line; - - -- Floating point types - - P (" type Short_Float is digits" - & Standard_Short_Float_Digits'Img); - P_Float_Range (Standard_Short_Float_Digits); - - P (" type Float is digits" - & Standard_Float_Digits'Img); - P_Float_Range (Standard_Float_Digits); - - P (" type Long_Float is digits" - & Standard_Long_Float_Digits'Img); - P_Float_Range (Standard_Long_Float_Digits); - - P (" type Long_Long_Float is digits" - & Standard_Long_Long_Float_Digits'Img); - P_Float_Range (Standard_Long_Long_Float_Digits); - - P (" -- function ""*"" (Left : root_integer; Right : root_real)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""*"" (Left : root_real; Right : root_integer)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""/"" (Left : root_real; Right : root_integer)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""*"" (Left : universal_fixed; " & - "Right : universal_fixed)"); - P (" -- return universal_fixed;"); - New_Line; - - P (" -- function ""/"" (Left : universal_fixed; " & - "Right : universal_fixed)"); - P (" -- return universal_fixed;"); - New_Line; - - P (" -- The declaration of type Character is based on the standard"); - P (" -- ISO 8859-1 character set."); - New_Line; - - P (" -- There are no character literals corresponding to the positions"); - P (" -- for control characters. They are indicated by lower case"); - P (" -- identifiers in the following list."); - New_Line; - - P (" -- Note: this type cannot be represented accurately in Ada"); - New_Line; - - P (" -- type Character is"); - New_Line; - - P (" -- (nul, soh, stx, etx, eot, enq, ack, bel,"); - P (" -- bs, ht, lf, vt, ff, cr, so, si,"); - New_Line; - - P (" -- dle, dc1, dc2, dc3, dc4, nak, syn, etb,"); - P (" -- can, em, sub, esc, fs, gs, rs, us,"); - New_Line; - - P (" -- ' ', '!', '""', '#', '$', '%', '&', ''',"); - P (" -- '(', ')', '*', '+', ',', '-', '.', '/',"); - New_Line; - - P (" -- '0', '1', '2', '3', '4', '5', '6', '7',"); - P (" -- '8', '9', ':', ';', '<', '=', '>', '?',"); - New_Line; - - P (" -- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',"); - P (" -- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',"); - New_Line; - - P (" -- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',"); - P (" -- 'X', 'Y', 'Z', '[', '\', ']', '^', '_',"); - New_Line; - - P (" -- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',"); - P (" -- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',"); - New_Line; - - P (" -- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',"); - P (" -- 'x', 'y', 'z', '{', '|', '}', '~', del,"); - New_Line; - - P (" -- reserved_128, reserved_129, bph, nbh,"); - P (" -- reserved_132, nel, ssa, esa,"); - New_Line; - - P (" -- hts, htj, vts, pld, plu, ri, ss2, ss3,"); - New_Line; - - P (" -- dcs, pu1, pu2, sts, cch, mw, spa, epa,"); - New_Line; - - P (" -- sos, reserved_153, sci, csi,"); - P (" -- st, osc, pm, apc,"); - New_Line; - - P (" -- ... );"); - New_Line; - - P (" -- The declaration of type Wide_Character is based " & - "on the standard"); - P (" -- ISO 10646 BMP character set."); - New_Line; - - P (" -- Note: this type cannot be represented accurately in Ada"); - New_Line; - - P (" -- The first 256 positions have the same contents as " & - "type Character"); - New_Line; - - P (" -- type Wide_Character is (nul, soh ... FFFE, FFFF);"); - New_Line; - - P (" package ASCII is"); - New_Line; - - P (" -- Control characters:"); - New_Line; - - P (" NUL : constant Character := Character'Val (16#00#);"); - P (" SOH : constant Character := Character'Val (16#01#);"); - P (" STX : constant Character := Character'Val (16#02#);"); - P (" ETX : constant Character := Character'Val (16#03#);"); - P (" EOT : constant Character := Character'Val (16#04#);"); - P (" ENQ : constant Character := Character'Val (16#05#);"); - P (" ACK : constant Character := Character'Val (16#06#);"); - P (" BEL : constant Character := Character'Val (16#07#);"); - P (" BS : constant Character := Character'Val (16#08#);"); - P (" HT : constant Character := Character'Val (16#09#);"); - P (" LF : constant Character := Character'Val (16#0A#);"); - P (" VT : constant Character := Character'Val (16#0B#);"); - P (" FF : constant Character := Character'Val (16#0C#);"); - P (" CR : constant Character := Character'Val (16#0D#);"); - P (" SO : constant Character := Character'Val (16#0E#);"); - P (" SI : constant Character := Character'Val (16#0F#);"); - P (" DLE : constant Character := Character'Val (16#10#);"); - P (" DC1 : constant Character := Character'Val (16#11#);"); - P (" DC2 : constant Character := Character'Val (16#12#);"); - P (" DC3 : constant Character := Character'Val (16#13#);"); - P (" DC4 : constant Character := Character'Val (16#14#);"); - P (" NAK : constant Character := Character'Val (16#15#);"); - P (" SYN : constant Character := Character'Val (16#16#);"); - P (" ETB : constant Character := Character'Val (16#17#);"); - P (" CAN : constant Character := Character'Val (16#18#);"); - P (" EM : constant Character := Character'Val (16#19#);"); - P (" SUB : constant Character := Character'Val (16#1A#);"); - P (" ESC : constant Character := Character'Val (16#1B#);"); - P (" FS : constant Character := Character'Val (16#1C#);"); - P (" GS : constant Character := Character'Val (16#1D#);"); - P (" RS : constant Character := Character'Val (16#1E#);"); - P (" US : constant Character := Character'Val (16#1F#);"); - P (" DEL : constant Character := Character'Val (16#7F#);"); - New_Line; - - P (" -- Other characters:"); - New_Line; - - P (" Exclam : constant Character := '!';"); - P (" Quotation : constant Character := '""';"); - P (" Sharp : constant Character := '#';"); - P (" Dollar : constant Character := '$';"); - P (" Percent : constant Character := '%';"); - P (" Ampersand : constant Character := '&';"); - P (" Colon : constant Character := ':';"); - P (" Semicolon : constant Character := ';';"); - P (" Query : constant Character := '?';"); - P (" At_Sign : constant Character := '@';"); - P (" L_Bracket : constant Character := '[';"); - P (" Back_Slash : constant Character := '\';"); - P (" R_Bracket : constant Character := ']';"); - P (" Circumflex : constant Character := '^';"); - P (" Underline : constant Character := '_';"); - P (" Grave : constant Character := '`';"); - P (" L_Brace : constant Character := '{';"); - P (" Bar : constant Character := '|';"); - P (" R_Brace : constant Character := '}';"); - P (" Tilde : constant Character := '~';"); - New_Line; - - P (" -- Lower case letters:"); - New_Line; - - for C in Character range 'a' .. 'z' loop - P (" LC_" & Character'Val (Character'Pos (C) - 32) & - " : constant Character := '" & C & "';"); - end loop; - New_Line; - - P (" end ASCII;"); - New_Line; - - P (" type String is array (Positive range <>) of Character;"); - P (" pragma Pack (String);"); - New_Line; - - P (" type Wide_String is array (Positive range <>) of Wide_Character;"); - P (" pragma Pack (Wide_String);"); - New_Line; - - -- Here it's OK to use the Duration type of the host compiler since - -- the implementation of Duration in GNAT is target independent. - - P (" type Duration is delta" & - Duration'Image (Duration'Delta)); - P (" range -((2 **" & Natural'Image (Duration'Size - 1) & - " - 1) *" & Duration'Image (Duration'Delta) & ") .."); - P (" +((2 **" & Natural'Image (Duration'Size - 1) & - " - 1) *" & Duration'Image (Duration'Delta) & ");"); - P (" for Duration'Small use" & Duration'Image (Duration'Small) & ";"); - New_Line; - - P (" Constraint_Error : exception;"); - P (" Program_Error : exception;"); - P (" Storage_Error : exception;"); - P (" Tasking_Error : exception;"); - New_Line; - - P ("end Standard;"); -end GnatPsta; diff --git a/gcc/ada/gnatsym.adb b/gcc/ada/gnatsym.adb index b5523f87da1..a15cb6df732 100644 --- a/gcc/ada/gnatsym.adb +++ b/gcc/ada/gnatsym.adb @@ -37,7 +37,9 @@ -- only on OpenVMS. -- gnatsym takes as parameters: --- - the name of the symbol file to create or update +-- - the name of the symbol file to create +-- - (optional) the policy to create the symbol file +-- - (optional) the name of the reference symbol file -- - the names of one or more object files where the symbols are found with GNAT.Command_Line; use GNAT.Command_Line; @@ -52,13 +54,16 @@ with Table; procedure Gnatsym is + Empty_String : aliased String := ""; + Empty : constant String_Access := Empty_String'Unchecked_Access; + -- To initialize variables Reference and Version_String + Copyright_Displayed : Boolean := False; -- A flag to prevent multiple display of the Copyright notice Success : Boolean := True; - Force : Boolean := False; - -- True when -f switcxh is used + Symbol_Policy : Policy := Autonomous; Verbose : Boolean := False; -- True when -v switch is used @@ -66,9 +71,15 @@ procedure Gnatsym is Quiet : Boolean := False; -- True when -q switch is used - Symbol_File_Name : String_Access; + Symbol_File_Name : String_Access := null; -- The name of the symbol file + Reference_Symbol_File_Name : String_Access := Empty; + -- The name of the reference symbol file + + Version_String : String_Access := Empty; + -- The version of the library. Used on VMS. + package Object_Files is new Table.Table (Table_Component_Type => String_Access, Table_Index_Type => Natural, @@ -113,19 +124,32 @@ procedure Gnatsym is procedure Parse_Cmd_Line is begin loop - case GNAT.Command_Line.Getopt ("f q v") is + case GNAT.Command_Line.Getopt ("c C q r: s: v V:") is when ASCII.NUL => exit; - when 'f' => - Force := True; + when 'c' => + Symbol_Policy := Compliant; + + when 'C' => + Symbol_Policy := Controlled; when 'q' => Quiet := True; + when 'r' => + Reference_Symbol_File_Name := + new String'(GNAT.Command_Line.Parameter); + + when 's' => + Symbol_File_Name := new String'(GNAT.Command_Line.Parameter); + when 'v' => Verbose := True; + when 'V' => + Version_String := new String'(GNAT.Command_Line.Parameter); + when others => Fail ("invalid switch: ", Full_Switch); end case; @@ -141,13 +165,8 @@ procedure Gnatsym is begin exit when S'Length = 0; - if Symbol_File_Name = null then - Symbol_File_Name := S; - - else - Object_Files.Increment_Last; - Object_Files.Table (Object_Files.Last) := S; - end if; + Object_Files.Increment_Last; + Object_Files.Table (Object_Files.Last) := S; end; end loop; exception @@ -162,11 +181,17 @@ procedure Gnatsym is procedure Usage is begin - Write_Line ("gnatsym [options] sym_file object_file {object_file}"); + Write_Line ("gnatsym [options] object_file {object_file}"); Write_Eol; - Write_Line (" -f Force generation of symbol file"); - Write_Line (" -q Quiet mode"); - Write_Line (" -v Verbose mode"); + Write_Line (" -c Compliant policy"); + Write_Line (" -C Controlled policy"); + Write_Line (" -q Quiet mode"); + Write_Line (" -r Reference symbol file name"); + Write_Line (" -s Symbol file name"); + Write_Line (" -v Verbose mode"); + Write_Line (" -V Version"); + Write_Eol; + Write_Line ("Specifying a symbol file with -s is compulsory"); Write_Eol; end Usage; @@ -188,7 +213,7 @@ begin -- If there is no symbol file or no object files on the command line, -- display the usage and exit with an error status. - if Object_Files.Last = 0 then + if Symbol_File_Name = null or else Object_Files.Last = 0 then Usage; OS_Exit (1); @@ -199,9 +224,16 @@ begin Write_Line (""""); end if; - -- Initialize the symbol file + -- Initialize the symbol file and, if specified, read the reference + -- file. - Symbols.Initialize (Symbol_File_Name.all, Force, Quiet, Success); + Symbols.Initialize + (Symbol_File => Symbol_File_Name.all, + Reference => Reference_Symbol_File_Name.all, + Symbol_Policy => Symbol_Policy, + Quiet => Quiet, + Version => Version_String.all, + Success => Success); -- Process the object files in order. Stop as soon as there is -- something wrong. @@ -232,6 +264,8 @@ begin Finalize (Quiet, Success); end if; + -- Fail if there was anything wrong + if not Success then Fail ("unable to build symbol file"); end if; diff --git a/gcc/ada/gnatvsn.adb b/gcc/ada/gnatvsn.adb index cbeadd5d3f6..b15c6faf582 100644 --- a/gcc/ada/gnatvsn.adb +++ b/gcc/ada/gnatvsn.adb @@ -40,6 +40,15 @@ package body Gnatvsn is -- check for the nul character in Gnat_Version_String. pragma Import (C, Version_String, "version_string"); + ------------------------- + -- Get_Gnat_Build_Type -- + ------------------------- + + function Get_Gnat_Build_Type return Gnat_Build_Type is + begin + return FSF; + end Get_Gnat_Build_Type; + ------------------------- -- Gnat_Version_String -- ------------------------- diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads index f665e5339ee..3b2c5e84285 100644 --- a/gcc/ada/gnatvsn.ads +++ b/gcc/ada/gnatvsn.ads @@ -45,12 +45,24 @@ package Gnatvsn is -- Static string identifying this version, that can be used as an argument -- to e.g. pragma Ident. - Gnat_Version_Type : constant String := "FSF "; - -- GNAT FSF version. This version of GNAT is part of a Free Software - -- Foundation release of the GNU Compiler Collection (GCC). The binder - -- will not output informational messages regarding intended use, - -- and the bug box generated by Comperr will give information on - -- how to report bugs and list the "no warranty" information. + type Gnat_Build_Type is (FSF, Public); + -- See Get_Gnat_Build_Type below for the meaning of these values. + + function Get_Gnat_Build_Type return Gnat_Build_Type; + -- This function returns one of the following values of Gnat_Build_Type: + -- + -- FSF + -- GNAT FSF version. This version of GNAT is part of a Free Software + -- Foundation release of the GNU Compiler Collection (GCC). The binder + -- will not output informational messages regarding intended use, + -- and the bug box generated by Comperr will give information on + -- how to report bugs and list the "no warranty" information. + -- + -- Public + -- GNAT Public version. + -- The binder will output informational messages, and the bug box + -- generated by the package Comperr will give appropriate bug + -- submission instructions. Ver_Len_Max : constant := 32; -- Longest possible length for Gnat_Version_String in this or any @@ -59,7 +71,7 @@ package Gnatvsn is -- value should never be decreased in the future, but it would be -- OK to increase it if absolutely necessary. - Library_Version : constant String := "GNAT Lib v3.4"; + Library_Version : constant String := "3.4"; -- Library version. This value must be updated whenever any change to the -- compiler affects the library formats in such a way as to obsolete -- previously compiled library modules. @@ -67,6 +79,9 @@ package Gnatvsn is -- Note: Makefile.in relies on the precise format of the library version -- string in order to correctly construct the soname value. + Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version; + -- Version string stored in e.g. ALI files. + ASIS_Version_Number : constant := 2; -- ASIS Version. This is used to check for consistency between the compiler -- used to generate trees, and an ASIS application that is reading the diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb index 7e429585b93..a7b22d6a3c8 100644 --- a/gcc/ada/gnatxref.adb +++ b/gcc/ada/gnatxref.adb @@ -24,10 +24,10 @@ -- -- ------------------------------------------------------------------------------ -with Xr_Tabls; use Xr_Tabls; -with Xref_Lib; use Xref_Lib; -with Osint; use Osint; -with Types; use Types; +with Xr_Tabls; use Xr_Tabls; +with Xref_Lib; use Xref_Lib; +with Osint; use Osint; +with Types; use Types; with Gnatvsn; with Opt; @@ -35,10 +35,9 @@ with Opt; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Command_Line; use GNAT.Command_Line; -with GNAT.Strings; use GNAT.Strings; +with GNAT.Strings; use GNAT.Strings; procedure Gnatxref is - Search_Unused : Boolean := False; Local_Symbols : Boolean := True; Prj_File : File_Name_String; @@ -209,8 +208,6 @@ procedure Gnatxref is ----------------- procedure Write_Usage is - use Ada.Text_IO; - begin Put_Line ("GNATXREF " & Gnatvsn.Gnat_Version_String & " Copyright 1998-2003, Ada Core Technologies Inc."); diff --git a/gcc/ada/gprcmd.adb b/gcc/ada/gprcmd.adb index 3d5766df703..5718e120d55 100644 --- a/gcc/ada/gprcmd.adb +++ b/gcc/ada/gprcmd.adb @@ -37,6 +37,11 @@ -- extend handle recursive directories ("/**" notation) -- deps post process dependency makefiles -- stamp copy file time stamp from file1 to file2 +-- prefix get the prefix of the GNAT installation + +with Gnatvsn; +with Osint; use Osint; +with Namet; use Namet; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Command_Line; use Ada.Command_Line; @@ -44,15 +49,12 @@ with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; use GNAT.OS_Lib; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.Regpat; use GNAT.Regpat; -with Gnatvsn; + procedure Gprcmd is -- ??? comments are thin throughout this unit - Version : constant String := - "GPRCMD " & Gnatvsn.Gnat_Version_String & - " Copyright 2002-2003, Ada Core Technologies Inc."; procedure Cat (File : String); -- Print the contents of file on standard output. @@ -347,7 +349,13 @@ begin begin if Cmd = "-v" then - Put_Line (Standard_Error, Version); + + -- Should this be on Standard_Error ??? + + Put (Standard_Error, "GPRCMD "); + Put (Standard_Error, Gnatvsn.Gnat_Version_String); + Put_Line (Standard_Error, + " Copyright 2002-2003, Free Software Fundation, Inc."); Usage; elsif Cmd = "pwd" then @@ -418,6 +426,40 @@ begin elsif Cmd = "stamp" then Check_Args (Argument_Count = 3); Copy_Time_Stamp (Argument (2), Argument (3)); + + elsif Cmd = "prefix" then + + -- Find the GNAT prefix. gprcmd is found in /bin. + -- So we find the full path of gprcmd, verify that it is in a + -- subdirectory "bin", and return the if it is the case. + -- Otherwise, nothing is returned. + + Find_Program_Name; + + declare + Path : String_Access := + Locate_Exec_On_Path (Name_Buffer (1 .. Name_Len)); + Index : Natural; + + begin + if Path /= null then + Index := Path'Last; + + while Index >= Path'First + 4 loop + exit when Path (Index) = Directory_Separator; + Index := Index - 1; + end loop; + + if Index > Path'First + 5 + and then Path (Index - 3 .. Index - 1) = "bin" + and then Path (Index - 4) = Directory_Separator + then + -- We have found the , return it. + + Put (Path (Path'First .. Index - 5)); + end if; + end if; + end; end if; end; end Gprcmd; diff --git a/gcc/ada/i-cstrea.adb b/gcc/ada/i-cstrea.adb index 9d322d42906..2c85bc937ed 100644 --- a/gcc/ada/i-cstrea.adb +++ b/gcc/ada/i-cstrea.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,8 @@ with Unchecked_Conversion; package body Interfaces.C_Streams is + use type System.CRTL.size_t; + ------------ -- fread -- ------------ diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads index 4650cdbde83..39f8af90a74 100644 --- a/gcc/ada/i-cstrea.ads +++ b/gcc/ada/i-cstrea.ads @@ -34,38 +34,17 @@ -- This package is a thin binding to selected functions in the C -- library that provide a complete interface for handling C streams. -with System.Parameters; +with System.CRTL; package Interfaces.C_Streams is pragma Preelaborate; - -- Note: the reason we do not use the types that are in Interfaces.C is - -- that we want to avoid dragging in the code in this unit if possible. - - subtype chars is System.Address; - -- Pointer to null-terminated array of characters - - subtype FILEs is System.Address; - -- Corresponds to the C type FILE* - + subtype chars is System.CRTL.chars; + subtype FILEs is System.CRTL.FILEs; + subtype int is System.CRTL.int; + subtype long is System.CRTL.long; + subtype size_t is System.CRTL.size_t; subtype voids is System.Address; - -- Corresponds to the C type void* - - subtype int is Integer; - -- Note: the above type is a subtype deliberately, and it is part of - -- this spec that the above correspondence is guaranteed. This means - -- that it is legitimate to, for example, use Integer instead of int. - -- We provide this synonym for clarity, but in some cases it may be - -- convenient to use the underlying types (for example to avoid an - -- unnecessary dependency of a spec on the spec of this unit). - - type long is range -(2 ** (System.Parameters.long_bits - 1)) - .. +(2 ** (System.Parameters.long_bits - 1)) - 1; - -- Note: the above type also used to be a subtype, but the correspondence - -- was unused so it was made into a parameterized type to avoid having - -- multiple versions of this spec for systems where long /= Long_Integer. - - type size_t is mod 2 ** Standard'Address_Size; NULL_Stream : constant FILEs; -- Value returned (NULL in C) to indicate an fdopen/fopen/tmpfile error @@ -106,34 +85,39 @@ package Interfaces.C_Streams is -- Library Reference" (Microsoft Press, 1990, ISBN 1-55615-225-6), -- which includes useful information on system compatibility. - procedure clearerr (stream : FILEs); + procedure clearerr (stream : FILEs) renames System.CRTL.clearerr; - function fclose (stream : FILEs) return int; + function fclose (stream : FILEs) return int renames System.CRTL.fclose; - function fdopen (handle : int; mode : chars) return FILEs; + function fdopen (handle : int; mode : chars) return FILEs + renames System.CRTL.fdopen; function feof (stream : FILEs) return int; function ferror (stream : FILEs) return int; - function fflush (stream : FILEs) return int; + function fflush (stream : FILEs) return int renames System.CRTL.fflush; - function fgetc (stream : FILEs) return int; + function fgetc (stream : FILEs) return int renames System.CRTL.fgetc; - function fgets (strng : chars; n : int; stream : FILEs) return chars; + function fgets (strng : chars; n : int; stream : FILEs) return chars + renames System.CRTL.fgets; function fileno (stream : FILEs) return int; - function fopen (filename : chars; Mode : chars) return FILEs; + function fopen (filename : chars; Mode : chars) return FILEs + renames System.CRTL.fopen; -- Note: to maintain target independence, use text_translation_required, -- a boolean variable defined in a-sysdep.c to deal with the target -- dependent text translation requirement. If this variable is set, -- then b/t should be appended to the standard mode argument to set -- the text translation mode off or on as required. - function fputc (C : int; stream : FILEs) return int; + function fputc (C : int; stream : FILEs) return int + renames System.CRTL.fputc; - function fputs (Strng : chars; Stream : FILEs) return int; + function fputs (Strng : chars; Stream : FILEs) return int + renames System.CRTL.fputs; function fread (buffer : voids; @@ -159,15 +143,16 @@ package Interfaces.C_Streams is (filename : chars; mode : chars; stream : FILEs) - return FILEs; + return FILEs renames System.CRTL.freopen; function fseek (stream : FILEs; offset : long; origin : int) - return int; + return int renames System.CRTL.fseek; - function ftell (stream : FILEs) return long; + function ftell (stream : FILEs) return long + renames System.CRTL.ftell; function fwrite (buffer : voids; @@ -176,12 +161,12 @@ package Interfaces.C_Streams is stream : FILEs) return size_t; - function isatty (handle : int) return int; + function isatty (handle : int) return int renames System.CRTL.isatty; - procedure mktemp (template : chars); + procedure mktemp (template : chars) renames System.CRTL.mktemp; -- The return value (which is just a pointer to template) is discarded - procedure rewind (stream : FILEs); + procedure rewind (stream : FILEs) renames System.CRTL.rewind; function setvbuf (stream : FILEs; @@ -190,16 +175,18 @@ package Interfaces.C_Streams is size : size_t) return int; - procedure tmpnam (string : chars); + procedure tmpnam (string : chars) renames System.CRTL.tmpnam; -- The parameter must be a pointer to a string buffer of at least L_tmpnam -- bytes (the call with a null parameter is not supported). The returned -- value, which is just a copy of the input argument, is discarded. - function tmpfile return FILEs; + function tmpfile return FILEs renames System.CRTL.tmpfile; - function ungetc (c : int; stream : FILEs) return int; + function ungetc (c : int; stream : FILEs) return int + renames System.CRTL.ungetc; - function unlink (filename : chars) return int; + function unlink (filename : chars) return int + renames System.CRTL.unlink; --------------------- -- Extra functions -- @@ -253,29 +240,6 @@ private pragma Inline (fwrite); pragma Inline (setvbuf); - -- The following routines are always functions in C, and thus can be - -- imported directly into Ada without any intermediate C needed - - pragma Import (C, clearerr); - pragma Import (C, fclose); - pragma Import (C, fdopen); - pragma Import (C, fflush); - pragma Import (C, fgetc); - pragma Import (C, fgets); - pragma Import (C, fopen); - pragma Import (C, fputc); - pragma Import (C, fputs); - pragma Import (C, freopen); - pragma Import (C, fseek); - pragma Import (C, ftell); - pragma Import (C, isatty); - pragma Import (C, mktemp); - pragma Import (C, rewind); - pragma Import (C, tmpnam); - pragma Import (C, tmpfile); - pragma Import (C, ungetc); - pragma Import (C, unlink); - pragma Import (C, file_exists, "__gnat_file_exists"); pragma Import (C, is_regular_file, "__gnat_is_regular_file_fd"); diff --git a/gcc/ada/i-vthrea.adb b/gcc/ada/i-vthrea.adb deleted file mode 100644 index 049e1c4bf68..00000000000 --- a/gcc/ada/i-vthrea.adb +++ /dev/null @@ -1,386 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- I N T E R F A C E S . V T H R E A D S -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003, 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- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL 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 GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Implement APEX process registration for AE653 - -with Ada.Exceptions; use Ada.Exceptions; -with Ada.Unchecked_Conversion; - -with Interfaces.C; - -with System.Secondary_Stack; -with System.Soft_Links; -with System.Task_Primitives.Ae_653; -with System.Task_Primitives.Operations; use System.Task_Primitives.Operations; -with System.Tasking; use System.Tasking; -with System.Task_Info; -with System.Tasking.Initialization; - -package body Interfaces.Vthreads is - - use System.OS_Interface; - - ----------------------- - -- Local Subprograms -- - ----------------------- - - procedure Enter_Task (T : Task_ID; Thread : Thread_Id); - -- Duplicate and generalize - -- System.Task_Primitives.Operations.Enter_Task - - procedure GNAT_Error_Handler (Sig : Signal); - -- Signal handler for ARINC processes - - procedure Init_Float; - pragma Import (C, Init_Float, "__gnat_init_float"); - -- Properly initializes the FPU for PPC systems. - - procedure Install_Handler; - -- Install signal handlers for the calling ARINC process - - function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID; - -- Duplicate and generalize - -- System.Task_Primitives.Operations.Register_Foreign_Thread - - ----------------------------- - -- Install_Signal_Handlers -- - ----------------------------- - - function Install_Signal_Handlers return Interfaces.C.int is - begin - Install_Handler; - Init_Float; - return 0; - end Install_Signal_Handlers; - - ---------------------- - -- Register_Foreign -- - ---------------------- - - -- Create Ada task data structures for an ARINC process. All dynamic - -- allocation of related data structures must be done via this routine. - - function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS is - use Interfaces.C; - use System.Task_Primitives.Ae_653; - - pragma Assert (taskVarGet (T, ATCB_Key_Addr) = ERROR); - -- "T" is not yet registered - - Result : OSI.STATUS := taskIdVerify (T); - Status : OSI.STATUS := OK; - Temp_Id : Task_ID; - - begin - if Result = OK then - Status := taskVarGet (T, ATCB_Key_Addr); - - -- Error of already registered - - if Status /= ERROR then - Result := ERROR; - - else - -- Create a TCB - - declare - -- Make sure the caller has a TCB, since it's possible to have - -- pure C APEX processes that create ones calling Ada code - - Caller : Task_ID; - - begin - Status := taskVarGet (taskIdSelf, ATCB_Key_Addr); - - if Status = ERROR then - Caller := Register_Foreign_Thread (taskIdSelf); - end if; - end; - - if taskIdSelf /= T then - Temp_Id := Register_Foreign_Thread (T); - end if; - - Result := OK; - end if; - end if; - - return Result; - end Register_Foreign; - - ------------------- - -- Reset_Foreign -- - ------------------- - - -- Reinitialize Ada task data structures. No dynamic allocation - -- may occur via this routine. - - function Reset_Foreign (T : Thread_Id) return STATUS is - use Interfaces.C; - use System.Secondary_Stack; - use System.Task_Primitives.Ae_653; - use type System.Address; - - pragma Assert (taskVarGet (T, ATCB_Key_Addr) /= ERROR); - -- "T" has already been registered - - Result : STATUS := taskVarGet (T, ATCB_Key_Addr); - function To_Address is new Ada.Unchecked_Conversion - (Interfaces.C.int, System.Address); - - pragma Assert ( - To_Task_Id - (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr - /= System.Null_Address); - -- "T" already has a secondary stack - - begin - if Result /= ERROR then - - -- Just reset the secondary stack pointer. The implementation here - -- assumes that the fixed secondary stack implementation is used. - -- If not, there will be a memory leak (along with allocation, which - -- is prohibited for ARINC processes once the system enters "normal" - -- mode). - - SS_Init - (To_Task_Id - (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr); - Result := OK; - end if; - - return Result; - end Reset_Foreign; - - ------------------ - -- Setup_Thread -- - ------------------ - - function Setup_Thread return System.Address is - Result : System.Address := System.Null_Address; - Status : OSI.STATUS; - - begin - if Is_Valid_Task then - Status := Reset_Foreign (taskIdSelf); - Result := - To_Address (System.Task_Primitives.Operations.Self); - else - Status := Register_Foreign (taskIdSelf); - Install_Handler; - Init_Float; - Result := - To_Address (System.Task_Primitives.Operations.Self); - end if; - - return Result; - end Setup_Thread; - - ---------------- - -- Enter_Task -- - ---------------- - - procedure Enter_Task (T : Task_ID; Thread : Thread_Id) is - use System.Task_Primitives.Ae_653; - - begin - Set_Task_Thread (T, Thread); - end Enter_Task; - - ------------------------ - -- GNAT_Error_Handler -- - ------------------------ - - procedure GNAT_Error_Handler (Sig : Signal) is - Mask : aliased sigset_t; - Result : int; - - begin - -- This code is the Ada replacement for init.c in the - -- AE653 level B runtime. - - -- VxWorks will always mask out the signal during the signal - -- handler and will reenable it on a longjmp. GNAT does not - -- generate a longjmp to return from a signal handler so the - -- signal will still be masked unless we unmask it. - - Result := pthread_sigmask (SIG_SETMASK, null, Mask'Unchecked_Access); - Result := sigdelset (Mask'Access, Sig); - Result := pthread_sigmask (SIG_SETMASK, Mask'Unchecked_Access, null); - - case Sig is - when SIGFPE => - Raise_Exception (Constraint_Error'Identity, "SIGFPE"); - when SIGILL => - Raise_Exception (Constraint_Error'Identity, "SIGILL"); - when SIGSEGV => - Raise_Exception - (Program_Error'Identity, - "erroneous memory access"); - when SIGBUS => - -- SIGBUS indicates stack overflow when it occurs - -- in an application domain (but not in the Core - -- OS under AE653, or in the kernel domain under - -- AE 1.1). - Raise_Exception - (Storage_Error'Identity, - "stack overflow or SIGBUS"); - when others => - Raise_Exception (Program_Error'Identity, "unhandled signal"); - end case; - end GNAT_Error_Handler; - - --------------------- - -- Install_Handler -- - --------------------- - - procedure Install_Handler is - Mask : aliased sigset_t; - Signal_Action : aliased struct_sigaction; - Result : Interfaces.C.int; - - begin - -- Set up signal handler to map synchronous signals to appropriate - -- exceptions. Make sure that the handler isn't interrupted by - -- another signal that might cause a scheduling event! - - -- This code is the Ada replacement for init.c in the - -- AE653 level B runtime. - Signal_Action.sa_handler := GNAT_Error_Handler'Address; - Signal_Action.sa_flags := SA_ONSTACK; - Result := sigemptyset (Mask'Access); - Signal_Action.sa_mask := Mask; - - Result := sigaction - (Signal (SIGFPE), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGILL), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGSEGV), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGBUS), Signal_Action'Unchecked_Access, null); - - end Install_Handler; - - ----------------------------- - -- Register_Foreign_Thread -- - ----------------------------- - - Foreign_Task_Elaborated : aliased Boolean := True; - - function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID is - pragma Assert (Thread = taskIdSelf or else Is_Valid_Task); - -- Ensure that allocation will work - - Local_ATCB : aliased Ada_Task_Control_Block (0); - New_Id : Task_ID; - Succeeded : Boolean; - - use type Interfaces.C.unsigned; - use type System.Address; - use System.Task_Info; - use System.Task_Primitives.Ae_653; - - begin - if taskIdSelf = Thread then - declare - Self : Task_ID := Local_ATCB'Unchecked_Access; - -- Temporarily record this as the Task_ID for the thread - - begin - Set_Current_Priority (Self, System.Priority'First); - Set_Task_Thread (Self, Thread); - end; - end if; - - pragma Assert (Is_Valid_Task); - -- It is now safe to use an allocator for the real TCB - - New_Id := new Ada_Task_Control_Block (0); - - -- Finish initialization - - System.Tasking.Initialize_ATCB - (New_Id, null, System.Null_Address, Null_Task, - Foreign_Task_Elaborated'Access, - System.Priority'First, - System.Task_Info.Unspecified_Task_Info, 0, New_Id, - Succeeded); - pragma Assert (Succeeded); - - New_Id.Master_of_Task := 0; - New_Id.Master_Within := New_Id.Master_of_Task + 1; - - for L in New_Id.Entry_Calls'Range loop - New_Id.Entry_Calls (L).Self := New_Id; - New_Id.Entry_Calls (L).Level := L; - end loop; - - New_Id.Common.State := Runnable; - New_Id.Awake_Count := 1; - - -- Since this is not an ordinary Ada task, we will start out undeferred - - New_Id.Deferral_Level := 0; - - System.Soft_Links.Create_TSD (New_Id.Common.Compiler_Data); - - -- Allocate a fixed secondary stack - - pragma Assert - (New_Id.Common.Compiler_Data.Sec_Stack_Addr = System.Null_Address); - System.Secondary_Stack.SS_Init - (New_Id.Common.Compiler_Data.Sec_Stack_Addr); - - Enter_Task (New_Id, Thread); - - return New_Id; - end Register_Foreign_Thread; - - -- Force use of tasking versions of secondary stack routines: - - procedure Force_Closure renames - System.Tasking.Initialization.Defer_Abortion; - pragma Unreferenced (Force_Closure); - --- Package elaboration code - -begin - -- Register the exported routines with the vThreads ARINC API - - procCreateHookAdd (Register_Foreign'Access); - procStartHookAdd (Reset_Foreign'Access); -end Interfaces.Vthreads; diff --git a/gcc/ada/i-vthrea.ads b/gcc/ada/i-vthrea.ads deleted file mode 100644 index d4a79757cfe..00000000000 --- a/gcc/ada/i-vthrea.ads +++ /dev/null @@ -1,93 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- I N T E R F A C E S . V T H R E A D S -- --- -- --- S p e c -- --- -- --- Copyright (C) 2002-2003, 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- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL 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 GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Implement APEX process registration for AE653. The routines exported --- by this package are only called from the APEX CREATE and START routines --- in the AE653 vThreads API. A context clause for this unit must appear in --- the Ada APEX binding. --- --- If this package appears in a context clause for an application that will --- be run in a non-AE653 version of VxWorks, or in a non-vThreads AE653 --- partition, link or load errors for the symbols procCreateHookAdd and --- procStartHookAdd will occur, unless these routines are defined --- in the application. This is used when simulating AE653 in AE 1.1. - -with System.OS_Interface; -with Interfaces.C; - -package Interfaces.Vthreads is - - function Setup_Thread return System.Address; - -- Register an existing vxWorks task. This routine is used - -- under AE 1.1 when simulating AE 653. - - function Install_Signal_Handlers return Interfaces.C.int; - pragma Export (C, Install_Signal_Handlers, - "__gnat_install_signal_handlers"); - -- Map the synchronous signals SIGSEGV, SIGFPE, SIGILL and - -- SIGBUS to Ada exceptions for the calling ARINC process. - -- This routine should be called as early as possible in - -- each ARINC process body. - -- C declaration: - -- extern int __gnat_install_signal_handlers (); - -- This call is unnecessary on AE 1.1. - -private - package OSI renames System.OS_Interface; - - function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS; - -- Create runtime structures necessary for Ada language support for - -- an ARINC process. Called from APEX CREATE routine. - - function Reset_Foreign (T : OSI.Thread_Id) return OSI.STATUS; - -- Reset runtime structures upon an AE653 process restart. Called from - -- APEX START routine. - - -- When defining the following routines for export in an AE 1.1 - -- simulation of AE653, Interfaces.C.int may be used for the - -- parameters of FUNCPTR. - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - -------------------------------- - -- Imported vThreads Routines -- - -------------------------------- - - procedure procCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, procCreateHookAdd, "procCreateHookAdd"); - -- Registers task registration routine for AE653 - - procedure procStartHookAdd (StartHookFunction : FUNCPTR); - pragma Import (C, procStartHookAdd, "procStartHookAdd"); - -- Registers task restart routine for AE653 - -end Interfaces.Vthreads; diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index fcc174b8a33..d2a8645fc19 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -229,6 +229,7 @@ package body Impunit is "g-regist", -- GNAT.Registry "g-regpat", -- GNAT.Regpat "g-semaph", -- GNAT.Semaphores + "g-signal", -- GNAT.Signals "g-socket", -- GNAT.Sockets "g-souinf", -- GNAT.Source_Info "g-speche", -- GNAT.Spell_Checker diff --git a/gcc/ada/init.c b/gcc/ada/init.c index c23819d7e08..734a482bdcc 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -71,28 +71,28 @@ extern struct Exception_Data tasking_error; extern struct Exception_Data _abort_signal; #define Lock_Task system__soft_links__lock_task -extern void (*Lock_Task) PARAMS ((void)); +extern void (*Lock_Task) (void); #define Unlock_Task system__soft_links__unlock_task -extern void (*Unlock_Task) PARAMS ((void)); +extern void (*Unlock_Task) (void); #define Get_Machine_State_Addr \ system__soft_links__get_machine_state_addr -extern struct Machine_State *(*Get_Machine_State_Addr) PARAMS ((void)); +extern struct Machine_State *(*Get_Machine_State_Addr) (void); #define Check_Abort_Status \ system__soft_links__check_abort_status -extern int (*Check_Abort_Status) PARAMS ((void)); +extern int (*Check_Abort_Status) (void); #define Raise_From_Signal_Handler \ ada__exceptions__raise_from_signal_handler -extern void Raise_From_Signal_Handler PARAMS ((struct Exception_Data *, - const char *)); +extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *); #define Propagate_Signal_Exception \ __gnat_propagate_sig_exc -extern void Propagate_Signal_Exception - PARAMS ((struct Machine_State *, struct Exception_Data *, const char *)); +extern void Propagate_Signal_Exception (struct Machine_State *, + struct Exception_Data *, + const char *); /* Copies of global values computed by the binder */ int __gl_main_priority = -1; @@ -134,8 +134,7 @@ char __gnat_get_interrupt_state (int); 's' Interrupt_State pragma set state to System */ char -__gnat_get_interrupt_state (intrup) - int intrup; +__gnat_get_interrupt_state (int intrup) { if (intrup >= __gl_num_interrupt_states) return 'n'; @@ -156,30 +155,18 @@ __gnat_get_interrupt_state (intrup) boundaries like this are not handled correctly in all systems. */ void -__gnat_set_globals (main_priority, - time_slice_val, - wc_encoding, - locking_policy, - queuing_policy, - task_dispatching_policy, - restrictions, - interrupt_states, - num_interrupt_states, - unreserve_all_interrupts, - exception_tracebacks, - zero_cost_exceptions) - int main_priority; - int time_slice_val; - char wc_encoding; - char locking_policy; - char queuing_policy; - char task_dispatching_policy; - char *restrictions; - char *interrupt_states; - int num_interrupt_states; - int unreserve_all_interrupts; - int exception_tracebacks; - int zero_cost_exceptions; +__gnat_set_globals (int main_priority, + int time_slice_val, + char wc_encoding, + char locking_policy, + char queuing_policy, + char task_dispatching_policy, + char *restrictions, + char *interrupt_states, + int num_interrupt_states, + int unreserve_all_interrupts, + int exception_tracebacks, + int zero_cost_exceptions) { static int already_called = 0; @@ -288,22 +275,20 @@ __gnat_set_globals (main_priority, #ifndef _AIXVERSION_430 -extern int nanosleep PARAMS ((struct timestruc_t *, struct timestruc_t *)); +extern int nanosleep (struct timestruc_t *, struct timestruc_t *); int -nanosleep (Rqtp, Rmtp) - struct timestruc_t *Rqtp, *Rmtp; +nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp) { return nsleep (Rqtp, Rmtp); } #endif /* _AIXVERSION_430 */ -static void __gnat_error_handler PARAMS ((int)); +static void __gnat_error_handler (int); static void -__gnat_error_handler (sig) - int sig; +__gnat_error_handler (int sig) { struct Exception_Data *exception; const char *msg; @@ -335,7 +320,7 @@ __gnat_error_handler (sig) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -363,7 +348,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -380,20 +365,16 @@ __gnat_initialize () #include #include -static void __gnat_error_handler PARAMS ((int, siginfo_t *, - struct sigcontext *)); -extern char *__gnat_get_code_loc PARAMS ((struct sigcontext *)); -extern void __gnat_enter_handler PARAMS ((struct sigcontext *, char *)); -extern size_t __gnat_machine_state_length PARAMS ((void)); +static void __gnat_error_handler (int, siginfo_t *, struct sigcontext *); +extern char *__gnat_get_code_loc (struct sigcontext *); +extern void __gnat_enter_handler (struct sigcontext *, char *); +extern size_t __gnat_machine_state_length (void); -extern long exc_lookup_gp PARAMS ((char *)); -extern void exc_resume PARAMS ((struct sigcontext *)); +extern long exc_lookup_gp (char *); +extern void exc_resume (struct sigcontext *); static void -__gnat_error_handler (sig, sip, context) - int sig; - siginfo_t *sip; - struct sigcontext *context; +__gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context) { struct Exception_Data *exception; static int recurse = 0; @@ -463,7 +444,7 @@ __gnat_error_handler (sig, sip, context) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -471,7 +452,7 @@ __gnat_install_handler () exceptions. Make sure that the handler isn't interrupted by another signal that might cause a scheduling event! */ - act.sa_handler = (void (*) PARAMS ((int))) __gnat_error_handler; + act.sa_handler = (void (*) (int)) __gnat_error_handler; act.sa_flags = SA_ONSTACK | SA_RESTART | SA_NODEFER | SA_SIGINFO; sigemptyset (&act.sa_mask); @@ -491,7 +472,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -500,16 +481,13 @@ __gnat_initialize () #define SC_GP 29 char * -__gnat_get_code_loc (context) - struct sigcontext *context; +__gnat_get_code_loc (struct sigcontext *context) { return (char *) context->sc_pc; } void -__gnat_enter_handler (context, pc) - struct sigcontext *context; - char *pc; +__gnat_enter_handler ( struct sigcontext *context, char *pc) { context->sc_pc = (long) pc; context->sc_regs[SC_GP] = exc_lookup_gp (pc); @@ -517,7 +495,7 @@ __gnat_enter_handler (context, pc) } size_t -__gnat_machine_state_length () +__gnat_machine_state_length (void) { return sizeof (struct sigcontext); } @@ -530,11 +508,10 @@ __gnat_machine_state_length () #include -static void __gnat_error_handler PARAMS ((int)); +static void __gnat_error_handler (int); static void -__gnat_error_handler (sig) - int sig; +__gnat_error_handler (int sig) { struct Exception_Data *exception; char *msg; @@ -566,7 +543,7 @@ __gnat_error_handler (sig) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -609,7 +586,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -639,11 +616,10 @@ struct Machine_State unsigned long edi; }; -static void __gnat_error_handler PARAMS ((int)); +static void __gnat_error_handler (int); static void -__gnat_error_handler (sig) - int sig; +__gnat_error_handler (int sig) { struct Exception_Data *exception; const char *msg; @@ -731,7 +707,7 @@ __gnat_error_handler (sig) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -759,7 +735,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -770,13 +746,12 @@ __gnat_initialize () #elif defined (__MINGW32__) #include -static LONG WINAPI __gnat_error_handler PARAMS ((PEXCEPTION_POINTERS)); +static LONG WINAPI __gnat_error_handler (PEXCEPTION_POINTERS); /* __gnat_initialize (mingw32). */ static LONG WINAPI -__gnat_error_handler (info) - PEXCEPTION_POINTERS info; +__gnat_error_handler (PEXCEPTION_POINTERS info) { static int recurse; struct Exception_Data *exception; @@ -891,14 +866,14 @@ __gnat_error_handler (info) } void -__gnat_install_handler () +__gnat_install_handler (void) { SetUnhandledExceptionFilter (__gnat_error_handler); __gnat_handler_installed = 1; } void -__gnat_initialize () +__gnat_initialize (void) { /* Initialize floating-point coprocessor. This call is needed because @@ -921,11 +896,10 @@ __gnat_initialize () #include -static void __gnat_error_handler PARAMS ((int)); +static void __gnat_error_handler (int); static void -__gnat_error_handler (sig) - int sig; +__gnat_error_handler (int sig) { struct Exception_Data *exception; char *msg; @@ -956,7 +930,7 @@ __gnat_error_handler (sig) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -982,7 +956,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { __gnat_init_float (); } @@ -994,7 +968,7 @@ __gnat_initialize () #elif defined (__Lynx__) void -__gnat_initialize () +__gnat_initialize (void) { __gnat_init_float (); } @@ -1004,7 +978,7 @@ __gnat_initialize () /*********************************/ void -__gnat_install_handler () +__gnat_install_handler (void) { __gnat_handler_installed = 1; } @@ -1016,7 +990,7 @@ __gnat_install_handler () #elif defined (__EMX__) /* OS/2 dependent initialization */ void -__gnat_initialize () +__gnat_initialize (void) { } @@ -1025,7 +999,7 @@ __gnat_initialize () /*********************************/ void -__gnat_install_handler () +__gnat_install_handler (void) { __gnat_handler_installed = 1; } @@ -1052,13 +1026,10 @@ struct Machine_State sigcontext_t context; }; -static void __gnat_error_handler PARAMS ((int, int, sigcontext_t *)); +static void __gnat_error_handler (int, int, sigcontext_t *); static void -__gnat_error_handler (sig, code, sc) - int sig; - int code; - sigcontext_t *sc; +__gnat_error_handler (int sig, int code, sigcontext_t *sc) { struct Machine_State *mstate; struct Exception_Data *exception; @@ -1138,7 +1109,7 @@ __gnat_error_handler (sig, code, sc) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -1169,7 +1140,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -1182,12 +1153,10 @@ __gnat_initialize () #include #include -static void __gnat_error_handler PARAMS ((int, siginfo_t *)); +static void __gnat_error_handler (int, siginfo_t *); static void -__gnat_error_handler (sig, sip) - int sig; - siginfo_t *sip; +__gnat_error_handler (int sig, siginfo_t *sip) { struct Exception_Data *exception; static int recurse = 0; @@ -1253,7 +1222,7 @@ __gnat_error_handler (sig, sip) } void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -1279,7 +1248,7 @@ __gnat_install_handler () } void -__gnat_initialize () +__gnat_initialize (void) { } @@ -1291,7 +1260,7 @@ __gnat_initialize () /* The prehandler actually gets control first on a condition. It swaps the stack pointer and calls the handler (__gnat_error_handler). */ -extern long __gnat_error_prehandler (); +extern long __gnat_error_prehandler (void); extern char *__gnat_error_prehandler_stack; /* Alternate signal stack */ @@ -1329,12 +1298,10 @@ extern struct Exception_Data *Coded_Exception (int); struct descriptor_s {unsigned short len, mbz; char *adr; }; -long __gnat_error_handler PARAMS ((int *, void *)); +long __gnat_error_handler (int *, void *); long -__gnat_error_handler (sigargs, mechargs) - int *sigargs; - void *mechargs; +__gnat_error_handler (int *sigargs, void *mechargs) { struct Exception_Data *exception = 0; char *msg = ""; @@ -1470,7 +1437,7 @@ __gnat_error_handler (sigargs, mechargs) } void -__gnat_install_handler () +__gnat_install_handler (void) { long prvhnd; char *c; @@ -1485,8 +1452,90 @@ __gnat_install_handler () } void -__gnat_initialize() +__gnat_initialize(void) +{ +} + +/*************************************************/ +/* __gnat_initialize (FreeBSD version) */ +/*************************************************/ + +#elif defined (__FreeBSD__) + +#include +#include + +static void +__gnat_error_handler (sig, code, sc) + int sig; + int code; + struct sigcontext *sc; { + struct Exception_Data *exception; + char *msg; + + switch (sig) + { + case SIGFPE: + exception = &constraint_error; + msg = "SIGFPE"; + break; + + case SIGILL: + exception = &constraint_error; + msg = "SIGILL"; + break; + + case SIGSEGV: + exception = &storage_error; + msg = "stack overflow or erroneous memory access"; + break; + + case SIGBUS: + exception = &constraint_error; + msg = "SIGBUS"; + break; + + default: + exception = &program_error; + msg = "unhandled signal"; + } + + Raise_From_Signal_Handler (exception, msg); +} + +void +__gnat_install_handler () +{ + struct sigaction act; + + /* Set up signal handler to map synchronous signals to appropriate + exceptions. Make sure that the handler isn't interrupted by another + signal that might cause a scheduling event! */ + + act.sa_handler = __gnat_error_handler; + act.sa_flags = SA_NODEFER | SA_RESTART; + (void) sigemptyset (&act.sa_mask); + + (void) sigaction (SIGILL, &act, NULL); + (void) sigaction (SIGFPE, &act, NULL); + (void) sigaction (SIGSEGV, &act, NULL); + (void) sigaction (SIGBUS, &act, NULL); +} + +void __gnat_init_float (); + +void +__gnat_initialize () +{ + __gnat_install_handler (); + + /* XXX - Initialize floating-point coprocessor. This call is + needed because FreeBSD defaults to 64-bit precision instead + of 80-bit precision? We require the full precision for + proper operation, given that we have set Max_Digits etc + with this in mind */ + __gnat_init_float (); } /***************************************/ @@ -1502,16 +1551,17 @@ __gnat_initialize() extern int __gnat_inum_to_ivec (int); static void __gnat_error_handler (int, int, struct sigcontext *); +void __gnat_map_signal (int); #ifndef __alpha_vxworks /* getpid is used by s-parint.adb, but is not defined by VxWorks, except on Alpha VxWorks */ -extern long getpid PARAMS ((void)); +extern long getpid (void); long -getpid () +getpid (void) { return taskIdSelf (); } @@ -1519,36 +1569,19 @@ getpid () /* This is needed by the GNAT run time to handle Vxworks interrupts */ int -__gnat_inum_to_ivec (num) - int num; +__gnat_inum_to_ivec (int num) { return INUM_TO_IVEC (num); } -static void -__gnat_error_handler (sig, code, sc) - int sig; - int code; - struct sigcontext *sc; +/* Exported to 5zintman.adb in order to handle different signal + to exception mappings in different VxWorks versions */ +void +__gnat_map_signal (int sig) { struct Exception_Data *exception; - sigset_t mask; - int result; char *msg; - /* VxWorks will always mask out the signal during the signal handler and - will reenable it on a longjmp. GNAT does not generate a longjmp to - return from a signal handler so the signal will still be masked unless - we unmask it. */ - sigprocmask (SIG_SETMASK, NULL, &mask); - sigdelset (&mask, sig); - sigprocmask (SIG_SETMASK, &mask, NULL); - - /* VxWorks will suspend the task when it gets a hardware exception. We - take the liberty of resuming the task for the application. */ - if (taskIsSuspended (taskIdSelf ()) != 0) - taskResume (taskIdSelf ()); - switch (sig) { case SIGFPE: @@ -1564,8 +1597,13 @@ __gnat_error_handler (sig, code, sc) msg = "SIGSEGV"; break; case SIGBUS: +#ifdef VTHREADS + exception = &storage_error; + msg = "SIGBUS: possible stack overflow"; +#else exception = &program_error; msg = "SIGBUS"; +#endif break; default: exception = &program_error; @@ -1575,8 +1613,31 @@ __gnat_error_handler (sig, code, sc) Raise_From_Signal_Handler (exception, msg); } +static void +__gnat_error_handler (int sig, int code, struct sigcontext *sc) +{ + sigset_t mask; + int result; + + /* VxWorks will always mask out the signal during the signal handler and + will reenable it on a longjmp. GNAT does not generate a longjmp to + return from a signal handler so the signal will still be masked unless + we unmask it. */ + sigprocmask (SIG_SETMASK, NULL, &mask); + sigdelset (&mask, sig); + sigprocmask (SIG_SETMASK, &mask, NULL); + + /* VxWorks will suspend the task when it gets a hardware exception. We + take the liberty of resuming the task for the application. */ + if (taskIsSuspended (taskIdSelf ()) != 0) + taskResume (taskIdSelf ()); + + __gnat_map_signal (sig); + +} + void -__gnat_install_handler () +__gnat_install_handler (void) { struct sigaction act; @@ -1601,7 +1662,7 @@ __gnat_install_handler () #define HAVE_GNAT_INIT_FLOAT void -__gnat_init_float () +__gnat_init_float (void) { /* Disable overflow/underflow exceptions on the PPC processor, this is needed to get correct Ada semantic. */ @@ -1631,7 +1692,7 @@ __gnat_init_float () } void -__gnat_initialize () +__gnat_initialize (void) { __gnat_init_float (); @@ -1661,8 +1722,7 @@ __gnat_initialize () #include static void -__gnat_error_handler (sig) - int sig; +__gnat_error_handler (int sig) { struct Exception_Data *exception; const char *msg; @@ -1694,7 +1754,7 @@ __gnat_error_handler (sig) } void -__gnat_install_handler() +__gnat_install_handler(void) { struct sigaction act; @@ -1711,10 +1771,12 @@ __gnat_install_handler() sigaction (SIGSEGV, &act, NULL); if (__gnat_get_interrupt_state (SIGBUS) != 's') sigaction (SIGBUS, &act, NULL); + + __gnat_handler_installed = 1; } void -__gnat_initialize () +__gnat_initialize (void) { __gnat_install_handler (); __gnat_init_float (); @@ -1726,28 +1788,12 @@ __gnat_initialize () #elif defined(__rtems__) -extern void __gnat_install_handler (); - -/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */ - -void -__gnat_initialize () -{ - __gnat_install_handler (); -} - -/***************************************/ -/* __gnat_initialize (RTEMS version) */ -/***************************************/ - -#elif defined(__rtems__) - -extern void __gnat_install_handler (); +extern void __gnat_install_handler (void); /* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */ void -__gnat_initialize () +__gnat_initialize (void) { __gnat_install_handler (); } @@ -1762,7 +1808,7 @@ __gnat_initialize () /***************************************/ void -__gnat_initialize () +__gnat_initialize (void) { } @@ -1771,7 +1817,7 @@ __gnat_initialize () /********************************************/ void -__gnat_install_handler () +__gnat_install_handler (void) { __gnat_handler_installed = 1; } @@ -1787,12 +1833,12 @@ __gnat_install_handler () WIN32 and could be used under OS/2 */ #if defined (_WIN32) || defined (__INTERIX) || defined (__EMX__) \ - || defined (__Lynx__) || defined(__NetBSD__) + || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) #define HAVE_GNAT_INIT_FLOAT void -__gnat_init_float () +__gnat_init_float (void) { #if defined (__i386__) || defined (i386) @@ -1809,7 +1855,7 @@ __gnat_init_float () /* All targets without a specific __gnat_init_float will use an empty one */ void -__gnat_init_float () +__gnat_init_float (void) { } #endif diff --git a/gcc/ada/itypes.adb b/gcc/ada/itypes.adb index 12864b84be2..dd5f98a5132 100644 --- a/gcc/ada/itypes.adb +++ b/gcc/ada/itypes.adb @@ -26,6 +26,7 @@ with Atree; use Atree; with Einfo; use Einfo; +with Opt; use Opt; with Sem; use Sem; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; @@ -64,7 +65,9 @@ package body Itypes is Set_Is_Itype (Typ); Set_Associated_Node_For_Itype (Typ, Related_Nod); - if In_Deleted_Code then + if In_Deleted_Code + and then not ASIS_Mode + then Set_Is_Frozen (Typ); end if; diff --git a/gcc/ada/lang-specs.h b/gcc/ada/lang-specs.h index 0ab33ff0201..b68e78d098b 100644 --- a/gcc/ada/lang-specs.h +++ b/gcc/ada/lang-specs.h @@ -35,6 +35,7 @@ %{!gnatc*:%{!gnatz*:%{!gnats*:%{!S:%{!c:\ %eone of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada}}}}}\ gnat1 %{I*} %{k8:-gnatk8} %{w:-gnatws} %1 %{!Q:-quiet} %{nostdinc*}\ + %{nostdlib*}\ -dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\ %{g*} %{O*} %{W*} %{w} %{p} %{pg:-p} %{m*} %{a} %{f*} %{d*}\ %{!S:%{o*:%w%*-gnatO}} \ diff --git a/gcc/ada/lang.opt b/gcc/ada/lang.opt index e38af20b2e8..7ac89f96426 100644 --- a/gcc/ada/lang.opt +++ b/gcc/ada/lang.opt @@ -45,7 +45,7 @@ Wwrite-strings Ada ; Documented for C -Wno-long-long +Wlong-long Ada ; Documented for C @@ -53,6 +53,10 @@ nostdinc Ada RejectNegative ; Don't look for source files +nostdlib +Ada +; Don't look for object files + fRTS Ada RejectNegative diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb index 285e2512027..fbb50af0800 100644 --- a/gcc/ada/lib-load.adb +++ b/gcc/ada/lib-load.adb @@ -78,7 +78,6 @@ package body Lib.Load is is Unum : Unit_Number_Type; Cunit_Entity : Entity_Id; - Scope_Entity : Entity_Id; Cunit : Node_Id; Du_Name : Node_Or_Entity_Id; End_Lab : Node_Id; @@ -98,11 +97,12 @@ package body Lib.Load is Du_Name := Cunit_Entity; End_Lab := New_Occurrence_Of (Cunit_Entity, No_Location); - Scope_Entity := Standard_Standard; - -- Child package - else -- Nkind (Name (With_Node)) = N_Expanded_Name + else + + -- Nkind (Name (With_Node)) = N_Expanded_Name + Cunit_Entity := Make_Defining_Identifier (No_Location, Chars => Chars (Selector_Name (Name (With_Node)))); @@ -113,19 +113,14 @@ package body Lib.Load is Set_Is_Child_Unit (Cunit_Entity); - if Nkind (Du_Name) = N_Defining_Program_Unit_Name then - Scope_Entity := Defining_Identifier (Du_Name); - else - Scope_Entity := Du_Name; - end if; - End_Lab := Make_Designator (No_Location, Name => New_Copy_Tree (Prefix (Name (With_Node))), Identifier => New_Occurrence_Of (Cunit_Entity, No_Location)); + end if; - Set_Scope (Cunit_Entity, Scope_Entity); + Set_Scope (Cunit_Entity, Standard_Standard); Cunit := Make_Compilation_Unit (No_Location, @@ -524,8 +519,8 @@ package body Lib.Load is -- legitimately occurs (e.g. two package bodies that contain -- inlined subprogram referenced by the other). - -- We also ignore limited_with clauses, because their purpose is - -- precisely to create legal circular structures. + -- Ada0Y (AI-50217): We also ignore limited_with clauses, because + -- their purpose is precisely to create legal circular structures. if Loading (Unum) and then (Is_Spec_Name (Units.Table (Unum).Unit_Name) @@ -693,14 +688,11 @@ package body Lib.Load is procedure Make_Instance_Unit (N : Node_Id) is Sind : constant Source_File_Index := Source_Index (Main_Unit); - begin Units.Increment_Last; - Units.Table (Units.Last) := Units.Table (Main_Unit); Units.Table (Units.Last).Cunit := Library_Unit (N); Units.Table (Units.Last).Generate_Code := True; - Units.Table (Main_Unit).Cunit := N; Units.Table (Main_Unit).Unit_Name := Get_Body_Name (Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N)))); @@ -718,7 +710,6 @@ package body Lib.Load is is Sunit : constant Node_Id := Cunit (Spec_Unit); Bunit : constant Node_Id := Cunit (Body_Unit); - begin -- The spec is irrelevant if the body is a subprogram body, and the -- spec is other than a subprogram spec or generic subprogram spec. @@ -730,7 +721,6 @@ package body Lib.Load is Nkind (Unit (Bunit)) = N_Subprogram_Body and then Nkind (Unit (Sunit)) /= N_Subprogram_Declaration and then Nkind (Unit (Sunit)) /= N_Generic_Subprogram_Declaration; - end Spec_Is_Irrelevant; -------------------- @@ -740,9 +730,7 @@ package body Lib.Load is procedure Version_Update (U : Node_Id; From : Node_Id) is Unum : constant Unit_Number_Type := Get_Cunit_Unit_Number (U); Fnum : constant Unit_Number_Type := Get_Cunit_Unit_Number (From); - begin - if Source_Index (Fnum) /= No_Source_File then Units.Table (Unum).Version := Units.Table (Unum).Version diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index 35248a49d9b..055f53a897b 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -91,6 +91,8 @@ package body Lib.Writ is System_Fname : File_Name_Type; -- File name for system spec if needed for dummy entry + Save_Style : constant Boolean := Style_Check; + begin -- Nothing to do if we already compiled System @@ -133,9 +135,12 @@ package body Lib.Writ is Error_Location => No_Location); -- Parse system.ads so that the checksum is set right + -- Style checks are not applied. + Style_Check := False; Initialize_Scanner (Units.Last, System_Source_File_Index); Discard_List (Par (Configuration_Pragmas => False)); + Style_Check := Save_Style; end Ensure_System_Dependency; --------------- @@ -209,7 +214,8 @@ package body Lib.Writ is Item := First (Context_Items (Cunit)); while Present (Item) loop - -- limited_with_clauses do not create dependencies. + -- Ada0Y (AI-50217): limited with_clauses do not create + -- dependencies if Nkind (Item) = N_With_Clause and then not (Limited_Present (Item)) @@ -680,6 +686,13 @@ package body Lib.Writ is -- Start of processing for Writ_ALI begin + -- We never write an ALI file if the original operating mode was + -- syntax-only (-gnats switch used in compiler invocation line) + + if Original_Operating_Mode = Check_Syntax then + return; + end if; + -- Build sorted source dependency table. We do this right away, -- because it is referenced by Up_To_Date_ALI_File_Exists. @@ -716,7 +729,7 @@ package body Lib.Writ is Write_Info_Initiate ('V'); Write_Info_Str (" """); - Write_Info_Str (Library_Version); + Write_Info_Str (Verbose_Library_Version); Write_Info_Char ('"'); Write_Info_EOL; diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb index db01b6b362f..5e909307264 100644 --- a/gcc/ada/lib.adb +++ b/gcc/ada/lib.adb @@ -460,8 +460,7 @@ package body Lib is end Generic_Separately_Compiled; function Generic_Separately_Compiled - (Sfile : File_Name_Type) - return Boolean + (Sfile : File_Name_Type) return Boolean is begin -- Exactly the same as previous function, but works directly on a file @@ -534,8 +533,7 @@ package body Lib is ---------------------------------- function Get_Cunit_Entity_Unit_Number - (E : Entity_Id) - return Unit_Number_Type + (E : Entity_Id) return Unit_Number_Type is begin for U in Units.First .. Units.Last loop @@ -613,8 +611,7 @@ package body Lib is -------------------------------- function In_Extended_Main_Code_Unit - (N : Node_Or_Entity_Id) - return Boolean + (N : Node_Or_Entity_Id) return Boolean is begin if Sloc (N) = Standard_Location then @@ -647,10 +644,7 @@ package body Lib is end if; end In_Extended_Main_Code_Unit; - function In_Extended_Main_Code_Unit - (Loc : Source_Ptr) - return Boolean - is + function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean is begin if Loc = Standard_Location then return True; @@ -676,8 +670,7 @@ package body Lib is ---------------------------------- function In_Extended_Main_Source_Unit - (N : Node_Or_Entity_Id) - return Boolean + (N : Node_Or_Entity_Id) return Boolean is Nloc : constant Source_Ptr := Sloc (N); Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit)); @@ -718,8 +711,7 @@ package body Lib is end In_Extended_Main_Source_Unit; function In_Extended_Main_Source_Unit - (Loc : Source_Ptr) - return Boolean + (Loc : Source_Ptr) return Boolean is Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit)); @@ -878,6 +870,17 @@ package body Lib is return Int (Units.Last) - Int (Main_Unit) + 1; end Num_Units; + ----------------- + -- Remove_Unit -- + ----------------- + + procedure Remove_Unit (U : Unit_Number_Type) is + begin + if U = Units.Last then + Units.Decrement_Last; + end if; + end Remove_Unit; + ---------------------------------- -- Replace_Linker_Option_String -- ---------------------------------- diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index e01ab65ff6b..82eaeb6301d 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -417,6 +417,10 @@ package Lib is function Num_Units return Nat; -- Number of units currently in unit table + procedure Remove_Unit (U : Unit_Number_Type); + -- Remove unit U from unit table. Currently this is effective only + -- if U is the last unit currently stored in the unit table. + function Entity_Is_In_Main_Unit (E : Entity_Id) return Boolean; -- Returns True if the entity E is declared in the main unit, or, in -- its corresponding spec, or one of its subunits. Entities declared @@ -462,8 +466,7 @@ package Lib is -- and False otherwise. function In_Extended_Main_Code_Unit - (N : Node_Or_Entity_Id) - return Boolean; + (N : Node_Or_Entity_Id) return Boolean; -- Return True if the node is in the generated code of the extended main -- unit, defined as the main unit, its specification (if any), and all -- its subunits (considered recursively). Units for which this enquiry @@ -472,15 +475,12 @@ package Lib is -- If the main unit is itself a subunit, then the extended main unit -- includes its parent unit, and the parent unit spec if it is separate. - function In_Extended_Main_Code_Unit - (Loc : Source_Ptr) - return Boolean; + function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean; -- Same function as above, but argument is a source pointer rather -- than a node. function In_Extended_Main_Source_Unit - (N : Node_Or_Entity_Id) - return Boolean; + (N : Node_Or_Entity_Id) return Boolean; -- Return True if the node is in the source text of the extended main -- unit, defined as the main unit, its specification (if any), and all -- its subunits (considered recursively). Units for which this enquiry @@ -490,9 +490,7 @@ package Lib is -- a subunit, then the extended main unit includes its parent unit, -- and the parent unit spec if it is separate. - function In_Extended_Main_Source_Unit - (Loc : Source_Ptr) - return Boolean; + function In_Extended_Main_Source_Unit (Loc : Source_Ptr) return Boolean; -- Same function as above, but argument is a source pointer rather -- than a node. @@ -515,8 +513,7 @@ package Lib is -- could not have been built without making a unit table entry. function Get_Cunit_Entity_Unit_Number - (E : Entity_Id) - return Unit_Number_Type; + (E : Entity_Id) return Unit_Number_Type; -- Return unit number of the unit whose compilation unit spec entity is -- the one passed as an argument. This must always succeed since the -- entity could not have been built without making a unit table entry. @@ -590,7 +587,7 @@ package Lib is -- function returns True if the given generic unit entity E is for a -- generic unit that should be separately compiled, and false otherwise. -- - -- Now GNAT can compile any generic unit including predefifined ones, but + -- Now GNAT can compile any generic unit including predefined ones, but -- because of the backward compatibility (to keep the ability to use old -- compiler versions to build GNAT) compiling library generics is an -- option. That is, now GNAT compiles a library generic as an ordinary @@ -603,8 +600,7 @@ package Lib is -- compiled with the current approach. function Generic_Separately_Compiled - (Sfile : File_Name_Type) - return Boolean; + (Sfile : File_Name_Type) return Boolean; -- Same as the previous function, but works directly on a unit file name. private diff --git a/gcc/ada/link.c b/gcc/ada/link.c index 5a8fbeb8339..4dd087658b0 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -154,6 +154,15 @@ unsigned char objlist_file_supported = 0; unsigned char using_gnu_linker = 0; const char *object_library_extension = ".a"; +#elif defined (__FreeBSD__) +char *object_file_option = ""; +char *run_path_option = ""; +char shared_libgnat_default = SHARED; +int link_max = 2147483647; +unsigned char objlist_file_supported = 0; +unsigned char using_gnu_linker = 0; +char *object_library_extension = ".a"; + #elif defined (linux) const char *object_file_option = ""; const char *run_path_option = "-Wl,-rpath,"; diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 3ebec3d7d83..b566c6b1c91 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -24,12 +24,6 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Exceptions; use Ada.Exceptions; -with Ada.Command_Line; use Ada.Command_Line; - -with GNAT.Directory_Operations; use GNAT.Directory_Operations; -with GNAT.Case_Util; use GNAT.Case_Util; - with ALI; use ALI; with ALI.Util; use ALI.Util; with Csets; @@ -65,6 +59,12 @@ with System.HTable; with Targparm; with Tempdir; +with Ada.Exceptions; use Ada.Exceptions; +with Ada.Command_Line; use Ada.Command_Line; + +with GNAT.Directory_Operations; use GNAT.Directory_Operations; +with GNAT.Case_Util; use GNAT.Case_Util; + package body Make is use ASCII; @@ -312,6 +312,11 @@ package body Make is Main_Project : Prj.Project_Id := No_Project; -- The project id of the main project file, if any + Project_Object_Directory : Project_Id := No_Project; + -- The object directory of the project for the last compilation. + -- Avoid calling Change_Dir if the current working directory is already + -- this directory + -- Packages of project files where unknown attributes are errors. Naming_String : aliased String := "naming"; @@ -344,6 +349,10 @@ package body Make is procedure Add_Object_Directories is new Prj.Env.For_All_Object_Dirs (Action => Add_Object_Dir); + procedure Change_To_Object_Directory (Project : Project_Id); + -- Change to the object directory of project Project, if this is not + -- already the current working directory. + type Bad_Compilation_Info is record File : File_Name_Type; Unit : Unit_Name_Type; @@ -480,6 +489,9 @@ package body Make is -- Marking Routines -- ---------------------- + Marking_Label : Byte := 1; + -- Value to mark the source files + procedure Mark (Source_File : File_Name_Type); -- Mark Source_File. Marking is used to signal that Source_File has -- already been inserted in the Q. @@ -1104,6 +1116,36 @@ package body Make is end if; end Bind; + -------------------------------- + -- Change_To_Object_Directory -- + -------------------------------- + + procedure Change_To_Object_Directory (Project : Project_Id) is + begin + -- Nothing to do if the current working directory is alresdy the one + -- we want. + + if Project_Object_Directory /= Project then + Project_Object_Directory := Project; + + -- If in a real project, set the working directory to the object + -- directory of the project. + + if Project /= No_Project then + Change_Dir + (Get_Name_String (Projects.Table (Project).Object_Directory)); + + -- Otherwise, for sources outside of any project, set the working + -- directory to the object directory of the main project. + + elsif Main_Project /= No_Project then + Change_Dir + (Get_Name_String + (Projects.Table (Main_Project).Object_Directory)); + end if; + end if; + end Change_To_Object_Directory; + ----------- -- Check -- ----------- @@ -1314,7 +1356,7 @@ package body Make is return; elsif ALIs.Table (ALI).Ver (1 .. ALIs.Table (ALI).Ver_Len) /= - Library_Version + Verbose_Library_Version then Verbose_Msg (Full_Lib_File, "compiled with old GNAT version"); ALI := No_ALI_Id; @@ -2201,28 +2243,23 @@ package body Make is end; end if; - -- Change to the object directory of the project file, if it is - -- not the main project file. + -- Change to the object directory of the project file, + -- if necessary. - if Arguments_Project /= Main_Project then - Change_Dir - (Get_Name_String - (Projects.Table (Arguments_Project).Object_Directory)); - end if; + Change_To_Object_Directory (Arguments_Project); Pid := Compile (Arguments_Path_Name, Lib_File, Arguments (1 .. Last_Argument)); - -- Change back to the object directory of the main project file, - -- if necessary. + else + -- If this is a source outside of any project file, make sure + -- it will be compiled in the object directory of the main project + -- file. - if Arguments_Project /= Main_Project then - Change_Dir - (Get_Name_String - (Projects.Table (Main_Project).Object_Directory)); + if Main_Project /= No_Project then + Change_To_Object_Directory (Arguments_Project); end if; - else Pid := Compile (Full_Source_File, Lib_File, Arguments (1 .. Last_Argument)); end if; @@ -2233,7 +2270,9 @@ package body Make is ------------- function Compile - (S : Name_Id; L : Name_Id; Args : Argument_List) return Process_Id + (S : Name_Id; + L : Name_Id; + Args : Argument_List) return Process_Id is Comp_Args : Argument_List (Args'First .. Args'Last + 8); Comp_Next : Integer := Args'First; @@ -3001,7 +3040,8 @@ package body Make is if Global_Attribute_Present then declare Path : constant String := - Absolute_Path (Global_Attribute.Value, Main_Project); + Absolute_Path + (Global_Attribute.Value, Global_Attribute.Project); begin if not Is_Regular_File (Path) then Make_Failed @@ -3033,7 +3073,8 @@ package body Make is if Local_Attribute_Present then declare Path : constant String := - Absolute_Path (Local_Attribute.Value, For_Project); + Absolute_Path + (Local_Attribute.Value, Local_Attribute.Project); begin if not Is_Regular_File (Path) then Make_Failed @@ -3363,7 +3404,10 @@ package body Make is -- cannot be specified on the command line. if Osint.Number_Of_Files /= 0 then - if Projects.Table (Main_Project).Library then + if Projects.Table (Main_Project).Library + and then not Unique_Compile + and then ((not Make_Steps) or else Bind_Only or else Link_Only) + then Make_Failed ("cannot specify a main program " & "on the command line for a library project file"); @@ -3386,7 +3430,7 @@ package body Make is loop declare - Main : constant String := Mains.Next_Main; + Main : constant String := Mains.Next_Main; -- The name specified on the command line may include -- directory information. @@ -3416,7 +3460,7 @@ package body Make is if Main /= File_Name then declare Data : constant Project_Data := - Projects.Table (Main_Project); + Projects.Table (Main_Project); Project_Path : constant String := Prj.Env.File_Name_Of_Library_Unit_Body @@ -3478,12 +3522,14 @@ package body Make is end if; if not Unique_Compile then + -- Record the project, if it is the first main if Real_Main_Project = No_Project then Real_Main_Project := Proj; elsif Proj /= Real_Main_Project then + -- Fail, as the current main is not a source -- of the same project as the first main. @@ -3557,11 +3603,14 @@ package body Make is declare Data : Project_Data := Projects.Table (Main_Project); + Languages : Variable_Value := - Prj.Util.Value_Of - (Name_Languages, Data.Decl.Attributes); + Prj.Util.Value_Of + (Name_Languages, Data.Decl.Attributes); + Current : String_List_Id; Element : String_Element; + Foreign_Language : Boolean := False; At_Least_One_Main : Boolean := False; @@ -3587,14 +3636,14 @@ package body Make is end loop Look_For_Foreign; end if; - -- The, find all mains, or if there is a foreign + -- Then, find all mains, or if there is a foreign -- language, all the Ada mains. while Value /= Prj.Nil_String loop Get_Name_String (String_Elements.Table (Value).Value); - -- To know if a main is an Ada main, get its project; - -- it should be the project specified on the command + -- To know if a main is an Ada main, get its project. + -- It should be the project specified on the command -- line. if (not Foreign_Language) or else @@ -3616,11 +3665,14 @@ package body Make is -- we put all sources of the main project in the Q. if not At_Least_One_Main then + -- First make sure that the binder and the linker - -- will not be invoked. + -- will not be invoked if -z is not used. - Do_Bind_Step := False; - Do_Link_Step := False; + if not No_Main_Subprogram then + Do_Bind_Step := False; + Do_Link_Step := False; + end if; -- Put all the sources in the queue @@ -3679,7 +3731,7 @@ package body Make is else -- Output usage information if no files to compile - Makeusg; + Usage; Exit_Program (E_Fatal); end if; end if; @@ -3714,6 +3766,16 @@ package body Make is And_Save => False); end if; + else + -- If we use a project file, we have already checked that a main + -- specified on the command line with directory information has the + -- path name corresponding to a correct source in the project tree. + -- So, we don't need the directory information to be taken into + -- account by Find_File, and in fact it may lead to take the wrong + -- sources for other compilation units, when there are extending + -- projects. + + Opt.Look_In_Primary_Dir := False; end if; -- If the user wants a program without a main subprogram, add the @@ -3733,12 +3795,50 @@ package body Make is -- project. begin - Change_Dir - (Get_Name_String - (Projects.Table (Main_Project).Object_Directory)); + Project_Object_Directory := No_Project; + Change_To_Object_Directory (Main_Project); exception when Directory_Error => + + -- This should never happen. But, if it does, display the + -- content of the parent directory of the obj dir. + + declare + Parent : constant Dir_Name_Str := + Dir_Name + (Get_Name_String + (Projects.Table (Main_Project).Object_Directory)); + Dir : Dir_Type; + Str : String (1 .. 200); + Last : Natural; + + begin + Write_Str ("Contents of directory """); + Write_Str (Parent); + Write_Line (""":"); + + Open (Dir, Parent); + + loop + Read (Dir, Str, Last); + exit when Last = 0; + Write_Str (" "); + Write_Line (Str (1 .. Last)); + end loop; + + Close (Dir); + + exception + when X : others => + Write_Line ("(unexpected exception)"); + Write_Line (Exception_Information (X)); + + if Is_Open (Dir) then + Close (Dir); + end if; + end; + Make_Failed ("unable to change working directory to """, Get_Name_String (Projects.Table (Main_Project).Object_Directory), @@ -4166,6 +4266,18 @@ package body Make is Multiple_Main_Loop : for N_File in 1 .. Osint.Number_Of_Files loop + -- Increase the marking label to be sure to check sources + -- for all executables. + + Marking_Label := Marking_Label + 1; + + -- Make sure it is not 0, which is the default value for + -- a file that has never been marked. + + if Marking_Label = 0 then + Marking_Label := 1; + end if; + -- First, find the executable name and path Executable := No_File; @@ -4544,6 +4656,13 @@ package body Make is end Recursive_Compilation_Step; end if; + -- For binding and linking, we need to be in the object directory of + -- the main project. + + if Main_Project /= No_Project then + Change_To_Object_Directory (Main_Project); + end if; + -- If we are here, it means that we need to rebuilt the current -- main. So we set Executable_Obsolete to True to make sure that -- the subsequent mains will be rebuilt. @@ -5511,7 +5630,7 @@ package body Make is end loop Scan_Args; if Usage_Requested then - Makeusg; + Usage; end if; -- Test for trailing -P switch @@ -5633,6 +5752,14 @@ package body Make is Make_Failed (Exception_Message (Err)); end; end if; + + -- Make sure no project object directory is recorded + + Project_Object_Directory := No_Project; + + -- Set the marking label to a value that is not zero + + Marking_Label := 1; end Initialize; ----------------------------------- @@ -5645,10 +5772,11 @@ package body Make is Into_Q : Boolean) is Put_In_Q : Boolean := Into_Q; - Unit : Com.Unit_Data; - Sfile : Name_Id; + Unit : Com.Unit_Data; + Sfile : Name_Id; + Extending : constant Boolean := - Projects.Table (The_Project).Extends /= No_Project; + Projects.Table (The_Project).Extends /= No_Project; function Check_Project (P : Project_Id) return Boolean; -- Returns True if P is The_Project or a project extended by @@ -5982,7 +6110,7 @@ package body Make is function Is_Marked (Source_File : File_Name_Type) return Boolean is begin - return Get_Name_Table_Byte (Source_File) /= 0; + return Get_Name_Table_Byte (Source_File) = Marking_Label; end Is_Marked; ---------- @@ -6166,7 +6294,7 @@ package body Make is procedure Mark (Source_File : File_Name_Type) is begin - Set_Name_Table_Byte (Source_File, 1); + Set_Name_Table_Byte (Source_File, Marking_Label); end Mark; -------------------- @@ -6489,7 +6617,6 @@ package body Make is then Add_Switch (Argv, Compiler, And_Save => And_Save); Add_Switch (Argv, Binder, And_Save => And_Save); - Add_Switch (Argv, Linker, And_Save => And_Save); if Argv'Length <= 6 or else Argv (6) /= '=' then Make_Failed ("missing path for --RTS"); @@ -6798,11 +6925,13 @@ package body Make is -- linking with all standard library files. Opt.No_Stdlib := True; + + Add_Switch (Argv, Compiler, And_Save => And_Save); Add_Switch (Argv, Binder, And_Save => And_Save); elsif Argv (2 .. Argv'Last) = "nostdinc" then - -- Pass -nostdinv to the Compiler and to gnatbind + -- Pass -nostdinc to the Compiler and to gnatbind Opt.No_Stdinc := True; Add_Switch (Argv, Compiler, And_Save => And_Save); diff --git a/gcc/ada/mdll-utl.adb b/gcc/ada/mdll-utl.adb index 82c33b0d6c1..2608e92f224 100644 --- a/gcc/ada/mdll-utl.adb +++ b/gcc/ada/mdll-utl.adb @@ -30,7 +30,7 @@ with Ada.Text_IO; with Ada.Exceptions; with GNAT.Directory_Operations; -with Sdefault; +with Osint; package body MDLL.Utl is @@ -155,7 +155,7 @@ package body MDLL.Utl is Base_File : String := ""; Build_Lib : Boolean := False) is - use Sdefault; + use Osint; Arguments : OS_Lib.Argument_List (1 .. 5 + Files'Length + Options'Length); @@ -167,7 +167,7 @@ package body MDLL.Utl is Out_V : aliased String := Output_File; Bas_Opt : aliased String := "-Wl,--base-file," & Base_File; Lib_Opt : aliased String := "-mdll"; - Lib_Dir : aliased String := "-L" & Object_Dir_Default_Name.all; + Lib_Dir : aliased String := "-L" & Object_Dir_Default_Prefix; begin A := A + 1; diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 83907b94903..cd9663c73e4 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -39,6 +39,7 @@ #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "real.h" #include "rtl.h" #include "errors.h" #include "diagnostic.h" @@ -146,7 +147,7 @@ static void gnat_adjust_rli (record_layout_info); const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; -/* Tables describing GCC tree codes used only by GNAT. +/* Tables describing GCC tree codes used only by GNAT. Table indexed by tree code giving a string containing a character classifying the tree code. Possibilities are @@ -258,13 +259,18 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) case OPT_Wmissing_prototypes: case OPT_Wstrict_prototypes: case OPT_Wwrite_strings: - case OPT_Wno_long_long: + case OPT_Wlong_long: break; /* This is handled by the front-end. */ case OPT_nostdinc: break; + case OPT_nostdlib: + gnat_argv[gnat_argc] = xstrdup ("-nostdlib"); + gnat_argc++; + break; + case OPT_fRTS: gnat_argv[gnat_argc] = xstrdup ("-fRTS"); gnat_argc++; @@ -272,7 +278,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) case OPT_gant: warning ("`-gnat' misspelled as `-gant'"); - + /* ... fall through ... */ case OPT_gnat: @@ -283,7 +289,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) gnat_argc++; if (arg[0] == 'O') - for (i = 1; i < save_argc - 1; i++) + for (i = 1; i < save_argc - 1; i++) if (!strncmp (save_argv[i], "-gnatO", 6)) if (save_argv[++i][0] != '-') { @@ -304,8 +310,8 @@ static unsigned int gnat_init_options (unsigned int argc, const char **argv) { /* Initialize gnat_argv with save_argv size. */ - gnat_argv = (char **) xmalloc ((argc + 1) * sizeof (argv[0])); - gnat_argv[0] = xstrdup (argv[0]); /* name of the command */ + gnat_argv = (char **) xmalloc ((argc + 1) * sizeof (argv[0])); + gnat_argv[0] = xstrdup (argv[0]); /* name of the command */ gnat_argc = 1; save_argc = argc; @@ -359,7 +365,7 @@ gnat_tree_size (enum tree_code code) /* Perform all the initialization steps that are language-specific. */ static bool -gnat_init () +gnat_init (void) { /* Performs whatever initialization steps needed by the language-dependent lexical analyzer. */ @@ -396,7 +402,7 @@ gnat_finish_incomplete_decl (tree dont_care ATTRIBUTE_UNUSED) objects. */ void -gnat_compute_largest_alignment () +gnat_compute_largest_alignment (void) { enum machine_mode mode; @@ -413,7 +419,7 @@ gnat_compute_largest_alignment () various language dependent hooks. */ void -gnat_init_gcc_eh () +gnat_init_gcc_eh (void) { /* We shouldn't do anything if the No_Exceptions_Handler pragma is set, though. This could for instance lead to the emission of tables with @@ -544,6 +550,13 @@ gnat_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier) tree new; rtx result; + /* If this is a statement, call the expansion routine for statements. */ + if (IS_STMT (exp)) + { + gnat_expand_stmt (exp); + return const0_rtx; + } + /* Update EXP to be the new expression to expand. */ switch (TREE_CODE (exp)) { @@ -699,7 +712,7 @@ static int gnat_eh_type_covers (tree a, tree b) { /* a catches b if they represent the same exception id or if a - is an "others". + is an "others". ??? integer_zero_node for "others" is hardwired in too many places currently. */ @@ -879,3 +892,108 @@ must_pass_by_ref (tree gnu_type) || (TYPE_SIZE (gnu_type) != 0 && TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST)); } + +/* This function is called by the front end to enumerate all the supported + modes for the machine. We pass a function which is called back with + the following integer parameters: + + FLOAT_P nonzero if this represents a floating-point mode + COMPLEX_P nonzero is this represents a complex mode + COUNT count of number of items, nonzero for vector mode + PRECISION number of bits in data representation + MANTISSA number of bits in mantissa, if FP and known, else zero. + SIZE number of bits used to store data + ALIGN number of bits to which mode is aligned. */ + +void +enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int)) +{ + enum machine_mode i; + + for (i = 0; i < NUM_MACHINE_MODES; i++) + { + enum machine_mode j; + bool float_p = 0; + bool complex_p = 0; + bool vector_p = 0; + bool skip_p = 0; + int mantissa = 0; + enum machine_mode inner_mode = i; + + switch (GET_MODE_CLASS (i)) + { + case MODE_INT: + break; + case MODE_FLOAT: + float_p = 1; + break; + case MODE_COMPLEX_INT: + complex_p = 1; + inner_mode = GET_MODE_INNER (i); + break; + case MODE_COMPLEX_FLOAT: + float_p = 1; + complex_p = 1; + inner_mode = GET_MODE_INNER (i); + break; + case MODE_VECTOR_INT: + vector_p = 1; + inner_mode = GET_MODE_INNER (i); + break; + case MODE_VECTOR_FLOAT: + float_p = 1; + vector_p = 1; + inner_mode = GET_MODE_INNER (i); + break; + default: + skip_p = 1; + } + + /* Skip this mode if it's one the front end doesn't need to know about + (e.g., the CC modes) or if there is no add insn for that mode (or + any wider mode), meaning it is not supported by the hardware. If + this a complex or vector mode, we care about the inner mode. */ + for (j = inner_mode; j != VOIDmode; j = GET_MODE_WIDER_MODE (j)) + if (add_optab->handlers[j].insn_code != CODE_FOR_nothing) + break; + + if (float_p) + { + const struct real_format *fmt = REAL_MODE_FORMAT (inner_mode); + + mantissa = fmt->p * fmt->log2_b; + } + + if (!skip_p && j != VOIDmode) + (*f) (float_p, complex_p, vector_p ? GET_MODE_NUNITS (i) : 0, + GET_MODE_BITSIZE (i), mantissa, + GET_MODE_SIZE (i) * BITS_PER_UNIT, GET_MODE_ALIGNMENT (i)); + } +} + +int +fp_prec_to_size (int prec) +{ + enum machine_mode mode; + + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if (GET_MODE_PRECISION (mode) == prec) + return GET_MODE_BITSIZE (mode); + + abort (); +} + +int +fp_size_to_prec (int size) +{ + enum machine_mode mode; + + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if (GET_MODE_BITSIZE (mode) == size) + return GET_MODE_PRECISION (mode); + + abort (); +} + diff --git a/gcc/ada/mkdir.c b/gcc/ada/mkdir.c index 2501461f9f0..ce08d9a0601 100644 --- a/gcc/ada/mkdir.c +++ b/gcc/ada/mkdir.c @@ -48,8 +48,7 @@ /* This function provides a portable binding to the mkdir function. */ int -__gnat_mkdir (dir_name) - char *dir_name; +__gnat_mkdir (char *dir_name) { #if defined (_WIN32) || defined (__vxworks) return mkdir (dir_name); diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb index f71ae7b2e81..93025586b31 100644 --- a/gcc/ada/mlib-prj.adb +++ b/gcc/ada/mlib-prj.adb @@ -576,7 +576,7 @@ package body MLib.Prj is for W in Unit_Data.First_With .. Unit_Data.Last_With loop Afile := Withs.Table (W).Afile; - if Library_ALIs.Get (Afile) + if Afile /= No_Name and then Library_ALIs.Get (Afile) and then not Processed_ALIs.Get (Afile) then if not Interface_ALIs.Get (Afile) then @@ -806,6 +806,49 @@ package body MLib.Prj is (B_Start & Get_Name_String (Data.Library_Name) & ".adb"); Add_Argument ("-L" & Get_Name_String (Data.Library_Name)); + -- Check if Binder'Default_Switches ("Ada) is defined. If it is, + -- add these switches to call gnatbind. + + declare + Binder_Package : constant Package_Id := + Value_Of + (Name => Name_Binder, + In_Packages => Data.Decl.Packages); + + begin + if Binder_Package /= No_Package then + declare + Defaults : constant Array_Element_Id := + Value_Of + (Name => Name_Default_Switches, + In_Arrays => + Packages.Table + (Binder_Package).Decl.Arrays); + Switches : Variable_Value := Nil_Variable_Value; + + Switch : String_List_Id := Nil_String; + + begin + if Defaults /= No_Array_Element then + Switches := + Value_Of + (Index => Name_Ada, In_Array => Defaults); + + if not Switches.Default then + Switch := Switches.Values; + + while Switch /= Nil_String loop + Add_Argument + (Get_Name_String + (String_Elements.Table (Switch).Value)); + Switch := String_Elements.Table (Switch).Next; + end loop; + end if; + end if; + end; + end if; + end; + -- Get all the ALI files of the project file declare @@ -1313,6 +1356,7 @@ package body MLib.Prj is Interfaces => Arguments (1 .. Argument_Number), Lib_Filename => Lib_Filename.all, Lib_Dir => Lib_Dirpath.all, + Symbol_Data => Data.Symbol_Data, Driver_Name => Driver_Name, Lib_Address => DLL_Address.all, Lib_Version => Lib_Version.all, diff --git a/gcc/ada/mlib-tgt.adb b/gcc/ada/mlib-tgt.adb index 0fc5919db40..d8e280a706c 100644 --- a/gcc/ada/mlib-tgt.adb +++ b/gcc/ada/mlib-tgt.adb @@ -79,6 +79,7 @@ package body MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -92,6 +93,7 @@ package body MLib.Tgt is pragma Unreferenced (Interfaces); pragma Unreferenced (Lib_Filename); pragma Unreferenced (Lib_Dir); + pragma Unreferenced (Symbol_Data); pragma Unreferenced (Driver_Name); pragma Unreferenced (Lib_Address); pragma Unreferenced (Lib_Version); diff --git a/gcc/ada/mlib-tgt.ads b/gcc/ada/mlib-tgt.ads index d7cad10b091..1fac4efe3fc 100644 --- a/gcc/ada/mlib-tgt.ads +++ b/gcc/ada/mlib-tgt.ads @@ -113,6 +113,7 @@ package MLib.Tgt is Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; + Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Address : String := ""; Lib_Version : String := ""; @@ -125,23 +126,33 @@ package MLib.Tgt is -- Afiles is the list of ALI files for the Ada object files. -- Options is a list of options to be passed to the tool (gcc or other) -- that effectively builds the dynamic library. + -- -- Interfaces is the list of ALI files for the interfaces of a SAL. -- It is empty if the library is not a SAL. + -- -- Lib_Filename is the name of the library, without any prefix or -- extension. For example, on Unix, if Lib_Filename is "toto", the name of -- the library file will be "libtoto.so". + -- -- Lib_Dir is the directory path where the library will be located. + -- -- Lib_Address is the base address of the library for a non relocatable -- library, given as an hexadecimal string. - -- For OSes that support symbolic links, Lib_Version, if non null, is - -- the actual file name of the library. For example on Unix, - -- if Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1", - -- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which will - -- be the actual library file. + -- + -- For OSes that support symbolic links, Lib_Version, if non null, + -- is the actual file name of the library. For example on Unix, if + -- Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1", + -- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which + -- will be the actual library file. + -- -- Relocatable indicates if the library should be relocatable or not, -- for those OSes that actually support non relocatable dynamic libraries. -- Relocatable indicates that automatic elaboration/finalization must be -- indicated to the linker, if possible. + -- + -- Symbol_Data is used for some patforms, including VMS, to generate + -- the symbols to be exported by the library. + -- -- Note: Depending on the OS, some of the parameters may not be taken -- into account. For example, on Linux, Foreign, Afiles Lib_Address and -- Relocatable are ignored. diff --git a/gcc/ada/nmake.adb b/gcc/ada/nmake.adb deleted file mode 100644 index 9b199faa0d0..00000000000 --- a/gcc/ada/nmake.adb +++ /dev/null @@ -1,2858 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- N M A K E -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - -pragma Style_Checks (All_Checks); --- Turn off subprogram order checking, since the routines here are --- generated automatically in order. - - -with Atree; use Atree; -with Sinfo; use Sinfo; -with Snames; use Snames; -with Stand; use Stand; - -package body Nmake is - - function Make_Unused_At_Start (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unused_At_Start, Sloc); - begin - return N; - end Make_Unused_At_Start; - - function Make_Unused_At_End (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unused_At_End, Sloc); - begin - return N; - end Make_Unused_At_End; - - function Make_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Identifier, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Identifier; - - function Make_Integer_Literal (Sloc : Source_Ptr; - Intval : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Integer_Literal, Sloc); - begin - Set_Intval (N, Intval); - return N; - end Make_Integer_Literal; - - function Make_Real_Literal (Sloc : Source_Ptr; - Realval : Ureal) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Real_Literal, Sloc); - begin - Set_Realval (N, Realval); - return N; - end Make_Real_Literal; - - function Make_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id; - Char_Literal_Value : Char_Code) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Character_Literal, Sloc); - begin - Set_Chars (N, Chars); - Set_Char_Literal_Value (N, Char_Literal_Value); - return N; - end Make_Character_Literal; - - function Make_String_Literal (Sloc : Source_Ptr; - Strval : String_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_String_Literal, Sloc); - begin - Set_Strval (N, Strval); - return N; - end Make_String_Literal; - - function Make_Pragma (Sloc : Source_Ptr; - Chars : Name_Id; - Pragma_Argument_Associations : List_Id := No_List; - Debug_Statement : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Pragma, Sloc); - begin - Set_Chars (N, Chars); - Set_Pragma_Argument_Associations - (N, Pragma_Argument_Associations); - Set_Debug_Statement (N, Debug_Statement); - return N; - end Make_Pragma; - - function Make_Pragma_Argument_Association (Sloc : Source_Ptr; - Chars : Name_Id := No_Name; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Pragma_Argument_Association, Sloc); - begin - Set_Chars (N, Chars); - Set_Expression (N, Expression); - return N; - end Make_Pragma_Argument_Association; - - function Make_Defining_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Identifier, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Identifier; - - function Make_Full_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Type_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Full_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Type_Definition (N, Type_Definition); - return N; - end Make_Full_Type_Declaration; - - function Make_Subtype_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subtype_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Subtype_Declaration; - - function Make_Subtype_Indication (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Constraint : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subtype_Indication, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Constraint (N, Constraint); - return N; - end Make_Subtype_Indication; - - function Make_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Constant_Present : Boolean := False; - Object_Definition : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Object_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Aliased_Present (N, Aliased_Present); - Set_Constant_Present (N, Constant_Present); - Set_Object_Definition (N, Object_Definition); - Set_Expression (N, Expression); - return N; - end Make_Object_Declaration; - - function Make_Number_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Number_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Expression (N, Expression); - return N; - end Make_Number_Declaration; - - function Make_Derived_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id; - Record_Extension_Part : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Derived_Type_Definition, Sloc); - begin - Set_Abstract_Present (N, Abstract_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Record_Extension_Part (N, Record_Extension_Part); - return N; - end Make_Derived_Type_Definition; - - function Make_Range_Constraint (Sloc : Source_Ptr; - Range_Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Range_Constraint, Sloc); - begin - Set_Range_Expression (N, Range_Expression); - return N; - end Make_Range_Constraint; - - function Make_Range (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id; - Includes_Infinities : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Range, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - Set_Includes_Infinities (N, Includes_Infinities); - return N; - end Make_Range; - - function Make_Enumeration_Type_Definition (Sloc : Source_Ptr; - Literals : List_Id; - End_Label : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Enumeration_Type_Definition, Sloc); - begin - Set_Literals (N, Literals); - Set_End_Label (N, End_Label); - return N; - end Make_Enumeration_Type_Definition; - - function Make_Defining_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Character_Literal, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Character_Literal; - - function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Signed_Integer_Type_Definition, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - return N; - end Make_Signed_Integer_Type_Definition; - - function Make_Modular_Type_Definition (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Modular_Type_Definition, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Modular_Type_Definition; - - function Make_Floating_Point_Definition (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Floating_Point_Definition, Sloc); - begin - Set_Digits_Expression (N, Digits_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Floating_Point_Definition; - - function Make_Real_Range_Specification (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Real_Range_Specification, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - return N; - end Make_Real_Range_Specification; - - function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Real_Range_Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Ordinary_Fixed_Point_Definition, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Ordinary_Fixed_Point_Definition; - - function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Decimal_Fixed_Point_Definition, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Digits_Expression (N, Digits_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Decimal_Fixed_Point_Definition; - - function Make_Digits_Constraint (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Digits_Constraint, Sloc); - begin - Set_Digits_Expression (N, Digits_Expression); - Set_Range_Constraint (N, Range_Constraint); - return N; - end Make_Digits_Constraint; - - function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr; - Subtype_Marks : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unconstrained_Array_Definition, Sloc); - begin - Set_Subtype_Marks (N, Subtype_Marks); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Unconstrained_Array_Definition; - - function Make_Constrained_Array_Definition (Sloc : Source_Ptr; - Discrete_Subtype_Definitions : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Constrained_Array_Definition, Sloc); - begin - Set_Discrete_Subtype_Definitions - (N, Discrete_Subtype_Definitions); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Constrained_Array_Definition; - - function Make_Discriminant_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Discriminant_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Type (N, Discriminant_Type); - Set_Expression (N, Expression); - return N; - end Make_Discriminant_Specification; - - function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr; - Constraints : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Index_Or_Discriminant_Constraint, Sloc); - begin - Set_Constraints (N, Constraints); - return N; - end Make_Index_Or_Discriminant_Constraint; - - function Make_Discriminant_Association (Sloc : Source_Ptr; - Selector_Names : List_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Discriminant_Association, Sloc); - begin - Set_Selector_Names (N, Selector_Names); - Set_Expression (N, Expression); - return N; - end Make_Discriminant_Association; - - function Make_Record_Definition (Sloc : Source_Ptr; - End_Label : Node_Id := Empty; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False; - Component_List : Node_Id; - Null_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Record_Definition, Sloc); - begin - Set_End_Label (N, End_Label); - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - Set_Component_List (N, Component_List); - Set_Null_Present (N, Null_Present); - return N; - end Make_Record_Definition; - - function Make_Component_List (Sloc : Source_Ptr; - Component_Items : List_Id; - Variant_Part : Node_Id := Empty; - Null_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_List, Sloc); - begin - Set_Component_Items (N, Component_Items); - Set_Variant_Part (N, Variant_Part); - Set_Null_Present (N, Null_Present); - return N; - end Make_Component_List; - - function Make_Component_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Expression (N, Expression); - return N; - end Make_Component_Declaration; - - function Make_Variant_Part (Sloc : Source_Ptr; - Name : Node_Id; - Variants : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Variant_Part, Sloc); - begin - Set_Name (N, Name); - Set_Variants (N, Variants); - return N; - end Make_Variant_Part; - - function Make_Variant (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Component_List : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Variant, Sloc); - begin - Set_Discrete_Choices (N, Discrete_Choices); - Set_Component_List (N, Component_List); - return N; - end Make_Variant; - - function Make_Others_Choice (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Others_Choice, Sloc); - begin - return N; - end Make_Others_Choice; - - function Make_Access_To_Object_Definition (Sloc : Source_Ptr; - All_Present : Boolean := False; - Subtype_Indication : Node_Id; - Constant_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_To_Object_Definition, Sloc); - begin - Set_All_Present (N, All_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Constant_Present (N, Constant_Present); - return N; - end Make_Access_To_Object_Definition; - - function Make_Access_Function_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Function_Definition, Sloc); - begin - Set_Protected_Present (N, Protected_Present); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Access_Function_Definition; - - function Make_Access_Procedure_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Procedure_Definition, Sloc); - begin - Set_Protected_Present (N, Protected_Present); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Access_Procedure_Definition; - - function Make_Access_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Definition, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Access_Definition; - - function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Incomplete_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - return N; - end Make_Incomplete_Type_Declaration; - - function Make_Explicit_Dereference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Explicit_Dereference, Sloc); - begin - Set_Prefix (N, Prefix); - return N; - end Make_Explicit_Dereference; - - function Make_Indexed_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Expressions : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Indexed_Component, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Expressions (N, Expressions); - return N; - end Make_Indexed_Component; - - function Make_Slice (Sloc : Source_Ptr; - Prefix : Node_Id; - Discrete_Range : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Slice, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Discrete_Range (N, Discrete_Range); - return N; - end Make_Slice; - - function Make_Selected_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Selected_Component, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Selector_Name (N, Selector_Name); - return N; - end Make_Selected_Component; - - function Make_Attribute_Reference (Sloc : Source_Ptr; - Prefix : Node_Id; - Attribute_Name : Name_Id; - Expressions : List_Id := No_List; - Must_Be_Byte_Aligned : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Attribute_Reference, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Attribute_Name (N, Attribute_Name); - Set_Expressions (N, Expressions); - Set_Must_Be_Byte_Aligned (N, Must_Be_Byte_Aligned); - return N; - end Make_Attribute_Reference; - - function Make_Aggregate (Sloc : Source_Ptr; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Aggregate, Sloc); - begin - Set_Expressions (N, Expressions); - Set_Component_Associations (N, Component_Associations); - Set_Null_Record_Present (N, Null_Record_Present); - return N; - end Make_Aggregate; - - function Make_Component_Association (Sloc : Source_Ptr; - Choices : List_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Association, Sloc); - begin - Set_Choices (N, Choices); - Set_Expression (N, Expression); - return N; - end Make_Component_Association; - - function Make_Extension_Aggregate (Sloc : Source_Ptr; - Ancestor_Part : Node_Id; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Extension_Aggregate, Sloc); - begin - Set_Ancestor_Part (N, Ancestor_Part); - Set_Expressions (N, Expressions); - Set_Component_Associations (N, Component_Associations); - Set_Null_Record_Present (N, Null_Record_Present); - return N; - end Make_Extension_Aggregate; - - function Make_Null (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Null, Sloc); - begin - return N; - end Make_Null; - - function Make_And_Then (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_And_Then, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_And_Then; - - function Make_Or_Else (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Or_Else, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_Or_Else; - - function Make_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_In, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_In; - - function Make_Not_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Not_In, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_Not_In; - - function Make_Op_And (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_And, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_And); - Set_Entity (N, Standard_Op_And); - return N; - end Make_Op_And; - - function Make_Op_Or (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Or, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Or); - Set_Entity (N, Standard_Op_Or); - return N; - end Make_Op_Or; - - function Make_Op_Xor (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Xor, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Xor); - Set_Entity (N, Standard_Op_Xor); - return N; - end Make_Op_Xor; - - function Make_Op_Eq (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Eq, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Eq); - Set_Entity (N, Standard_Op_Eq); - return N; - end Make_Op_Eq; - - function Make_Op_Ne (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Ne, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Ne); - Set_Entity (N, Standard_Op_Ne); - return N; - end Make_Op_Ne; - - function Make_Op_Lt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Lt, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Lt); - Set_Entity (N, Standard_Op_Lt); - return N; - end Make_Op_Lt; - - function Make_Op_Le (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Le, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Le); - Set_Entity (N, Standard_Op_Le); - return N; - end Make_Op_Le; - - function Make_Op_Gt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Gt, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Gt); - Set_Entity (N, Standard_Op_Gt); - return N; - end Make_Op_Gt; - - function Make_Op_Ge (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Ge, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Ge); - Set_Entity (N, Standard_Op_Ge); - return N; - end Make_Op_Ge; - - function Make_Op_Add (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Add, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Add); - Set_Entity (N, Standard_Op_Add); - return N; - end Make_Op_Add; - - function Make_Op_Subtract (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Subtract, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Subtract); - Set_Entity (N, Standard_Op_Subtract); - return N; - end Make_Op_Subtract; - - function Make_Op_Concat (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Concat, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Concat); - Set_Entity (N, Standard_Op_Concat); - return N; - end Make_Op_Concat; - - function Make_Op_Multiply (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Multiply, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Multiply); - Set_Entity (N, Standard_Op_Multiply); - return N; - end Make_Op_Multiply; - - function Make_Op_Divide (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Divide, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Divide); - Set_Entity (N, Standard_Op_Divide); - return N; - end Make_Op_Divide; - - function Make_Op_Mod (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Mod, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Mod); - Set_Entity (N, Standard_Op_Mod); - return N; - end Make_Op_Mod; - - function Make_Op_Rem (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rem, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Rem); - Set_Entity (N, Standard_Op_Rem); - return N; - end Make_Op_Rem; - - function Make_Op_Expon (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Expon, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Expon); - Set_Entity (N, Standard_Op_Expon); - return N; - end Make_Op_Expon; - - function Make_Op_Plus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Plus, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Add); - Set_Entity (N, Standard_Op_Plus); - return N; - end Make_Op_Plus; - - function Make_Op_Minus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Minus, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Subtract); - Set_Entity (N, Standard_Op_Minus); - return N; - end Make_Op_Minus; - - function Make_Op_Abs (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Abs, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Abs); - Set_Entity (N, Standard_Op_Abs); - return N; - end Make_Op_Abs; - - function Make_Op_Not (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Not, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Not); - Set_Entity (N, Standard_Op_Not); - return N; - end Make_Op_Not; - - function Make_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Type_Conversion, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Type_Conversion; - - function Make_Qualified_Expression (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Qualified_Expression, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Qualified_Expression; - - function Make_Allocator (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Allocator, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Allocator; - - function Make_Null_Statement (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Null_Statement, Sloc); - begin - return N; - end Make_Null_Statement; - - function Make_Label (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Label, Sloc); - begin - Set_Identifier (N, Identifier); - return N; - end Make_Label; - - function Make_Assignment_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Assignment_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Expression (N, Expression); - return N; - end Make_Assignment_Statement; - - function Make_If_Statement (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id; - Elsif_Parts : List_Id := No_List; - Else_Statements : List_Id := No_List; - End_Span : Uint := No_Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_If_Statement, Sloc); - begin - Set_Condition (N, Condition); - Set_Then_Statements (N, Then_Statements); - Set_Elsif_Parts (N, Elsif_Parts); - Set_Else_Statements (N, Else_Statements); - Set_End_Span (N, End_Span); - return N; - end Make_If_Statement; - - function Make_Elsif_Part (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Elsif_Part, Sloc); - begin - Set_Condition (N, Condition); - Set_Then_Statements (N, Then_Statements); - return N; - end Make_Elsif_Part; - - function Make_Case_Statement (Sloc : Source_Ptr; - Expression : Node_Id; - Alternatives : List_Id; - End_Span : Uint := No_Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Case_Statement, Sloc); - begin - Set_Expression (N, Expression); - Set_Alternatives (N, Alternatives); - Set_End_Span (N, End_Span); - return N; - end Make_Case_Statement; - - function Make_Case_Statement_Alternative (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Case_Statement_Alternative, Sloc); - begin - Set_Discrete_Choices (N, Discrete_Choices); - Set_Statements (N, Statements); - return N; - end Make_Case_Statement_Alternative; - - function Make_Loop_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Iteration_Scheme : Node_Id := Empty; - Statements : List_Id; - End_Label : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Null_Loop : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Loop_Statement, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Iteration_Scheme (N, Iteration_Scheme); - Set_Statements (N, Statements); - Set_End_Label (N, End_Label); - Set_Has_Created_Identifier (N, Has_Created_Identifier); - Set_Is_Null_Loop (N, Is_Null_Loop); - return N; - end Make_Loop_Statement; - - function Make_Iteration_Scheme (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Loop_Parameter_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Iteration_Scheme, Sloc); - begin - Set_Condition (N, Condition); - Set_Loop_Parameter_Specification - (N, Loop_Parameter_Specification); - return N; - end Make_Iteration_Scheme; - - function Make_Loop_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Reverse_Present : Boolean := False; - Discrete_Subtype_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Loop_Parameter_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Reverse_Present (N, Reverse_Present); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - return N; - end Make_Loop_Parameter_Specification; - - function Make_Block_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Declarations : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Task_Allocation_Block : Boolean := False; - Is_Asynchronous_Call_Block : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Block_Statement, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Has_Created_Identifier (N, Has_Created_Identifier); - Set_Is_Task_Allocation_Block (N, Is_Task_Allocation_Block); - Set_Is_Asynchronous_Call_Block (N, Is_Asynchronous_Call_Block); - return N; - end Make_Block_Statement; - - function Make_Exit_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty; - Condition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exit_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Condition (N, Condition); - return N; - end Make_Exit_Statement; - - function Make_Goto_Statement (Sloc : Source_Ptr; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Goto_Statement, Sloc); - begin - Set_Name (N, Name); - return N; - end Make_Goto_Statement; - - function Make_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Subprogram_Declaration; - - function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abstract_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Abstract_Subprogram_Declaration; - - function Make_Function_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Function_Specification; - - function Make_Procedure_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Procedure_Specification; - - function Make_Designator (Sloc : Source_Ptr; - Name : Node_Id; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Designator, Sloc); - begin - Set_Name (N, Name); - Set_Identifier (N, Identifier); - return N; - end Make_Designator; - - function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr; - Name : Node_Id; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Defining_Program_Unit_Name, Sloc); - begin - Set_Name (N, Name); - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Defining_Program_Unit_Name; - - function Make_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id; - Strval : String_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Operator_Symbol, Sloc); - begin - Set_Chars (N, Chars); - Set_Strval (N, Strval); - return N; - end Make_Operator_Symbol; - - function Make_Defining_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Operator_Symbol, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Operator_Symbol; - - function Make_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Parameter_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Parameter_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_In_Present (N, In_Present); - Set_Out_Present (N, Out_Present); - Set_Parameter_Type (N, Parameter_Type); - Set_Expression (N, Expression); - return N; - end Make_Parameter_Specification; - - function Make_Subprogram_Body (Sloc : Source_Ptr; - Specification : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id; - Bad_Is_Detected : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Body, Sloc); - begin - Set_Specification (N, Specification); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Bad_Is_Detected (N, Bad_Is_Detected); - return N; - end Make_Subprogram_Body; - - function Make_Procedure_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Call_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Procedure_Call_Statement; - - function Make_Function_Call (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Call, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Function_Call; - - function Make_Parameter_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id; - Explicit_Actual_Parameter : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Parameter_Association, Sloc); - begin - Set_Selector_Name (N, Selector_Name); - Set_Explicit_Actual_Parameter (N, Explicit_Actual_Parameter); - return N; - end Make_Parameter_Association; - - function Make_Return_Statement (Sloc : Source_Ptr; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Return_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Return_Statement; - - function Make_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Package_Declaration; - - function Make_Package_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Package_Specification; - - function Make_Package_Body (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Body, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Package_Body; - - function Make_Private_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Private_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_Private_Type_Declaration; - - function Make_Private_Extension_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Private_Extension_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - Set_Abstract_Present (N, Abstract_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Private_Extension_Declaration; - - function Make_Use_Package_Clause (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Use_Package_Clause, Sloc); - begin - Set_Names (N, Names); - return N; - end Make_Use_Package_Clause; - - function Make_Use_Type_Clause (Sloc : Source_Ptr; - Subtype_Marks : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Use_Type_Clause, Sloc); - begin - Set_Subtype_Marks (N, Subtype_Marks); - return N; - end Make_Use_Type_Clause; - - function Make_Object_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Mark : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Object_Renaming_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Subtype_Mark (N, Subtype_Mark); - Set_Name (N, Name); - return N; - end Make_Object_Renaming_Declaration; - - function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Renaming_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Name (N, Name); - return N; - end Make_Exception_Renaming_Declaration; - - function Make_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Package_Renaming_Declaration; - - function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Renaming_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Name (N, Name); - return N; - end Make_Subprogram_Renaming_Declaration; - - function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Package_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Package_Renaming_Declaration; - - function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Procedure_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Procedure_Renaming_Declaration; - - function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Function_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Function_Renaming_Declaration; - - function Make_Task_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Task_Definition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Task_Definition (N, Task_Definition); - return N; - end Make_Task_Type_Declaration; - - function Make_Single_Task_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Task_Definition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Single_Task_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Task_Definition (N, Task_Definition); - return N; - end Make_Single_Task_Declaration; - - function Make_Task_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Definition, Sloc); - begin - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Task_Definition; - - function Make_Task_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Task_Body; - - function Make_Protected_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Protected_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Protected_Definition (N, Protected_Definition); - return N; - end Make_Protected_Type_Declaration; - - function Make_Single_Protected_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Protected_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Single_Protected_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Protected_Definition (N, Protected_Definition); - return N; - end Make_Single_Protected_Declaration; - - function Make_Protected_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Definition, Sloc); - begin - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Protected_Definition; - - function Make_Protected_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Declarations (N, Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Protected_Body; - - function Make_Entry_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Entry_Declaration; - - function Make_Accept_Statement (Sloc : Source_Ptr; - Entry_Direct_Name : Node_Id; - Entry_Index : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Declarations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Accept_Statement, Sloc); - begin - Set_Entry_Direct_Name (N, Entry_Direct_Name); - Set_Entry_Index (N, Entry_Index); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Declarations (N, Declarations); - return N; - end Make_Accept_Statement; - - function Make_Entry_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Entry_Body_Formal_Part : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Entry_Body_Formal_Part (N, Entry_Body_Formal_Part); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Entry_Body; - - function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr; - Entry_Index_Specification : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Condition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Body_Formal_Part, Sloc); - begin - Set_Entry_Index_Specification (N, Entry_Index_Specification); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Condition (N, Condition); - return N; - end Make_Entry_Body_Formal_Part; - - function Make_Entry_Index_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Index_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - return N; - end Make_Entry_Index_Specification; - - function Make_Entry_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Call_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Entry_Call_Statement; - - function Make_Requeue_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Abort_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Requeue_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Abort_Present (N, Abort_Present); - return N; - end Make_Requeue_Statement; - - function Make_Delay_Until_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Until_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Delay_Until_Statement; - - function Make_Delay_Relative_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Relative_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Delay_Relative_Statement; - - function Make_Selective_Accept (Sloc : Source_Ptr; - Select_Alternatives : List_Id; - Else_Statements : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Selective_Accept, Sloc); - begin - Set_Select_Alternatives (N, Select_Alternatives); - Set_Else_Statements (N, Else_Statements); - return N; - end Make_Selective_Accept; - - function Make_Accept_Alternative (Sloc : Source_Ptr; - Accept_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Accept_Alternative, Sloc); - begin - Set_Accept_Statement (N, Accept_Statement); - Set_Condition (N, Condition); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Accept_Alternative; - - function Make_Delay_Alternative (Sloc : Source_Ptr; - Delay_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Alternative, Sloc); - begin - Set_Delay_Statement (N, Delay_Statement); - Set_Condition (N, Condition); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Delay_Alternative; - - function Make_Terminate_Alternative (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Pragmas_Before : List_Id := No_List; - Pragmas_After : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Terminate_Alternative, Sloc); - begin - Set_Condition (N, Condition); - Set_Pragmas_Before (N, Pragmas_Before); - Set_Pragmas_After (N, Pragmas_After); - return N; - end Make_Terminate_Alternative; - - function Make_Timed_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Delay_Alternative : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Timed_Entry_Call, Sloc); - begin - Set_Entry_Call_Alternative (N, Entry_Call_Alternative); - Set_Delay_Alternative (N, Delay_Alternative); - return N; - end Make_Timed_Entry_Call; - - function Make_Entry_Call_Alternative (Sloc : Source_Ptr; - Entry_Call_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Call_Alternative, Sloc); - begin - Set_Entry_Call_Statement (N, Entry_Call_Statement); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Entry_Call_Alternative; - - function Make_Conditional_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Else_Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Conditional_Entry_Call, Sloc); - begin - Set_Entry_Call_Alternative (N, Entry_Call_Alternative); - Set_Else_Statements (N, Else_Statements); - return N; - end Make_Conditional_Entry_Call; - - function Make_Asynchronous_Select (Sloc : Source_Ptr; - Triggering_Alternative : Node_Id; - Abortable_Part : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Asynchronous_Select, Sloc); - begin - Set_Triggering_Alternative (N, Triggering_Alternative); - Set_Abortable_Part (N, Abortable_Part); - return N; - end Make_Asynchronous_Select; - - function Make_Triggering_Alternative (Sloc : Source_Ptr; - Triggering_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Triggering_Alternative, Sloc); - begin - Set_Triggering_Statement (N, Triggering_Statement); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Triggering_Alternative; - - function Make_Abortable_Part (Sloc : Source_Ptr; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abortable_Part, Sloc); - begin - Set_Statements (N, Statements); - return N; - end Make_Abortable_Part; - - function Make_Abort_Statement (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abort_Statement, Sloc); - begin - Set_Names (N, Names); - return N; - end Make_Abort_Statement; - - function Make_Compilation_Unit (Sloc : Source_Ptr; - Context_Items : List_Id; - Private_Present : Boolean := False; - Unit : Node_Id; - Aux_Decls_Node : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Compilation_Unit, Sloc); - begin - Set_Context_Items (N, Context_Items); - Set_Private_Present (N, Private_Present); - Set_Unit (N, Unit); - Set_Aux_Decls_Node (N, Aux_Decls_Node); - return N; - end Make_Compilation_Unit; - - function Make_Compilation_Unit_Aux (Sloc : Source_Ptr; - Declarations : List_Id := No_List; - Actions : List_Id := No_List; - Pragmas_After : List_Id := No_List; - Config_Pragmas : List_Id := Empty_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Compilation_Unit_Aux, Sloc); - begin - Set_Declarations (N, Declarations); - Set_Actions (N, Actions); - Set_Pragmas_After (N, Pragmas_After); - Set_Config_Pragmas (N, Config_Pragmas); - return N; - end Make_Compilation_Unit_Aux; - - function Make_With_Clause (Sloc : Source_Ptr; - Name : Node_Id; - First_Name : Boolean := True; - Last_Name : Boolean := True; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_With_Clause, Sloc); - begin - Set_Name (N, Name); - Set_First_Name (N, First_Name); - Set_Last_Name (N, Last_Name); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_With_Clause; - - function Make_With_Type_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Tagged_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_With_Type_Clause, Sloc); - begin - Set_Name (N, Name); - Set_Tagged_Present (N, Tagged_Present); - return N; - end Make_With_Type_Clause; - - function Make_Subprogram_Body_Stub (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Body_Stub, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Subprogram_Body_Stub; - - function Make_Package_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Package_Body_Stub; - - function Make_Task_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Task_Body_Stub; - - function Make_Protected_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Protected_Body_Stub; - - function Make_Subunit (Sloc : Source_Ptr; - Name : Node_Id; - Proper_Body : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subunit, Sloc); - begin - Set_Name (N, Name); - Set_Proper_Body (N, Proper_Body); - return N; - end Make_Subunit; - - function Make_Exception_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Exception_Declaration; - - function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr; - Statements : List_Id; - End_Label : Node_Id := Empty; - Exception_Handlers : List_Id := No_List; - At_End_Proc : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Handled_Sequence_Of_Statements, Sloc); - begin - Set_Statements (N, Statements); - Set_End_Label (N, End_Label); - Set_Exception_Handlers (N, Exception_Handlers); - Set_At_End_Proc (N, At_End_Proc); - return N; - end Make_Handled_Sequence_Of_Statements; - - function Make_Exception_Handler (Sloc : Source_Ptr; - Choice_Parameter : Node_Id := Empty; - Exception_Choices : List_Id; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Handler, Sloc); - begin - Set_Choice_Parameter (N, Choice_Parameter); - Set_Exception_Choices (N, Exception_Choices); - Set_Statements (N, Statements); - return N; - end Make_Exception_Handler; - - function Make_Raise_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Statement, Sloc); - begin - Set_Name (N, Name); - return N; - end Make_Raise_Statement; - - function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations); - return N; - end Make_Generic_Subprogram_Declaration; - - function Make_Generic_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Package_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations); - return N; - end Make_Generic_Package_Declaration; - - function Make_Package_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Package_Instantiation; - - function Make_Procedure_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Procedure_Instantiation; - - function Make_Function_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Function_Instantiation; - - function Make_Generic_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id := Empty; - Explicit_Generic_Actual_Parameter : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Association, Sloc); - begin - Set_Selector_Name (N, Selector_Name); - Set_Explicit_Generic_Actual_Parameter - (N, Explicit_Generic_Actual_Parameter); - return N; - end Make_Generic_Association; - - function Make_Formal_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Subtype_Mark : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Object_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_In_Present (N, In_Present); - Set_Out_Present (N, Out_Present); - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Formal_Object_Declaration; - - function Make_Formal_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Formal_Type_Definition : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Formal_Type_Definition (N, Formal_Type_Definition); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - return N; - end Make_Formal_Type_Declaration; - - function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Private_Type_Definition, Sloc); - begin - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_Formal_Private_Type_Definition; - - function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Private_Present : Boolean := False; - Abstract_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Derived_Type_Definition, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Private_Present (N, Private_Present); - Set_Abstract_Present (N, Abstract_Present); - return N; - end Make_Formal_Derived_Type_Definition; - - function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Discrete_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Discrete_Type_Definition; - - function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Signed_Integer_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Signed_Integer_Type_Definition; - - function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Modular_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Modular_Type_Definition; - - function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Floating_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Floating_Point_Definition; - - function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Ordinary_Fixed_Point_Definition; - - function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Decimal_Fixed_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Decimal_Fixed_Point_Definition; - - function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Default_Name : Node_Id := Empty; - Box_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Default_Name (N, Default_Name); - Set_Box_Present (N, Box_Present); - return N; - end Make_Formal_Subprogram_Declaration; - - function Make_Formal_Package_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List; - Box_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Package_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - Set_Box_Present (N, Box_Present); - return N; - end Make_Formal_Package_Declaration; - - function Make_Attribute_Definition_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Chars : Name_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Attribute_Definition_Clause, Sloc); - begin - Set_Name (N, Name); - Set_Chars (N, Chars); - Set_Expression (N, Expression); - return N; - end Make_Attribute_Definition_Clause; - - function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Array_Aggregate : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Enumeration_Representation_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Array_Aggregate (N, Array_Aggregate); - return N; - end Make_Enumeration_Representation_Clause; - - function Make_Record_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Mod_Clause : Node_Id := Empty; - Component_Clauses : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Record_Representation_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Mod_Clause (N, Mod_Clause); - Set_Component_Clauses (N, Component_Clauses); - return N; - end Make_Record_Representation_Clause; - - function Make_Component_Clause (Sloc : Source_Ptr; - Component_Name : Node_Id; - Position : Node_Id; - First_Bit : Node_Id; - Last_Bit : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Clause, Sloc); - begin - Set_Component_Name (N, Component_Name); - Set_Position (N, Position); - Set_First_Bit (N, First_Bit); - Set_Last_Bit (N, Last_Bit); - return N; - end Make_Component_Clause; - - function Make_Code_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Code_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Code_Statement; - - function Make_Op_Rotate_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rotate_Left, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Rotate_Left); - Set_Entity (N, Standard_Op_Rotate_Left); - return N; - end Make_Op_Rotate_Left; - - function Make_Op_Rotate_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rotate_Right, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Rotate_Right); - Set_Entity (N, Standard_Op_Rotate_Right); - return N; - end Make_Op_Rotate_Right; - - function Make_Op_Shift_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Left, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Left); - Set_Entity (N, Standard_Op_Shift_Left); - return N; - end Make_Op_Shift_Left; - - function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Right_Arithmetic, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Right_Arithmetic); - Set_Entity (N, Standard_Op_Shift_Right_Arithmetic); - return N; - end Make_Op_Shift_Right_Arithmetic; - - function Make_Op_Shift_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Right, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Right); - Set_Entity (N, Standard_Op_Shift_Right); - return N; - end Make_Op_Shift_Right; - - function Make_Delta_Constraint (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delta_Constraint, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Range_Constraint (N, Range_Constraint); - return N; - end Make_Delta_Constraint; - - function Make_At_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_At_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Expression (N, Expression); - return N; - end Make_At_Clause; - - function Make_Mod_Clause (Sloc : Source_Ptr; - Expression : Node_Id; - Pragmas_Before : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Mod_Clause, Sloc); - begin - Set_Expression (N, Expression); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Mod_Clause; - - function Make_Conditional_Expression (Sloc : Source_Ptr; - Expressions : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Conditional_Expression, Sloc); - begin - Set_Expressions (N, Expressions); - return N; - end Make_Conditional_Expression; - - function Make_Expanded_Name (Sloc : Source_Ptr; - Chars : Name_Id; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Expanded_Name, Sloc); - begin - Set_Chars (N, Chars); - Set_Prefix (N, Prefix); - Set_Selector_Name (N, Selector_Name); - return N; - end Make_Expanded_Name; - - function Make_Free_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Free_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Free_Statement; - - function Make_Freeze_Entity (Sloc : Source_Ptr; - Actions : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Freeze_Entity, Sloc); - begin - Set_Actions (N, Actions); - return N; - end Make_Freeze_Entity; - - function Make_Implicit_Label_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Implicit_Label_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Implicit_Label_Declaration; - - function Make_Itype_Reference (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Itype_Reference, Sloc); - begin - return N; - end Make_Itype_Reference; - - function Make_Raise_Constraint_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Constraint_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Constraint_Error; - - function Make_Raise_Program_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Program_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Program_Error; - - function Make_Raise_Storage_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Storage_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Storage_Error; - - function Make_Reference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Reference, Sloc); - begin - Set_Prefix (N, Prefix); - return N; - end Make_Reference; - - function Make_Subprogram_Info (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Info, Sloc); - begin - Set_Identifier (N, Identifier); - return N; - end Make_Subprogram_Info; - - function Make_Unchecked_Expression (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unchecked_Expression, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Unchecked_Expression; - - function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unchecked_Type_Conversion, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Unchecked_Type_Conversion; - - function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Validate_Unchecked_Conversion, Sloc); - begin - return N; - end Make_Validate_Unchecked_Conversion; - -end Nmake; diff --git a/gcc/ada/nmake.ads b/gcc/ada/nmake.ads deleted file mode 100644 index be05e7940b3..00000000000 --- a/gcc/ada/nmake.ads +++ /dev/null @@ -1,1347 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- N M A K E -- --- -- --- S p e c -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - -pragma Style_Checks (All_Checks); --- Turn off subprogram order checking, since the routines here are --- generated automatically in order. - - -with Nlists; use Nlists; -with Types; use Types; -with Uintp; use Uintp; -with Urealp; use Urealp; - -package Nmake is - --- This package contains a set of routines used to construct tree nodes --- using a functional style. There is one routine for each node type defined --- in Sinfo with the general interface: - --- function Make_xxx (Sloc : Source_Ptr, --- Field_Name_1 : Field_Name_1_Type [:= default] --- Field_Name_2 : Field_Name_2_Type [:= default] --- ...) --- return Node_Id - --- Only syntactic fields are included (i.e. fields marked as "-Sem" or "-Lib" --- in the Sinfo spec are excluded). In addition, the following four syntactic --- fields are excluded: - --- Prev_Ids --- More_Ids --- Comes_From_Source --- Paren_Count - --- since they are very rarely set in expanded code. If they need to be set, --- to other than the default values (False, False, False, zero), then the --- appropriate Set_xxx procedures must be used on the returned value. - --- Default values are provided only for flag fields (where the default is --- False), and for optional fields. An optional field is one where the --- comment line describing the field contains the string "(set to xxx if". --- For such fields, a default value of xxx is provided." - --- Warning: since calls to Make_xxx routines are normal function calls, the --- arguments can be evaluated in any order. This means that at most one such --- argument can have side effects (e.g. be a call to a parse routine). - - function Make_Unused_At_Start (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Unused_At_Start); - - function Make_Unused_At_End (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Unused_At_End); - - function Make_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Identifier); - - function Make_Integer_Literal (Sloc : Source_Ptr; - Intval : Uint) - return Node_Id; - pragma Inline (Make_Integer_Literal); - - function Make_Real_Literal (Sloc : Source_Ptr; - Realval : Ureal) - return Node_Id; - pragma Inline (Make_Real_Literal); - - function Make_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id; - Char_Literal_Value : Char_Code) - return Node_Id; - pragma Inline (Make_Character_Literal); - - function Make_String_Literal (Sloc : Source_Ptr; - Strval : String_Id) - return Node_Id; - pragma Inline (Make_String_Literal); - - function Make_Pragma (Sloc : Source_Ptr; - Chars : Name_Id; - Pragma_Argument_Associations : List_Id := No_List; - Debug_Statement : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Pragma); - - function Make_Pragma_Argument_Association (Sloc : Source_Ptr; - Chars : Name_Id := No_Name; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Pragma_Argument_Association); - - function Make_Defining_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Identifier); - - function Make_Full_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Type_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Full_Type_Declaration); - - function Make_Subtype_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Subtype_Declaration); - - function Make_Subtype_Indication (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Constraint : Node_Id) - return Node_Id; - pragma Inline (Make_Subtype_Indication); - - function Make_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Constant_Present : Boolean := False; - Object_Definition : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Object_Declaration); - - function Make_Number_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Number_Declaration); - - function Make_Derived_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id; - Record_Extension_Part : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Derived_Type_Definition); - - function Make_Range_Constraint (Sloc : Source_Ptr; - Range_Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Range_Constraint); - - function Make_Range (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id; - Includes_Infinities : Boolean := False) - return Node_Id; - pragma Inline (Make_Range); - - function Make_Enumeration_Type_Definition (Sloc : Source_Ptr; - Literals : List_Id; - End_Label : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Enumeration_Type_Definition); - - function Make_Defining_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Character_Literal); - - function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id; - pragma Inline (Make_Signed_Integer_Type_Definition); - - function Make_Modular_Type_Definition (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Modular_Type_Definition); - - function Make_Floating_Point_Definition (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Floating_Point_Definition); - - function Make_Real_Range_Specification (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id; - pragma Inline (Make_Real_Range_Specification); - - function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Real_Range_Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Ordinary_Fixed_Point_Definition); - - function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Decimal_Fixed_Point_Definition); - - function Make_Digits_Constraint (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Digits_Constraint); - - function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr; - Subtype_Marks : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Unconstrained_Array_Definition); - - function Make_Constrained_Array_Definition (Sloc : Source_Ptr; - Discrete_Subtype_Definitions : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Constrained_Array_Definition); - - function Make_Discriminant_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Discriminant_Specification); - - function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr; - Constraints : List_Id) - return Node_Id; - pragma Inline (Make_Index_Or_Discriminant_Constraint); - - function Make_Discriminant_Association (Sloc : Source_Ptr; - Selector_Names : List_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Discriminant_Association); - - function Make_Record_Definition (Sloc : Source_Ptr; - End_Label : Node_Id := Empty; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False; - Component_List : Node_Id; - Null_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Record_Definition); - - function Make_Component_List (Sloc : Source_Ptr; - Component_Items : List_Id; - Variant_Part : Node_Id := Empty; - Null_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Component_List); - - function Make_Component_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Component_Declaration); - - function Make_Variant_Part (Sloc : Source_Ptr; - Name : Node_Id; - Variants : List_Id) - return Node_Id; - pragma Inline (Make_Variant_Part); - - function Make_Variant (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Component_List : Node_Id) - return Node_Id; - pragma Inline (Make_Variant); - - function Make_Others_Choice (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Others_Choice); - - function Make_Access_To_Object_Definition (Sloc : Source_Ptr; - All_Present : Boolean := False; - Subtype_Indication : Node_Id; - Constant_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Access_To_Object_Definition); - - function Make_Access_Function_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Access_Function_Definition); - - function Make_Access_Procedure_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Access_Procedure_Definition); - - function Make_Access_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Access_Definition); - - function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Incomplete_Type_Declaration); - - function Make_Explicit_Dereference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id; - pragma Inline (Make_Explicit_Dereference); - - function Make_Indexed_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Expressions : List_Id) - return Node_Id; - pragma Inline (Make_Indexed_Component); - - function Make_Slice (Sloc : Source_Ptr; - Prefix : Node_Id; - Discrete_Range : Node_Id) - return Node_Id; - pragma Inline (Make_Slice); - - function Make_Selected_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id; - pragma Inline (Make_Selected_Component); - - function Make_Attribute_Reference (Sloc : Source_Ptr; - Prefix : Node_Id; - Attribute_Name : Name_Id; - Expressions : List_Id := No_List; - Must_Be_Byte_Aligned : Boolean := False) - return Node_Id; - pragma Inline (Make_Attribute_Reference); - - function Make_Aggregate (Sloc : Source_Ptr; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Aggregate); - - function Make_Component_Association (Sloc : Source_Ptr; - Choices : List_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Component_Association); - - function Make_Extension_Aggregate (Sloc : Source_Ptr; - Ancestor_Part : Node_Id; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Extension_Aggregate); - - function Make_Null (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Null); - - function Make_And_Then (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_And_Then); - - function Make_Or_Else (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Or_Else); - - function Make_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_In); - - function Make_Not_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Not_In); - - function Make_Op_And (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_And); - - function Make_Op_Or (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Or); - - function Make_Op_Xor (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Xor); - - function Make_Op_Eq (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Eq); - - function Make_Op_Ne (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Ne); - - function Make_Op_Lt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Lt); - - function Make_Op_Le (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Le); - - function Make_Op_Gt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Gt); - - function Make_Op_Ge (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Ge); - - function Make_Op_Add (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Add); - - function Make_Op_Subtract (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Subtract); - - function Make_Op_Concat (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Concat); - - function Make_Op_Multiply (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Multiply); - - function Make_Op_Divide (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Divide); - - function Make_Op_Mod (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Mod); - - function Make_Op_Rem (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rem); - - function Make_Op_Expon (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Expon); - - function Make_Op_Plus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Plus); - - function Make_Op_Minus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Minus); - - function Make_Op_Abs (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Abs); - - function Make_Op_Not (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Not); - - function Make_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Type_Conversion); - - function Make_Qualified_Expression (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Qualified_Expression); - - function Make_Allocator (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Allocator); - - function Make_Null_Statement (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Null_Statement); - - function Make_Label (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Label); - - function Make_Assignment_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Assignment_Statement); - - function Make_If_Statement (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id; - Elsif_Parts : List_Id := No_List; - Else_Statements : List_Id := No_List; - End_Span : Uint := No_Uint) - return Node_Id; - pragma Inline (Make_If_Statement); - - function Make_Elsif_Part (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id) - return Node_Id; - pragma Inline (Make_Elsif_Part); - - function Make_Case_Statement (Sloc : Source_Ptr; - Expression : Node_Id; - Alternatives : List_Id; - End_Span : Uint := No_Uint) - return Node_Id; - pragma Inline (Make_Case_Statement); - - function Make_Case_Statement_Alternative (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Case_Statement_Alternative); - - function Make_Loop_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Iteration_Scheme : Node_Id := Empty; - Statements : List_Id; - End_Label : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Null_Loop : Boolean := False) - return Node_Id; - pragma Inline (Make_Loop_Statement); - - function Make_Iteration_Scheme (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Loop_Parameter_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Iteration_Scheme); - - function Make_Loop_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Reverse_Present : Boolean := False; - Discrete_Subtype_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Loop_Parameter_Specification); - - function Make_Block_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Declarations : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Task_Allocation_Block : Boolean := False; - Is_Asynchronous_Call_Block : Boolean := False) - return Node_Id; - pragma Inline (Make_Block_Statement); - - function Make_Exit_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty; - Condition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Exit_Statement); - - function Make_Goto_Statement (Sloc : Source_Ptr; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Goto_Statement); - - function Make_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Declaration); - - function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Abstract_Subprogram_Declaration); - - function Make_Function_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Function_Specification); - - function Make_Procedure_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Specification); - - function Make_Designator (Sloc : Source_Ptr; - Name : Node_Id; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Designator); - - function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr; - Name : Node_Id; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Defining_Program_Unit_Name); - - function Make_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id; - Strval : String_Id) - return Node_Id; - pragma Inline (Make_Operator_Symbol); - - function Make_Defining_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Operator_Symbol); - - function Make_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Parameter_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Parameter_Specification); - - function Make_Subprogram_Body (Sloc : Source_Ptr; - Specification : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id; - Bad_Is_Detected : Boolean := False) - return Node_Id; - pragma Inline (Make_Subprogram_Body); - - function Make_Procedure_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Call_Statement); - - function Make_Function_Call (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Function_Call); - - function Make_Parameter_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id; - Explicit_Actual_Parameter : Node_Id) - return Node_Id; - pragma Inline (Make_Parameter_Association); - - function Make_Return_Statement (Sloc : Source_Ptr; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Return_Statement); - - function Make_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Declaration); - - function Make_Package_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Specification); - - function Make_Package_Body (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Package_Body); - - function Make_Private_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Private_Type_Declaration); - - function Make_Private_Extension_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Private_Extension_Declaration); - - function Make_Use_Package_Clause (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id; - pragma Inline (Make_Use_Package_Clause); - - function Make_Use_Type_Clause (Sloc : Source_Ptr; - Subtype_Marks : List_Id) - return Node_Id; - pragma Inline (Make_Use_Type_Clause); - - function Make_Object_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Mark : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Object_Renaming_Declaration); - - function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Exception_Renaming_Declaration); - - function Make_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Renaming_Declaration); - - function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Renaming_Declaration); - - function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Package_Renaming_Declaration); - - function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Procedure_Renaming_Declaration); - - function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Function_Renaming_Declaration); - - function Make_Task_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Task_Definition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Task_Type_Declaration); - - function Make_Single_Task_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Task_Definition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Single_Task_Declaration); - - function Make_Task_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Definition); - - function Make_Task_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Body); - - function Make_Protected_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Protected_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Type_Declaration); - - function Make_Single_Protected_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Protected_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Single_Protected_Declaration); - - function Make_Protected_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Definition); - - function Make_Protected_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Body); - - function Make_Entry_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Declaration); - - function Make_Accept_Statement (Sloc : Source_Ptr; - Entry_Direct_Name : Node_Id; - Entry_Index : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Declarations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Accept_Statement); - - function Make_Entry_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Entry_Body_Formal_Part : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Body); - - function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr; - Entry_Index_Specification : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Condition : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Body_Formal_Part); - - function Make_Entry_Index_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Index_Specification); - - function Make_Entry_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Call_Statement); - - function Make_Requeue_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Abort_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Requeue_Statement); - - function Make_Delay_Until_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Delay_Until_Statement); - - function Make_Delay_Relative_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Delay_Relative_Statement); - - function Make_Selective_Accept (Sloc : Source_Ptr; - Select_Alternatives : List_Id; - Else_Statements : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Selective_Accept); - - function Make_Accept_Alternative (Sloc : Source_Ptr; - Accept_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Accept_Alternative); - - function Make_Delay_Alternative (Sloc : Source_Ptr; - Delay_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Delay_Alternative); - - function Make_Terminate_Alternative (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Pragmas_Before : List_Id := No_List; - Pragmas_After : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Terminate_Alternative); - - function Make_Timed_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Delay_Alternative : Node_Id) - return Node_Id; - pragma Inline (Make_Timed_Entry_Call); - - function Make_Entry_Call_Alternative (Sloc : Source_Ptr; - Entry_Call_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Call_Alternative); - - function Make_Conditional_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Else_Statements : List_Id) - return Node_Id; - pragma Inline (Make_Conditional_Entry_Call); - - function Make_Asynchronous_Select (Sloc : Source_Ptr; - Triggering_Alternative : Node_Id; - Abortable_Part : Node_Id) - return Node_Id; - pragma Inline (Make_Asynchronous_Select); - - function Make_Triggering_Alternative (Sloc : Source_Ptr; - Triggering_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Triggering_Alternative); - - function Make_Abortable_Part (Sloc : Source_Ptr; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Abortable_Part); - - function Make_Abort_Statement (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id; - pragma Inline (Make_Abort_Statement); - - function Make_Compilation_Unit (Sloc : Source_Ptr; - Context_Items : List_Id; - Private_Present : Boolean := False; - Unit : Node_Id; - Aux_Decls_Node : Node_Id) - return Node_Id; - pragma Inline (Make_Compilation_Unit); - - function Make_Compilation_Unit_Aux (Sloc : Source_Ptr; - Declarations : List_Id := No_List; - Actions : List_Id := No_List; - Pragmas_After : List_Id := No_List; - Config_Pragmas : List_Id := Empty_List) - return Node_Id; - pragma Inline (Make_Compilation_Unit_Aux); - - function Make_With_Clause (Sloc : Source_Ptr; - Name : Node_Id; - First_Name : Boolean := True; - Last_Name : Boolean := True; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_With_Clause); - - function Make_With_Type_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Tagged_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_With_Type_Clause); - - function Make_Subprogram_Body_Stub (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Body_Stub); - - function Make_Package_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Body_Stub); - - function Make_Task_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Body_Stub); - - function Make_Protected_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Body_Stub); - - function Make_Subunit (Sloc : Source_Ptr; - Name : Node_Id; - Proper_Body : Node_Id) - return Node_Id; - pragma Inline (Make_Subunit); - - function Make_Exception_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Exception_Declaration); - - function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr; - Statements : List_Id; - End_Label : Node_Id := Empty; - Exception_Handlers : List_Id := No_List; - At_End_Proc : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Handled_Sequence_Of_Statements); - - function Make_Exception_Handler (Sloc : Source_Ptr; - Choice_Parameter : Node_Id := Empty; - Exception_Choices : List_Id; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Exception_Handler); - - function Make_Raise_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Raise_Statement); - - function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id; - pragma Inline (Make_Generic_Subprogram_Declaration); - - function Make_Generic_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id; - pragma Inline (Make_Generic_Package_Declaration); - - function Make_Package_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Package_Instantiation); - - function Make_Procedure_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Instantiation); - - function Make_Function_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Function_Instantiation); - - function Make_Generic_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id := Empty; - Explicit_Generic_Actual_Parameter : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Association); - - function Make_Formal_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Subtype_Mark : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Formal_Object_Declaration); - - function Make_Formal_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Formal_Type_Definition : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Type_Declaration); - - function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Private_Type_Definition); - - function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Private_Present : Boolean := False; - Abstract_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Derived_Type_Definition); - - function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Discrete_Type_Definition); - - function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Signed_Integer_Type_Definition); - - function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Modular_Type_Definition); - - function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Floating_Point_Definition); - - function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Ordinary_Fixed_Point_Definition); - - function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Decimal_Fixed_Point_Definition); - - function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Default_Name : Node_Id := Empty; - Box_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Subprogram_Declaration); - - function Make_Formal_Package_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List; - Box_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Package_Declaration); - - function Make_Attribute_Definition_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Chars : Name_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Attribute_Definition_Clause); - - function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Array_Aggregate : Node_Id) - return Node_Id; - pragma Inline (Make_Enumeration_Representation_Clause); - - function Make_Record_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Mod_Clause : Node_Id := Empty; - Component_Clauses : List_Id) - return Node_Id; - pragma Inline (Make_Record_Representation_Clause); - - function Make_Component_Clause (Sloc : Source_Ptr; - Component_Name : Node_Id; - Position : Node_Id; - First_Bit : Node_Id; - Last_Bit : Node_Id) - return Node_Id; - pragma Inline (Make_Component_Clause); - - function Make_Code_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Code_Statement); - - function Make_Op_Rotate_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rotate_Left); - - function Make_Op_Rotate_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rotate_Right); - - function Make_Op_Shift_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Left); - - function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Right_Arithmetic); - - function Make_Op_Shift_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Right); - - function Make_Delta_Constraint (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Delta_Constraint); - - function Make_At_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_At_Clause); - - function Make_Mod_Clause (Sloc : Source_Ptr; - Expression : Node_Id; - Pragmas_Before : List_Id) - return Node_Id; - pragma Inline (Make_Mod_Clause); - - function Make_Conditional_Expression (Sloc : Source_Ptr; - Expressions : List_Id) - return Node_Id; - pragma Inline (Make_Conditional_Expression); - - function Make_Expanded_Name (Sloc : Source_Ptr; - Chars : Name_Id; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id; - pragma Inline (Make_Expanded_Name); - - function Make_Free_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Free_Statement); - - function Make_Freeze_Entity (Sloc : Source_Ptr; - Actions : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Freeze_Entity); - - function Make_Implicit_Label_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Implicit_Label_Declaration); - - function Make_Itype_Reference (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Itype_Reference); - - function Make_Raise_Constraint_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Constraint_Error); - - function Make_Raise_Program_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Program_Error); - - function Make_Raise_Storage_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Storage_Error); - - function Make_Reference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id; - pragma Inline (Make_Reference); - - function Make_Subprogram_Info (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Info); - - function Make_Unchecked_Expression (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Unchecked_Expression); - - function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Unchecked_Type_Conversion); - - function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Validate_Unchecked_Conversion); - -end Nmake; diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb index cce9b1e87aa..be1eca67bcd 100644 --- a/gcc/ada/opt.adb +++ b/gcc/ada/opt.adb @@ -186,6 +186,7 @@ package body Opt is ---------------- procedure Tree_Write is + Version_String : String := Gnat_Version_String; begin Tree_Write_Int (ASIS_Version_Number); Tree_Write_Bool (Brief_Output); @@ -202,9 +203,9 @@ package body Opt is Tree_Write_Bool (Assertions_Enabled); Tree_Write_Bool (Enable_Overflow_Checks); Tree_Write_Bool (Full_List); - Tree_Write_Int (Int (Gnat_Version_String'Length)); - Tree_Write_Data (Gnat_Version_String'Address, - Gnat_Version_String'Length); + Tree_Write_Int (Int (Version_String'Length)); + Tree_Write_Data (Version_String'Address, + Version_String'Length); Tree_Write_Data (Distribution_Stub_Mode'Address, Distribution_Stub_Mode_Type'Object_Size / Storage_Unit); Tree_Write_Bool (Immediate_Errors); diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 356ed026927..356564a12ab 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -719,6 +719,11 @@ package Opt is -- Set to True to enable output of generated code in source form. This -- flag is set by the -gnatG switch. + Print_Standard : Boolean := False; + -- GNAT + -- Set to true to enable printing of package standard in source form. + -- This flag is set by the -gnatS switch + Propagate_Exceptions : Boolean := False; -- GNAT -- Indicates if subprogram descriptor exception tables should be diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb index 88fcd3fd94e..1bd39c4ea66 100644 --- a/gcc/ada/osint.adb +++ b/gcc/ada/osint.adb @@ -24,12 +24,13 @@ -- -- ------------------------------------------------------------------------------ -with Fmap; use Fmap; +with Fmap; use Fmap; with Hostparm; -with Namet; use Namet; -with Opt; use Opt; -with Output; use Output; -with Sdefault; use Sdefault; +with Namet; use Namet; +with Opt; use Opt; +with Output; use Output; +with Sdefault; use Sdefault; +with System.Case_Util; use System.Case_Util; with Table; with Unchecked_Conversion; @@ -40,7 +41,19 @@ with GNAT.HTable; package body Osint is Running_Program : Program_Type := Unspecified; - Program_Set : Boolean := False; + -- comment required here ??? + + Program_Set : Boolean := False; + -- comment required here ??? + + Std_Prefix : String_Ptr; + -- Standard prefix, computed dynamically the first time Relocate_Path + -- is called, and cached for subsequent calls. + + Empty : aliased String := ""; + No_Dir : constant String_Ptr := Empty'Access; + -- Used in Locate_File as a fake directory when Name is already an + -- absolute path. ------------------------------------- -- Use of Name_Find and Name_Enter -- @@ -61,8 +74,7 @@ package body Osint is function Append_Suffix_To_File_Name (Name : Name_Id; - Suffix : String) - return Name_Id; + Suffix : String) return Name_Id; -- Appends Suffix to Name and returns the new name. function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type; @@ -71,11 +83,19 @@ package body Osint is function Concat (String_One : String; String_Two : String) return String; -- Concatenates 2 strings and returns the result of the concatenation + function Executable_Prefix return String_Ptr; + -- Returns the name of the root directory where the executable is stored. + -- The executable must be located in a directory called "bin", or + -- under root/lib/gcc-lib/..., or under root/libexec/gcc/... Thus, if + -- the executable is stored in directory "/foo/bar/bin", this routine + -- returns "/foo/bar/". Return "" if the location is not recognized + -- as described above. + function Update_Path (Path : String_Ptr) return String_Ptr; -- Update the specified path to replace the prefix with the location -- where GNAT is installed. See the file prefix.c in GCC for details. - procedure Write_With_Check (A : Address; N : Integer); + procedure Write_With_Check (A : Address; N : Integer); -- Writes N bytes from buffer starting at address A to file whose FD is -- stored in Output_FD, and whose file name is stored as a File_Name_Type -- in Output_File_Name. A check is made for disk full, and if this is @@ -86,8 +106,7 @@ package body Osint is (N : File_Name_Type; T : File_Type; Dir : Natural; - Name : String) - return File_Name_Type; + Name : String) return File_Name_Type; -- See if the file N whose name is Name exists in directory Dir. Dir is -- an index into the Lib_Search_Directories table if T = Library. -- Otherwise if T = Source, Dir is an index into the @@ -99,8 +118,7 @@ package body Osint is function To_Path_String_Access (Path_Addr : Address; - Path_Len : Integer) - return String_Access; + Path_Len : Integer) return String_Access; -- Converts a C String to an Ada String. Are we doing this to avoid -- withing Interfaces.C.Strings ??? @@ -205,17 +223,15 @@ package body Osint is Equal => "="); function Smart_Find_File - (N : File_Name_Type; - T : File_Type) - return File_Name_Type; + (N : File_Name_Type; + T : File_Type) return File_Name_Type; -- Exactly like Find_File except that if File_Cache_Enabled is True this -- routine looks first in the hash table to see if the full name of the -- file is already available. function Smart_File_Stamp - (N : File_Name_Type; - T : File_Type) - return Time_Stamp_Type; + (N : File_Name_Type; + T : File_Type) return Time_Stamp_Type; -- Takes the same parameter as the routine above (N is a file name -- without any prefix directory information) and behaves like File_Stamp -- except that if File_Cache_Enabled is True this routine looks first in @@ -578,8 +594,7 @@ package body Osint is function Append_Suffix_To_File_Name (Name : Name_Id; - Suffix : String) - return Name_Id + Suffix : String) return Name_Id is begin Get_Name_String (Name); @@ -735,6 +750,63 @@ package body Osint is return Name_Enter; end Executable_Name; + ------------------------- + -- Executable_Prefix -- + ------------------------- + + function Executable_Prefix return String_Ptr is + Exec_Name : String (1 .. Len_Arg (0)); + + function Get_Install_Dir (Exec : String) return String_Ptr; + -- S is the executable name preceeded by the absolute or relative + -- path, e.g. "c:\usr\bin\gcc.exe" or "..\bin\gcc". + + --------------------- + -- Get_Install_Dir -- + --------------------- + + function Get_Install_Dir (Exec : String) return String_Ptr is + begin + for J in reverse Exec'Range loop + if Is_Directory_Separator (Exec (J)) then + if J < Exec'Last - 5 then + if (To_Lower (Exec (J + 1)) = 'l' + and then To_Lower (Exec (J + 2)) = 'i' + and then To_Lower (Exec (J + 3)) = 'b') + or else + (To_Lower (Exec (J + 1)) = 'b' + and then To_Lower (Exec (J + 2)) = 'i' + and then To_Lower (Exec (J + 3)) = 'n') + then + return new String'(Exec (Exec'First .. J)); + end if; + end if; + end if; + end loop; + + return new String'(""); + end Get_Install_Dir; + + -- Start of processing for Executable_Prefix + + begin + Osint.Fill_Arg (Exec_Name'Address, 0); + + -- First determine if a path prefix was placed in front of the + -- executable name. + + for J in reverse Exec_Name'Range loop + if Is_Directory_Separator (Exec_Name (J)) then + return Get_Install_Dir (Exec_Name); + end if; + end loop; + + -- If we come here, the user has typed the executable name with no + -- directory prefix. + + return Get_Install_Dir (GNAT.OS_Lib.Locate_Exec_On_Path (Exec_Name).all); + end Executable_Prefix; + ------------------ -- Exit_Program -- ------------------ @@ -820,9 +892,8 @@ package body Osint is --------------- function Find_File - (N : File_Name_Type; - T : File_Type) - return File_Name_Type + (N : File_Name_Type; + T : File_Type) return File_Name_Type is begin Get_Name_String (N); @@ -1019,8 +1090,7 @@ package body Osint is -- call to Get_Next_Dir_In_Path_Init, updated by Get_Next_Dir_In_Path. function Get_Next_Dir_In_Path - (Search_Path : String_Access) - return String_Access + (Search_Path : String_Access) return String_Access is Lower_Bound : Positive := Search_Path_Pos; Upper_Bound : Positive; @@ -1073,8 +1143,7 @@ package body Osint is function Get_RTS_Search_Dir (Search_Dir : String; - File_Type : Search_File_Type) - return String_Ptr + File_Type : Search_File_Type) return String_Ptr is procedure Get_Current_Dir (Dir : System.Address; @@ -1229,6 +1298,28 @@ package body Osint is end if; end Get_RTS_Search_Dir; + -------------------------------- + -- Include_Dir_Default_Prefix -- + -------------------------------- + + function Include_Dir_Default_Prefix return String is + Include_Dir : String_Access := + String_Access (Update_Path (Include_Dir_Default_Name)); + + begin + if Include_Dir = null then + return ""; + + else + declare + Result : constant String := Include_Dir.all; + begin + Free (Include_Dir); + return Result; + end; + end if; + end Include_Dir_Default_Prefix; + ---------------- -- Initialize -- ---------------- @@ -1339,13 +1430,17 @@ package body Osint is (N : File_Name_Type; T : File_Type; Dir : Natural; - Name : String) - return File_Name_Type + Name : String) return File_Name_Type is Dir_Name : String_Ptr; begin - if T = Library then + -- If Name is already an absolute path, do not look for a directory + + if Is_Absolute_Path (Name) then + Dir_Name := No_Dir; + + elsif T = Library then Dir_Name := Lib_Search_Directories.Table (Dir); else pragma Assert (T /= Config); @@ -1381,9 +1476,8 @@ package body Osint is ------------------------------- function Matching_Full_Source_Name - (N : File_Name_Type; - T : Time_Stamp_Type) - return File_Name_Type + (N : File_Name_Type; + T : Time_Stamp_Type) return File_Name_Type is begin Get_Name_String (N); @@ -1610,6 +1704,28 @@ package body Osint is return Number_File_Names; end Number_Of_Files; + ------------------------------- + -- Object_Dir_Default_Prefix -- + ------------------------------- + + function Object_Dir_Default_Prefix return String is + Object_Dir : String_Access := + String_Access (Update_Path (Object_Dir_Default_Name)); + + begin + if Object_Dir = null then + return ""; + + else + declare + Result : constant String := Object_Dir.all; + begin + Free (Object_Dir); + return Result; + end; + end if; + end Object_Dir_Default_Prefix; + ---------------------- -- Object_File_Name -- ---------------------- @@ -1698,8 +1814,7 @@ package body Osint is function Read_Default_Search_Dirs (Search_Dir_Prefix : String_Access; Search_File : String_Access; - Search_Dir_Default_Name : String_Access) - return String_Access + Search_Dir_Default_Name : String_Access) return String_Access is Prefix_Len : constant Integer := Search_Dir_Prefix.all'Length; Buffer : String (1 .. Prefix_Len + Search_File.all'Length + 1); @@ -1818,8 +1933,7 @@ package body Osint is function Read_Library_Info (Lib_File : File_Name_Type; - Fatal_Err : Boolean := False) - return Text_Buffer_Ptr + Fatal_Err : Boolean := False) return Text_Buffer_Ptr is Lib_FD : File_Descriptor; -- The file descriptor for the current library file. A negative value @@ -2074,6 +2188,44 @@ package body Osint is end Read_Source_File; + ------------------- + -- Relocate_Path -- + ------------------- + + function Relocate_Path + (Prefix : String; + Path : String) return String_Ptr + is + S : String_Ptr; + + procedure set_std_prefix (S : String; Len : Integer); + pragma Import (C, set_std_prefix); + + begin + if Std_Prefix = null then + Std_Prefix := Executable_Prefix; + + if Std_Prefix.all /= "" then + -- Remove trailing directory separator when calling set_std_prefix + + set_std_prefix (Std_Prefix.all, Std_Prefix'Length - 1); + end if; + end if; + + if Path (Prefix'Range) = Prefix then + if Std_Prefix.all /= "" then + S := new String + (1 .. Std_Prefix'Length + Path'Last - Prefix'Last); + S (1 .. Std_Prefix'Length) := Std_Prefix.all; + S (Std_Prefix'Length + 1 .. S'Last) := + Path (Prefix'Last + 1 .. Path'Last); + return S; + end if; + end if; + + return new String'(Path); + end Relocate_Path; + ----------------- -- Set_Program -- ----------------- @@ -2093,9 +2245,8 @@ package body Osint is ---------------------- function Smart_File_Stamp - (N : File_Name_Type; - T : File_Type) - return Time_Stamp_Type + (N : File_Name_Type; + T : File_Type) return Time_Stamp_Type is Time_Stamp : Time_Stamp_Type; @@ -2120,8 +2271,7 @@ package body Osint is function Smart_Find_File (N : File_Name_Type; - T : File_Type) - return File_Name_Type + T : File_Type) return File_Name_Type is Full_File_Name : File_Name_Type; @@ -2212,13 +2362,11 @@ package body Osint is function To_Canonical_Dir_Spec (Host_Dir : String; - Prefix_Style : Boolean) - return String_Access + Prefix_Style : Boolean) return String_Access is function To_Canonical_Dir_Spec (Host_Dir : Address; - Prefix_Flag : Integer) - return Address; + Prefix_Flag : Integer) return Address; pragma Import (C, To_Canonical_Dir_Spec, "__gnat_to_canonical_dir_spec"); C_Host_Dir : String (1 .. Host_Dir'Length + 1); @@ -2254,13 +2402,11 @@ package body Osint is function To_Canonical_File_List (Wildcard_Host_File : String; - Only_Dirs : Boolean) - return String_Access_List_Access + Only_Dirs : Boolean) return String_Access_List_Access is function To_Canonical_File_List_Init (Host_File : Address; - Only_Dirs : Integer) - return Integer; + Only_Dirs : Integer) return Integer; pragma Import (C, To_Canonical_File_List_Init, "__gnat_to_canonical_file_list_init"); @@ -2313,8 +2459,7 @@ package body Osint is ---------------------------- function To_Canonical_File_Spec - (Host_File : String) - return String_Access + (Host_File : String) return String_Access is function To_Canonical_File_Spec (Host_File : Address) return Address; pragma Import @@ -2349,8 +2494,7 @@ package body Osint is ---------------------------- function To_Canonical_Path_Spec - (Host_Path : String) - return String_Access + (Host_Path : String) return String_Access is function To_Canonical_Path_Spec (Host_Path : Address) return Address; pragma Import @@ -2384,13 +2528,11 @@ package body Osint is function To_Host_Dir_Spec (Canonical_Dir : String; - Prefix_Style : Boolean) - return String_Access + Prefix_Style : Boolean) return String_Access is function To_Host_Dir_Spec (Canonical_Dir : Address; - Prefix_Flag : Integer) - return Address; + Prefix_Flag : Integer) return Address; pragma Import (C, To_Host_Dir_Spec, "__gnat_to_host_dir_spec"); C_Canonical_Dir : String (1 .. Canonical_Dir'Length + 1); @@ -2420,8 +2562,7 @@ package body Osint is ---------------------------- function To_Host_File_Spec - (Canonical_File : String) - return String_Access + (Canonical_File : String) return String_Access is function To_Host_File_Spec (Canonical_File : Address) return Address; pragma Import (C, To_Host_File_Spec, "__gnat_to_host_file_spec"); @@ -2451,8 +2592,7 @@ package body Osint is function To_Path_String_Access (Path_Addr : Address; - Path_Len : Integer) - return String_Access + Path_Len : Integer) return String_Access is subtype Path_String is String (1 .. Path_Len); type Path_String_Access is access Path_String; @@ -2493,7 +2633,7 @@ package body Osint is In_Length : constant Integer := Path'Length; In_String : String (1 .. In_Length + 1); - Component_Name : aliased String := "GNAT" & ASCII.NUL; + Component_Name : aliased String := "GCC" & ASCII.NUL; Result_Ptr : Address; Result_Length : Integer; Out_String : String_Ptr; diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads index ba586222675..18e261039dc 100644 --- a/gcc/ada/osint.ads +++ b/gcc/ada/osint.ads @@ -202,10 +202,29 @@ package Osint is return String_Access; -- Convert a canonical syntax file specification to host syntax. + function Relocate_Path + (Prefix : String; + Path : String) return String_Ptr; + -- Given an absolute path and a prefix, if Path starts with Prefix, + -- replace the Prefix substring with the root installation directory. + -- By default, try to compute the root installation directory by looking + -- at the executable name as it was typed on the command line and, if + -- needed, use the PATH environment variable. + -- If the above computation fails, return Path. + -- This function assumes that Prefix'First = Path'First + ------------------------- -- Search Dir Routines -- ------------------------- + function Include_Dir_Default_Prefix return String; + -- Return the directory of the run-time library sources, as modified + -- by update_path. + + function Object_Dir_Default_Prefix return String; + -- Return the directory of the run-time library ALI and object files, as + -- modified by update_path. + procedure Add_Default_Search_Dirs; -- This routine adds the default search dirs indicated by the -- environment variables and sdefault package. diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb index 78f80f45c6f..ea52af636bf 100644 --- a/gcc/ada/output.adb +++ b/gcc/ada/output.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2001, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -236,10 +236,12 @@ package body Output is procedure Write_Char (C : Character) is begin - if Next_Column < Buffer'Length then - Buffer (Natural (Next_Column)) := C; - Next_Column := Next_Column + 1; + if Next_Column = Buffer'Length then + Write_Eol; end if; + + Buffer (Natural (Next_Column)) := C; + Next_Column := Next_Column + 1; end Write_Char; --------------- diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 00cbd9b1569..8066aa77b96 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -300,9 +300,14 @@ package body Ch10 is Append_List (P_Context_Clause, Context_Items (Comp_Unit_Node)); else - Error_Msg_SC ("compilation unit expected"); - Cunit_Error_Flag := True; - Resync_Cunit; + if Operating_Mode = Check_Syntax and then Token = Tok_EOF then + Error_Msg_SC ("?file contains no compilation units"); + + else + Error_Msg_SC ("compilation unit expected"); + Cunit_Error_Flag := True; + Resync_Cunit; + end if; -- If we are at an end of file, then just quit, the above error -- message was complaint enough. @@ -777,7 +782,7 @@ package body Ch10 is -- Processing for WITH clause - -- First check for LIMITED WITH + -- Ada0Y (AI-50217): First check for LIMITED WITH if Token = Tok_Limited then Has_Limited := True; diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 2b9adaf73ae..2880fe43678 100644 --- a/gcc/ada/par-ch12.adb +++ b/gcc/ada/par-ch12.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -367,12 +367,12 @@ package body Ch12 is -- bother to check for it being exceeded. begin - Idents (1) := P_Defining_Identifier; + Idents (1) := P_Defining_Identifier (C_Comma_Colon); Num_Idents := 1; while Comma_Present loop Num_Idents := Num_Idents + 1; - Idents (Num_Idents) := P_Defining_Identifier; + Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon); end loop; T_Colon; @@ -873,7 +873,7 @@ package body Ch12 is begin Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr); Scan; -- past PACKAGE - Set_Defining_Identifier (Def_Node, P_Defining_Identifier); + Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is)); T_Is; T_New; Set_Name (Def_Node, P_Qualified_Simple_Name); diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb index cfcc3807fc0..7a7e4798a85 100644 --- a/gcc/ada/par-ch13.adb +++ b/gcc/ada/par-ch13.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -92,7 +92,7 @@ package body Ch13 is -- Note that the name in a representation clause is always a simple -- name, even in the attribute case, see AI-300 which made this so! - Identifier_Node := P_Identifier; + Identifier_Node := P_Identifier (C_Use); -- Check case of qualified name to give good error message diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index 7064c5df578..dd58e1f9cdc 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -47,7 +47,7 @@ package body Ch2 is -- Error recovery: can raise Error_Resync (cannot return Error) - function P_Identifier return Node_Id is + function P_Identifier (C : Id_Check := None) return Node_Id is Ident_Node : Node_Id; begin @@ -61,7 +61,7 @@ package body Ch2 is -- If we have a reserved identifier, manufacture an identifier with -- a corresponding name after posting an appropriate error message - elsif Is_Reserved_Identifier then + elsif Is_Reserved_Identifier (C) then Scan_Reserved_Identifier (Force_Msg => False); Ident_Node := Token_Node; Scan; -- past the node diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index df156b93c05..8236c5897d7 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -164,7 +164,7 @@ package body Ch3 is -- Error recovery: can raise Error_Resync - function P_Defining_Identifier return Node_Id is + function P_Defining_Identifier (C : Id_Check := None) return Node_Id is Ident_Node : Node_Id; begin @@ -179,7 +179,7 @@ package body Ch3 is -- If we have a reserved identifier, manufacture an identifier with -- a corresponding name after posting an appropriate error message - elsif Is_Reserved_Identifier then + elsif Is_Reserved_Identifier (C) then Scan_Reserved_Identifier (Force_Msg => True); -- Otherwise we have junk that cannot be interpreted as an identifier @@ -262,7 +262,7 @@ package body Ch3 is Type_Loc := Token_Ptr; Type_Start_Col := Start_Column; T_Type; - Ident_Node := P_Defining_Identifier; + Ident_Node := P_Defining_Identifier (C_Is); Discr_Sloc := Token_Ptr; if P_Unknown_Discriminant_Part_Opt then @@ -732,7 +732,7 @@ package body Ch3 is begin Decl_Node := New_Node (N_Subtype_Declaration, Token_Ptr); Scan; -- past SUBTYPE - Set_Defining_Identifier (Decl_Node, P_Defining_Identifier); + Set_Defining_Identifier (Decl_Node, P_Defining_Identifier (C_Is)); TF_Is; if Token = Tok_New then @@ -1090,7 +1090,7 @@ package body Ch3 is begin Ident_Sloc := Token_Ptr; Save_Scan_State (Scan_State); -- at first identifier - Idents (1) := P_Defining_Identifier; + Idents (1) := P_Defining_Identifier (C_Comma_Colon); -- If we have a colon after the identifier, then we can assume that -- this is in fact a valid identifier declaration and can steam ahead. @@ -1104,7 +1104,7 @@ package body Ch3 is while Comma_Present loop Num_Idents := Num_Idents + 1; - Idents (Num_Idents) := P_Defining_Identifier; + Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon); end loop; Save_Scan_State (Scan_State); -- at colon @@ -1685,7 +1685,7 @@ package body Ch3 is if Token = Tok_Char_Literal then return P_Defining_Character_Literal; else - return P_Defining_Identifier; + return P_Defining_Identifier (C_Comma_Right_Paren); end if; end P_Enumeration_Literal_Specification; @@ -2278,12 +2278,12 @@ package body Ch3 is Specification_Loop : loop Ident_Sloc := Token_Ptr; - Idents (1) := P_Defining_Identifier; + Idents (1) := P_Defining_Identifier (C_Comma_Colon); Num_Idents := 1; while Comma_Present loop Num_Idents := Num_Idents + 1; - Idents (Num_Idents) := P_Defining_Identifier; + Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon); end loop; T_Colon; @@ -2518,7 +2518,7 @@ package body Ch3 is Names_List := New_List; loop - Append (P_Identifier, Names_List); + Append (P_Identifier (C_Vertical_Bar_Arrow), Names_List); exit when Token /= Tok_Vertical_Bar; Scan; -- past | end loop; @@ -2747,12 +2747,12 @@ package body Ch3 is end if; Ident_Sloc := Token_Ptr; - Idents (1) := P_Defining_Identifier; + Idents (1) := P_Defining_Identifier (C_Comma_Colon); Num_Idents := 1; while Comma_Present loop Num_Idents := Num_Idents + 1; - Idents (Num_Idents) := P_Defining_Identifier; + Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon); end loop; T_Colon; diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 62c4e108c21..838738c9bd9 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -28,6 +28,8 @@ pragma Style_Checks (All_Checks); -- Turn off subprogram body ordering check. Subprograms are in order -- by RM section rather than alphabetical +with Hostparm; use Hostparm; + separate (Par) package body Ch4 is @@ -1116,6 +1118,7 @@ package body Ch4 is -- POSITIONAL_ARRAY_AGGREGATE ::= -- (EXPRESSION, EXPRESSION {, EXPRESSION}) -- | (EXPRESSION {, EXPRESSION}, others => EXPRESSION) + -- | (EXPRESSION {, EXPRESSION}, others => <>) -- NAMED_ARRAY_AGGREGATE ::= -- (ARRAY_COMPONENT_ASSOCIATION {, ARRAY_COMPONENT_ASSOCIATION}) @@ -1124,6 +1127,9 @@ package body Ch4 is -- Error recovery: can raise Error_Resync + -- Note: POSITIONAL_ARRAY_AGGREGATE rule has been extended to give support + -- to Ada0Y limited aggregates (AI-287) + function P_Aggregate_Or_Paren_Expr return Node_Id is Aggregate_Node : Node_Id; Expr_List : List_Id; @@ -1161,6 +1167,20 @@ package body Ch4 is end if; end if; + -- Ada0Y (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. + + if Extensions_Allowed and then Token = Tok_Box then + Error_Msg_SC ("(Ada 0Y) box notation only allowed with " + & "named notation"); + Scan; -- past BOX + Aggregate_Node := New_Node (N_Aggregate, Lparen_Sloc); + return Aggregate_Node; + end if; + Expr_Node := P_Expression_Or_Range_Attribute; -- Extension aggregate case @@ -1354,6 +1374,7 @@ package body Ch4 is -- RECORD_COMPONENT_ASSOCIATION ::= -- [COMPONENT_CHOICE_LIST =>] EXPRESSION + -- | COMPONENT_CHOICE_LIST => <> -- COMPONENT_CHOICE_LIST => -- component_SELECTOR_NAME {| component_SELECTOR_NAME} @@ -1361,6 +1382,7 @@ package body Ch4 is -- ARRAY_COMPONENT_ASSOCIATION ::= -- DISCRETE_CHOICE_LIST => EXPRESSION + -- | DISCRETE_CHOICE_LIST => <> -- Note: this routine only handles the named cases, including others. -- Cases where the component choice list is not present have already @@ -1368,6 +1390,10 @@ package body Ch4 is -- Error recovery: can raise Error_Resync + -- Note: RECORD_COMPONENT_ASSOCIATION and ARRAY_COMPONENT_ASSOCIATION + -- rules have been extended to give support to Ada0Y limited + -- aggregates (AI-287) + function P_Record_Or_Array_Component_Association return Node_Id is Assoc_Node : Node_Id; @@ -1376,7 +1402,32 @@ package body Ch4 is Set_Choices (Assoc_Node, P_Discrete_Choice_List); Set_Sloc (Assoc_Node, Token_Ptr); TF_Arrow; - Set_Expression (Assoc_Node, P_Expression); + + if Token = Tok_Box then + + -- Ada0Y (AI-287): The box notation is used to indicate the default + -- initialization of limited aggregate components + + if not Extensions_Allowed then + Error_Msg_SP + ("(Ada 0Y) limited aggregates are an Ada0X extension"); + + if OpenVMS then + Error_Msg_SP + ("\unit must be compiled with " & + "'/'E'X'T'E'N'S'I'O'N'S'_'A'L'L'O'W'E'D qualifier"); + else + Error_Msg_SP + ("\unit must be compiled with -gnatX switch"); + end if; + end if; + + Set_Box_Present (Assoc_Node); + Scan; -- Past box + else + Set_Expression (Assoc_Node, P_Expression); + end if; + return Assoc_Node; end P_Record_Or_Array_Component_Association; diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index e8c6f3d65d6..e45b0fafb59 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -1004,7 +1004,7 @@ package body Ch5 is begin Label_Node := New_Node (N_Label, Token_Ptr); Scan; -- past << - Set_Identifier (Label_Node, P_Identifier); + Set_Identifier (Label_Node, P_Identifier (C_Greater_Greater)); T_Greater_Greater; Append_Elmt (Label_Node, Label_List); return Label_Node; @@ -1621,7 +1621,7 @@ package body Ch5 is New_Node (N_Loop_Parameter_Specification, Token_Ptr); Save_Scan_State (Scan_State); - ID_Node := P_Defining_Identifier; + ID_Node := P_Defining_Identifier (C_In); Set_Defining_Identifier (Loop_Param_Specification_Node, ID_Node); if Token = Tok_Left_Paren then diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index e5dc9ffff68..cc0e8981740 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -593,6 +593,10 @@ package body Ch6 is -- True, a real dot has been scanned and we are positioned past it, -- if the result is False, the scan position is unchanged. + -------------- + -- Real_Dot -- + -------------- + function Real_Dot return Boolean is Scan_State : Saved_Scan_State; @@ -715,7 +719,7 @@ package body Ch6 is Set_Identifier_Casing (Current_Source_File, Determine_Token_Casing); end if; - Ident_Node := P_Identifier; + Ident_Node := P_Identifier (C_Dot); Merge_Identifier (Ident_Node, Tok_Return); -- Normal case (not child library unit name) @@ -746,7 +750,7 @@ package body Ch6 is Name_Node := New_Node (N_Selected_Component, Token_Ptr); Scan; -- past period Set_Prefix (Name_Node, Prefix_Node); - Ident_Node := P_Identifier; + Ident_Node := P_Identifier (C_Dot); Set_Selector_Name (Name_Node, Ident_Node); Prefix_Node := Name_Node; end loop; @@ -870,7 +874,7 @@ package body Ch6 is Ignore (Tok_Left_Paren); Ident_Sloc := Token_Ptr; - Idents (1) := P_Defining_Identifier; + Idents (1) := P_Defining_Identifier (C_Comma_Colon); Num_Idents := 1; Ident_Loop : loop @@ -924,7 +928,7 @@ package body Ch6 is T_Comma; Num_Idents := Num_Idents + 1; - Idents (Num_Idents) := P_Defining_Identifier; + Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon); end loop Ident_Loop; -- Fall through the loop on encountering a colon, or deciding diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb index e68c972d63f..6bfc409acce 100644 --- a/gcc/ada/par-ch9.adb +++ b/gcc/ada/par-ch9.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -90,7 +90,7 @@ package body Ch9 is if Token = Tok_Body then Scan; -- past BODY - Name_Node := P_Defining_Identifier; + Name_Node := P_Defining_Identifier (C_Is); Scope.Table (Scope.Last).Labl := Name_Node; if Token = Tok_Left_Paren then @@ -133,7 +133,7 @@ package body Ch9 is else Task_Node := New_Node (N_Single_Task_Declaration, Task_Sloc); - Name_Node := P_Defining_Identifier; + Name_Node := P_Defining_Identifier (C_Is); Set_Defining_Identifier (Task_Node, Name_Node); Scope.Table (Scope.Last).Labl := Name_Node; @@ -141,7 +141,6 @@ package body Ch9 is Error_Msg_SC ("discriminant part not allowed for single task"); Discard_Junk_List (P_Known_Discriminant_Part_Opt); end if; - end if; -- Parse optional task definition. Note that P_Task_Definition scans @@ -344,7 +343,7 @@ package body Ch9 is if Token = Tok_Body then Scan; -- past BODY - Name_Node := P_Defining_Identifier; + Name_Node := P_Defining_Identifier (C_Is); Scope.Table (Scope.Last).Labl := Name_Node; if Token = Tok_Left_Paren then @@ -381,7 +380,7 @@ package body Ch9 is Scan; -- past TYPE Protected_Node := New_Node (N_Protected_Type_Declaration, Protected_Sloc); - Name_Node := P_Defining_Identifier; + Name_Node := P_Defining_Identifier (C_Is); Set_Defining_Identifier (Protected_Node, Name_Node); Scope.Table (Scope.Last).Labl := Name_Node; Set_Discriminant_Specifications @@ -390,7 +389,7 @@ package body Ch9 is else Protected_Node := New_Node (N_Single_Protected_Declaration, Protected_Sloc); - Name_Node := P_Defining_Identifier; + Name_Node := P_Defining_Identifier (C_Is); Set_Defining_Identifier (Protected_Node, Name_Node); if Token = Tok_Left_Paren then @@ -631,7 +630,8 @@ package body Ch9 is Decl_Node := New_Node (N_Entry_Declaration, Token_Ptr); Scan; -- past ENTRY - Set_Defining_Identifier (Decl_Node, P_Defining_Identifier); + Set_Defining_Identifier + (Decl_Node, P_Defining_Identifier (C_Left_Paren_Semicolon)); -- If left paren, could be (Discrete_Subtype_Definition) or Formal_Part @@ -719,7 +719,7 @@ package body Ch9 is Scan; -- past ACCEPT Scope.Table (Scope.Last).Labl := Token_Node; - Set_Entry_Direct_Name (Accept_Node, P_Identifier); + Set_Entry_Direct_Name (Accept_Node, P_Identifier (C_Do)); -- Left paren could be (Entry_Index) or Formal_Part, determine which @@ -932,7 +932,7 @@ package body Ch9 is begin Iterator_Node := New_Node (N_Entry_Index_Specification, Token_Ptr); T_For; -- past FOR - Set_Defining_Identifier (Iterator_Node, P_Defining_Identifier); + Set_Defining_Identifier (Iterator_Node, P_Defining_Identifier (C_In)); T_In; Set_Discrete_Subtype_Definition (Iterator_Node, P_Discrete_Subtype_Definition); diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb index fb0f2684f6c..163fb0b13e8 100644 --- a/gcc/ada/par-load.adb +++ b/gcc/ada/par-load.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,6 +42,8 @@ with Sinput.L; use Sinput.L; with Stylesw; use Stylesw; with Validsw; use Validsw; +with GNAT.Spelling_Checker; use GNAT.Spelling_Checker; + separate (Par) procedure Load is @@ -188,26 +190,45 @@ begin or else Name_Buffer (1) = 'g') then - -- In the predefined file case, we know the user did not construct - -- their own package, but we got the wrong one. This means that the - -- name supplied by the user crunched to something we recognized, - -- but then the file did not contain the unit expected. Most likely - -- this is due to a misspelling, e.g. - - -- with Ada.Calender; - - -- This crunches to a-calend, which indeed contains the unit - -- Ada.Calendar, and we can diagnose the misspelling. This is - -- a simple heuristic, but it catches many common cases of - -- misspelling of predefined unit names without needing a full - -- list of them. - - Error_Msg_Name_1 := Expected_Unit (Cur_Unum); - Error_Msg ("% is not a predefined library unit!", Loc); - Error_Msg_Name_1 := Unit_Name (Cur_Unum); - Error_Msg ("possible misspelling of %!", Loc); + declare + Expect_Name : constant Name_Id := Expected_Unit (Cur_Unum); + Actual_Name : constant Name_Id := Unit_Name (Cur_Unum); + + begin + Error_Msg_Name_1 := Expect_Name; + Error_Msg ("% is not a predefined library unit!", Loc); + + -- In the predefined file case, we know the user did not + -- construct their own package, but we got the wrong one. + -- This means that the name supplied by the user crunched + -- to something we recognized, but then the file did not + -- contain the unit expected. Most likely this is due to + -- a misspelling, e.g. + + -- with Ada.Calender; + + -- This crunches to a-calend, which indeed contains the unit + -- Ada.Calendar, and we can diagnose the misspelling. This + -- is a simple heuristic, but it catches many common cases + -- of misspelling of predefined unit names without needing + -- a full list of them. + + -- Before actually issinying the message, we will check that the + -- unit name is indeed a plausible misspelling of the one we got. + + if Is_Bad_Spelling_Of + (Found => Get_Name_String (Expect_Name), + Expect => Get_Name_String (Actual_Name)) + then + Error_Msg_Name_1 := Actual_Name; + Error_Msg ("possible misspelling of %!", Loc); + end if; + end; - -- Non-predefined file name case + -- Non-predefined file name case. In this case we generate a message + -- and then we quit, because we are in big trouble, and if we try + -- to continue compilation, we get into some nasty situations + -- (for example in some subunit cases). else Error_Msg ("file { does not contain expected unit!", Loc); @@ -217,7 +238,10 @@ begin Error_Msg ("found unit $!", Loc); end if; - raise Unrecoverable_Error; + -- In both cases, remove the unit if it is the last unit (which it + -- normally (always?) will be) so that it is out of the way later. + + Remove_Unit (Cur_Unum); end if; -- If current unit is a body, load its corresponding spec diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 2f5482fd70a..19eefc42047 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -980,6 +980,7 @@ begin Pragma_Task_Info | Pragma_Task_Name | Pragma_Task_Storage | + Pragma_Thread_Body | Pragma_Time_Slice | Pragma_Title | Pragma_Unchecked_Union | diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb index d7e2e15e33a..d23269ea88d 100644 --- a/gcc/ada/par-util.adb +++ b/gcc/ada/par-util.adb @@ -24,6 +24,7 @@ -- -- ------------------------------------------------------------------------------ +with Csets; use Csets; with Uintp; use Uintp; with GNAT.Spelling_Checker; use GNAT.Spelling_Checker; @@ -419,7 +420,7 @@ package body Util is -- Is_Reserved_Identifier -- ---------------------------- - function Is_Reserved_Identifier return Boolean is + function Is_Reserved_Identifier (C : Id_Check := None) return Boolean is begin if not Is_Reserved_Keyword (Token) then return False; @@ -438,20 +439,88 @@ package body Util is -- keyword casing, then we return False, since it is pretty -- clearly intended to be a keyword. - if Ident_Casing /= Unknown - and then Key_Casing /= Unknown - and then Ident_Casing /= Key_Casing - and then Determine_Token_Casing = Key_Casing + if Ident_Casing = Unknown + or else Key_Casing = Unknown + or else Ident_Casing = Key_Casing + or else Determine_Token_Casing /= Key_Casing then - return False; + return True; - -- Otherwise assume that an identifier was intended + -- Here we have a keyword written clearly with keyword casing. + -- In default mode, we would not be willing to consider this as + -- a reserved identifier, but if C is set, we may still accept it - else - return True; + elsif C /= None then + declare + Scan_State : Saved_Scan_State; + OK_Next_Tok : Boolean; + + begin + Save_Scan_State (Scan_State); + Scan; + + if Token_Is_At_Start_Of_Line then + return False; + end if; + + case C is + when None => + raise Program_Error; + + when C_Comma_Right_Paren => + OK_Next_Tok := + Token = Tok_Comma or else Token = Tok_Right_Paren; + + when C_Comma_Colon => + OK_Next_Tok := + Token = Tok_Comma or else Token = Tok_Colon; + + when C_Do => + OK_Next_Tok := + Token = Tok_Do; + + when C_Dot => + OK_Next_Tok := + Token = Tok_Dot; + + when C_Greater_Greater => + OK_Next_Tok := + Token = Tok_Greater_Greater; + + when C_In => + OK_Next_Tok := + Token = Tok_In; + + when C_Is => + OK_Next_Tok := + Token = Tok_Is; + + when C_Left_Paren_Semicolon => + OK_Next_Tok := + Token = Tok_Left_Paren or else Token = Tok_Semicolon; + + when C_Use => + OK_Next_Tok := + Token = Tok_Use; + + when C_Vertical_Bar_Arrow => + OK_Next_Tok := + Token = Tok_Vertical_Bar or else Token = Tok_Arrow; + end case; + + Restore_Scan_State (Scan_State); + + if OK_Next_Tok then + return True; + end if; + end; end if; end; end if; + + -- If we fall through it is not a reserved identifier + + return False; end Is_Reserved_Identifier; ---------------------- diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index b5365332fb3..56629ef436f 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -26,7 +26,6 @@ with Atree; use Atree; with Casing; use Casing; -with Csets; use Csets; with Debug; use Debug; with Elists; use Elists; with Errout; use Errout; @@ -189,6 +188,73 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- that there is a missing body, but it seems more reasonable to let the -- later semantic checking discover this. + ---------------------------------------------------- + -- Handling of Reserved Words Used as Identifiers -- + ---------------------------------------------------- + + -- Note: throughout the parser, the terms reserved word and keyword + -- are used interchangably to refer to the same set of reserved + -- keywords (including until, protected, etc). + + -- If a reserved word is used in place of an identifier, the parser + -- where possible tries to recover gracefully. In particular, if the + -- keyword is clearly spelled using identifier casing, e.g. Until in + -- a source program using mixed case identifiers and lower case keywords, + -- then the keyword is treated as an identifier if it appears in a place + -- where an identifier is required. + + -- The situation is more complex if the keyword is spelled with normal + -- keyword casing. In this case, the parser is more reluctant to + -- consider it to be intended as an identifier, unless it has some + -- further confirmation. + + -- In the case of an identifier appearing in the identifier list of a + -- declaration, the appearence of a comma or colon right after the + -- keyword on the same line is taken as confirmation. For an enumeration + -- literal, a comma or right paren right after the identifier is also + -- treated as adequate confirmation. + + -- The following type is used in calls to Is_Reserved_Identifier and + -- also to P_Defining_Identifier and P_Identifier. The default for all + -- these functins is that reserved words in reserved word case are not + -- considered to be reserved identifiers. The Id_Check value indicates + -- tokens, which if they appear immediately after the identifier, are + -- taken as confirming that the use of an identifier was expected + + type Id_Check is + (None, + -- Default, no special token test + + C_Comma_Right_Paren, + -- Consider as identifier if followed by comma or right paren + + C_Comma_Colon, + -- Consider as identifier if followed by comma or colon + + C_Do, + -- Consider as identifier if followed by DO + + C_Dot, + -- Consider as identifier if followed by period + + C_Greater_Greater, + -- Consider as identifier if followed by >> + + C_In, + -- Consider as identifier if followed by IN + + C_Is, + -- Consider as identifier if followed by IS + + C_Left_Paren_Semicolon, + -- Consider as identifier if followed by left paren or semicolon + + C_Use, + -- Consider as identifier if followed by USE + + C_Vertical_Bar_Arrow); + -- Consider as identifier if followed by | or => + -------------------------------------------- -- Handling IS Used in Place of Semicolon -- -------------------------------------------- @@ -450,9 +516,12 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- List that is created. package Ch2 is - function P_Identifier return Node_Id; function P_Pragma return Node_Id; + function P_Identifier (C : Id_Check := None) return Node_Id; + -- Scans out an identifier. The parameter C determines the treatment + -- of reserved identifiers. See declaration of Id_Check for details. + function P_Pragmas_Opt return List_Id; -- This function scans for a sequence of pragmas in other than a -- declaration sequence or statement sequence context. All pragmas @@ -482,7 +551,6 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is function P_Basic_Declarative_Items return List_Id; function P_Constraint_Opt return Node_Id; function P_Declarative_Part return List_Id; - function P_Defining_Identifier return Node_Id; function P_Discrete_Choice_List return List_Id; function P_Discrete_Range return Node_Id; function P_Discrete_Subtype_Definition return Node_Id; @@ -503,6 +571,11 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- case where the source has a single declaration with multiple -- defining identifiers. + function P_Defining_Identifier (C : Id_Check := None) return Node_Id; + -- Scan out a defining identifier. The parameter C controls the + -- treatment of errors in case a reserved word is scanned. See the + -- declaration of this type for details. + function Init_Expr_Opt (P : Boolean := False) return Node_Id; -- If an initialization expression is present (:= expression), then -- it is scanned out and returned, otherwise Empty is returned if no @@ -908,10 +981,12 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- past it, otherwise the call has no effect at all. T may be any -- reserved word token, or comma, left or right paren, or semicolon. - function Is_Reserved_Identifier return Boolean; + function Is_Reserved_Identifier (C : Id_Check := None) return Boolean; -- Test if current token is a reserved identifier. This test is based -- on the token being a keyword and being spelled in typical identifier - -- style (i.e. starting with an upper case letter). + -- style (i.e. starting with an upper case letter). The parameter C + -- determines the special treatment if a reserved word is encountered + -- that has the normal casing of a reserved word. procedure Merge_Identifier (Prev : Node_Id; Nxt : Token_Type); -- Called when the previous token is an identifier (whose Token_Node diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index e3fb2c0ef38..8482fd2a2e3 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -69,6 +69,9 @@ package body Prj.Attr is "LVlibrary_options#" & "SVlibrary_src_dir#" & "SVlibrary_gcc#" & + "SVlibrary_symbol_file#" & + "SVlibrary_symbol_policy#" & + "SVlibrary_reference_symbol_file#" & "LVmain#" & "LVlanguages#" & "SVmain_language#" & diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb index 9865dff63c1..ac39eeda369 100644 --- a/gcc/ada/prj-dect.adb +++ b/gcc/ada/prj-dect.adb @@ -125,6 +125,7 @@ package body Prj.Dect is begin Attribute := Default_Project_Node (Of_Kind => N_Attribute_Declaration); Set_Location_Of (Attribute, To => Token_Ptr); + Set_Previous_Line_Node (Attribute); -- Scan past "for" @@ -467,6 +468,9 @@ package body Prj.Dect is if Current_Attribute = Empty_Attribute then Attribute := Empty_Node; end if; + + Set_End_Of_Line (Attribute); + Set_Previous_Line_Node (Attribute); end Parse_Attribute_Declaration; ----------------------------- @@ -535,6 +539,9 @@ package body Prj.Dect is Expect (Tok_Is, "IS"); if Token = Tok_Is then + Set_End_Of_Line (Case_Construction); + Set_Previous_Line_Node (Case_Construction); + Set_Next_End_Node (Case_Construction); -- Scan past "is" @@ -571,6 +578,8 @@ package body Prj.Dect is Scan; Expect (Tok_Arrow, "`=>`"); + Set_End_Of_Line (Current_Item); + Set_Previous_Line_Node (Current_Item); -- Empty_Node in Field1 of a Case_Item indicates -- the "when others =>" branch. @@ -596,6 +605,8 @@ package body Prj.Dect is Set_First_Choice_Of (Current_Item, To => First_Choice); Expect (Tok_Arrow, "`=>`"); + Set_End_Of_Line (Current_Item); + Set_Previous_Line_Node (Current_Item); Parse_Declarative_Items (Declarations => First_Declarative_Item, @@ -613,6 +624,7 @@ package body Prj.Dect is End_Case_Construction; Expect (Tok_End, "`END CASE`"); + Remove_Next_End_Node; if Token = Tok_End then @@ -629,6 +641,7 @@ package body Prj.Dect is Scan; Expect (Tok_Semicolon, "`;`"); + Set_Previous_End_Node (Case_Construction); end Parse_Case_Construction; @@ -673,6 +686,9 @@ package body Prj.Dect is Current_Project => Current_Project, Current_Package => Current_Package); + Set_End_Of_Line (Current_Declaration); + Set_Previous_Line_Node (Current_Declaration); + when Tok_For => Parse_Attribute_Declaration @@ -681,6 +697,9 @@ package body Prj.Dect is Current_Project => Current_Project, Current_Package => Current_Package); + Set_End_Of_Line (Current_Declaration); + Set_Previous_Line_Node (Current_Declaration); + when Tok_Package => -- Package declaration @@ -693,6 +712,8 @@ package body Prj.Dect is (Package_Declaration => Current_Declaration, Current_Project => Current_Project); + Set_Previous_End_Node (Current_Declaration); + when Tok_Type => -- Type String Declaration @@ -706,6 +727,9 @@ package body Prj.Dect is (String_Type => Current_Declaration, Current_Project => Current_Project); + Set_End_Of_Line (Current_Declaration); + Set_Previous_Line_Node (Current_Declaration); + when Tok_Case => -- Case construction @@ -716,6 +740,8 @@ package body Prj.Dect is Current_Project => Current_Project, Current_Package => Current_Package); + Set_Previous_End_Node (Current_Declaration); + when others => exit; @@ -928,8 +954,13 @@ package body Prj.Dect is end if; Expect (Tok_Semicolon, "`;`"); + Set_End_Of_Line (Package_Declaration); + Set_Previous_Line_Node (Package_Declaration); elsif Token = Tok_Is then + Set_End_Of_Line (Package_Declaration); + Set_Previous_Line_Node (Package_Declaration); + Set_Next_End_Node (Package_Declaration); Parse_Declarative_Items (Declarations => First_Declarative_Item, @@ -970,6 +1001,7 @@ package body Prj.Dect is end if; Expect (Tok_Semicolon, "`;`"); + Remove_Next_End_Node; else Error_Msg ("expected IS or RENAMES", Token_Ptr); diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 588352fc29f..5c3a07be0d9 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -203,10 +203,13 @@ package body Prj.Env is return Projects.Table (Project).Ada_Include_Path; end Ada_Include_Path; + ---------------------- + -- Ada_Include_Path -- + ---------------------- + function Ada_Include_Path (Project : Project_Id; - Recursive : Boolean) - return String + Recursive : Boolean) return String is begin if Recursive then @@ -224,8 +227,7 @@ package body Prj.Env is function Ada_Objects_Path (Project : Project_Id; - Including_Libraries : Boolean := True) - return String_Access + Including_Libraries : Boolean := True) return String_Access is procedure Add (Project : Project_Id); -- Add all the object directories of a project to the path only if @@ -1061,8 +1063,7 @@ package body Prj.Env is (Name : String; Project : Project_Id; Main_Project_Only : Boolean := True; - Full_Path : Boolean := False) - return String + Full_Path : Boolean := False) return String is The_Project : Project_Id := Project; Data : Project_Data := Projects.Table (Project); @@ -1547,8 +1548,7 @@ package body Prj.Env is function Path_Name_Of_Library_Unit_Body (Name : String; - Project : Project_Id) - return String + Project : Project_Id) return String is Data : constant Project_Data := Projects.Table (Project); Original_Name : String := Name; @@ -1733,8 +1733,7 @@ package body Prj.Env is function Project_Of (Name : String; - Main_Project : Project_Id) - return Project_Id + Main_Project : Project_Id) return Project_Id is Result : Project_Id := No_Project; @@ -1777,10 +1776,13 @@ package body Prj.Env is Unit := Units.Table (Current); -- Check for body + Current_Name := Unit.File_Names (Body_Part).Name; + -- Case of a body present if Current_Name /= No_Name then + -- If it has the name of the original name or the body name, -- we have found the project. @@ -1798,6 +1800,7 @@ package body Prj.Env is Current_Name := Unit.File_Names (Specification).Name; if Current_Name /= No_Name then + -- If name same as the original name, or the spec name, we have -- found the project. diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads index 7ea02870198..8730ccb52d2 100644 --- a/gcc/ada/prj-env.ads +++ b/gcc/ada/prj-env.ads @@ -66,8 +66,7 @@ package Prj.Env is function Ada_Include_Path (Project : Project_Id; - Recursive : Boolean) - return String; + Recursive : Boolean) return String; -- Get the ADA_INCLUDE_PATH of a Project file. If Recursive it True, -- get all the source directories of the imported and modified project -- files (recursively). If Recursive is False, just get the path for the @@ -76,8 +75,7 @@ package Prj.Env is function Ada_Objects_Path (Project : Project_Id; - Including_Libraries : Boolean := True) - return String_Access; + Including_Libraries : Boolean := True) return String_Access; -- Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute -- it and cache it. When Including_Libraries is False, do not include the -- object directories of the library projects, and do not cache the result. @@ -86,7 +84,7 @@ package Prj.Env is (Project : Project_Id; Including_Libraries : Boolean); -- Set the env vars for additional project path files, after - -- creating if necessary the path files. + -- creating the path files if necessary. procedure Delete_All_Path_Files; -- Delete all temporary path files that have been created by @@ -94,22 +92,23 @@ package Prj.Env is function Path_Name_Of_Library_Unit_Body (Name : String; - Project : Project_Id) - return String; - -- Returns the Path of a library unit. + Project : Project_Id) return String; + -- Returns the Path of a library unit function File_Name_Of_Library_Unit_Body (Name : String; Project : Project_Id; Main_Project_Only : Boolean := True; - Full_Path : Boolean := False) - return String; + Full_Path : Boolean := False) return String; -- Returns the file name of a library unit, in canonical case. Name may or -- may not have an extension (corresponding to the naming scheme of the -- project). If there is no body with this name, but there is a spec, the -- name of the spec is returned. + -- -- If Full_Path is False (the default), the simple file name is returned. + -- -- If Full_Path is True, the absolute path name is returned. + -- -- If neither a body nor a spec can be found, an empty string is returned. -- If Main_Project_Only is True, the unit must be an immediate source of -- Project. If it is False, it may be a source of one of its imported @@ -117,8 +116,7 @@ package Prj.Env is function Project_Of (Name : String; - Main_Project : Project_Id) - return Project_Id; + Main_Project : Project_Id) return Project_Id; -- Get the project of a source. The source file name may be truncated -- (".adb" or ".ads" may be missing). If the source is in a project being -- extended, return the ultimate extending project. If it is not a source diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 27662a3f89e..6089bea61ed 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -991,8 +991,8 @@ package body Prj.Nmsc is The_Unit_Data := Units.Table (The_Unit_Id); if Specs then - if The_Unit_Data.File_Names (Specification).Project /= - Project + if not Check_Project + (The_Unit_Data.File_Names (Specification).Project) then Error_Msg (Project, @@ -1001,8 +1001,8 @@ package body Prj.Nmsc is end if; else - if The_Unit_Data.File_Names (Com.Body_Part).Project /= - Project + if not Check_Project + (The_Unit_Data.File_Names (Com.Body_Part).Project) then Error_Msg (Project, @@ -1350,16 +1350,32 @@ package body Prj.Nmsc is (Snames.Name_Library_Src_Dir, Data.Decl.Attributes); - Auto_Init_Supported - : constant Boolean := - MLib.Tgt. - Standalone_Library_Auto_Init_Is_Supported; + Lib_Symbol_File : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Symbol_File, + Data.Decl.Attributes); + + Lib_Symbol_Policy : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Symbol_Policy, + Data.Decl.Attributes); + + Lib_Ref_Symbol_File : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Reference_Symbol_File, + Data.Decl.Attributes); + + Auto_Init_Supported : constant Boolean := + MLib.Tgt. + Standalone_Library_Auto_Init_Is_Supported; + + OK : Boolean := True; begin pragma Assert (Lib_Interfaces.Kind = List); - -- It is a library project file if attribute Library_Interface - -- is defined. + -- It is a stand-alone library project file if attribute + -- Library_Interface is defined. if not Lib_Interfaces.Default then declare @@ -1566,102 +1582,257 @@ package body Prj.Nmsc is Lib_Auto_Init.Location); end if; end if; + end; - if Lib_Src_Dir.Value /= Empty_String then - declare - Dir_Id : constant Name_Id := Lib_Src_Dir.Value; + -- If attribute Library_Src_Dir is defined and not the + -- empty string, check if the directory exist and is not + -- the object directory or one of the source directories. + -- This is the directory where copies of the interface + -- sources will be copied. Note that this directory may be + -- the library directory. - begin - Locate_Directory - (Dir_Id, Data.Display_Directory, - Data.Library_Src_Dir, - Data.Display_Library_Src_Dir); + if Lib_Src_Dir.Value /= Empty_String then + declare + Dir_Id : constant Name_Id := Lib_Src_Dir.Value; - -- Comment needed here ??? + begin + Locate_Directory + (Dir_Id, Data.Display_Directory, + Data.Library_Src_Dir, + Data.Display_Library_Src_Dir); - if Data.Library_Src_Dir = No_Name then + -- If directory does not exist, report an error - -- Get the absolute name of the library directory - -- that does not exist, to report an error. + if Data.Library_Src_Dir = No_Name then - declare - Dir_Name : constant String := - Get_Name_String (Dir_Id); - begin - if Is_Absolute_Path (Dir_Name) then - Err_Vars.Error_Msg_Name_1 := Dir_Id; + -- Get the absolute name of the library directory + -- that does not exist, to report an error. - else - Get_Name_String (Data.Directory); + declare + Dir_Name : constant String := + Get_Name_String (Dir_Id); - if Name_Buffer (Name_Len) /= - Directory_Separator - then - Name_Len := Name_Len + 1; - Name_Buffer (Name_Len) := - Directory_Separator; - end if; + begin + if Is_Absolute_Path (Dir_Name) then + Err_Vars.Error_Msg_Name_1 := Dir_Id; - Name_Buffer - (Name_Len + 1 .. - Name_Len + Dir_Name'Length) := - Dir_Name; - Name_Len := Name_Len + Dir_Name'Length; - Err_Vars.Error_Msg_Name_1 := Name_Find; - end if; + else + Get_Name_String (Data.Directory); - -- Report the error + if Name_Buffer (Name_Len) /= + Directory_Separator + then + Name_Len := Name_Len + 1; + Name_Buffer (Name_Len) := + Directory_Separator; + end if; - Error_Msg - (Project, - "Directory { does not exist", - Lib_Src_Dir.Location); - end; + Name_Buffer + (Name_Len + 1 .. + Name_Len + Dir_Name'Length) := + Dir_Name; + Name_Len := Name_Len + Dir_Name'Length; + Err_Vars.Error_Msg_Name_1 := Name_Find; + end if; - -- And comment needed here ??? + -- Report the error - elsif Data.Library_Src_Dir = Data.Object_Directory then Error_Msg (Project, - "directory to copy interfaces cannot be " & - "the object directory", + "Directory { does not exist", Lib_Src_Dir.Location); - Data.Library_Src_Dir := No_Name; + end; - -- And comment needed here ??? + -- Report an error if it is the same as the object + -- directory. - else - declare - Src_Dirs : String_List_Id := Data.Source_Dirs; - Src_Dir : String_Element; - begin - while Src_Dirs /= Nil_String loop - Src_Dir := String_Elements.Table (Src_Dirs); - Src_Dirs := Src_Dir.Next; - - if Data.Library_Src_Dir = Src_Dir.Value then - Error_Msg - (Project, - "directory to copy interfaces cannot " & - "be one of the source directories", - Lib_Src_Dir.Location); - Data.Library_Src_Dir := No_Name; - exit; - end if; - end loop; - end; + elsif Data.Library_Src_Dir = Data.Object_Directory then + Error_Msg + (Project, + "directory to copy interfaces cannot be " & + "the object directory", + Lib_Src_Dir.Location); + Data.Library_Src_Dir := No_Name; + + -- Check if it is the same as one of the source + -- directories. + + else + declare + Src_Dirs : String_List_Id := Data.Source_Dirs; + Src_Dir : String_Element; - if Data.Library_Src_Dir /= No_Name - and then Current_Verbosity = High + begin + while Src_Dirs /= Nil_String loop + Src_Dir := String_Elements.Table (Src_Dirs); + Src_Dirs := Src_Dir.Next; + + -- Report an error if it is one of the + -- source directories. + + if Data.Library_Src_Dir = Src_Dir.Value then + Error_Msg + (Project, + "directory to copy interfaces cannot " & + "be one of the source directories", + Lib_Src_Dir.Location); + Data.Library_Src_Dir := No_Name; + exit; + end if; + end loop; + end; + + if Data.Library_Src_Dir /= No_Name + and then Current_Verbosity = High + then + Write_Str ("Directory to copy interfaces ="""); + Write_Str (Get_Name_String (Data.Library_Dir)); + Write_Line (""""); + end if; + end if; + end; + end if; + + if not Lib_Symbol_File.Default then + Data.Symbol_Data.Symbol_File := Lib_Symbol_File.Value; + + Get_Name_String (Lib_Symbol_File.Value); + + if Name_Len = 0 then + Error_Msg + (Project, + "symbol file name cannot be an empty string", + Lib_Symbol_File.Location); + + else + OK := not Is_Absolute_Path (Name_Buffer (1 .. Name_Len)); + + if OK then + for J in 1 .. Name_Len loop + if Name_Buffer (J) = '/' + or else Name_Buffer (J) = Directory_Separator then - Write_Str ("Directory to copy interfaces ="""); - Write_Str (Get_Name_String (Data.Library_Dir)); - Write_Line (""""); + OK := False; + exit; end if; - end if; - end; + end loop; + end if; + + if not OK then + Error_Msg_Name_1 := Lib_Symbol_File.Value; + Error_Msg + (Project, + "symbol file name { is illegal. " & + "Name canot include directory info.", + Lib_Symbol_File.Location); + end if; end if; - end; + end if; + + if not Lib_Symbol_Policy.Default then + declare + Value : constant String := + To_Lower + (Get_Name_String (Lib_Symbol_Policy.Value)); + + begin + if Value = "autonomous" or else Value = "default" then + Data.Symbol_Data.Symbol_Policy := Autonomous; + + elsif Value = "compliant" then + Data.Symbol_Data.Symbol_Policy := Compliant; + + elsif Value = "controlled" then + Data.Symbol_Data.Symbol_Policy := Controlled; + + else + Error_Msg + (Project, + "illegal value for Library_Symbol_Policy", + Lib_Symbol_Policy.Location); + end if; + end; + end if; + + if Lib_Ref_Symbol_File.Default then + if Data.Symbol_Data.Symbol_Policy /= Autonomous then + Error_Msg + (Project, + "a reference symbol file need to be defined", + Lib_Symbol_Policy.Location); + end if; + + else + Data.Symbol_Data.Reference := Lib_Ref_Symbol_File.Value; + + Get_Name_String (Lib_Symbol_File.Value); + + if Name_Len = 0 then + Error_Msg + (Project, + "reference symbol file name cannot be an empty string", + Lib_Symbol_File.Location); + + else + OK := not Is_Absolute_Path (Name_Buffer (1 .. Name_Len)); + + if OK then + for J in 1 .. Name_Len loop + if Name_Buffer (J) = '/' + or else Name_Buffer (J) = Directory_Separator + then + OK := False; + exit; + end if; + end loop; + end if; + + if not OK then + Error_Msg_Name_1 := Lib_Ref_Symbol_File.Value; + Error_Msg + (Project, + "reference symbol file { name is illegal. " & + "Name canot include directory info.", + Lib_Ref_Symbol_File.Location); + end if; + + if not Is_Regular_File + (Get_Name_String (Data.Object_Directory) & + Directory_Separator & + Get_Name_String (Lib_Ref_Symbol_File.Value)) + then + Error_Msg_Name_1 := Lib_Ref_Symbol_File.Value; + Error_Msg + (Project, + "library reference symbol file { does not exist", + Lib_Ref_Symbol_File.Location); + end if; + + if Data.Symbol_Data.Symbol_File /= No_Name then + declare + Symbol : String := + Get_Name_String + (Data.Symbol_Data.Symbol_File); + + Reference : String := + Get_Name_String + (Data.Symbol_Data.Reference); + + begin + Canonical_Case_File_Name (Symbol); + Canonical_Case_File_Name (Reference); + + if Symbol = Reference then + Error_Msg + (Project, + "reference symbol file and symbol file " & + "cannot be the same file", + Lib_Ref_Symbol_File.Location); + end if; + end; + end if; + end if; + end if; end if; end Standalone_Library; end if; @@ -2973,11 +3144,28 @@ package body Prj.Nmsc is end if; if Lib_Dir.Default then - Error_Msg - (Project, - "a project extending a library project must specify " & - "an attribute Library_Dir", - Data.Location); + + -- If the extending project is a virtual project, we + -- put the error message in the library project that + -- is extended, rather than in the extending all project. + -- Of course, we cannot put it in the virtual extending + -- project, because it has no source. + + if Data.Virtual then + Error_Msg_Name_1 := Extended_Data.Name; + + Error_Msg + (Project, + "library project % cannot be virtually extended", + Extended_Data.Location); + + else + Error_Msg + (Project, + "a project extending a library project must " & + "specify an attribute Library_Dir", + Data.Location); + end if; end if; Projects.Table (Data.Extends).Library := False; @@ -3001,6 +3189,7 @@ package body Prj.Nmsc is Data.Library_Dir, Data.Display_Library_Dir); if Data.Library_Dir = No_Name then + -- Get the absolute name of the library directory that -- does not exist, to report an error. diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb index 28e4af9bd44..1aa4725e46c 100644 --- a/gcc/ada/prj-part.adb +++ b/gcc/ada/prj-part.adb @@ -35,6 +35,7 @@ with Prj.Err; use Prj.Err; with Scans; use Scans; with Sinput; use Sinput; with Sinput.P; use Sinput.P; +with Snames; with Table; with Types; use Types; @@ -44,6 +45,8 @@ with Ada.Exceptions; use Ada.Exceptions; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.OS_Lib; use GNAT.OS_Lib; +with System.HTable; use System.HTable; + pragma Elaborate_All (GNAT.OS_Lib); package body Prj.Part is @@ -62,6 +65,11 @@ package body Prj.Part is -- The path name(s) of directories where project files may reside. -- May be empty. + type Extension_Origin is (None, Extending_Simple, Extending_All); + -- Type of parameter From_Extended for procedures Parse_Single_Project and + -- Post_Parse_Context_Clause. Extending_All means that we are parsing the + -- tree rooted at an extending all project. + ------------------------------------ -- Local Packages and Subprograms -- ------------------------------------ @@ -73,6 +81,7 @@ package body Prj.Part is Path : Name_Id; Location : Source_Ptr; Limited_With : Boolean; + Node : Project_Node_Id; Next : With_Id; end record; -- Information about an imported project, to be put in table Withs below @@ -105,6 +114,42 @@ package body Prj.Part is -- limited imported projects when there is a circularity with at least -- one limited imported project file. + package Virtual_Hash is new Simple_HTable + (Header_Num => Header_Num, + Element => Project_Node_Id, + No_Element => Empty_Node, + Key => Project_Node_Id, + Hash => Prj.Tree.Hash, + Equal => "="); + -- Hash table to store the node id of the project for which a virtual + -- extending project need to be created. + + package Processed_Hash is new Simple_HTable + (Header_Num => Header_Num, + Element => Boolean, + No_Element => False, + Key => Project_Node_Id, + Hash => Prj.Tree.Hash, + Equal => "="); + -- Hash table to store the project process when looking for project that + -- need to have a virtual extending project, to avoid processing the same + -- project twice. + + procedure Create_Virtual_Extending_Project + (For_Project : Project_Node_Id; + Main_Project : Project_Node_Id); + -- Create a virtual extending project of For_Project. Main_Project is + -- the extending all project. + + procedure Look_For_Virtual_Projects_For + (Proj : Project_Node_Id; + Potentially_Virtual : Boolean); + -- Look for projects that need to have a virtual extending project. + -- This procedure is recursive. If called with Potentially_Virtual set to + -- True, then Proj may need an virtual extending project; otherwise it + -- does not (because it is already extended), but other projects that it + -- imports may need to be virtually extended. + procedure Pre_Parse_Context_Clause (Context_Clause : out With_Id); -- Parse the context clause of a project. -- Store the paths and locations of the imported projects in table Withs. @@ -115,7 +160,7 @@ package body Prj.Part is (Context_Clause : With_Id; Imported_Projects : out Project_Node_Id; Project_Directory : Name_Id; - From_Extended : Boolean); + From_Extended : Extension_Origin); -- Parse the imported projects that have been stored in table Withs, -- if any. From_Extended is used for the call to Parse_Single_Project -- below. @@ -124,10 +169,10 @@ package body Prj.Part is (Project : out Project_Node_Id; Path_Name : String; Extended : Boolean; - From_Extended : Boolean); + From_Extended : Extension_Origin); -- Parse a project file. -- Recursive procedure: it calls itself for imported and extended - -- projects. When From_Extended is True, if the project has already + -- projects. When From_Extended is not None, if the project has already -- been parsed and is an extended project A, return the ultimate -- (not extended) project that extends A. @@ -148,6 +193,132 @@ package body Prj.Part is -- Returns No_Name if the path name is invalid, because the corresponding -- project name does not have the syntax of an ada identifier. + -------------------------------------- + -- Create_Virtual_Extending_Project -- + -------------------------------------- + + procedure Create_Virtual_Extending_Project + (For_Project : Project_Node_Id; + Main_Project : Project_Node_Id) + is + + Virtual_Name : constant String := + Virtual_Prefix & + Get_Name_String (Name_Of (For_Project)); + -- The name of the virtual extending project + + Virtual_Name_Id : Name_Id; + -- Virtual extending project name id + + Virtual_Path_Id : Name_Id; + -- Fake path name of the virtual extending project. The directory is + -- the same directory as the extending all project. + + Virtual_Dir_Id : constant Name_Id := + Immediate_Directory_Of (Path_Name_Of (Main_Project)); + -- The directory of the extending all project + + -- The source of the virtual extending project is something like: + + -- project V$ extends is + + -- for Source_Dirs use (); + + -- end V$; + + -- The project directory cannot be specified during parsing; it will be + -- put directly in the virtual extending project data during processing. + + -- Nodes that made up the virtual extending project + + Virtual_Project : constant Project_Node_Id := + Default_Project_Node (N_Project); + With_Clause : constant Project_Node_Id := + Default_Project_Node (N_With_Clause); + Project_Declaration : constant Project_Node_Id := + Default_Project_Node (N_Project_Declaration); + Source_Dirs_Declaration : constant Project_Node_Id := + Default_Project_Node (N_Declarative_Item); + Source_Dirs_Attribute : constant Project_Node_Id := + Default_Project_Node + (N_Attribute_Declaration, List); + Source_Dirs_Expression : constant Project_Node_Id := + Default_Project_Node (N_Expression, List); + Source_Dirs_Term : constant Project_Node_Id := + Default_Project_Node (N_Term, List); + Source_Dirs_List : constant Project_Node_Id := + Default_Project_Node + (N_Literal_String_List, List); + + begin + -- Get the virtual name id + + Name_Len := Virtual_Name'Length; + Name_Buffer (1 .. Name_Len) := Virtual_Name; + Virtual_Name_Id := Name_Find; + + -- Get the virtual path name + + Get_Name_String (Path_Name_Of (Main_Project)); + + while Name_Len > 0 + and then Name_Buffer (Name_Len) /= Directory_Separator + and then Name_Buffer (Name_Len) /= '/' + loop + Name_Len := Name_Len - 1; + end loop; + + Name_Buffer (Name_Len + 1 .. Name_Len + Virtual_Name'Length) := + Virtual_Name; + Name_Len := Name_Len + Virtual_Name'Length; + Virtual_Path_Id := Name_Find; + + -- With clause + + Set_Name_Of (With_Clause, Virtual_Name_Id); + Set_Path_Name_Of (With_Clause, Virtual_Path_Id); + Set_Project_Node_Of (With_Clause, Virtual_Project); + Set_Next_With_Clause_Of + (With_Clause, First_With_Clause_Of (Main_Project)); + Set_First_With_Clause_Of (Main_Project, With_Clause); + + -- Virtual project node + + Set_Name_Of (Virtual_Project, Virtual_Name_Id); + Set_Path_Name_Of (Virtual_Project, Virtual_Path_Id); + Set_Location_Of (Virtual_Project, Location_Of (Main_Project)); + Set_Directory_Of (Virtual_Project, Virtual_Dir_Id); + Set_Project_Declaration_Of (Virtual_Project, Project_Declaration); + Set_Extended_Project_Path_Of + (Virtual_Project, Path_Name_Of (For_Project)); + + -- Project declaration + + Set_First_Declarative_Item_Of + (Project_Declaration, Source_Dirs_Declaration); + Set_Extended_Project_Of (Project_Declaration, For_Project); + + -- Source_Dirs declaration + + Set_Current_Item_Node (Source_Dirs_Declaration, Source_Dirs_Attribute); + + -- Source_Dirs attribute + + Set_Name_Of (Source_Dirs_Attribute, Snames.Name_Source_Dirs); + Set_Expression_Of (Source_Dirs_Attribute, Source_Dirs_Expression); + + -- Source_Dirs expression + + Set_First_Term (Source_Dirs_Expression, Source_Dirs_Term); + + -- Source_Dirs term + + Set_Current_Term (Source_Dirs_Term, Source_Dirs_List); + + -- Source_Dirs empty list: nothing to do + + end Create_Virtual_Extending_Project; + ---------------------------- -- Immediate_Directory_Of -- ---------------------------- @@ -181,6 +352,73 @@ package body Prj.Part is return Name_Find; end Immediate_Directory_Of; + ----------------------------------- + -- Look_For_Virtual_Projects_For -- + ----------------------------------- + + procedure Look_For_Virtual_Projects_For + (Proj : Project_Node_Id; + Potentially_Virtual : Boolean) + + is + Declaration : Project_Node_Id := Empty_Node; + -- Node for the project declaration of Proj + + With_Clause : Project_Node_Id := Empty_Node; + -- Node for a with clause of Proj + + Imported : Project_Node_Id := Empty_Node; + -- Node for a project imported by Proj + + Extended : Project_Node_Id := Empty_Node; + -- Node for the eventual project extended by Proj + + begin + -- Nothing to do if Proj is not defined or if it has already been + -- processed. + + if Proj /= Empty_Node and then not Processed_Hash.Get (Proj) then + -- Make sure the project will not be processed again + + Processed_Hash.Set (Proj, True); + + Declaration := Project_Declaration_Of (Proj); + + if Declaration /= Empty_Node then + Extended := Extended_Project_Of (Declaration); + end if; + + -- If this is a project that may need a virtual extending project + -- and it is not itself an extending project, put it in the list. + + if Potentially_Virtual and then Extended = Empty_Node then + Virtual_Hash.Set (Proj, Proj); + end if; + + -- Now check the projects it imports + + With_Clause := First_With_Clause_Of (Proj); + + while With_Clause /= Empty_Node loop + Imported := Project_Node_Of (With_Clause); + + if Imported /= Empty_Node then + Look_For_Virtual_Projects_For + (Imported, Potentially_Virtual => True); + end if; + + With_Clause := Next_With_Clause_Of (With_Clause); + end loop; + + -- Check also the eventual project extended by Proj. As this project + -- is already extended, call recursively with Potentially_Virtual + -- being False. + + Look_For_Virtual_Projects_For + (Extended, Potentially_Virtual => False); + end if; + end Look_For_Virtual_Projects_For; + ----------- -- Parse -- ----------- @@ -189,7 +427,8 @@ package body Prj.Part is (Project : out Project_Node_Id; Project_File_Name : String; Always_Errout_Finalize : Boolean; - Packages_To_Check : String_List_Access := All_Packages) + Packages_To_Check : String_List_Access := All_Packages; + Store_Comments : Boolean := False) is Current_Directory : constant String := Get_Current_Dir; @@ -214,6 +453,8 @@ package body Prj.Part is begin Prj.Err.Initialize; + Prj.Err.Scanner.Set_Comment_As_Token (Store_Comments); + Prj.Err.Scanner.Set_End_Of_Line_As_Token (Store_Comments); -- Parse the main project file @@ -228,7 +469,84 @@ package body Prj.Part is (Project => Project, Path_Name => Path_Name, Extended => False, - From_Extended => False); + From_Extended => None); + + -- If Project is an extending-all project, create the eventual + -- virtual extending projects and check that there are no illegally + -- imported projects. + + if Project /= Empty_Node and then Is_Extending_All (Project) then + -- First look for projects that potentially need a virtual + -- extending project. + + Virtual_Hash.Reset; + Processed_Hash.Reset; + + -- Mark the extending all project as processed, to avoid checking + -- the imported projects in case of a "limited with" on this + -- extending all project. + + Processed_Hash.Set (Project, True); + + declare + Declaration : constant Project_Node_Id := + Project_Declaration_Of (Project); + begin + Look_For_Virtual_Projects_For + (Extended_Project_Of (Declaration), + Potentially_Virtual => False); + end; + + -- Now, check the projects directly imported by the main project. + -- Remove from the potentially virtual any project extended by one + -- of these imported projects. For non extending imported + -- projects, check that they do not belong to the project tree of + -- the project being "extended-all" by the main project. + + declare + With_Clause : Project_Node_Id := + First_With_Clause_Of (Project); + Imported : Project_Node_Id := Empty_Node; + Declaration : Project_Node_Id := Empty_Node; + + begin + while With_Clause /= Empty_Node loop + Imported := Project_Node_Of (With_Clause); + + if Imported /= Empty_Node then + Declaration := Project_Declaration_Of (Imported); + + if Extended_Project_Of (Declaration) /= Empty_Node then + loop + Imported := Extended_Project_Of (Declaration); + exit when Imported = Empty_Node; + Virtual_Hash.Remove (Imported); + Declaration := Project_Declaration_Of (Imported); + end loop; + + elsif Virtual_Hash.Get (Imported) /= Empty_Node then + Error_Msg + ("this project cannot be imported directly", + Location_Of (With_Clause)); + end if; + + end if; + + With_Clause := Next_With_Clause_Of (With_Clause); + end loop; + end; + + -- Now create all the virtual extending projects + + declare + Proj : Project_Node_Id := Virtual_Hash.Get_First; + begin + while Proj /= Empty_Node loop + Create_Virtual_Extending_Project (Proj, Project); + Proj := Virtual_Hash.Get_Next; + end loop; + end; + end if; -- If there were any kind of error during the parsing, serious -- or not, then the parsing fails. @@ -264,6 +582,8 @@ package body Prj.Part is Current_With : With_Record; + Current_With_Node : Project_Node_Id := Empty_Node; + begin -- Assume no context clause @@ -274,6 +594,7 @@ package body Prj.Part is -- or we have exhausted the with clauses. while Token = Tok_With or else Token = Tok_Limited loop + Current_With_Node := Default_Project_Node (Of_Kind => N_With_Clause); Limited_With := Token = Tok_Limited; if Limited_With then @@ -298,6 +619,7 @@ package body Prj.Part is (Path => Token_Name, Location => Token_Ptr, Limited_With => Limited_With, + Node => Current_With_Node, Next => No_With); Withs.Increment_Last; @@ -315,6 +637,8 @@ package body Prj.Part is Scan; if Token = Tok_Semicolon then + Set_End_Of_Line (Current_With_Node); + Set_Previous_Line_Node (Current_With_Node); -- End of (possibly multiple) with clause; @@ -325,6 +649,9 @@ package body Prj.Part is Error_Msg ("expected comma or semi colon", Token_Ptr); exit Comma_Loop; end if; + + Current_With_Node := + Default_Project_Node (Of_Kind => N_With_Clause); end loop Comma_Loop; end loop With_Loop; end Pre_Parse_Context_Clause; @@ -338,7 +665,7 @@ package body Prj.Part is (Context_Clause : With_Id; Imported_Projects : out Project_Node_Id; Project_Directory : Name_Id; - From_Extended : Boolean) + From_Extended : Extension_Origin) is Current_With_Clause : With_Id := Context_Clause; @@ -400,13 +727,11 @@ package body Prj.Part is -- First with clause of the context clause - Current_Project := Default_Project_Node - (Of_Kind => N_With_Clause); + Current_Project := Current_With.Node; Imported_Projects := Current_Project; else - Next_Project := Default_Project_Node - (Of_Kind => N_With_Clause); + Next_Project := Current_With.Node; Set_Next_With_Clause_Of (Current_Project, Next_Project); Current_Project := Next_Project; end if; @@ -494,7 +819,7 @@ package body Prj.Part is (Project : out Project_Node_Id; Path_Name : String; Extended : Boolean; - From_Extended : Boolean) + From_Extended : Extension_Origin) is Normed_Path_Name : Name_Id; Canonical_Path_Name : Name_Id; @@ -515,6 +840,8 @@ package body Prj.Part is use Tree_Private_Part; + Project_Comment_State : Tree.Comment_State; + begin declare Normed : String := Normalize_Pathname (Path_Name); @@ -554,6 +881,8 @@ package body Prj.Part is end if; end loop; + -- Put the new path name on the stack + Project_Stack.Increment_Last; Project_Stack.Table (Project_Stack.Last).Name := Canonical_Path_Name; @@ -583,7 +912,7 @@ package body Prj.Part is -- in an extended project, replace A with the ultimate project -- extending A. - if From_Extended then + if From_Extended /= None then declare Decl : Project_Node_Id := Project_Declaration_Of @@ -619,6 +948,7 @@ package body Prj.Part is Save_Project_Scan_State (Project_Scan_State); Source_Index := Load_Project_File (Path_Name); + Tree.Save (Project_Comment_State); -- if we cannot find it, we stop @@ -629,6 +959,7 @@ package body Prj.Part is end if; Prj.Err.Scanner.Initialize_Scanner (Types.No_Unit, Source_Index); + Tree.Reset_State; Scan; if Name_From_Path = No_Name then @@ -648,6 +979,10 @@ package body Prj.Part is Write_Eol; end if; + -- Is there any imported project? + + Pre_Parse_Context_Clause (First_With); + Project_Directory := Immediate_Directory_Of (Normed_Path_Name); Project := Default_Project_Node (Of_Kind => N_Project); Project_Stack.Table (Project_Stack.Last).Id := Project; @@ -655,10 +990,6 @@ package body Prj.Part is Set_Path_Name_Of (Project, Normed_Path_Name); Set_Location_Of (Project, Token_Ptr); - -- Is there any imported project? - - Pre_Parse_Context_Clause (First_With); - Expect (Tok_Project, "PROJECT"); -- Mark location of PROJECT token if present @@ -745,13 +1076,26 @@ package body Prj.Part is declare Imported_Projects : Project_Node_Id := Empty_Node; + From_Ext : Extension_Origin := None; begin + -- Extending_All is always propagated + + if From_Extended = Extending_All then + From_Ext := Extending_All; + + -- Otherwise, From_Extended is set to Extending_Single if the + -- current project is an extending project. + + elsif Extended then + From_Ext := Extending_Simple; + end if; + Post_Parse_Context_Clause (Context_Clause => First_With, Imported_Projects => Imported_Projects, Project_Directory => Project_Directory, - From_Extended => Extended); + From_Extended => From_Ext); Set_First_With_Clause_Of (Project, Imported_Projects); end; @@ -797,6 +1141,12 @@ package body Prj.Part is -- We are extending another project Scan; -- scan past EXTENDS + + if Token = Tok_All then + Set_Is_Extending_All (Project); + Scan; -- scan past ALL + end if; + Expect (Tok_String_Literal, "literal string"); if Token = Tok_String_Literal then @@ -836,11 +1186,27 @@ package body Prj.Part is end if; else - Parse_Single_Project - (Project => Extended_Project, - Path_Name => Extended_Project_Path_Name, - Extended => True, - From_Extended => False); + declare + From_Extended : Extension_Origin := None; + + begin + if Is_Extending_All (Project) then + From_Extended := Extending_All; + end if; + + Parse_Single_Project + (Project => Extended_Project, + Path_Name => Extended_Project_Path_Name, + Extended => True, + From_Extended => From_Extended); + end; + + -- A project that extends an extending-all project is also + -- an extending-all project. + + if Is_Extending_All (Extended_Project) then + Set_Is_Extending_All (Project); + end if; end if; end; @@ -848,6 +1214,30 @@ package body Prj.Part is end if; end if; + -- Check that a non extending-all project does not import an + -- extending-all project. + + if not Is_Extending_All (Project) then + declare + With_Clause : Project_Node_Id := First_With_Clause_Of (Project); + Imported : Project_Node_Id := Empty_Node; + + begin + With_Clause_Loop : + while With_Clause /= Empty_Node loop + Imported := Project_Node_Of (With_Clause); + With_Clause := Next_With_Clause_Of (With_Clause); + + if Is_Extending_All (Imported) then + Error_Msg_Name_1 := Name_Of (Imported); + Error_Msg ("cannot import extending-all project {", + Token_Ptr); + exit With_Clause_Loop; + end if; + end loop With_Clause_Loop; + end; + end if; + -- Check that a project with a name including a dot either imports -- or extends the project whose name precedes the last dot. @@ -903,6 +1293,9 @@ package body Prj.Part is end if; Expect (Tok_Is, "IS"); + Set_End_Of_Line (Project); + Set_Previous_Line_Node (Project); + Set_Next_End_Node (Project); declare Project_Declaration : Project_Node_Id := Empty_Node; @@ -923,6 +1316,7 @@ package body Prj.Part is end; Expect (Tok_End, "END"); + Remove_Next_End_Node; -- Skip "end" if present @@ -980,6 +1374,7 @@ package body Prj.Part is -- source. if Token = Tok_Semicolon then + Set_Previous_End_Node (Project); Scan; if Token /= Tok_EOF then @@ -995,6 +1390,15 @@ package body Prj.Part is -- And remove the project from the project stack Project_Stack.Decrement_Last; + + -- Indicate if there are unkept comments + + Tree.Set_Project_File_Includes_Unkept_Comments + (Node => Project, To => Tree.There_Are_Unkept_Comments); + + -- And restore the comment state that was saved + + Tree.Restore (Project_Comment_State); end Parse_Single_Project; ----------------------- diff --git a/gcc/ada/prj-part.ads b/gcc/ada/prj-part.ads index a4d20faef1a..5b8f3921928 100644 --- a/gcc/ada/prj-part.ads +++ b/gcc/ada/prj-part.ads @@ -34,13 +34,15 @@ package Prj.Part is (Project : out Project_Node_Id; Project_File_Name : String; Always_Errout_Finalize : Boolean; - Packages_To_Check : String_List_Access := All_Packages); + Packages_To_Check : String_List_Access := All_Packages; + Store_Comments : Boolean := False); -- Parse project file and all its imported project files and create a tree. -- Return the node for the project (or Empty_Node if parsing failed). If -- Always_Errout_Finalize is True, Errout.Finalize is called in all cases, -- Otherwise, Errout.Finalize is only called if there are errors (but not -- if there are only warnings). Packages_To_Check indicates the packages -- where any unknown attribute produces an error. For other packages, an - -- unknown attribute produces a warning. + -- unknown attribute produces a warning. When Store_Comments is True, + -- comments are stored in the parse tree. end Prj.Part; diff --git a/gcc/ada/prj-pp.adb b/gcc/ada/prj-pp.adb index 8bbc265efc8..1ac45ed28e3 100644 --- a/gcc/ada/prj-pp.adb +++ b/gcc/ada/prj-pp.adb @@ -27,8 +27,8 @@ with Ada.Characters.Handling; use Ada.Characters.Handling; with Hostparm; -with Namet; use Namet; -with Output; use Output; +with Namet; use Namet; +with Output; use Output; with Snames; package body Prj.PP is @@ -47,7 +47,6 @@ package body Prj.PP is procedure Indicate_Tested (Kind : Project_Node_Kind); -- Set the corresponding component of array Not_Tested to False. -- Only called by pragmas Debug. - -- --------------------- -- Indicate_Tested -- @@ -98,9 +97,13 @@ package body Prj.PP is procedure Write_Line (S : String); -- Outputs S followed by a new line - procedure Write_String (S : String); + procedure Write_String (S : String; Truncated : Boolean := False); -- Outputs S using Write_Str, starting a new line if line would - -- become too long. + -- become too long, when Truncated = False. + -- When Truncated = True, only the part of the string that can fit on + -- the line is output. + + procedure Write_End_Of_Line_Comment (Node : Project_Node_Id); Write_Char : Write_Char_Ap := Output.Write_Char'Access; Write_Eol : Write_Eol_Ap := Output.Write_Eol'Access; @@ -246,6 +249,21 @@ package body Prj.PP is end if; end Write_Empty_Line; + ------------------------------- + -- Write_End_Of_Line_Comment -- + ------------------------------- + + procedure Write_End_Of_Line_Comment (Node : Project_Node_Id) is + Value : Name_Id := End_Of_Line_Comment (Node); + begin + if Value /= No_Name then + Write_String (" --"); + Write_String (Get_Name_String (Value), Truncated => True); + end if; + + Write_Line (""); + end Write_End_Of_Line_Comment; + ---------------- -- Write_Line -- ---------------- @@ -262,18 +280,24 @@ package body Prj.PP is -- Write_String -- ------------------ - procedure Write_String (S : String) is + procedure Write_String (S : String; Truncated : Boolean := False) is + Length : Natural := S'Length; begin -- If the string would not fit on the line, -- start a new line. - if Column + S'Length > Max_Line_Length then - Write_Eol.all; - Column := 0; + if Column + Length > Max_Line_Length then + if Truncated then + Length := Max_Line_Length - Column; + + else + Write_Eol.all; + Column := 0; + end if; end if; - Write_Str (S); - Column := Column + S'Length; + Write_Str (S (S'First .. S'First + Length - 1)); + Column := Column + Length; end Write_String; ----------- @@ -296,6 +320,7 @@ package body Prj.PP is Write_Empty_Line (Always => True); end if; + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("project "); Output_Name (Name_Of (Node)); @@ -307,21 +332,26 @@ package body Prj.PP is Output_String (Extended_Project_Path_Of (Node)); end if; - Write_Line (" is"); + Write_String (" is"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent + Increment); Write_Empty_Line (Always => True); -- Output all of the declarations in the project Print (Project_Declaration_Of (Node), Indent); + Print (First_Comment_Before_End (Node), Indent + Increment); Start_Line (Indent); Write_String ("end "); Output_Name (Name_Of (Node)); Write_Line (";"); + Print (First_Comment_After_End (Node), Indent); when N_With_Clause => pragma Debug (Indicate_Tested (N_With_Clause)); if Name_Of (Node) /= No_Name then + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); if Non_Limited_Project_Node_Of (Node) = Empty_Node then @@ -330,7 +360,9 @@ package body Prj.PP is Write_String ("with "); Output_String (String_Value_Of (Node)); - Write_Line (";"); + Write_String (";"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent); end if; Print (Next_With_Clause_Of (Node), Indent); @@ -352,6 +384,7 @@ package body Prj.PP is when N_Package_Declaration => pragma Debug (Indicate_Tested (N_Package_Declaration)); Write_Empty_Line (Always => True); + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("package "); Output_Name (Name_Of (Node)); @@ -362,10 +395,14 @@ package body Prj.PP is (Name_Of (Project_Of_Renamed_Package_Of (Node))); Write_String ("."); Output_Name (Name_Of (Node)); - Write_Line (";"); + Write_String (";"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After_End (Node), Indent); else - Write_Line (" is"); + Write_String (" is"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent + Increment); if First_Declarative_Item_Of (Node) /= Empty_Node then Print @@ -373,15 +410,19 @@ package body Prj.PP is Indent + Increment); end if; + Print (First_Comment_Before_End (Node), + Indent + Increment); Start_Line (Indent); Write_String ("end "); Output_Name (Name_Of (Node)); Write_Line (";"); + Print (First_Comment_After_End (Node), Indent); Write_Empty_Line; end if; when N_String_Type_Declaration => pragma Debug (Indicate_Tested (N_String_Type_Declaration)); + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("type "); Output_Name (Name_Of (Node)); @@ -404,7 +445,9 @@ package body Prj.PP is end loop; end; - Write_Line (");"); + Write_String (");"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent); when N_Literal_String => pragma Debug (Indicate_Tested (N_Literal_String)); @@ -412,6 +455,7 @@ package body Prj.PP is when N_Attribute_Declaration => pragma Debug (Indicate_Tested (N_Attribute_Declaration)); + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("for "); Output_Attribute_Name (Name_Of (Node)); @@ -424,26 +468,34 @@ package body Prj.PP is Write_String (" use "); Print (Expression_Of (Node), Indent); - Write_Line (";"); + Write_String (";"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent); when N_Typed_Variable_Declaration => pragma Debug (Indicate_Tested (N_Typed_Variable_Declaration)); + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Output_Name (Name_Of (Node)); Write_String (" : "); Output_Name (Name_Of (String_Type_Of (Node))); Write_String (" := "); Print (Expression_Of (Node), Indent); - Write_Line (";"); + Write_String (";"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent); when N_Variable_Declaration => pragma Debug (Indicate_Tested (N_Variable_Declaration)); + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Output_Name (Name_Of (Node)); Write_String (" := "); Print (Expression_Of (Node), Indent); - Write_Line (";"); + Write_String (";"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent); when N_Expression => pragma Debug (Indicate_Tested (N_Expression)); @@ -566,10 +618,13 @@ package body Prj.PP is if Is_Non_Empty then Write_Empty_Line; + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("case "); Print (Case_Variable_Reference_Of (Node), Indent); - Write_Line (" is"); + Write_String (" is"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent + Increment); declare Case_Item : Project_Node_Id := @@ -584,8 +639,11 @@ package body Prj.PP is end loop; end; + Print (First_Comment_Before_End (Node), + Indent + Increment); Start_Line (Indent); Write_Line ("end case;"); + Print (First_Comment_After_End (Node), Indent); end if; end; @@ -596,6 +654,7 @@ package body Prj.PP is or else not Eliminate_Empty_Case_Constructions then Write_Empty_Line; + Print (First_Comment_Before (Node), Indent); Start_Line (Indent); Write_String ("when "); @@ -618,7 +677,9 @@ package body Prj.PP is end; end if; - Write_Line (" =>"); + Write_String (" =>"); + Write_End_Of_Line_Comment (Node); + Print (First_Comment_After (Node), Indent + Increment); declare First : constant Project_Node_Id := @@ -626,13 +687,39 @@ package body Prj.PP is begin if First = Empty_Node then - Write_Eol.all; + Write_Empty_Line; else Print (First, Indent + Increment); end if; end; end if; + + when N_Comment_Zones => + + -- Nothing to do, because it will not be processed directly + + null; + + when N_Comment => + pragma Debug (Indicate_Tested (N_Comment)); + + if Follows_Empty_Line (Node) then + Write_Empty_Line; + end if; + + Start_Line (Indent); + Write_String ("--"); + Write_String + (Get_Name_String (String_Value_Of (Node)), + Truncated => True); + Write_Line (""); + + if Is_Followed_By_Empty_Line (Node) then + Write_Empty_Line; + end if; + + Print (Next_Comment (Node), Indent); end case; end if; end Print; @@ -674,7 +761,7 @@ package body Prj.PP is Output.Write_Line ("Project_Node_Kinds not tested:"); for Kind in Project_Node_Kind loop - if Not_Tested (Kind) then + if Kind /= N_Comment_Zones and then Not_Tested (Kind) then Output.Write_Str (" "); Output.Write_Line (Project_Node_Kind'Image (Kind)); end if; diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index fc0d816d9af..e75057a883d 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -56,8 +56,9 @@ package body Prj.Proc is -- arguments are not null string. procedure Add_Attributes - (Decl : in out Declarations; - First : Attribute_Node_Id); + (Project : Project_Id; + Decl : in out Declarations; + First : Attribute_Node_Id); -- Add all attributes, starting with First, with their default -- values to the package or project with declarations Decl. @@ -66,21 +67,18 @@ package body Prj.Proc is From_Project_Node : Project_Node_Id; Pkg : Package_Id; First_Term : Project_Node_Id; - Kind : Variable_Kind) - return Variable_Value; + Kind : Variable_Kind) return Variable_Value; -- From N_Expression project node From_Project_Node, compute the value -- of an expression and return it as a Variable_Value. function Imported_Or_Extended_Project_From (Project : Project_Id; - With_Name : Name_Id) - return Project_Id; + With_Name : Name_Id) return Project_Id; -- Find an imported or extended project of Project whose name is With_Name function Package_From (Project : Project_Id; - With_Name : Name_Id) - return Package_Id; + With_Name : Name_Id) return Package_Id; -- Find the package of Project whose name is With_Name procedure Process_Declarative_Items @@ -143,8 +141,9 @@ package body Prj.Proc is -------------------- procedure Add_Attributes - (Decl : in out Declarations; - First : Attribute_Node_Id) + (Project : Project_Id; + Decl : in out Declarations; + First : Attribute_Node_Id) is The_Attribute : Attribute_Node_Id := First; Attribute_Data : Attribute_Record; @@ -171,7 +170,8 @@ package body Prj.Proc is when Single => New_Attribute := - (Kind => Single, + (Project => Project, + Kind => Single, Location => No_Location, Default => True, Value => Empty_String); @@ -180,7 +180,8 @@ package body Prj.Proc is when List => New_Attribute := - (Kind => List, + (Project => Project, + Kind => List, Location => No_Location, Default => True, Values => Nil_String); @@ -225,8 +226,7 @@ package body Prj.Proc is From_Project_Node : Project_Node_Id; Pkg : Package_Id; First_Term : Project_Node_Id; - Kind : Variable_Kind) - return Variable_Value + Kind : Variable_Kind) return Variable_Value is The_Term : Project_Node_Id := First_Term; -- The term in the expression list @@ -241,6 +241,7 @@ package body Prj.Proc is -- Reference to the last string elements in Result, when Kind is List. begin + Result.Project := Project; Result.Location := Location_Of (First_Term); -- Process each term of the expression, starting with First_Term @@ -536,14 +537,16 @@ package body Prj.Proc is Expression_Kind_Of (The_Current_Term) = List then The_Variable := - (Kind => List, + (Project => Project, + Kind => List, Location => No_Location, Default => True, Values => Nil_String); else The_Variable := - (Kind => Single, + (Project => Project, + Kind => Single, Location => No_Location, Default => True, Value => Empty_String); @@ -739,8 +742,7 @@ package body Prj.Proc is function Imported_Or_Extended_Project_From (Project : Project_Id; - With_Name : Name_Id) - return Project_Id + With_Name : Name_Id) return Project_Id is Data : constant Project_Data := Projects.Table (Project); List : Project_List := Data.Imported_Projects; @@ -779,8 +781,7 @@ package body Prj.Proc is function Package_From (Project : Project_Id; - With_Name : Name_Id) - return Package_Id + With_Name : Name_Id) return Package_Id is Data : constant Project_Data := Projects.Table (Project); Result : Package_Id := Data.Decl.Packages; @@ -840,6 +841,25 @@ package body Prj.Proc is Check (Project); end if; + -- If main project is an extending all project, set the object + -- directory of all virtual extending projects to the object directory + -- of the main project. + + if Project /= No_Project + and then Is_Extending_All (From_Project_Node) + then + declare + Object_Dir : constant Name_Id := + Projects.Table (Project).Object_Directory; + begin + for Index in Projects.First .. Projects.Last loop + if Projects.Table (Index).Virtual then + Projects.Table (Index).Object_Directory := Object_Dir; + end if; + end loop; + end; + end if; + -- Check that no extended project shares its object directory with -- another project. @@ -855,20 +875,39 @@ package body Prj.Proc is and then Projects.Table (Prj).Sources_Present and then Projects.Table (Prj).Object_Directory = Obj_Dir then - Error_Msg_Name_1 := Projects.Table (Extending).Name; - Error_Msg_Name_2 := Projects.Table (Extended).Name; + if Projects.Table (Extending).Virtual then + Error_Msg_Name_1 := Projects.Table (Extended).Name; - if Error_Report = null then - Error_Msg ("project % cannot extend project %", - Projects.Table (Extending).Location); + if Error_Report = null then + Error_Msg + ("project % cannot be extended by " & + "a virtual project", + Projects.Table (Extending).Location); + + else + Error_Report + ("project """ & + Get_Name_String (Error_Msg_Name_1) & + """ cannot be extended by a virtual project", + Project); + end if; else - Error_Report - ("project """ & - Get_Name_String (Error_Msg_Name_1) & - """ cannot extend project """ & - Get_Name_String (Error_Msg_Name_2) & '"', - Project); + Error_Msg_Name_1 := Projects.Table (Extending).Name; + Error_Msg_Name_2 := Projects.Table (Extended).Name; + + if Error_Report = null then + Error_Msg ("project % cannot extend project %", + Projects.Table (Extending).Location); + + else + Error_Report + ("project """ & + Get_Name_String (Error_Msg_Name_1) & + """ cannot extend project """ & + Get_Name_String (Error_Msg_Name_2) & '"', + Project); + end if; end if; Error_Msg_Name_1 := Projects.Table (Extended).Name; @@ -997,7 +1036,8 @@ package body Prj.Proc is -- Set the default values of the attributes Add_Attributes - (Packages.Table (New_Pkg).Decl, + (Project, + Packages.Table (New_Pkg).Decl, Package_Attributes.Table (Package_Id_Of (Current_Item)).First_Attribute); @@ -1222,6 +1262,8 @@ package body Prj.Proc is Array_Elements.Table (New_Element) := Array_Elements.Table (Orig_Element); + Array_Elements.Table (New_Element).Value.Project := + Project; -- Adjust the Next link @@ -1789,6 +1831,18 @@ package body Prj.Proc is Processed_Data.Name := Name; + Get_Name_String (Name); + + -- If name starts with the virtual prefix, flag the project as + -- being a virtual extending project. + + if Name_Len > Virtual_Prefix'Length + and then Name_Buffer (1 .. Virtual_Prefix'Length) = + Virtual_Prefix + then + Processed_Data.Virtual := True; + end if; + Processed_Data.Display_Path_Name := Path_Name_Of (From_Project_Node); Get_Name_String (Processed_Data.Display_Path_Name); @@ -1806,7 +1860,7 @@ package body Prj.Proc is Processed_Data.Extended_By := Extended_By; Processed_Data.Naming := Standard_Naming_Data; - Add_Attributes (Processed_Data.Decl, Attribute_First); + Add_Attributes (Project, Processed_Data.Decl, Attribute_First); With_Clause := First_With_Clause_Of (From_Project_Node); while With_Clause /= Empty_Node loop diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb index 6587d35300b..7e548e8ce2e 100644 --- a/gcc/ada/prj-tree.adb +++ b/gcc/ada/prj-tree.adb @@ -24,17 +24,193 @@ -- -- ------------------------------------------------------------------------------ +with Prj.Err; + package body Prj.Tree is + Node_With_Comments : constant array (Project_Node_Kind) of Boolean := + (N_Project => True, + N_With_Clause => True, + N_Project_Declaration => False, + N_Declarative_Item => False, + N_Package_Declaration => True, + N_String_Type_Declaration => True, + N_Literal_String => False, + N_Attribute_Declaration => True, + N_Typed_Variable_Declaration => True, + N_Variable_Declaration => True, + N_Expression => False, + N_Term => False, + N_Literal_String_List => False, + N_Variable_Reference => False, + N_External_Value => False, + N_Attribute_Reference => False, + N_Case_Construction => True, + N_Case_Item => True, + N_Comment_Zones => True, + N_Comment => True); + -- Indicates the kinds of node that may have associated comments + + package Next_End_Nodes is new Table.Table + (Table_Component_Type => Project_Node_Id, + Table_Index_Type => Natural, + Table_Low_Bound => 1, + Table_Initial => 10, + Table_Increment => 100, + Table_Name => "Next_End_Nodes"); + -- A stack of nodes to indicates to what node the next "end" is associated + use Tree_Private_Part; + End_Of_Line_Node : Project_Node_Id := Empty_Node; + -- The node an end of line comment may be associated with + + Previous_Line_Node : Project_Node_Id := Empty_Node; + -- The node an immediately following comment may be associated with + + Previous_End_Node : Project_Node_Id := Empty_Node; + -- The node comments immediately following an "end" line may be + -- associated with. + + Unkept_Comments : Boolean := False; + -- Set to True when some comments may not be associated with any node + + function Comment_Zones_Of + (Node : Project_Node_Id) return Project_Node_Id; + -- Returns the ID of the N_Comment_Zones node associated with node Node. + -- If there is not already an N_Comment_Zones node, create one and + -- associate it with node Node. + + ------------------ + -- Add_Comments -- + ------------------ + + procedure Add_Comments (To : Project_Node_Id; Where : Comment_Location) is + Zone : Project_Node_Id := Empty_Node; + Previous : Project_Node_Id := Empty_Node; + + begin + pragma Assert + (To /= Empty_Node + and then + Project_Nodes.Table (To).Kind /= N_Comment); + + Zone := Project_Nodes.Table (To).Comments; + + if Zone = Empty_Node then + + -- Create new N_Comment_Zones node + + Project_Nodes.Increment_Last; + Project_Nodes.Table (Project_Nodes.Last) := + (Kind => N_Comment_Zones, + Expr_Kind => Undefined, + Location => No_Location, + Directory => No_Name, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => No_Name, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Flag1 => False, + Flag2 => False, + Comments => Empty_Node); + + Zone := Project_Nodes.Last; + Project_Nodes.Table (To).Comments := Zone; + end if; + + if Where = End_Of_Line then + Project_Nodes.Table (Zone).Value := Comments.Table (1).Value; + + else + -- Get each comments in the Comments table and link them to node To + + for J in 1 .. Comments.Last loop + + -- Create new N_Comment node + + if (Where = After or else Where = After_End) and then + Token /= Tok_EOF and then + Comments.Table (J).Follows_Empty_Line + then + Comments.Table (1 .. Comments.Last - J + 1) := + Comments.Table (J .. Comments.Last); + Comments.Set_Last (Comments.Last - J + 1); + return; + end if; + + Project_Nodes.Increment_Last; + Project_Nodes.Table (Project_Nodes.Last) := + (Kind => N_Comment, + Expr_Kind => Undefined, + Flag1 => Comments.Table (J).Follows_Empty_Line, + Flag2 => + Comments.Table (J).Is_Followed_By_Empty_Line, + Location => No_Location, + Directory => No_Name, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => Comments.Table (J).Value, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Comments => Empty_Node); + + -- If this is the first comment, put it in the right field of + -- the node Zone. + + if Previous = Empty_Node then + case Where is + when Before => + Project_Nodes.Table (Zone).Field1 := Project_Nodes.Last; + + when After => + Project_Nodes.Table (Zone).Field2 := Project_Nodes.Last; + + when Before_End => + Project_Nodes.Table (Zone).Field3 := Project_Nodes.Last; + + when After_End => + Project_Nodes.Table (Zone).Comments := Project_Nodes.Last; + + when End_Of_Line => + null; + end case; + + else + -- When it is not the first, link it to the previous one + + Project_Nodes.Table (Previous).Comments := Project_Nodes.Last; + end if; + + -- This node becomes the previous one for the next comment, if + -- there is one. + + Previous := Project_Nodes.Last; + end loop; + end if; + + -- Empty the Comments table, so that there is no risk to link the same + -- comments to another node. + + Comments.Set_Last (0); + end Add_Comments; + + -------------------------------- -- Associative_Array_Index_Of -- -------------------------------- function Associative_Array_Index_Of - (Node : Project_Node_Id) - return Name_Id + (Node : Project_Node_Id) return Name_Id is begin pragma Assert @@ -51,8 +227,7 @@ package body Prj.Tree is ---------------------------- function Associative_Package_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -67,8 +242,7 @@ package body Prj.Tree is ---------------------------- function Associative_Project_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -90,7 +264,7 @@ package body Prj.Tree is (Project_Nodes.Table (Node).Kind = N_Attribute_Declaration or else Project_Nodes.Table (Node).Kind = N_Attribute_Reference)); - return Project_Nodes.Table (Node).Case_Insensitive; + return Project_Nodes.Table (Node).Flag1; end Case_Insensitive; -------------------------------- @@ -98,8 +272,7 @@ package body Prj.Tree is -------------------------------- function Case_Variable_Reference_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -109,13 +282,54 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field1; end Case_Variable_Reference_Of; + ---------------------- + -- Comment_Zones_Of -- + ---------------------- + + function Comment_Zones_Of + (Node : Project_Node_Id) return Project_Node_Id + is + Zone : Project_Node_Id; + + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + -- If there is not already an N_Comment_Zones associated, create a new + -- one and associate it with node Node. + + if Zone = Empty_Node then + Project_Nodes.Increment_Last; + Zone := Project_Nodes.Last; + Project_Nodes.Table (Zone) := + (Kind => N_Comment_Zones, + Location => No_Location, + Directory => No_Name, + Expr_Kind => Undefined, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => No_Name, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Flag1 => False, + Flag2 => False, + Comments => Empty_Node); + Project_Nodes.Table (Node).Comments := Zone; + end if; + + return Zone; + end Comment_Zones_Of; + ----------------------- -- Current_Item_Node -- ----------------------- function Current_Item_Node - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -130,8 +344,7 @@ package body Prj.Tree is ------------------ function Current_Term - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -147,27 +360,118 @@ package body Prj.Tree is function Default_Project_Node (Of_Kind : Project_Node_Kind; - And_Expr_Kind : Variable_Kind := Undefined) - return Project_Node_Id + And_Expr_Kind : Variable_Kind := Undefined) return Project_Node_Id is + Result : Project_Node_Id; + Zone : Project_Node_Id; + Previous : Project_Node_Id; + begin + -- Create new node with specified kind and expression kind + Project_Nodes.Increment_Last; Project_Nodes.Table (Project_Nodes.Last) := - (Kind => Of_Kind, - Location => No_Location, - Directory => No_Name, - Expr_Kind => And_Expr_Kind, - Variables => Empty_Node, - Packages => Empty_Node, - Pkg_Id => Empty_Package, - Name => No_Name, - Path_Name => No_Name, - Value => No_Name, - Field1 => Empty_Node, - Field2 => Empty_Node, - Field3 => Empty_Node, - Case_Insensitive => False); - return Project_Nodes.Last; + (Kind => Of_Kind, + Location => No_Location, + Directory => No_Name, + Expr_Kind => And_Expr_Kind, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => No_Name, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Flag1 => False, + Flag2 => False, + Comments => Empty_Node); + + -- Save the new node for the returned value + + Result := Project_Nodes.Last; + + if Comments.Last > 0 then + + -- If this is not a node with comments, then set the flag + + if not Node_With_Comments (Of_Kind) then + Unkept_Comments := True; + + elsif Of_Kind /= N_Comment and then Of_Kind /= N_Comment_Zones then + + Project_Nodes.Increment_Last; + Project_Nodes.Table (Project_Nodes.Last) := + (Kind => N_Comment_Zones, + Expr_Kind => Undefined, + Location => No_Location, + Directory => No_Name, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => No_Name, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Flag1 => False, + Flag2 => False, + Comments => Empty_Node); + + Zone := Project_Nodes.Last; + Project_Nodes.Table (Result).Comments := Zone; + Previous := Empty_Node; + + for J in 1 .. Comments.Last loop + + -- Create a new N_Comment node + + Project_Nodes.Increment_Last; + Project_Nodes.Table (Project_Nodes.Last) := + (Kind => N_Comment, + Expr_Kind => Undefined, + Flag1 => Comments.Table (J).Follows_Empty_Line, + Flag2 => + Comments.Table (J).Is_Followed_By_Empty_Line, + Location => No_Location, + Directory => No_Name, + Variables => Empty_Node, + Packages => Empty_Node, + Pkg_Id => Empty_Package, + Name => No_Name, + Path_Name => No_Name, + Value => Comments.Table (J).Value, + Field1 => Empty_Node, + Field2 => Empty_Node, + Field3 => Empty_Node, + Comments => Empty_Node); + + -- Link it to the N_Comment_Zones node, if it is the first, + -- otherwise to the previous one. + + if Previous = Empty_Node then + Project_Nodes.Table (Zone).Field1 := Project_Nodes.Last; + + else + Project_Nodes.Table (Previous).Comments := + Project_Nodes.Last; + end if; + + -- This new node will be the previous one for the next + -- N_Comment node, if there is one. + + Previous := Project_Nodes.Last; + end loop; + + -- Empty the Comments table after all comments have been processed + + Comments.Set_Last (0); + end if; + end if; + + return Result; end Default_Project_Node; ------------------ @@ -183,6 +487,24 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Directory; end Directory_Of; + ------------------------- + -- End_Of_Line_Comment -- + ------------------------- + + function End_Of_Line_Comment (Node : Project_Node_Id) return Name_Id is + Zone : Project_Node_Id := Empty_Node; + + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + if Zone = Empty_Node then + return No_Name; + else + return Project_Nodes.Table (Zone).Value; + end if; + end End_Of_Line_Comment; + ------------------------ -- Expression_Kind_Of -- ------------------------ @@ -218,8 +540,7 @@ package body Prj.Tree is ------------------- function Expression_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -239,8 +560,7 @@ package body Prj.Tree is ------------------------- function Extended_Project_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -255,8 +575,7 @@ package body Prj.Tree is ------------------------------ function Extended_Project_Path_Of - (Node : Project_Node_Id) - return Name_Id + (Node : Project_Node_Id) return Name_Id is begin pragma Assert @@ -270,8 +589,7 @@ package body Prj.Tree is -- Extending_Project_Of -- -------------------------- function Extending_Project_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -286,8 +604,7 @@ package body Prj.Tree is --------------------------- function External_Reference_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -318,8 +635,7 @@ package body Prj.Tree is ------------------------ function First_Case_Item_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -345,13 +661,96 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field1; end First_Choice_Of; + ------------------------- + -- First_Comment_After -- + ------------------------- + + function First_Comment_After + (Node : Project_Node_Id) return Project_Node_Id + is + Zone : Project_Node_Id := Empty_Node; + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + if Zone = Empty_Node then + return Empty_Node; + + else + return Project_Nodes.Table (Zone).Field2; + end if; + end First_Comment_After; + + ----------------------------- + -- First_Comment_After_End -- + ----------------------------- + + function First_Comment_After_End + (Node : Project_Node_Id) + return Project_Node_Id + is + Zone : Project_Node_Id := Empty_Node; + + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + if Zone = Empty_Node then + return Empty_Node; + + else + return Project_Nodes.Table (Zone).Comments; + end if; + end First_Comment_After_End; + + -------------------------- + -- First_Comment_Before -- + -------------------------- + + function First_Comment_Before + (Node : Project_Node_Id) return Project_Node_Id + is + Zone : Project_Node_Id := Empty_Node; + + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + if Zone = Empty_Node then + return Empty_Node; + + else + return Project_Nodes.Table (Zone).Field1; + end if; + end First_Comment_Before; + + ------------------------------ + -- First_Comment_Before_End -- + ------------------------------ + + function First_Comment_Before_End + (Node : Project_Node_Id) return Project_Node_Id + is + Zone : Project_Node_Id := Empty_Node; + + begin + pragma Assert (Node /= Empty_Node); + Zone := Project_Nodes.Table (Node).Comments; + + if Zone = Empty_Node then + return Empty_Node; + + else + return Project_Nodes.Table (Zone).Field3; + end if; + end First_Comment_Before_End; + ------------------------------- -- First_Declarative_Item_Of -- ------------------------------- function First_Declarative_Item_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -375,8 +774,7 @@ package body Prj.Tree is ------------------------------ function First_Expression_In_List - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -391,8 +789,7 @@ package body Prj.Tree is -------------------------- function First_Literal_String - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -407,8 +804,7 @@ package body Prj.Tree is ---------------------- function First_Package_Of - (Node : Project_Node_Id) - return Package_Declaration_Id + (Node : Project_Node_Id) return Package_Declaration_Id is begin pragma Assert @@ -423,8 +819,7 @@ package body Prj.Tree is -------------------------- function First_String_Type_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -439,8 +834,7 @@ package body Prj.Tree is ---------------- function First_Term - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -455,8 +849,7 @@ package body Prj.Tree is ----------------------- function First_Variable_Of - (Node : Project_Node_Id) - return Variable_Node_Id + (Node : Project_Node_Id) return Variable_Node_Id is begin pragma Assert @@ -474,8 +867,7 @@ package body Prj.Tree is -------------------------- function First_With_Clause_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -485,6 +877,19 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field1; end First_With_Clause_Of; + ------------------------ + -- Follows_Empty_Line -- + ------------------------ + + function Follows_Empty_Line (Node : Project_Node_Id) return Boolean is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Comment); + return Project_Nodes.Table (Node).Flag1; + end Follows_Empty_Line; + ---------- -- Hash -- ---------- @@ -494,14 +899,51 @@ package body Prj.Tree is return Header_Num (N mod Project_Node_Id (Header_Num'Last)); end Hash; + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize is + begin + Project_Nodes.Set_Last (Empty_Node); + Projects_Htable.Reset; + end Initialize; + + ------------------------------- + -- Is_Followed_By_Empty_Line -- + ------------------------------- + + function Is_Followed_By_Empty_Line + (Node : Project_Node_Id) return Boolean + is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Comment); + return Project_Nodes.Table (Node).Flag2; + end Is_Followed_By_Empty_Line; + + ---------------------- + -- Is_Extending_All -- + ---------------------- + + function Is_Extending_All (Node : Project_Node_Id) return Boolean is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Project); + return Project_Nodes.Table (Node).Flag2; + end Is_Extending_All; + ------------------------------------- -- Imported_Or_Extended_Project_Of -- ------------------------------------- function Imported_Or_Extended_Project_Of (Project : Project_Node_Id; - With_Name : Name_Id) - return Project_Node_Id + With_Name : Name_Id) return Project_Node_Id is With_Clause : Project_Node_Id := First_With_Clause_Of (Project); Result : Project_Node_Id := Empty_Node; @@ -534,16 +976,6 @@ package body Prj.Tree is return Result; end Imported_Or_Extended_Project_Of; - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - Project_Nodes.Set_Last (Empty_Node); - Projects_Htable.Reset; - end Initialize; - ------------- -- Kind_Of -- ------------- @@ -579,8 +1011,7 @@ package body Prj.Tree is -------------------- function Next_Case_Item - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -590,13 +1021,25 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field3; end Next_Case_Item; + ------------------ + -- Next_Comment -- + ------------------ + + function Next_Comment (Node : Project_Node_Id) return Project_Node_Id is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Comment); + return Project_Nodes.Table (Node).Comments; + end Next_Comment; + --------------------------- -- Next_Declarative_Item -- --------------------------- function Next_Declarative_Item - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -611,8 +1054,7 @@ package body Prj.Tree is ----------------------------- function Next_Expression_In_List - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -643,8 +1085,7 @@ package body Prj.Tree is ----------------------------- function Next_Package_In_Project - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -675,8 +1116,7 @@ package body Prj.Tree is --------------- function Next_Term - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -710,8 +1150,7 @@ package body Prj.Tree is ------------------------- function Next_With_Clause_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -726,8 +1165,7 @@ package body Prj.Tree is --------------------------------- function Non_Limited_Project_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -736,6 +1174,7 @@ package body Prj.Tree is (Project_Nodes.Table (Node).Kind = N_With_Clause)); return Project_Nodes.Table (Node).Field3; end Non_Limited_Project_Node_Of; + ------------------- -- Package_Id_Of -- ------------------- @@ -754,8 +1193,7 @@ package body Prj.Tree is --------------------- function Package_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -787,8 +1225,7 @@ package body Prj.Tree is ---------------------------- function Project_Declaration_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -798,13 +1235,25 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field2; end Project_Declaration_Of; + ------------------------------------------- + -- Project_File_Includes_Unkept_Comments -- + ------------------------------------------- + + function Project_File_Includes_Unkept_Comments + (Node : Project_Node_Id) return Boolean + is + Declaration : constant Project_Node_Id := + Project_Declaration_Of (Node); + begin + return Project_Nodes.Table (Declaration).Flag1; + end Project_File_Includes_Unkept_Comments; + --------------------- -- Project_Node_Of -- --------------------- function Project_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -823,8 +1272,7 @@ package body Prj.Tree is ----------------------------------- function Project_Of_Renamed_Package_Of - (Node : Project_Node_Id) - return Project_Node_Id + (Node : Project_Node_Id) return Project_Node_Id is begin pragma Assert @@ -834,6 +1282,181 @@ package body Prj.Tree is return Project_Nodes.Table (Node).Field1; end Project_Of_Renamed_Package_Of; + -------------------------- + -- Remove_Next_End_Node -- + -------------------------- + + procedure Remove_Next_End_Node is + begin + Next_End_Nodes.Decrement_Last; + end Remove_Next_End_Node; + + ----------------- + -- Reset_State -- + ----------------- + + procedure Reset_State is + begin + End_Of_Line_Node := Empty_Node; + Previous_Line_Node := Empty_Node; + Previous_End_Node := Empty_Node; + Unkept_Comments := False; + Comments.Set_Last (0); + end Reset_State; + + ------------- + -- Restore -- + ------------- + + procedure Restore (S : in Comment_State) is + begin + End_Of_Line_Node := S.End_Of_Line_Node; + Previous_Line_Node := S.Previous_Line_Node; + Previous_End_Node := S.Previous_End_Node; + Next_End_Nodes.Set_Last (0); + Unkept_Comments := S.Unkept_Comments; + + Comments.Set_Last (0); + + for J in S.Comments'Range loop + Comments.Increment_Last; + Comments.Table (Comments.Last) := S.Comments (J); + end loop; + end Restore; + + ---------- + -- Save -- + ---------- + + procedure Save (S : out Comment_State) is + Cmts : Comments_Ptr := new Comment_Array (1 .. Comments.Last); + begin + for J in 1 .. Comments.Last loop + Cmts (J) := Comments.Table (J); + end loop; + + S := + (End_Of_Line_Node => End_Of_Line_Node, + Previous_Line_Node => Previous_Line_Node, + Previous_End_Node => Previous_End_Node, + Unkept_Comments => Unkept_Comments, + Comments => Cmts); + end Save; + + ---------- + -- Scan -- + ---------- + + procedure Scan is + Empty_Line : Boolean := False; + begin + -- If there are comments, then they will not be kept. Set the flag and + -- clear the comments. + + if Comments.Last > 0 then + Unkept_Comments := True; + Comments.Set_Last (0); + end if; + + -- Loop until a token other that End_Of_Line or Comment is found + + loop + Prj.Err.Scanner.Scan; + + case Token is + when Tok_End_Of_Line => + if Prev_Token = Tok_End_Of_Line then + Empty_Line := True; + + if Comments.Last > 0 then + Comments.Table (Comments.Last).Is_Followed_By_Empty_Line + := True; + end if; + end if; + + when Tok_Comment => + -- If this is a line comment, add it to the comment table + + if Prev_Token = Tok_End_Of_Line + or else Prev_Token = No_Token + then + Comments.Increment_Last; + Comments.Table (Comments.Last) := + (Value => Comment_Id, + Follows_Empty_Line => Empty_Line, + Is_Followed_By_Empty_Line => False); + + -- Otherwise, it is an end of line comment. If there is + -- an end of line node specified, associate the comment with + -- this node. + + elsif End_Of_Line_Node /= Empty_Node then + declare + Zones : constant Project_Node_Id := + Comment_Zones_Of (End_Of_Line_Node); + begin + Project_Nodes.Table (Zones).Value := Comment_Id; + end; + + -- Otherwise, this end of line node cannot be kept + + else + Unkept_Comments := True; + Comments.Set_Last (0); + end if; + + Empty_Line := False; + + when others => + -- If there are comments, where the first comment is not + -- following an empty line, put the initial uninterrupted + -- comment zone with the node of the preceding line (either + -- a Previous_Line or a Previous_End node), if any. + + if Comments.Last > 0 and then + not Comments.Table (1).Follows_Empty_Line then + if Previous_Line_Node /= Empty_Node then + Add_Comments + (To => Previous_Line_Node, Where => After); + + elsif Previous_End_Node /= Empty_Node then + Add_Comments + (To => Previous_End_Node, Where => After_End); + end if; + end if; + + -- If there are still comments and the token is "end", then + -- put these comments with the Next_End node, if any; + -- otherwise, these comments cannot be kept. Always clear + -- the comments. + + if Comments.Last > 0 and then Token = Tok_End then + if Next_End_Nodes.Last > 0 then + Add_Comments + (To => Next_End_Nodes.Table (Next_End_Nodes.Last), + Where => Before_End); + + else + Unkept_Comments := True; + end if; + + Comments.Set_Last (0); + end if; + + -- Reset the End_Of_Line, Previous_Line and Previous_End nodes + -- so that they are not used again. + + End_Of_Line_Node := Empty_Node; + Previous_Line_Node := Empty_Node; + Previous_End_Node := Empty_Node; + + -- And return + + exit; + end case; + end loop; + end Scan; + ------------------------------------ -- Set_Associative_Array_Index_Of -- ------------------------------------ @@ -899,7 +1522,7 @@ package body Prj.Tree is (Project_Nodes.Table (Node).Kind = N_Attribute_Declaration or else Project_Nodes.Table (Node).Kind = N_Attribute_Reference)); - Project_Nodes.Table (Node).Case_Insensitive := To; + Project_Nodes.Table (Node).Flag1 := To; end Set_Case_Insensitive; ------------------------------------ @@ -966,6 +1589,15 @@ package body Prj.Tree is Project_Nodes.Table (Node).Directory := To; end Set_Directory_Of; + --------------------- + -- Set_End_Of_Line -- + --------------------- + + procedure Set_End_Of_Line (To : Project_Node_Id) is + begin + End_Of_Line_Node := To; + end Set_End_Of_Line; + ---------------------------- -- Set_Expression_Kind_Of -- ---------------------------- @@ -1082,6 +1714,63 @@ package body Prj.Tree is Project_Nodes.Table (Node).Field1 := To; end Set_First_Choice_Of; + ----------------------------- + -- Set_First_Comment_After -- + ----------------------------- + + procedure Set_First_Comment_After + (Node : Project_Node_Id; + To : Project_Node_Id) + is + Zone : constant Project_Node_Id := + Comment_Zones_Of (Node); + begin + Project_Nodes.Table (Zone).Field2 := To; + end Set_First_Comment_After; + + --------------------------------- + -- Set_First_Comment_After_End -- + --------------------------------- + + procedure Set_First_Comment_After_End + (Node : Project_Node_Id; + To : Project_Node_Id) + is + Zone : constant Project_Node_Id := + Comment_Zones_Of (Node); + begin + Project_Nodes.Table (Zone).Comments := To; + end Set_First_Comment_After_End; + + ------------------------------ + -- Set_First_Comment_Before -- + ------------------------------ + + procedure Set_First_Comment_Before + (Node : Project_Node_Id; + To : Project_Node_Id) + + is + Zone : constant Project_Node_Id := + Comment_Zones_Of (Node); + begin + Project_Nodes.Table (Zone).Field1 := To; + end Set_First_Comment_Before; + + ---------------------------------- + -- Set_First_Comment_Before_End -- + ---------------------------------- + + procedure Set_First_Comment_Before_End + (Node : Project_Node_Id; + To : Project_Node_Id) + is + Zone : constant Project_Node_Id := + Comment_Zones_Of (Node); + begin + Project_Nodes.Table (Zone).Field2 := To; + end Set_First_Comment_Before_End; + ------------------------ -- Set_Next_Case_Item -- ------------------------ @@ -1098,6 +1787,22 @@ package body Prj.Tree is Project_Nodes.Table (Node).Field3 := To; end Set_Next_Case_Item; + ---------------------- + -- Set_Next_Comment -- + ---------------------- + + procedure Set_Next_Comment + (Node : Project_Node_Id; + To : Project_Node_Id) + is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Comment); + Project_Nodes.Table (Node).Comments := To; + end Set_Next_Comment; + ----------------------------------- -- Set_First_Declarative_Item_Of -- ----------------------------------- @@ -1237,6 +1942,19 @@ package body Prj.Tree is Project_Nodes.Table (Node).Field1 := To; end Set_First_With_Clause_Of; + -------------------------- + -- Set_Is_Extending_All -- + -------------------------- + + procedure Set_Is_Extending_All (Node : Project_Node_Id) is + begin + pragma Assert + (Node /= Empty_Node + and then + Project_Nodes.Table (Node).Kind = N_Project); + Project_Nodes.Table (Node).Flag2 := True; + end Set_Is_Extending_All; + ----------------- -- Set_Kind_Of -- ----------------- @@ -1340,6 +2058,16 @@ package body Prj.Tree is Project_Nodes.Table (Node).Field2 := To; end Set_Next_Declarative_Item; + ----------------------- + -- Set_Next_End_Node -- + ----------------------- + + procedure Set_Next_End_Node (To : Project_Node_Id) is + begin + Next_End_Nodes.Increment_Last; + Next_End_Nodes.Table (Next_End_Nodes.Last) := To; + end Set_Next_End_Node; + --------------------------------- -- Set_Next_Expression_In_List -- --------------------------------- @@ -1506,6 +2234,23 @@ package body Prj.Tree is Project_Nodes.Table (Node).Path_Name := To; end Set_Path_Name_Of; + --------------------------- + -- Set_Previous_End_Node -- + --------------------------- + procedure Set_Previous_End_Node (To : Project_Node_Id) is + begin + Previous_End_Node := To; + end Set_Previous_End_Node; + + ---------------------------- + -- Set_Previous_Line_Node -- + ---------------------------- + + procedure Set_Previous_Line_Node (To : Project_Node_Id) is + begin + Previous_Line_Node := To; + end Set_Previous_Line_Node; + -------------------------------- -- Set_Project_Declaration_Of -- -------------------------------- @@ -1522,6 +2267,20 @@ package body Prj.Tree is Project_Nodes.Table (Node).Field2 := To; end Set_Project_Declaration_Of; + ----------------------------------------------- + -- Set_Project_File_Includes_Unkept_Comments -- + ----------------------------------------------- + + procedure Set_Project_File_Includes_Unkept_Comments + (Node : Project_Node_Id; + To : Boolean) + is + Declaration : constant Project_Node_Id := + Project_Declaration_Of (Node); + begin + Project_Nodes.Table (Declaration).Flag1 := To; + end Set_Project_File_Includes_Unkept_Comments; + ------------------------- -- Set_Project_Node_Of -- ------------------------- @@ -1604,6 +2363,8 @@ package body Prj.Tree is and then (Project_Nodes.Table (Node).Kind = N_With_Clause or else + Project_Nodes.Table (Node).Kind = N_Comment + or else Project_Nodes.Table (Node).Kind = N_Literal_String)); Project_Nodes.Table (Node).Value := To; end Set_String_Value_Of; @@ -1612,8 +2373,9 @@ package body Prj.Tree is -- String_Type_Of -- -------------------- - function String_Type_Of (Node : Project_Node_Id) - return Project_Node_Id is + function String_Type_Of + (Node : Project_Node_Id) return Project_Node_Id + is begin pragma Assert (Node /= Empty_Node @@ -1640,6 +2402,8 @@ package body Prj.Tree is and then (Project_Nodes.Table (Node).Kind = N_With_Clause or else + Project_Nodes.Table (Node).Kind = N_Comment + or else Project_Nodes.Table (Node).Kind = N_Literal_String)); return Project_Nodes.Table (Node).Value; end String_Value_Of; @@ -1650,8 +2414,7 @@ package body Prj.Tree is function Value_Is_Valid (For_Typed_Variable : Project_Node_Id; - Value : Name_Id) - return Boolean + Value : Name_Id) return Boolean is begin pragma Assert @@ -1679,4 +2442,14 @@ package body Prj.Tree is end Value_Is_Valid; + ------------------------------- + -- There_Are_Unkept_Comments -- + ------------------------------- + + function There_Are_Unkept_Comments return Boolean is + begin + return Unkept_Comments; + end There_Are_Unkept_Comments; + + end Prj.Tree; diff --git a/gcc/ada/prj-tree.ads b/gcc/ada/prj-tree.ads index 4ddebb35763..942c10be0b9 100644 --- a/gcc/ada/prj-tree.ads +++ b/gcc/ada/prj-tree.ads @@ -30,8 +30,8 @@ with GNAT.HTable; with Prj.Attr; use Prj.Attr; with Prj.Com; use Prj.Com; +with Table; use Table; with Types; use Types; -with Table; package Prj.Tree is @@ -79,7 +79,9 @@ package Prj.Tree is N_External_Value, N_Attribute_Reference, N_Case_Construction, - N_Case_Item); + N_Case_Item, + N_Comment_Zones, + N_Comment); -- Each node in the tree is of a Project_Node_Kind -- For the signification of the fields in each node of a -- Project_Node_Kind, look at package Tree_Private_Part. @@ -90,8 +92,7 @@ package Prj.Tree is function Default_Project_Node (Of_Kind : Project_Node_Kind; - And_Expr_Kind : Variable_Kind := Undefined) - return Project_Node_Id; + And_Expr_Kind : Variable_Kind := Undefined) return Project_Node_Id; -- Returns a Project_Node_Record with the specified Kind and -- Expr_Kind; all the other components have default nil values. @@ -100,11 +101,85 @@ package Prj.Tree is function Imported_Or_Extended_Project_Of (Project : Project_Node_Id; - With_Name : Name_Id) - return Project_Node_Id; + With_Name : Name_Id) return Project_Node_Id; -- Return the node of a project imported or extended by project Project and -- whose name is With_Name. Return Empty_Node if there is no such project. + -------------- + -- Comments -- + -------------- + + type Comment_State is private; + -- A type to store the values of several global variables related to + -- comments. + + procedure Save (S : out Comment_State); + -- Save in variable S the comment state. Called before scanning a new + -- project file. + + procedure Restore (S : in Comment_State); + -- Restore the comment state to a previously saved value. Called after + -- scanning a project file. + + procedure Reset_State; + -- Set the comment state to its initial value. Called before scanning a + -- new project file. + + function There_Are_Unkept_Comments return Boolean; + -- Indicates that some of the comments in a project file could not be + -- stored in the parse tree. + + procedure Set_Previous_Line_Node (To : Project_Node_Id); + -- Indicate the node on the previous line. If there are comments + -- immediately following this line, then they should be associated with + -- this node. + + procedure Set_Previous_End_Node (To : Project_Node_Id); + -- Indicate that on the previous line the "end" belongs to node To. + -- If there are comments immediately following this "end" line, they + -- should be associated with this node. + + procedure Set_End_Of_Line (To : Project_Node_Id); + -- Indicate the node on the current line. If there is an end of line + -- comment, then it should be associated with this node. + + procedure Set_Next_End_Node (To : Project_Node_Id); + -- Put node To on the top of the end node stack. When an "end" line + -- is found with this node on the top of the end node stack, the comments, + -- if any, immediately preceding this "end" line will be associated with + -- this node. + + procedure Remove_Next_End_Node; + -- Remove the top of the end node stack. + + ------------------------ + -- Comment Processing -- + ------------------------ + + type Comment_Data is record + Value : Name_Id := No_Name; + Follows_Empty_Line : Boolean := False; + Is_Followed_By_Empty_Line : Boolean := False; + end record; + + package Comments is new Table.Table + (Table_Component_Type => Comment_Data, + Table_Index_Type => Natural, + Table_Low_Bound => 1, + Table_Initial => 10, + Table_Increment => 100, + Table_Name => "Prj.Tree.Comments"); + -- A table to store the comments that may be stored is the tree + + procedure Scan; + -- Scan the tokens and accumulate comments. + + type Comment_Location is + (Before, After, Before_End, After_End, End_Of_Line); + + procedure Add_Comments (To : Project_Node_Id; Where : Comment_Location); + -- Add comments to this node. + ---------------------- -- Access Functions -- ---------------------- @@ -125,6 +200,39 @@ package Prj.Tree is pragma Inline (Location_Of); -- Valid for all non empty nodes + function First_Comment_After + (Node : Project_Node_Id) return Project_Node_Id; + -- Valid only for N_Comment_Zones nodes + + function First_Comment_After_End + (Node : Project_Node_Id) return Project_Node_Id; + -- Valid only for N_Comment_Zones nodes + + function First_Comment_Before + (Node : Project_Node_Id) return Project_Node_Id; + -- Valid only for N_Comment_Zones nodes + + function First_Comment_Before_End + (Node : Project_Node_Id) return Project_Node_Id; + -- Valid only for N_Comment_Zones nodes + + function Next_Comment (Node : Project_Node_Id) return Project_Node_Id; + -- Valid only for N_Comment nodes + + function End_Of_Line_Comment (Node : Project_Node_Id) return Name_Id; + -- Valid only for non empty nodes + + function Follows_Empty_Line (Node : Project_Node_Id) return Boolean; + -- Valid only for N_Comment nodes + + function Is_Followed_By_Empty_Line (Node : Project_Node_Id) return Boolean; + -- Valid only for N_Comment nodes + + function Project_File_Includes_Unkept_Comments + (Node : Project_Node_Id) + return Boolean; + -- Valid only for N_Project nodes + function Directory_Of (Node : Project_Node_Id) return Name_Id; pragma Inline (Directory_Of); -- Only valid for N_Project nodes. @@ -135,15 +243,17 @@ package Prj.Tree is -- N_Variable_Declaration, N_Typed_Variable_Declaration, N_Expression, -- N_Term, N_Variable_Reference or N_Attribute_Reference nodes. + function Is_Extending_All (Node : Project_Node_Id) return Boolean; + pragma Inline (Is_Extending_All); + -- Only valid for N_Project + function First_Variable_Of - (Node : Project_Node_Id) - return Variable_Node_Id; + (Node : Project_Node_Id) return Variable_Node_Id; pragma Inline (First_Variable_Of); -- Only valid for N_Project or N_Package_Declaration nodes function First_Package_Of - (Node : Project_Node_Id) - return Package_Declaration_Id; + (Node : Project_Node_Id) return Package_Declaration_Id; pragma Inline (First_Package_Of); -- Only valid for N_Project nodes @@ -151,123 +261,105 @@ package Prj.Tree is pragma Inline (Package_Id_Of); -- Only valid for N_Package_Declaration nodes - function Path_Name_Of (Node : Project_Node_Id) return Name_Id; + function Path_Name_Of (Node : Project_Node_Id) return Name_Id; pragma Inline (Path_Name_Of); -- Only valid for N_Project and N_With_Clause nodes. - function String_Value_Of (Node : Project_Node_Id) return Name_Id; + function String_Value_Of (Node : Project_Node_Id) return Name_Id; pragma Inline (String_Value_Of); - -- Only valid for N_With_Clause or N_Literal_String nodes. + -- Only valid for N_With_Clause, N_Literal_String nodes or N_Comment function First_With_Clause_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_With_Clause_Of); -- Only valid for N_Project nodes function Project_Declaration_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Project_Declaration_Of); -- Only valid for N_Project nodes function Extending_Project_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Extending_Project_Of); -- Only valid for N_Project_Declaration nodes function First_String_Type_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_String_Type_Of); -- Only valid for N_Project nodes function Extended_Project_Path_Of - (Node : Project_Node_Id) - return Name_Id; + (Node : Project_Node_Id) return Name_Id; pragma Inline (Extended_Project_Path_Of); -- Only valid for N_With_Clause nodes function Project_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Project_Node_Of); -- Only valid for N_With_Clause, N_Variable_Reference and -- N_Attribute_Reference nodes. function Non_Limited_Project_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Non_Limited_Project_Node_Of); -- Only valid for N_With_Clause nodes. Returns Empty_Node for limited -- imported project files, otherwise returns the same result as -- Project_Node_Of. function Next_With_Clause_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_With_Clause_Of); -- Only valid for N_With_Clause nodes function First_Declarative_Item_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Declarative_Item_Of); -- Only valid for N_With_Clause nodes function Extended_Project_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Extended_Project_Of); - -- Only valid for N_With_Clause nodes + -- Only valid for N_Project_Declaration nodes function Current_Item_Node - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Current_Item_Node); -- Only valid for N_Declarative_Item nodes function Next_Declarative_Item - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Declarative_Item); -- Only valid for N_Declarative_Item node function Project_Of_Renamed_Package_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Project_Of_Renamed_Package_Of); -- Only valid for N_Package_Declaration nodes. -- May return Empty_Node. function Next_Package_In_Project - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Package_In_Project); -- Only valid for N_Package_Declaration nodes function First_Literal_String - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Literal_String); -- Only valid for N_String_Type_Declaration nodes function Next_String_Type - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_String_Type); -- Only valid for N_String_Type_Declaration nodes function Next_Literal_String - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Literal_String); -- Only valid for N_Literal_String nodes function Expression_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Expression_Of); -- Only valid for N_Attribute_Declaration, N_Typed_Variable_Declaration -- or N_Variable_Declaration nodes @@ -286,104 +378,88 @@ package Prj.Tree is function Value_Is_Valid (For_Typed_Variable : Project_Node_Id; - Value : Name_Id) - return Boolean; + Value : Name_Id) return Boolean; pragma Inline (Value_Is_Valid); -- Only valid for N_Typed_Variable_Declaration. Returns True if Value is -- in the list of allowed strings for For_Typed_Variable. False otherwise. function Associative_Array_Index_Of - (Node : Project_Node_Id) - return Name_Id; + (Node : Project_Node_Id) return Name_Id; pragma Inline (Associative_Array_Index_Of); -- Only valid for N_Attribute_Declaration and N_Attribute_Reference. -- Returns No_String for non associative array attributes. function Next_Variable - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Variable); -- Only valid for N_Typed_Variable_Declaration or N_Variable_Declaration -- nodes. function First_Term - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Term); -- Only valid for N_Expression nodes function Next_Expression_In_List - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Expression_In_List); -- Only valid for N_Expression nodes function Current_Term - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Current_Term); -- Only valid for N_Term nodes function Next_Term - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Term); -- Only valid for N_Term nodes function First_Expression_In_List - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Expression_In_List); -- Only valid for N_Literal_String_List nodes function Package_Node_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Package_Node_Of); -- Only valid for N_Variable_Reference or N_Attribute_Reference nodes. -- May return Empty_Node. function String_Type_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (String_Type_Of); -- Only valid for N_Variable_Reference or N_Typed_Variable_Declaration -- nodes. function External_Reference_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (External_Reference_Of); -- Only valid for N_External_Value nodes function External_Default_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (External_Default_Of); -- Only valid for N_External_Value nodes function Case_Variable_Reference_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Case_Variable_Reference_Of); -- Only valid for N_Case_Construction nodes function First_Case_Item_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Case_Item_Of); -- Only valid for N_Case_Construction nodes function First_Choice_Of - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (First_Choice_Of); -- Return the first choice in a N_Case_Item, or Empty_Node if -- this is when others. function Next_Case_Item - (Node : Project_Node_Id) - return Project_Node_Id; + (Node : Project_Node_Id) return Project_Node_Id; pragma Inline (Next_Case_Item); -- Only valid for N_Case_Item nodes @@ -415,6 +491,35 @@ package Prj.Tree is To : Source_Ptr); pragma Inline (Set_Location_Of); + procedure Set_First_Comment_After + (Node : Project_Node_Id; + To : Project_Node_Id); + pragma Inline (Set_First_Comment_After); + + procedure Set_First_Comment_After_End + (Node : Project_Node_Id; + To : Project_Node_Id); + pragma Inline (Set_First_Comment_After_End); + + procedure Set_First_Comment_Before + (Node : Project_Node_Id; + To : Project_Node_Id); + pragma Inline (Set_First_Comment_Before); + + procedure Set_First_Comment_Before_End + (Node : Project_Node_Id; + To : Project_Node_Id); + pragma Inline (Set_First_Comment_Before_End); + + procedure Set_Next_Comment + (Node : Project_Node_Id; + To : Project_Node_Id); + pragma Inline (Set_Next_Comment); + + procedure Set_Project_File_Includes_Unkept_Comments + (Node : Project_Node_Id; + To : Boolean); + procedure Set_Directory_Of (Node : Project_Node_Id; To : Name_Id); @@ -425,6 +530,9 @@ package Prj.Tree is To : Variable_Kind); pragma Inline (Set_Expression_Kind_Of); + procedure Set_Is_Extending_All (Node : Project_Node_Id); + pragma Inline (Set_Is_Extending_All); + procedure Set_First_Variable_Of (Node : Project_Node_Id; To : Variable_Node_Id); @@ -680,10 +788,32 @@ package Prj.Tree is Field3 : Project_Node_Id := Empty_Node; -- See below the meaning for each Project_Node_Kind - Case_Insensitive : Boolean := False; - -- This flag is significant only for N_Attribute_Declaration and - -- N_Atribute_Reference. It indicates for an associative array - -- attribute, that the index is case insensitive. + Flag1 : Boolean := False; + -- This flag is significant only for: + -- N_Attribute_Declaration and N_Atribute_Reference + -- It indicates for an associative array attribute, that the + -- index is case insensitive. + -- N_Comment - it indicates that the comment is preceded by an + -- empty line. + -- N_Project - it indicates that there are comments in the project + -- source that cannot be kept in the tree. + -- N_Project_Declaration + -- - it indixates that there are unkept comment in the + -- project. + + Flag2 : Boolean := False; + -- This flag is significant only for: + -- N_Project - it indicates that the project "extends all" another + -- project. + -- N_Comment - it indicates that the comment is followed by an + -- empty line. + + Comments : Project_Node_Id := Empty_Node; + -- For nodes other that N_Comment_Zones or N_Comment, designates the + -- comment zones associated with the node. + -- for N_Comment_Zones, designates the comment after the "end" of + -- the construct. + -- For N_Comment, designates the next comment, if any. end record; @@ -851,7 +981,7 @@ package Prj.Tree is -- -- Field3: not used -- -- Value: not used - -- N_Case_Item); + -- N_Case_Item -- -- Name: not used -- -- Path_Name: not used -- -- Expr_Kind: not used @@ -861,6 +991,28 @@ package Prj.Tree is -- -- Field3: next case item -- -- Value: not used + -- N_Comment_zones + -- -- Name: not used + -- -- Path_Name: not used + -- -- Expr_Kind: not used + -- -- Field1: comment before the construct + -- -- Field2: comment after the construct + -- -- Field3: comment before the "end" of the construct + -- -- Value: end of line comment + -- -- Comments: comment after the "end" of the construct + + -- N_Comment + -- -- Name: not used + -- -- Path_Name: not used + -- -- Expr_Kind: not used + -- -- Field1: not used + -- -- Field2: not used + -- -- Field3: not used + -- -- Value: comment + -- -- Flag1: comment is preceded by an empty line + -- -- Flag2: comment is followed by an empty line + -- -- Comments: next comment + package Project_Nodes is new Table.Table (Table_Component_Type => Project_Node_Record, Table_Index_Type => Project_Node_Id, @@ -900,4 +1052,20 @@ package Prj.Tree is end Tree_Private_Part; +private + type Comment_Array is array (Positive range <>) of Comment_Data; + type Comments_Ptr is access Comment_Array; + + type Comment_State is record + End_Of_Line_Node : Project_Node_Id := Empty_Node; + + Previous_Line_Node : Project_Node_Id := Empty_Node; + + Previous_End_Node : Project_Node_Id := Empty_Node; + + Unkept_Comments : Boolean := False; + + Comments : Comments_Ptr := null; + end record; + end Prj.Tree; diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index f03f5559622..6594b8782ac 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -77,6 +77,7 @@ package body Prj is (First_Referred_By => No_Project, Name => No_Name, Path_Name => No_Name, + Virtual => False, Display_Path_Name => No_Name, Location => No_Location, Mains => Nil_String, @@ -95,6 +96,7 @@ package body Prj is Standalone_Library => False, Lib_Interface_ALIs => Nil_String, Lib_Auto_Init => False, + Symbol_Data => No_Symbols, Sources_Present => True, Sources => Nil_String, Source_Dirs => Nil_String, @@ -121,7 +123,8 @@ package body Prj is Seen => False, Flag1 => False, Flag2 => False, - Depth => 0); + Depth => 0, + Unkept_Comments => False); ------------------- -- Add_To_Buffer -- @@ -305,7 +308,8 @@ package body Prj is Element := (Index => Lang, Index_Case_Sensitive => False, - Value => (Kind => Single, + Value => (Project => No_Project, + Kind => Single, Location => No_Location, Default => False, Value => Default_Spec_Suffix), @@ -340,7 +344,8 @@ package body Prj is Element := (Index => Lang, Index_Case_Sensitive => False, - Value => (Kind => Single, + Value => (Project => No_Project, + Kind => Single, Location => No_Location, Default => False, Value => Default_Body_Suffix), @@ -383,15 +388,6 @@ package body Prj is and then Left.Separate_Suffix = Right.Separate_Suffix; end Same_Naming_Scheme; - ---------- - -- Scan -- - ---------- - - procedure Scan is - begin - Scanner.Scan; - end Scan; - -------------------------- -- Standard_Naming_Data -- -------------------------- diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index b9dff5988b8..3f9033c7b3c 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -47,6 +47,10 @@ package Prj is -- Default value of parameter Packages of procedures Parse, in Prj.Pars and -- Prj.Part, indicating that all packages should be checked. + Virtual_Prefix : constant String := "v$"; + -- The prefix for virtual extending projects. Because of the '$', which is + -- normally forbidden for project names, there cannot be any name clash. + Project_File_Extension : String := ".gpr"; -- The standard project file name extension. -- It is not a constant, because Canonical_Case_File_Name is called @@ -71,8 +75,27 @@ package Prj is type Lib_Kind is (Static, Dynamic, Relocatable); + type Policy is (Autonomous, Compliant, Controlled); + -- See explaination about this type in package Symbol + + type Symbol_Record is record + Symbol_File : Name_Id := No_Name; + Reference : Name_Id := No_Name; + Symbol_Policy : Policy := Autonomous; + end record; + -- Type to keep the symbol data to be used when building a shared library + + No_Symbols : Symbol_Record := + (Symbol_File => No_Name, + Reference => No_Name, + Symbol_Policy => Autonomous); + function Empty_String return Name_Id; + type Project_Id is new Nat; + No_Project : constant Project_Id := 0; + -- Id of a Project File + type String_List_Id is new Nat; Nil_String : constant String_List_Id := 0; type String_Element is record @@ -103,6 +126,7 @@ package Prj is -- while processing the project tree (unknown package name). type Variable_Value (Kind : Variable_Kind := Undefined) is record + Project : Project_Id := No_Project; Location : Source_Ptr := No_Location; Default : Boolean := False; case Kind is @@ -118,7 +142,8 @@ package Prj is -- Default is True if the current value is the default one for the variable Nil_Variable_Value : constant Variable_Value := - (Kind => Undefined, + (Project => No_Project, + Kind => Undefined, Location => No_Location, Default => False); -- Value of a non existing variable or array element @@ -299,10 +324,6 @@ package Prj is -- Returns True if Left and Right are the same naming scheme -- not considering Specs and Bodies. - type Project_Id is new Nat; - No_Project : constant Project_Id := 0; - -- Id of a Project File - type Project_List is new Nat; Empty_Project_List : constant Project_List := 0; -- A list of project files. @@ -339,6 +360,9 @@ package Prj is -- The path name of the project file. -- Set by Prj.Proc.Process. + Virtual : Boolean := False; + -- True for virtual extending projects + Display_Path_Name : Name_Id := No_Name; Location : Source_Ptr := No_Location; @@ -409,6 +433,9 @@ package Prj is -- For non static Standalone Library Project Files, indicate if -- the library initialisation should be automatic. + Symbol_Data : Symbol_Record := No_Symbols; + -- Symbol file name, reference symbol file name, symbol policy + Sources_Present : Boolean := True; -- A flag that indicates if there are sources in this project file. -- There are no sources if 1) Source_Dirs is specified as an @@ -527,6 +554,10 @@ package Prj is -- The maximum depth of a project in the project graph. -- Depth of main project is 0. + Unkept_Comments : Boolean := False; + -- True if there are comments in the project sources that cannot + -- be kept in the project tree. + end record; function Empty_Project return Project_Data; @@ -583,10 +614,6 @@ package Prj is -- it is called for B. With_State may be used by Action to choose a -- behavior or to report some global result. - procedure Scan; - pragma Inline (Scan); - -- Scan a token. Change all operator symbols to literal strings. - private Initial_Buffer_Size : constant := 100; diff --git a/gcc/ada/raise.c b/gcc/ada/raise.c index 751c01d70ca..8b1d082b0f4 100644 --- a/gcc/ada/raise.c +++ b/gcc/ada/raise.c @@ -58,9 +58,7 @@ typedef char bool; /* We have not yet figured out how to import this directly */ void -_gnat_builtin_longjmp (ptr, flag) - void *ptr; - int flag ATTRIBUTE_UNUSED; +_gnat_builtin_longjmp (void *ptr, int flag ATTRIBUTE_UNUSED) { __builtin_longjmp (ptr, 1); } @@ -72,7 +70,7 @@ _gnat_builtin_longjmp (ptr, flag) performs any system dependent cleanup required. */ void -__gnat_unhandled_terminate () +__gnat_unhandled_terminate (void) { /* Special termination handling for VMS */ @@ -108,10 +106,10 @@ typedef struct _Unwind_Context _Unwind_Context; typedef struct _Unwind_Exception _Unwind_Exception; _Unwind_Reason_Code -__gnat_Unwind_RaiseException PARAMS ((_Unwind_Exception *)); +__gnat_Unwind_RaiseException (_Unwind_Exception *); _Unwind_Reason_Code -__gnat_Unwind_ForcedUnwind PARAMS ((_Unwind_Exception *, void *, void *)); +__gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *); #ifdef IN_RTS /* For eh personality routine */ @@ -540,9 +538,7 @@ typedef struct } region_descriptor; static void -db_region_for (region, uw_context) - region_descriptor *region; - _Unwind_Context *uw_context; +db_region_for (region_descriptor *region, _Unwind_Context *uw_context) { _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1; @@ -563,9 +559,7 @@ db_region_for (region, uw_context) ttype table. */ static const _Unwind_Ptr -get_ttype_entry_for (region, filter) - region_descriptor *region; - long filter; +get_ttype_entry_for (region_descriptor *region, long filter) { _Unwind_Ptr ttype_entry; @@ -580,9 +574,8 @@ get_ttype_entry_for (region, filter) /* Fill out the REGION descriptor for the provided UW_CONTEXT. */ static void -get_region_description_for (uw_context, region) - _Unwind_Context *uw_context; - region_descriptor *region; +get_region_description_for (_Unwind_Context *uw_context, + region_descriptor *region) { const unsigned char * p; _Unwind_Word tmp; @@ -674,9 +667,7 @@ typedef struct static void -db_action_for (action, uw_context) - action_descriptor *action; - _Unwind_Context *uw_context; +db_action_for (action_descriptor *action, _Unwind_Context *uw_context) { _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1; @@ -725,10 +716,9 @@ db_action_for (action, uw_context) #define __builtin_eh_return_data_regno(x) x static void -get_call_site_action_for (uw_context, region, action) - _Unwind_Context *uw_context; - region_descriptor *region; - action_descriptor *action; +get_call_site_action_for (_Unwind_Context *uw_context, + region_descriptor *region, + action_descriptor *action) { _Unwind_Ptr call_site = _Unwind_GetIP (uw_context) - 1; @@ -786,10 +776,9 @@ get_call_site_action_for (uw_context, region, action) /* ! __USING_SJLJ_EXCEPTIONS__ */ static void -get_call_site_action_for (uw_context, region, action) - _Unwind_Context *uw_context; - region_descriptor *region; - action_descriptor *action; +get_call_site_action_for (_Unwind_Context *uw_context, + region_descriptor *region, + action_descriptor *action) { _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1; @@ -861,11 +850,10 @@ get_call_site_action_for (uw_context, region, action) UW_CONTEXT in REGION. */ static void -get_action_description_for (uw_context, uw_exception, region, action) - _Unwind_Context *uw_context; - _Unwind_Exception *uw_exception; - region_descriptor *region; - action_descriptor *action; +get_action_description_for (_Unwind_Context *uw_context, + _Unwind_Exception *uw_exception, + region_descriptor *region, + action_descriptor *action) { _GNAT_Exception * gnat_exception = (_GNAT_Exception *) uw_exception; @@ -950,11 +938,10 @@ get_action_description_for (uw_context, uw_exception, region, action) occured. */ static void -setup_to_install (uw_context, uw_exception, uw_landing_pad, uw_filter) - _Unwind_Context *uw_context; - _Unwind_Exception *uw_exception; - int uw_filter; - _Unwind_Ptr uw_landing_pad; +setup_to_install (_Unwind_Context *uw_context, + _Unwind_Exception *uw_exception, + _Unwind_Ptr uw_landing_pad, + int uw_filter) { #ifndef EH_RETURN_DATA_REGNO /* We should not be called if the appropriate underlying support is not @@ -981,20 +968,18 @@ setup_to_install (uw_context, uw_exception, uw_landing_pad, uw_filter) /* The following is defined from a-except.adb. Its purpose is to enable automatic backtraces upon exception raise, as provided through the GNAT.Traceback facilities. */ -extern void __gnat_notify_handled_exception PARAMS ((void)); -extern void __gnat_notify_unhandled_exception PARAMS ((void)); +extern void __gnat_notify_handled_exception (void); +extern void __gnat_notify_unhandled_exception (void); /* Below is the eh personality routine per se. We currently assume that only GNU-Ada exceptions are met. */ _Unwind_Reason_Code -__gnat_eh_personality (uw_version, uw_phases, - uw_exception_class, uw_exception, uw_context) - int uw_version; - _Unwind_Action uw_phases; - _Unwind_Exception_Class uw_exception_class; - _Unwind_Exception *uw_exception; - _Unwind_Context *uw_context; +__gnat_eh_personality (int uw_version, + _Unwind_Action uw_phases, + _Unwind_Exception_Class uw_exception_class, + _Unwind_Exception *uw_exception, + _Unwind_Context *uw_context) { _GNAT_Exception * gnat_exception = (_GNAT_Exception *) uw_exception; @@ -1075,8 +1060,7 @@ __gnat_eh_personality (uw_version, uw_phases, #undef _Unwind_RaiseException _Unwind_Reason_Code -__gnat_Unwind_RaiseException (e) - _Unwind_Exception *e; +__gnat_Unwind_RaiseException (_Unwind_Exception *e) { return _Unwind_SjLj_RaiseException (e); } @@ -1085,10 +1069,9 @@ __gnat_Unwind_RaiseException (e) #undef _Unwind_ForcedUnwind _Unwind_Reason_Code -__gnat_Unwind_ForcedUnwind (e, handler, argument) - _Unwind_Exception *e; - void * handler; - void * argument; +__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e, + void * handler, + void * argument) { return _Unwind_SjLj_ForcedUnwind (e, handler, argument); } @@ -1097,17 +1080,15 @@ __gnat_Unwind_ForcedUnwind (e, handler, argument) #else /* __USING_SJLJ_EXCEPTIONS__ */ _Unwind_Reason_Code -__gnat_Unwind_RaiseException (e) - _Unwind_Exception *e; +__gnat_Unwind_RaiseException (_Unwind_Exception *e) { return _Unwind_RaiseException (e); } _Unwind_Reason_Code -__gnat_Unwind_ForcedUnwind (e, handler, argument) - _Unwind_Exception *e; - void * handler; - void * argument; +__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e, + void * handler, + void * argument) { return _Unwind_ForcedUnwind (e, handler, argument); } @@ -1127,18 +1108,16 @@ __gnat_Unwind_ForcedUnwind (e, handler, argument) functions never to be called. */ _Unwind_Reason_Code -__gnat_Unwind_RaiseException (e) - _Unwind_Exception *e ATTRIBUTE_UNUSED; +__gnat_Unwind_RaiseException (_Unwind_Exception *e ATTRIBUTE_UNUSED) { abort (); } _Unwind_Reason_Code -__gnat_Unwind_ForcedUnwind (e, handler, argument) - _Unwind_Exception *e ATTRIBUTE_UNUSED; - void * handler ATTRIBUTE_UNUSED; - void * argument ATTRIBUTE_UNUSED; +__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e ATTRIBUTE_UNUSED, + void * handler ATTRIBUTE_UNUSED, + void * argument ATTRIBUTE_UNUSED) { abort (); } diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index 5759855b9b9..3d0acf16026 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -258,6 +258,8 @@ package body Rtsfind is for J in RE_Id loop RE_Table (J) := Empty; end loop; + + RTE_Is_Available := False; end Initialize; ------------ @@ -548,7 +550,6 @@ package body Rtsfind is declare Loaded : Boolean; pragma Warnings (Off, Loaded); - begin Loaded := Is_Loaded (U.Uname); end; @@ -567,7 +568,6 @@ package body Rtsfind is if U.Unum = No_Unit then Load_Fail ("not found", U_Id, Id); - elsif Fatal_Error (U.Unum) then Load_Fail ("had parser errors", U_Id, Id); end if; @@ -599,7 +599,6 @@ package body Rtsfind is Set_Analyzed (Cunit (Current_Sem_Unit), True); if not Analyzed (Cunit (U.Unum)) then - Save_Private_Visibility; Semantics (Cunit (U.Unum)); Restore_Private_Visibility; diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index 000202cb63a..3ecd94842bd 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -298,6 +298,7 @@ package Rtsfind is System_String_Ops_Concat_5, System_Task_Info, System_Tasking, + System_Threads, System_Unsigned_Types, System_Val_Bool, System_Val_Char, @@ -1034,6 +1035,7 @@ package Rtsfind is RE_IS_Ilf, -- System.Scalar_Values RE_IS_Ill, -- System.Scalar_Values + RE_Default_Secondary_Stack_Size, -- System.Secondary_Stack RE_Mark_Id, -- System.Secondary_Stack RE_SS_Allocate, -- System.Secondary_Stack RE_SS_Pool, -- System.Secondary_Stack @@ -1164,6 +1166,11 @@ package Rtsfind is RE_Get_GNAT_Exception, -- System.Soft_Links RE_Update_Exception, -- System.Soft_Links + RE_ATSD, -- System.Threads + RE_Thread_Body_Enter, -- System.Threads + RE_Thread_Body_Exceptional_Exit, -- System.Threads + RE_Thread_Body_Leave, -- System.Threads + RE_Bits_1, -- System.Unsigned_Types RE_Bits_2, -- System.Unsigned_Types RE_Bits_4, -- System.Unsigned_Types @@ -1968,6 +1975,7 @@ package Rtsfind is RE_IS_Ilf => System_Scalar_Values, RE_IS_Ill => System_Scalar_Values, + RE_Default_Secondary_Stack_Size => System_Secondary_Stack, RE_Mark_Id => System_Secondary_Stack, RE_SS_Allocate => System_Secondary_Stack, RE_SS_Mark => System_Secondary_Stack, @@ -2098,6 +2106,11 @@ package Rtsfind is RE_Get_GNAT_Exception => System_Soft_Links, RE_Update_Exception => System_Soft_Links, + RE_ATSD => System_Threads, + RE_Thread_Body_Enter => System_Threads, + RE_Thread_Body_Exceptional_Exit => System_Threads, + RE_Thread_Body_Leave => System_Threads, + RE_Bits_1 => System_Unsigned_Types, RE_Bits_2 => System_Unsigned_Types, RE_Bits_4 => System_Unsigned_Types, diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads new file mode 100644 index 00000000000..9fef16b4f24 --- /dev/null +++ b/gcc/ada/s-crtl.ads @@ -0,0 +1,159 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C R T L -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2003 Free Software Foundation, Inc. -- +-- -- +-- GNAT is 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 2, 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 COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the low level interface to the C Run Time Library +-- on non-VMS systems. + +with System.Parameters; +package System.CRTL is +pragma Preelaborate (CRTL); + + subtype chars is System.Address; + -- Pointer to null-terminated array of characters + + subtype FILEs is System.Address; + -- Corresponds to the C type FILE* + + subtype int is Integer; + + type long is range -(2 ** (System.Parameters.long_bits - 1)) + .. +(2 ** (System.Parameters.long_bits - 1)) - 1; + + subtype off_t is Long_Integer; + + type size_t is mod 2 ** Standard'Address_Size; + + function atoi (A : System.Address) return Integer; + pragma Import (C, atoi, "atoi"); + + procedure clearerr (stream : FILEs); + pragma Import (C, clearerr, "clearerr"); + + function fclose (stream : FILEs) return int; + pragma Import (C, fclose, "fclose"); + + function fdopen (handle : int; mode : chars) return FILEs; + pragma Import (C, fdopen, "fdopen"); + + function fflush (stream : FILEs) return int; + pragma Import (C, fflush, "fflush"); + + function fgetc (stream : FILEs) return int; + pragma Import (C, fgetc, "fgetc"); + + function fgets (strng : chars; n : int; stream : FILEs) return chars; + pragma Import (C, fgets, "fgets"); + + function fopen (filename : chars; Mode : chars) return FILEs; + pragma Import (C, fopen, "fopen"); + + function fputc (C : int; stream : FILEs) return int; + pragma Import (C, fputc, "fputc"); + + function fputs (Strng : chars; Stream : FILEs) return int; + pragma Import (C, fputs, "fputs"); + + procedure free (Ptr : System.Address); + pragma Import (C, free, "free"); + + function freopen + (filename : chars; + mode : chars; + stream : FILEs) + return FILEs; + pragma Import (C, freopen, "freopen"); + + function fseek + (stream : FILEs; + offset : long; + origin : int) + return int; + pragma Import (C, fseek, "fseek"); + + function ftell (stream : FILEs) return long; + pragma Import (C, ftell, "ftell"); + + function getenv (S : String) return System.Address; + pragma Import (C, getenv, "getenv"); + + function isatty (handle : int) return int; + pragma Import (C, isatty, "isatty"); + + function lseek (fd : int; offset : off_t; direction : int) return off_t; + pragma Import (C, lseek, "lseek"); + + function malloc (Size : size_t) return System.Address; + pragma Import (C, malloc, "malloc"); + + procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t); + pragma Import (C, memcpy, "memcpy"); + + procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t); + pragma Import (C, memmove, "memmove"); + + procedure mktemp (template : chars); + pragma Import (C, mktemp, "mktemp"); + + function read (fd : int; buffer : chars; nbytes : int) return int; + pragma Import (C, read, "read"); + + function realloc + (Ptr : System.Address; Size : size_t) return System.Address; + pragma Import (C, realloc, "realloc"); + + procedure rewind (stream : FILEs); + pragma Import (C, rewind, "rewind"); + + function setvbuf + (stream : FILEs; + buffer : chars; + mode : int; + size : size_t) + return int; + pragma Import (C, setvbuf, "setvbuf"); + + procedure tmpnam (string : chars); + pragma Import (C, tmpnam, "tmpnam"); + + function tmpfile return FILEs; + pragma Import (C, tmpfile, "tmpfile"); + + function ungetc (c : int; stream : FILEs) return int; + pragma Import (C, ungetc, "ungetc"); + + function unlink (filename : chars) return int; + pragma Import (C, unlink, "unlink"); + + function write (fd : int; buffer : chars; nbytes : int) return int; + pragma Import (C, write, "write"); +end System.CRTL; diff --git a/gcc/ada/s-direio.adb b/gcc/ada/s-direio.adb index 8f43e740d87..a05461f81a3 100644 --- a/gcc/ada/s-direio.adb +++ b/gcc/ada/s-direio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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 @@ with Ada.IO_Exceptions; use Ada.IO_Exceptions; with Interfaces.C_Streams; use Interfaces.C_Streams; with System; use System; +with System.CRTL; with System.File_IO; with System.Soft_Links; with Unchecked_Deallocation; @@ -46,6 +47,9 @@ package body System.Direct_IO is subtype AP is FCB.AFCB_Ptr; use type FCB.Shared_Status_Type; + use type System.CRTL.long; + use type System.CRTL.size_t; + ----------------------- -- Local Subprograms -- ----------------------- diff --git a/gcc/ada/s-exnint.adb b/gcc/ada/s-exnint.adb index 432922147af..10b51d877d9 100644 --- a/gcc/ada/s-exnint.adb +++ b/gcc/ada/s-exnint.adb @@ -37,11 +37,7 @@ package body System.Exn_Int is -- Exn_Integer -- ----------------- - function Exn_Integer - (Left : Integer; - Right : Natural) - return Integer - is + function Exn_Integer (Left : Integer; Right : Natural) return Integer is pragma Suppress (Division_Check); pragma Suppress (Overflow_Check); diff --git a/gcc/ada/s-exnint.ads b/gcc/ada/s-exnint.ads index d601b86d537..d35547b7bb5 100644 --- a/gcc/ada/s-exnint.ads +++ b/gcc/ada/s-exnint.ads @@ -36,9 +36,6 @@ package System.Exn_Int is pragma Pure (Exn_Int); - function Exn_Integer - (Left : Integer; - Right : Natural) - return Integer; + function Exn_Integer (Left : Integer; Right : Natural) return Integer; end System.Exn_Int; diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index 9028fd694ba..cf29b249533 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.adb @@ -34,6 +34,7 @@ with Ada.Finalization; use Ada.Finalization; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with Interfaces.C_Streams; use Interfaces.C_Streams; +with System.CRTL; with System.Soft_Links; with Unchecked_Deallocation; @@ -43,6 +44,8 @@ package body System.File_IO is package SSL renames System.Soft_Links; + use type System.CRTL.size_t; + ---------------------- -- Global Variables -- ---------------------- @@ -812,6 +815,10 @@ package body System.File_IO is -- Normal case of non-null name given else + if Name'Length > Namelen then + raise Name_Error; + end if; + Namestr (1 .. Name'Length) := Name; Namestr (Name'Length + 1) := ASCII.NUL; end if; diff --git a/gcc/ada/s-geveop.adb b/gcc/ada/s-geveop.adb index f183a213b39..1820bdf2a47 100644 --- a/gcc/ada/s-geveop.adb +++ b/gcc/ada/s-geveop.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002 Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,7 +61,7 @@ package body System.Generic_Vector_Operations is function VP is new Unchecked_Conversion (Address, Vector_Ptr); function EP is new Unchecked_Conversion (Address, Element_Ptr); - SA : Address := XA + ((Length + 0) / VU * VU + SA : constant Address := XA + ((Length + 0) / VU * VU and (Boolean'Pos (Unaligned) - Address'(1))); -- First address of argument X to start serial processing @@ -102,7 +102,7 @@ package body System.Generic_Vector_Operations is function VP is new Unchecked_Conversion (Address, Vector_Ptr); function EP is new Unchecked_Conversion (Address, Element_Ptr); - SA : Address := XA + ((Length + 0) / VU * VU + SA : constant Address := XA + ((Length + 0) / VU * VU and (Boolean'Pos (Unaligned) - Address'(1))); -- First address of argument X to start serial processing diff --git a/gcc/ada/s-interr.adb b/gcc/ada/s-interr.adb index dc578bc1ce0..0145610dd12 100644 --- a/gcc/ada/s-interr.adb +++ b/gcc/ada/s-interr.adb @@ -598,7 +598,7 @@ package body System.Interrupts is Ptr := Registered_Handler_Head; - while (Ptr /= null) loop + while Ptr /= null loop if Ptr.H = Fat.Handler_Addr then return True; end if; @@ -946,7 +946,7 @@ package body System.Interrupts is Server_ID (Interrupt) := To_System (Access_Hold.all'Identity); end if; - if (New_Handler = null) then + if New_Handler = null then if Old_Handler /= null then Unbind_Handler (Interrupt); end if; diff --git a/gcc/ada/s-memcop.ads b/gcc/ada/s-memcop.ads index d71d48f17ca..f4d945487be 100644 --- a/gcc/ada/s-memcop.ads +++ b/gcc/ada/s-memcop.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2003 Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,24 +35,27 @@ -- -- ------------------------------------------------------------------------------ --- This package provides general block copy mechanisms analgous to those +-- This package provides general block copy mechanisms analogous to those -- provided by the C routines memcpy and memmove allowing for copies with --- and without possible overflow. +-- and without possible overlap of the operands. + +-- The idea is to allow a configurable run-time to provide this capability +-- for use by the compiler without dragging in C-run time routines. + +with System.CRTL; +-- The above with is contrary to the intent ??? package System.Memory_Copy is pragma Preelaborate; - type size_t is mod 2 ** Standard'Address_Size; - -- Note: the reason we redefine this here instead of using the - -- definition in Interfaces.C is that we do not want to drag in - -- all of Interfaces.C just because System.Memory_Copy is used. - - procedure memcpy (S1 : Address; S2 : Address; N : size_t); + procedure memcpy (S1 : Address; S2 : Address; N : System.CRTL.size_t) + renames System.CRTL.memcpy; -- Copies N storage units from area starting at S2 to area starting -- at S1 without any check for buffer overflow. The memory areas -- must not overlap, or the result of this call is undefined. - procedure memmove (S1 : Address; S2 : Address; N : size_t); + procedure memmove (S1 : Address; S2 : Address; N : System.CRTL.size_t) + renames System.CRTL.memmove; -- Copies N storage units from area starting at S2 to area starting -- at S1 without any check for buffer overflow. The difference between -- this memmove and memcpy is that with memmove, the storage areas may @@ -60,8 +63,6 @@ pragma Preelaborate; -- is as if S2 is first moved to a temporary area, and then this area -- is copied to S1 in a separate step). -private - -- In the standard library, these are just interfaced to the C routines. -- But in the HI-E (high integrity version) they may be reprogrammed to -- meet certification requirements (and marked High_Integrity). @@ -70,7 +71,4 @@ private -- available, and the HI-E compiler will as a result generate implicit -- loops (which will violate the restriction No_Implicit_Loops). - pragma Import (C, memcpy, "memcpy"); - pragma Import (C, memmove, "memmove"); - end System.Memory_Copy; diff --git a/gcc/ada/s-memory.adb b/gcc/ada/s-memory.adb index cdbb22e8908..66637c7291b 100644 --- a/gcc/ada/s-memory.adb +++ b/gcc/ada/s-memory.adb @@ -46,21 +46,22 @@ with Ada.Exceptions; with System.Soft_Links; with System.Parameters; +with System.CRTL; package body System.Memory is use Ada.Exceptions; use System.Soft_Links; - function c_malloc (Size : size_t) return System.Address; - pragma Import (C, c_malloc, "malloc"); + function c_malloc (Size : System.CRTL.size_t) return System.Address + renames System.CRTL.malloc; - procedure c_free (Ptr : System.Address); - pragma Import (C, c_free, "free"); + procedure c_free (Ptr : System.Address) + renames System.CRTL.free; function c_realloc - (Ptr : System.Address; Size : size_t) return System.Address; - pragma Import (C, c_realloc, "realloc"); + (Ptr : System.Address; Size : System.CRTL.size_t) return System.Address + renames System.CRTL.realloc; ----------- -- Alloc -- @@ -85,10 +86,10 @@ package body System.Memory is end if; if Parameters.No_Abort then - Result := c_malloc (Actual_Size); + Result := c_malloc (System.CRTL.size_t (Actual_Size)); else Abort_Defer.all; - Result := c_malloc (Actual_Size); + Result := c_malloc (System.CRTL.size_t (Actual_Size)); Abort_Undefer.all; end if; @@ -132,10 +133,10 @@ package body System.Memory is end if; if Parameters.No_Abort then - Result := c_realloc (Ptr, Actual_Size); + Result := c_realloc (Ptr, System.CRTL.size_t (Actual_Size)); else Abort_Defer.all; - Result := c_realloc (Ptr, Actual_Size); + Result := c_realloc (Ptr, System.CRTL.size_t (Actual_Size)); Abort_Undefer.all; end if; diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads index cd4004c834a..6b07f9190af 100644 --- a/gcc/ada/s-rident.ads +++ b/gcc/ada/s-rident.ads @@ -56,6 +56,7 @@ package System.Rident is No_Asynchronous_Control, -- (RM D.7(10)) No_Calendar, -- GNAT No_Delay, -- (RM H.4(21)) + No_Direct_Boolean_Operators, -- GNAT No_Dispatch, -- (RM H.4(19)) No_Dynamic_Interrupts, -- GNAT No_Dynamic_Priorities, -- (RM D.9(9)) diff --git a/gcc/ada/s-stache.adb b/gcc/ada/s-stache.adb index 65e816b654f..aa403c3f988 100644 --- a/gcc/ada/s-stache.adb +++ b/gcc/ada/s-stache.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2003 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- -- @@ -36,6 +36,7 @@ with Ada.Exceptions; with System.Storage_Elements; use System.Storage_Elements; with System.Parameters; use System.Parameters; with System.Soft_Links; +with System.CRTL; package body System.Stack_Checking is @@ -72,7 +73,6 @@ package body System.Stack_Checking is procedure Invalidate_Stack_Cache (Any_Stack : Stack_Access) is pragma Warnings (Off, Any_Stack); - begin Cache := Null_Stack; end Invalidate_Stack_Cache; @@ -82,8 +82,7 @@ package body System.Stack_Checking is -------------------- function Set_Stack_Info - (Stack : access Stack_Access) - return Stack_Access + (Stack : access Stack_Access) return Stack_Access is type Frame_Mark is null record; Frame_Location : Frame_Mark; @@ -93,12 +92,6 @@ package body System.Stack_Checking is Limit_Chars : System.Address; Limit : Integer; - function getenv (S : String) return System.Address; - pragma Import (C, getenv, External_Name => "getenv"); - - function atoi (A : System.Address) return Integer; - pragma Import (C, atoi); - begin -- The order of steps 1 .. 3 is important, see specification. @@ -113,16 +106,16 @@ package body System.Stack_Checking is -- the current frame address. if My_Stack.Size = 0 then - My_Stack.Size := Storage_Offset (Default_Env_Stack_Size); -- When the environment variable GNAT_STACK_LIMIT is set, -- set Environment_Stack_Size to that number of kB. - Limit_Chars := getenv ("GNAT_STACK_LIMIT" & ASCII.NUL); + Limit_Chars := System.CRTL.getenv ("GNAT_STACK_LIMIT" & ASCII.NUL); if Limit_Chars /= Null_Address then - Limit := atoi (Limit_Chars); + Limit := System.CRTL.atoi (Limit_Chars); + if Limit >= 0 then My_Stack.Size := Storage_Offset (Limit) * Kilobyte; end if; @@ -192,8 +185,7 @@ package body System.Stack_Checking is ----------------- function Stack_Check - (Stack_Address : System.Address) - return Stack_Access + (Stack_Address : System.Address) return Stack_Access is type Frame_Marker is null record; Marker : Frame_Marker; @@ -227,7 +219,6 @@ package body System.Stack_Checking is -- it is essential to use our local copy of Stack! begin - if (Stack_Grows_Down and then (not (Frame_Address <= My_Stack.Base))) or else diff --git a/gcc/ada/s-tasdeb.adb b/gcc/ada/s-tasdeb.adb index f8f50b9a1bb..baca96162db 100644 --- a/gcc/ada/s-tasdeb.adb +++ b/gcc/ada/s-tasdeb.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2003 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- -- @@ -39,14 +39,12 @@ -- Do not add any dependency to GNARL packages since this package is used -- in both normal and restricted (ravenscar) environments. -with Interfaces.C; +with System.CRTL; with System.Task_Primitives.Operations; with Unchecked_Conversion; package body System.Tasking.Debug is - use Interfaces.C; - package STPO renames System.Task_Primitives.Operations; function To_Integer is new @@ -60,8 +58,7 @@ package body System.Tasking.Debug is -- Local Subprograms -- ----------------------- - procedure write (Fd : Integer; S : String; Count : size_t); - pragma Import (C, write); + procedure Write (Fd : Integer; S : String; Count : Integer); procedure Put (S : String); -- Display S on standard output. @@ -177,7 +174,7 @@ package body System.Tasking.Debug is procedure Put (S : String) is begin - write (2, S, S'Length); + Write (2, S, S'Length); end Put; -------------- @@ -186,7 +183,7 @@ package body System.Tasking.Debug is procedure Put_Line (S : String := "") is begin - write (2, S & ASCII.LF, S'Length + 1); + Write (2, S & ASCII.LF, S'Length + 1); end Put_Line; ---------------------- @@ -297,4 +294,11 @@ package body System.Tasking.Debug is end if; end Trace; + procedure Write (Fd : Integer; S : String; Count : Integer) is + + Num : Integer; + begin + Num := System.CRTL.write (Fd, S (S'First)'Address, Count); + end Write; + end System.Tasking.Debug; diff --git a/gcc/ada/s-taskin.adb b/gcc/ada/s-taskin.adb index 84dafe76123..63d527d20ae 100644 --- a/gcc/ada/s-taskin.adb +++ b/gcc/ada/s-taskin.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003, 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- -- @@ -122,7 +122,7 @@ package body System.Tasking is All_Tasks_List := T; end Initialize_ATCB; - Main_Task_Image : String := "main_task"; + Main_Task_Image : constant String := "main_task"; -- Image of environment task. Main_Priority : Integer; diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb index 8fc01030702..14826330e72 100644 --- a/gcc/ada/s-tassta.adb +++ b/gcc/ada/s-tassta.adb @@ -1089,7 +1089,8 @@ package body System.Tasking.Stages is (Ada, Tailored_Exception_Information, "__gnat_tailored_exception_information"); - Excep : Exception_Occurrence_Access := SSL.Get_Current_Excep.all; + Excep : constant Exception_Occurrence_Access := + SSL.Get_Current_Excep.all; begin -- This procedure is called by the task outermost handler in diff --git a/gcc/ada/s-thread.adb b/gcc/ada/s-thread.adb index 0f3a90c1a08..369d46d0e84 100644 --- a/gcc/ada/s-thread.adb +++ b/gcc/ada/s-thread.adb @@ -31,27 +31,21 @@ -- -- ------------------------------------------------------------------------------ --- This is the VxWorks/Cert version of this package +-- This is a dummy version of this package. with Unchecked_Conversion; -package body System.Threads is - - Current_ATSD : aliased System.Address := System.Null_Address; - pragma Export (C, Current_ATSD, "__gnat_current_atsd"); +with System.Threads.Initialization; - function From_Address is - new Unchecked_Conversion (Address, ATSD_Access); +package body System.Threads is ----------------------- -- Get_Current_Excep -- ----------------------- function Get_Current_Excep return EOA is - CTSD : ATSD_Access := From_Address (Current_ATSD); begin - pragma Assert (Current_ATSD /= System.Null_Address); - return CTSD.Current_Excep'Access; + return null; end Get_Current_Excep; ------------------------ @@ -59,10 +53,8 @@ package body System.Threads is ------------------------ function Get_Jmpbuf_Address return Address is - CTSD : ATSD_Access := From_Address (Current_ATSD); begin - pragma Assert (Current_ATSD /= System.Null_Address); - return CTSD.Jmpbuf_Address; + return Null_Address; end Get_Jmpbuf_Address; ------------------------ @@ -70,10 +62,8 @@ package body System.Threads is ------------------------ function Get_Sec_Stack_Addr return Address is - CTSD : ATSD_Access := From_Address (Current_ATSD); begin - pragma Assert (Current_ATSD /= System.Null_Address); - return CTSD.Sec_Stack_Addr; + return Null_Address; end Get_Sec_Stack_Addr; ------------------------ @@ -81,10 +71,9 @@ package body System.Threads is ------------------------ procedure Set_Jmpbuf_Address (Addr : Address) is - CTSD : ATSD_Access := From_Address (Current_ATSD); + pragma Unreferenced (Addr); begin - pragma Assert (Current_ATSD /= System.Null_Address); - CTSD.Jmpbuf_Address := Addr; + null; end Set_Jmpbuf_Address; ------------------------ @@ -92,10 +81,46 @@ package body System.Threads is ------------------------ procedure Set_Sec_Stack_Addr (Addr : Address) is - CTSD : ATSD_Access := From_Address (Current_ATSD); + pragma Unreferenced (Addr); begin - pragma Assert (Current_ATSD /= System.Null_Address); - CTSD.Sec_Stack_Addr := Addr; + null; end Set_Sec_Stack_Addr; + ----------------------- + -- Thread_Body_Enter -- + ----------------------- + + procedure Thread_Body_Enter + (Sec_Stack_Address : System.Address; + Sec_Stack_Size : Natural; + Process_ATSD_Address : System.Address) + is + pragma Unreferenced (Sec_Stack_Address); + pragma Unreferenced (Sec_Stack_Size); + pragma Unreferenced (Process_ATSD_Address); + begin + null; + end Thread_Body_Enter; + + ---------------------------------- + -- Thread_Body_Exceptional_Exit -- + ---------------------------------- + + procedure Thread_Body_Exceptional_Exit + (EO : Ada.Exceptions.Exception_Occurrence) + is + pragma Unreferenced (EO); + begin + null; + end Thread_Body_Exceptional_Exit; + + ----------------------- + -- Thread_Body_Leave -- + ----------------------- + + procedure Thread_Body_Leave is + begin + null; + end Thread_Body_Leave; + end System.Threads; diff --git a/gcc/ada/s-thread.ads b/gcc/ada/s-thread.ads index 6bf6aafb568..f1606f1b808 100644 --- a/gcc/ada/s-thread.ads +++ b/gcc/ada/s-thread.ads @@ -34,7 +34,14 @@ -- This package provides facilities to register a thread to the runtime, -- and allocate its task specific datas. +-- pragma Thread_Body is currently supported for: +-- VxWorks AE653 with the restricted / cert runtime + with Ada.Exceptions; +-- used for Exception_Occurrence + +with System.Soft_Links; +-- used for TSD package System.Threads is @@ -48,7 +55,7 @@ package System.Threads is type ATSD_Access is access ATSD; - -- Get/Set for the attributes of the current thread. + -- Get/Set for the attributes of the current thread function Get_Jmpbuf_Address return Address; pragma Inline (Get_Jmpbuf_Address); @@ -65,29 +72,75 @@ package System.Threads is function Get_Current_Excep return EOA; pragma Inline (Get_Current_Excep); -private + -------------------------- + -- Thread Body Handling -- + -------------------------- + + -- The subprograms in this section are called by the expansion of a + -- subprogram body to which a Thread_Body pragma has been applied: + + -- Given a subprogram body + + -- procedure xyz (params ....) is -- can also be a function + -- + -- begin + -- + -- + -- end xyz; + + -- The expansion resulting from use of the Thread_Body pragma is: + + -- procedure xyz (params ...) is + + -- _Secondary_Stack : aliased + -- Storage_Elements.Storage_Array + -- (1 .. Storage_Offset (Sec_Stack_Size)); + -- for _Secondary_Stack'Alignment use Standard'Maximum_Alignment; - ------------------------ - -- Task Specific Data -- - ------------------------ + -- _Process_ATSD : aliased System.Threads.ATSD; - type ATSD is limited record - Jmpbuf_Address : Address := Null_Address; - -- Address of jump buffer used to store the address of the - -- current longjmp/setjmp buffer for exception management. - -- These buffers are threaded into a stack, and the address - -- here is the top of the stack. A null address means that - -- no exception handler is currently active. + -- begin + -- System.Threads.Thread_Body_Enter; + -- (_Secondary_Stack'Address, + -- _Secondary_Stack'Length, + -- _Process_ATSD'Address); - Sec_Stack_Addr : Address := Null_Address; - -- Address of currently allocated secondary stack + -- declare + -- + -- begin + -- + -- + -- end; - Current_Excep : aliased EO; - -- Exception occurrence that contains the information for the - -- current exception. Note that any exception in the same task - -- destroys this information, so the data in this variable must - -- be copied out before another exception can occur. + -- System.Threads.Thread_Body_Leave; + + -- exception + -- when E : others => + -- System.Threads.Thread_Body_Exceptional_Exit (E); + -- end; + + -- Note the exception handler is omitted if pragma Restriction + -- No_Exception_Handlers is currently active. + + -- Note: the secondary stack size (Sec_Stack_Size) comes either from + -- the pragma, if specified, or is the default value taken from + -- the declaration in System.Secondary_Stack. + + procedure Thread_Body_Enter + (Sec_Stack_Address : System.Address; + Sec_Stack_Size : Natural; + Process_ATSD_Address : System.Address); + -- Enter thread body, see above for details + + procedure Thread_Body_Leave; + -- Leave thread body (normally), see above for details + + procedure Thread_Body_Exceptional_Exit + (EO : Ada.Exceptions.Exception_Occurrence); + -- Leave thread body (abnormally on exception), see above for details + +private - end record; + type ATSD is new System.Soft_Links.TSD; end System.Threads; diff --git a/gcc/ada/s-tpae65.adb b/gcc/ada/s-tpae65.adb deleted file mode 100644 index b0438b00fa3..00000000000 --- a/gcc/ada/s-tpae65.adb +++ /dev/null @@ -1,87 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003, 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- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL 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 GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Export certain tasking-related routines for use by Interfaces.Vthreads - -with Interfaces.C; -package body System.Task_Primitives.Ae_653 is - - ------------------- - -- ATCB_Key_Addr -- - ------------------- - - function ATCB_Key_Addr return Address_Access is - Key_Addr : Address_Access; - pragma Import (Ada, Key_Addr, "__gnat_ATCB_key_addr"); - -- Done this way to minimize impact on other targets. This - -- implementation is temporary, and specific to AE653 - begin - return Key_Addr; - end ATCB_Key_Addr; - - -------------------------- - -- Set_Current_Priority -- - -------------------------- - - procedure Set_Current_Priority - (T : System.Tasking.Task_ID; - Prio : System.Priority) - is - begin - T.Common.Current_Priority := Prio; - end Set_Current_Priority; - - --------------------- - -- Set_Task_Thread -- - --------------------- - - procedure Set_Task_Thread - (T : System.Tasking.Task_ID; - Thread : System.OS_Interface.Thread_Id) - is - use System.OS_Interface; - use System.Tasking; - use type Interfaces.C.int; - Result : STATUS; - begin - T.Common.LL.Thread := Thread; - if taskVarGet (Thread, ATCB_Key_Addr) = ERROR then - Result := taskVarAdd (Thread, ATCB_Key_Addr); - pragma Assert (Result = OK); - end if; - - Result := taskVarSet (Thread, ATCB_Key_Addr, To_Address (T)); - pragma Assert (Result = OK); - end Set_Task_Thread; - -end System.Task_Primitives.Ae_653; diff --git a/gcc/ada/s-tpae65.ads b/gcc/ada/s-tpae65.ads deleted file mode 100644 index 641f17187d8..00000000000 --- a/gcc/ada/s-tpae65.ads +++ /dev/null @@ -1,54 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 -- --- -- --- S p e c -- --- -- --- Copyright (C) 2002-2003, 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- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL 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 GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Export certain tasking-related routines for use by Interfaces.Vthreads - -with System.Tasking; -with System.OS_Interface; -package System.Task_Primitives.Ae_653 is - type Address_Access is access System.Address; - - function ATCB_Key_Addr return Address_Access; - pragma Inline (ATCB_Key_Addr); - -- Address of ATCB_Key taskvar - - procedure Set_Current_Priority - (T : System.Tasking.Task_ID; Prio : System.Priority); - -- Set priority - - procedure Set_Task_Thread - (T : System.Tasking.Task_ID; - Thread : System.OS_Interface.Thread_Id); - -- Set "Thread" as the underlying OS thread implementing "T" - -end System.Task_Primitives.Ae_653; diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads index 1551296907e..b8f5c397654 100644 --- a/gcc/ada/scans.ads +++ b/gcc/ada/scans.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -187,15 +187,21 @@ package Scans is Tok_Dot_Dot, -- .. Sterm, Chtok - -- The following three entries are used only when scanning - -- project files. + -- The following three entries are used only when scanning project + -- files. Tok_Project, Tok_Extends, Tok_External, + Tok_Comment, + + -- The following entry is used by the preprocessor and when scanning + -- project files. - -- The following two entries are used by the preprocessor Tok_End_Of_Line, + + -- The following entry is used by the preprocessor + Tok_Special, No_Token); @@ -404,6 +410,10 @@ package Scans is Special_Character : Character; -- Valid only when Token = Tok_Special + Comment_Id : Name_Id := No_Name; + -- Valid only when Token = Tok_Comment. Store the string that follows + -- the two '-' of a comment. + -------------------------------------------------------- -- Procedures for Saving and Restoring the Scan State -- -------------------------------------------------------- diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb index 91908d3667d..ff0792c2cf0 100644 --- a/gcc/ada/scn.adb +++ b/gcc/ada/scn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -261,10 +261,14 @@ package body Scn is begin Scanner.Initialize_Scanner (Unit, Index); - -- Set default for Comes_From_Source. All nodes built now until we + -- Set default for Comes_From_Source (except if we are going to process + -- an artificial string internally created within the compiler and + -- placed into internal source duffer). All nodes built now until we -- reenter the analyzer will have Comes_From_Source set to True - Set_Comes_From_Source_Default (True); + if Index /= Internal_Source_File then + Set_Comes_From_Source_Default (True); + end if; -- Check license if GNAT type header possibly present @@ -278,7 +282,19 @@ package body Scn is -- call Scan. Scan initial token (note this initializes Prev_Token, -- Prev_Token_Ptr). - Scan; + -- There are two reasons not to do the Scan step in case if we + -- initialize the scanner for the internal source buffer: + + -- - The artificial string may not be created by the compiler in this + -- buffer when we call Initialize_Scanner + + -- - For these artificial strings a special way of scanning is used, so + -- the standard step of the scanner may just break the algorithm of + -- processing these strings. + + if Index /= Internal_Source_File then + Scan; + end if; -- Clear flags for reserved words used as indentifiers diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 369a6acc944..cb46bf189ee 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -49,6 +49,9 @@ package body Scng is Special_Characters : array (Character) of Boolean := (others => False); -- For characters that are Special token, the value is True + Comment_Is_Token : Boolean := False; + -- True if comments are tokens + End_Of_Line_Is_Token : Boolean := False; -- True if End_Of_Line is a token @@ -229,6 +232,8 @@ package body Scng is procedure Scan is + Start_Of_Comment : Source_Ptr; + procedure Check_End_Of_Line; -- Called when end of line encountered. Checks that line is not -- too long, and that other style checks for the end of line are met. @@ -1394,6 +1399,7 @@ package body Scng is else -- Source (Scan_Ptr + 1) = '-' then if Style_Check then Style.Check_Comment; end if; Scan_Ptr := Scan_Ptr + 2; + Start_Of_Comment := Scan_Ptr; -- Loop to scan comment (this loop runs more than once only if -- a horizontal tab or other non-graphic character is scanned) @@ -1449,9 +1455,18 @@ package body Scng is end loop; - -- Note that we do NOT execute a return here, instead we fall - -- through to reexecute the scan loop to look for a token. - + -- Note that, except when comments are tokens, we do NOT + -- execute a return here, instead we fall through to reexecute + -- the scan loop to look for a token. + + if Comment_Is_Token then + Name_Len := Integer (Scan_Ptr - Start_Of_Comment); + Name_Buffer (1 .. Name_Len) := + String (Source (Start_Of_Comment .. Scan_Ptr - 1)); + Comment_Id := Name_Find; + Token := Tok_Comment; + return; + end if; end if; end Minus_Case; @@ -2066,6 +2081,14 @@ package body Scng is return; end if; end Scan; + -------------------------- + -- Set_Comment_As_Token -- + -------------------------- + + procedure Set_Comment_As_Token (Value : Boolean) is + begin + Comment_Is_Token := Value; + end Set_Comment_As_Token; ------------------------------ -- Set_End_Of_Line_As_Token -- diff --git a/gcc/ada/scng.ads b/gcc/ada/scng.ads index 7ebb441f63e..31e81a7cd7f 100644 --- a/gcc/ada/scng.ads +++ b/gcc/ada/scng.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is 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,6 +91,10 @@ package Scng is -- Indicate if End_Of_Line is a token or not. -- By default, End_Of_Line is not a token. + procedure Set_Comment_As_Token (Value : Boolean); + -- Indicate if a comment is a token or not. + -- By default, a comment is not a token. + function Set_Start_Column return Column_Number; -- This routine is called with Scan_Ptr pointing to the first character -- of a line. On exit, Scan_Ptr is advanced to the first non-blank diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index d02abfd52dd..897e9b500af 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -29,6 +29,7 @@ with Checks; use Checks; with Einfo; use Einfo; with Elists; use Elists; with Errout; use Errout; +with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; with Itypes; use Itypes; @@ -334,7 +335,7 @@ package body Sem_Aggr is -- -- Typ is the context type in which N occurs. -- - -- This routine creates an implicit array subtype whose bouds are + -- This routine creates an implicit array subtype whose bounds are -- those defined by the aggregate. When this routine is invoked -- Resolve_Array_Aggregate has already processed aggregate N. Thus the -- Aggregate_Bounds of each sub-aggregate, is an N_Range node giving the @@ -866,7 +867,11 @@ package body Sem_Aggr is Error_Msg_N ("aggregate type cannot have limited component", N); Explain_Limited_Type (Typ, N); - elsif Is_Limited_Type (Typ) then + -- Ada0Y (AI-287): Limited aggregates allowed + + elsif Is_Limited_Type (Typ) + and not Extensions_Allowed + then Error_Msg_N ("aggregate type cannot be limited", N); Explain_Limited_Type (Typ, N); @@ -958,6 +963,8 @@ package body Sem_Aggr is -- formal parameter. Consequently we also need to test for -- N_Procedure_Call_Statement or N_Function_Call. + Set_Etype (N, Aggr_Typ); -- may be overridden later on. + if Is_Constrained (Typ) and then (Pkind = N_Assignment_Statement or else Pkind = N_Parameter_Association or else @@ -1637,9 +1644,27 @@ package body Sem_Aggr is end if; end loop; - if not - Resolve_Aggr_Expr - (Expression (Assoc), Single_Elmt => Single_Choice) + -- Ada0Y (AI-287): In case of default initialized component + -- we delay the resolution to the expansion phase + + if Box_Present (Assoc) then + + -- Ada0Y (AI-287): In case of default initialization of a + -- component the expander will generate calls to the + -- corresponding initialization subprogram. + + if Present (Base_Init_Proc (Etype (Component_Typ))) + or else Has_Task (Base_Type (Component_Typ)) + then + null; + else + Error_Msg_N + ("(Ada 0Y): no value supplied for this component", + Assoc); + end if; + + elsif not Resolve_Aggr_Expr (Expression (Assoc), + Single_Elmt => Single_Choice) then return Failure; end if; @@ -1760,8 +1785,26 @@ package body Sem_Aggr is if Others_Present then Assoc := Last (Component_Associations (N)); - if not Resolve_Aggr_Expr (Expression (Assoc), - Single_Elmt => False) + + -- Ada0Y (AI-287): In case of default initialized component + -- we delay the resolution to the expansion phase. + + if Box_Present (Assoc) then + + -- Ada0Y (AI-287): In case of default initialization of a + -- component the expander will generate calls to the + -- corresponding initialization subprogram. + + if Present (Base_Init_Proc (Etype (Component_Typ))) then + null; + else + Error_Msg_N + ("(Ada 0Y): no value supplied for these components", + Assoc); + end if; + + elsif not Resolve_Aggr_Expr (Expression (Assoc), + Single_Elmt => False) then return Failure; end if; @@ -1914,9 +1957,16 @@ package body Sem_Aggr is return; elsif Is_Limited_Type (Typ) then - Error_Msg_N ("aggregate type cannot be limited", N); - Explain_Limited_Type (Typ, N); - return; + + -- Ada0Y (AI-287): Limited aggregates are allowed + + if Extensions_Allowed then + null; + else + Error_Msg_N ("aggregate type cannot be limited", N); + Explain_Limited_Type (Typ, N); + return; + end if; elsif Is_Class_Wide_Type (Typ) then Error_Msg_N ("aggregate cannot be of a class-wide type", N); @@ -2017,7 +2067,19 @@ package body Sem_Aggr is -- -- This variable is updated as a side effect of function Get_Value - procedure Add_Association (Component : Entity_Id; Expr : Node_Id); + Mbox_Present : Boolean := False; + Others_Mbox : Boolean := False; + -- Ada0Y (AI-287): Variables used in case of default initialization to + -- provide a functionality similar to Others_Etype. Mbox_Present + -- indicates that the component takes its default initialization; + -- Others_Mbox indicates that at least one component takes its default + -- initialization. Similar to Others_Etype, they are also updated as a + -- side effect of function Get_Value. + + procedure Add_Association + (Component : Entity_Id; + Expr : Node_Id; + Box_Present : Boolean := False); -- Builds a new N_Component_Association node which associates -- Component to expression Expr and adds it to the new association -- list New_Assoc_List being built. @@ -2064,7 +2126,11 @@ package body Sem_Aggr is -- Add_Association -- --------------------- - procedure Add_Association (Component : Entity_Id; Expr : Node_Id) is + procedure Add_Association + (Component : Entity_Id; + Expr : Node_Id; + Box_Present : Boolean := False) + is Choice_List : constant List_Id := New_List; New_Assoc : Node_Id; @@ -2072,8 +2138,9 @@ package body Sem_Aggr is Append (New_Occurrence_Of (Component, Sloc (Expr)), Choice_List); New_Assoc := Make_Component_Association (Sloc (Expr), - Choices => Choice_List, - Expression => Expr); + Choices => Choice_List, + Expression => Expr, + Box_Present => Box_Present); Append (New_Assoc, New_Assoc_List); end Add_Association; @@ -2174,7 +2241,44 @@ package body Sem_Aggr is Expr : Node_Id := Empty; Selector_Name : Node_Id; + procedure Check_Non_Limited_Type; + -- Relax check to allow the default initialization of limited types. + -- For example: + -- record + -- C : Lim := (..., others => <>); + -- end record; + + ---------------------------- + -- Check_Non_Limited_Type -- + ---------------------------- + + procedure Check_Non_Limited_Type is + begin + if Is_Limited_Type (Etype (Compon)) + and then Comes_From_Source (Compon) + and then not In_Instance_Body + then + -- Ada0Y (AI-287): Limited aggregates are allowed + + if Extensions_Allowed + and then Present (Expression (Assoc)) + and then Nkind (Expression (Assoc)) = N_Aggregate + then + null; + else + Error_Msg_N + ("initialization not allowed for limited types", N); + Explain_Limited_Type (Etype (Compon), Compon); + end if; + + end if; + end Check_Non_Limited_Type; + + -- Start of processing for Get_Value + begin + Mbox_Present := False; + if Present (From) then Assoc := First (From); else @@ -2186,14 +2290,6 @@ package body Sem_Aggr is while Present (Selector_Name) loop if Nkind (Selector_Name) = N_Others_Choice then if Consider_Others_Choice and then No (Expr) then - if Present (Others_Etype) and then - Base_Type (Others_Etype) /= Base_Type (Etype (Compon)) - then - Error_Msg_N ("components in OTHERS choice must " & - "have same type", Selector_Name); - end if; - - Others_Etype := Etype (Compon); -- We need to duplicate the expression for each -- successive component covered by the others choice. @@ -2202,10 +2298,38 @@ package body Sem_Aggr is -- indispensable otherwise, because each one must be -- expanded individually to preserve side-effects. - if Expander_Active then - return New_Copy_Tree (Expression (Assoc)); + -- Ada0Y (AI-287): In case of default initialization of + -- components, we duplicate the corresponding default + -- expression (from the record type declaration). + + if Box_Present (Assoc) then + Others_Mbox := True; + Mbox_Present := True; + + if Expander_Active then + return New_Copy_Tree (Expression (Parent (Compon))); + else + return Expression (Parent (Compon)); + end if; + else - return Expression (Assoc); + Check_Non_Limited_Type; + + if Present (Others_Etype) and then + Base_Type (Others_Etype) /= Base_Type (Etype + (Compon)) + then + Error_Msg_N ("components in OTHERS choice must " & + "have same type", Selector_Name); + end if; + + Others_Etype := Etype (Compon); + + if Expander_Active then + return New_Copy_Tree (Expression (Assoc)); + else + return Expression (Assoc); + end if; end if; end if; @@ -2216,10 +2340,27 @@ package body Sem_Aggr is -- components are grouped together with a "|" choice. -- For instance "filed1 | filed2 => Expr" - if Present (Next (Selector_Name)) then - Expr := New_Copy_Tree (Expression (Assoc)); + if Box_Present (Assoc) then + Mbox_Present := True; + + -- Duplicate the default expression of the component + -- from the record type declaration + + if Present (Next (Selector_Name)) then + Expr := New_Copy_Tree + (Expression (Parent (Compon))); + else + Expr := Expression (Parent (Compon)); + end if; + else - Expr := Expression (Assoc); + Check_Non_Limited_Type; + + if Present (Next (Selector_Name)) then + Expr := New_Copy_Tree (Expression (Assoc)); + else + Expr := Expression (Assoc); + end if; end if; Generate_Reference (Compon, Selector_Name); @@ -2753,7 +2894,19 @@ package body Sem_Aggr is Component := Node (Component_Elmt); Expr := Get_Value (Component, Component_Associations (N), True); - if No (Expr) then + if Mbox_Present and then Is_Limited_Type (Etype (Component)) then + + -- Ada0Y (AI-287): In case of default initialization of a limited + -- component we pass the limited component to the expander. The + -- expander will generate calls to the corresponding initiali- + -- zation subprograms. + + Add_Association + (Component => Component, + Expr => Empty, + Box_Present => True); + + elsif No (Expr) then Error_Msg_NE ("no value supplied for component &!", N, Component); else Resolve_Aggr_Expr (Expr, Component); @@ -2783,7 +2936,12 @@ package body Sem_Aggr is Typech := Empty; if Nkind (Selectr) = N_Others_Choice then - if No (Others_Etype) then + + -- Ada0Y (AI-287): others choice may have expression or mbox + + if No (Others_Etype) + and then not Others_Mbox + then Error_Msg_N ("OTHERS must represent at least one component", Selectr); end if; @@ -2804,8 +2962,10 @@ package body Sem_Aggr is -- component supplied by a previous expansion. if No (New_Assoc) then + if Box_Present (Parent (Selectr)) then + null; - if Chars (Selectr) /= Name_uTag + elsif Chars (Selectr) /= Name_uTag and then Chars (Selectr) /= Name_uParent and then Chars (Selectr) /= Name_uController then @@ -2827,8 +2987,11 @@ package body Sem_Aggr is Typech := Base_Type (Etype (Component)); elsif Typech /= Base_Type (Etype (Component)) then - Error_Msg_N - ("components in choice list must have same type", Selectr); + if not Box_Present (Parent (Selectr)) then + Error_Msg_N + ("components in choice list must have same type", + Selectr); + end if; end if; Next (Selectr); diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 83833c15b5a..8629c4d7359 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -372,8 +372,8 @@ package body Sem_Attr is ---------------------------------- procedure Build_Access_Subprogram_Type (P : Node_Id) is - Index : Interp_Index; - It : Interp; + Index : Interp_Index; + It : Interp; function Get_Kind (E : Entity_Id) return Entity_Kind; -- Distinguish between access to regular and protected @@ -395,6 +395,10 @@ package body Sem_Attr is -- Start of processing for Build_Access_Subprogram_Type begin + -- In the case of an access to subprogram, use the name of the + -- subprogram itself as the designated type. Type-checking in + -- this case compares the signatures of the designated types. + if not Is_Overloaded (P) then Acc_Type := New_Internal_Entity @@ -408,7 +412,6 @@ package body Sem_Attr is Set_Etype (N, Any_Type); while Present (It.Nam) loop - if not Is_Intrinsic_Subprogram (It.Nam) then Acc_Type := New_Internal_Entity @@ -437,17 +440,20 @@ package body Sem_Attr is ("prefix of % attribute cannot be enumeration literal", P); end if; - -- In the case of an access to subprogram, use the name of the - -- subprogram itself as the designated type. Type-checking in - -- this case compares the signatures of the designated types. + -- Case of access to subprogram if Is_Entity_Name (P) and then Is_Overloadable (Entity (P)) then + -- Not allowed for nested subprograms if No_Implicit_Dynamic_Code + -- restriction set (since in general a trampoline is required). + if not Is_Library_Level_Entity (Entity (P)) then Check_Restriction (No_Implicit_Dynamic_Code, P); end if; + -- Build the appropriate subprogram type + Build_Access_Subprogram_Type (P); -- For unrestricted access, kill current values, since this @@ -460,7 +466,7 @@ package body Sem_Attr is return; - -- Component is an operation of a protected type. + -- Component is an operation of a protected type elsif Nkind (P) = N_Selected_Component and then Is_Overloadable (Entity (Selector_Name (P))) @@ -1358,7 +1364,8 @@ package body Sem_Attr is Error_Attr ("prefix of % attribute must be generic type", N); elsif Is_Generic_Actual_Type (Entity (P)) - or In_Instance + or else In_Instance + or else In_Inlined_Body then null; @@ -2178,9 +2185,12 @@ package body Sem_Attr is if Is_Entity_Name (P) and then Is_Type (Entity (P)) then -- If we are within an instance, the attribute must be legal - -- because it was valid in the generic unit. + -- because it was valid in the generic unit. Ditto if this is + -- an inlining of a function declared in an instance. - if In_Instance then + if In_Instance + or else In_Inlined_Body + then return; -- For sure OK if we have a real private type itself, but must @@ -6406,7 +6416,6 @@ package body Sem_Attr is end if; if Is_Entity_Name (P) then - if Is_Overloaded (P) then Get_First_Interp (P, Index, It); @@ -6437,19 +6446,18 @@ package body Sem_Attr is Resolve (P); end if; + Error_Msg_Name_1 := Aname; + if not Is_Entity_Name (P) then null; elsif Is_Abstract (Entity (P)) and then Is_Overloadable (Entity (P)) then - Error_Msg_Name_1 := Aname; Error_Msg_N ("prefix of % attribute cannot be abstract", P); Set_Etype (N, Any_Type); elsif Convention (Entity (P)) = Convention_Intrinsic then - Error_Msg_Name_1 := Aname; - if Ekind (Entity (P)) = E_Enumeration_Literal then Error_Msg_N ("prefix of % attribute cannot be enumeration literal", @@ -6460,6 +6468,10 @@ package body Sem_Attr is end if; Set_Etype (N, Any_Type); + + elsif Is_Thread_Body (Entity (P)) then + Error_Msg_N + ("prefix of % attribute cannot be a thread body", P); end if; -- Assignments, return statements, components of aggregates, diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index bb33f4cf27f..3dac1e3aa02 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -761,7 +761,7 @@ package body Sem_Cat is return; end if; - -- Process explicit with_clauses that are not limited. + -- Ada0Y (AI-50217): Process explicit with_clauses that are not limited declare Item : Node_Id; diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 743e943ff7a..4fdf9a9a4ca 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -73,8 +73,11 @@ package body Sem_Ch10 is -- Analyzes items in the context clause of compilation unit procedure Build_Limited_Views (N : Node_Id); - -- Build list of shadow entities for a package mentioned in a - -- limited_with clause. + -- Build and decorate the list of shadow entities for a package mentioned + -- in a limited_with clause. If the package was not previously analyzed + -- then it also performs a basic decoration of the real entities; this + -- is required to do not pass non-decorated entities to the back-end. + -- Implements Ada0Y (AI-50217). procedure Check_Body_Needed_For_SAL (Unit_Name : Entity_Id); -- Check whether the source for the body of a compilation unit must @@ -93,11 +96,12 @@ package body Sem_Ch10 is -- and not in an inner frame. procedure Expand_Limited_With_Clause (Nam : Node_Id; N : Node_Id); - -- if a child unit appears in a limited_with clause, there are implicit + -- If a child unit appears in a limited_with clause, there are implicit -- limited_with clauses on all parents that are not already visible -- through a regular with clause. This procedure creates the implicit -- limited with_clauses for the parents and loads the corresponding units. -- The shadow entities are created when the inserted clause is analyzed. + -- Implements Ada0Y (AI-50217). procedure Expand_With_Clause (Nam : Node_Id; N : Node_Id); -- When a child unit appears in a context clause, the implicit withs on @@ -123,10 +127,13 @@ package body Sem_Ch10 is -- Subsidiary to previous one. Process only with_ and use_clauses for -- current unit and its library unit if any. + procedure Install_Limited_Context_Clauses (N : Node_Id); + -- Subsidiary to Install_Context. Process only limited with_clauses + -- for current unit. Implements Ada0Y (AI-50217). + procedure Install_Limited_Withed_Unit (N : Node_Id); -- Place shadow entities for a limited_with package in the visibility - -- structures for the current compilation. Verify that there is no - -- regular with_clause in the context. + -- structures for the current compilation. Implements Ada0Y (AI-50217). procedure Install_Withed_Unit (With_Clause : Node_Id); -- If the unit is not a child unit, make unit immediately visible. @@ -169,7 +176,7 @@ package body Sem_Ch10 is procedure Remove_Limited_With_Clause (N : Node_Id); -- Remove from visibility the shadow entities introduced for a package - -- mentioned in a limited_with clause. + -- mentioned in a limited_with clause. Implements Ada0Y (AI-50217). procedure Remove_Parents (Lib_Unit : Node_Id); -- Remove_Parents checks if Lib_Unit is a child spec. If so then the parent @@ -606,6 +613,9 @@ package body Sem_Ch10 is begin Item := First (Context_Items (N)); while Present (Item) loop + + -- Ada0Y (AI-50217): Do not consider limited-withed units + if Nkind (Item) = N_With_Clause and then not Implicit_With (Item) and then not Limited_Present (Item) @@ -782,9 +792,9 @@ package body Sem_Ch10 is begin -- Loop through context items. This is done is three passes: -- a) The first pass analyze non-limited with-clauses. - -- b) The second pass add implicit limited_with clauses for the - -- the parents of child units. - -- c) The third pass analyzes limited_with clauses. + -- b) The second pass add implicit limited_with clauses for + -- the parents of child units (Ada0Y: AI-50217) + -- c) The third pass analyzes limited_with clauses (Ada0Y: AI-50217) Item := First (Context_Items (N)); while Present (Item) loop @@ -792,7 +802,9 @@ package body Sem_Ch10 is -- For with clause, analyze the with clause, and then update -- the version, since we are dependent on a unit that we with. - if Nkind (Item) = N_With_Clause then + if Nkind (Item) = N_With_Clause + and then not Limited_Present (Item) + then -- Skip analyzing with clause if no unit, nothing to do (this -- happens for a with that references a non-existant unit) @@ -845,6 +857,11 @@ package body Sem_Ch10 is and then Limited_Present (Item) then + if Nkind (Unit (N)) /= N_Package_Declaration then + Error_Msg_N ("limited with_clause only allowed in" + & " package specification", Item); + end if; + -- Skip analyzing with clause if no unit, see above. if Present (Library_Unit (Item)) then @@ -1239,6 +1256,7 @@ package body Sem_Ch10 is Num_Scopes : Int := 0; Use_Clauses : array (1 .. Scope_Stack.Last) of Node_Id; Enclosing_Child : Entity_Id := Empty; + Svg : constant Suppress_Array := Scope_Suppress; procedure Analyze_Subunit_Context; -- Capture names in use clauses of the subunit. This must be done @@ -1482,6 +1500,10 @@ package body Sem_Ch10 is Re_Install_Use_Clauses; Install_Context (N); + -- Restore state of suppress flags for current body. + + Scope_Suppress := Svg; + -- If the subunit is within a child unit, then siblings of any -- parent unit that appear in the context clause of the subunit -- must also be made immediately visible. @@ -1573,8 +1595,8 @@ package body Sem_Ch10 is begin if Limited_Present (N) then - - -- Build visibility structures but do not analyze unit + -- Ada0Y (AI-50217): Build visibility structures but do not + -- analyze unit Build_Limited_Views (N); return; @@ -1732,7 +1754,14 @@ package body Sem_Ch10 is Generate_Reference (Par_Name, Pref); Pref := Prefix (Pref); - Par_Name := Scope (Par_Name); + + -- If E_Name is the dummy entity for a nonexistent unit, + -- its scope is set to Standard_Standard, and no attempt + -- should be made to further unwind scopes. + + if Par_Name /= Standard_Standard then + Par_Name := Scope (Par_Name); + end if; end loop; if Present (Entity (Pref)) @@ -2534,6 +2563,8 @@ package body Sem_Ch10 is Install_Parents (Lib_Unit, Private_Present (Parent (Lib_Unit))); end if; + Install_Limited_Context_Clauses (N); + Check_With_Type_Clauses (N); end Install_Context; @@ -2548,7 +2579,6 @@ package body Sem_Ch10 is Check_Private : Boolean := False; Decl_Node : Node_Id; Lib_Parent : Entity_Id; - Lim_Present : Boolean := False; begin -- Loop through context clauses to find the with/use clauses. @@ -2565,9 +2595,8 @@ package body Sem_Ch10 is then if Limited_Present (Item) then - -- Second pass will be necessary + -- Limited withed units will be installed later. - Lim_Present := True; goto Continue; -- If Name (Item) is not an entity name, something is wrong, and @@ -2703,7 +2732,7 @@ package body Sem_Ch10 is if Is_Child_Spec (Lib_Unit) then - -- The unit also has implicit withs on its own parents. + -- The unit also has implicit withs on its own parents if No (Context_Items (N)) then Set_Context_Items (N, New_List); @@ -2778,23 +2807,224 @@ package body Sem_Ch10 is if Check_Private then Check_Private_Child_Unit (N); end if; + end Install_Context_Clauses; - -- Second pass: install limited_with clauses + ------------------------------------- + -- Install_Limited_Context_Clauses -- + ------------------------------------- - if Lim_Present then - Item := First (Context_Items (N)); + procedure Install_Limited_Context_Clauses (N : Node_Id) is + Item : Node_Id; + + procedure Check_Parent (P : Node_Id; W : Node_Id); + -- Check that the unlimited view of a given compilation_unit is not + -- already visible in the parents (neither immediately through the + -- context clauses, nor indirectly through "use + renamings"). + + procedure Check_Private_Limited_Withed_Unit (N : Node_Id); + -- Check that if a limited_with clause of a given compilation_unit + -- mentions a private child of some library unit, then the given + -- compilation_unit shall be the declaration of a private descendant + -- of that library unit. + + procedure Check_Withed_Unit (W : Node_Id); + -- Check that a limited with_clause does not appear in the same + -- context_clause as a nonlimited with_clause that mentions + -- the same library. + + -------------------- + -- Check_Parent -- + -------------------- + + procedure Check_Parent (P : Node_Id; W : Node_Id) is + Item : Node_Id; + Spec : Node_Id; + WEnt : Entity_Id; + Nam : Node_Id; + E : Entity_Id; + E2 : Entity_Id; + begin + pragma Assert (Nkind (W) = N_With_Clause); + + -- Step 1: Check if the unlimited view is installed in the parent + + Item := First (Context_Items (P)); while Present (Item) loop if Nkind (Item) = N_With_Clause - and then Limited_Present (Item) + and then not Limited_Present (Item) + and then not Implicit_With (Item) + and then Library_Unit (Item) = Library_Unit (W) then - Install_Limited_Withed_Unit (Item); + Error_Msg_N ("unlimited view visible in ancestor", W); + return; end if; Next (Item); end loop; - end if; - end Install_Context_Clauses; + + -- Step 2: Check "use + renamings" + + WEnt := Defining_Unit_Name (Specification (Unit (Library_Unit (W)))); + Spec := Specification (Unit (P)); + + -- We tried to traverse the list of entities corresponding to the + -- defining entity of the package spec. However, first_entity was + -- found to be 'empty'. Don't know why??? + + -- Def := Defining_Unit_Name (Spec); + -- Ent := First_Entity (Def); + + -- As a workaround we traverse the list of visible declarations ??? + + Item := First (Visible_Declarations (Spec)); + while Present (Item) loop + + if Nkind (Item) = N_Use_Package_Clause then + + -- Traverse the list of packages + + Nam := First (Names (Item)); + + while Present (Nam) loop + E := Entity (Nam); + + pragma Assert (Present (Parent (E))); + + if Nkind (Parent (E)) + = N_Package_Renaming_Declaration + and then Renamed_Entity (E) = WEnt + then + Error_Msg_N ("unlimited view visible through " + & "use_clause + renamings", W); + return; + + elsif Nkind (Parent (E)) = N_Package_Specification then + + -- The use clause may refer to a local package. + -- Check all the enclosing scopes. + + E2 := E; + while E2 /= Standard_Standard + and then E2 /= WEnt loop + E2 := Scope (E2); + end loop; + + if E2 = WEnt then + Error_Msg_N ("unlimited view visible through " + & "use_clause ", W); + return; + end if; + + end if; + Next (Nam); + end loop; + + end if; + + Next (Item); + end loop; + + -- Recursive call to check all the ancestors + + if Is_Child_Spec (Unit (P)) then + Check_Parent (P => Parent_Spec (Unit (P)), W => W); + end if; + end Check_Parent; + + --------------------------------------- + -- Check_Private_Limited_Withed_Unit -- + --------------------------------------- + + procedure Check_Private_Limited_Withed_Unit (N : Node_Id) is + C : Node_Id; + P : Node_Id; + Found : Boolean := False; + + begin + -- If the current compilation unit is not private we don't + -- need to check anything else. + + if not Private_Present (Parent (N)) then + Found := False; + + else + -- Compilation unit of the parent of the withed library unit + + P := Parent_Spec (Unit (Library_Unit (N))); + + -- Traverse all the ancestors of the current compilation + -- unit to check if it is a descendant of named library unit. + + C := Parent (N); + while Present (Parent_Spec (Unit (C))) loop + C := Parent_Spec (Unit (C)); + + if C = P then + Found := True; + exit; + end if; + end loop; + end if; + + if not Found then + Error_Msg_N ("current unit is not a private descendant" + & " of the withed unit ('R'M 10.1.2(8)", N); + end if; + end Check_Private_Limited_Withed_Unit; + + ----------------------- + -- Check_Withed_Unit -- + ----------------------- + + procedure Check_Withed_Unit (W : Node_Id) is + Item : Node_Id; + + begin + -- A limited with_clause can not appear in the same context_clause + -- as a nonlimited with_clause which mentions the same library. + + Item := First (Context_Items (N)); + while Present (Item) loop + if Nkind (Item) = N_With_Clause + and then not Limited_Present (Item) + and then not Implicit_With (Item) + and then Library_Unit (Item) = Library_Unit (W) + then + Error_Msg_N ("limited and unlimited view " + & "not allowed in the same context clauses", W); + return; + end if; + + Next (Item); + end loop; + end Check_Withed_Unit; + + -- Start of processing for Install_Limited_Context_Clauses + + begin + Item := First (Context_Items (N)); + while Present (Item) loop + if Nkind (Item) = N_With_Clause + and then Limited_Present (Item) + then + + Check_Withed_Unit (Item); + + if Private_Present (Library_Unit (Item)) then + Check_Private_Limited_Withed_Unit (Item); + end if; + + if Is_Child_Spec (Unit (N)) then + Check_Parent (Parent_Spec (Unit (N)), Item); + end if; + + Install_Limited_Withed_Unit (Item); + end if; + + Next (Item); + end loop; + end Install_Limited_Context_Clauses; --------------------- -- Install_Parents -- @@ -2917,6 +3147,10 @@ package body Sem_Ch10 is -- the current unit. -- Shouldn't this be somewhere more general ??? + ----------------- + -- Is_Ancestor -- + ----------------- + function Is_Ancestor (E : Entity_Id) return Boolean is Par : Entity_Id; @@ -3011,8 +3245,7 @@ package body Sem_Ch10 is Unum : Unit_Number_Type := Get_Source_Unit (Library_Unit (N)); P_Unit : Entity_Id := Unit (Library_Unit (N)); - P : Entity_Id := - Defining_Unit_Name (Specification (P_Unit)); + P : Entity_Id; Lim_Elmt : Elmt_Id; Lim_Typ : Entity_Id; Is_Child_Package : Boolean := False; @@ -3039,6 +3272,33 @@ package body Sem_Ch10 is -- Start of processing for Install_Limited_Withed_Unit begin + -- In case of limited with_clause on subprograms, generics, instances, + -- or generic renamings, the corresponding error was previously posted + -- and we have nothing to do here. + + case Nkind (P_Unit) is + + when N_Package_Declaration => + null; + + when N_Subprogram_Declaration | + N_Generic_Package_Declaration | + N_Generic_Subprogram_Declaration | + N_Package_Instantiation | + N_Function_Instantiation | + N_Procedure_Instantiation | + N_Generic_Package_Renaming_Declaration | + N_Generic_Procedure_Renaming_Declaration | + N_Generic_Function_Renaming_Declaration => + return; + + when others => + pragma Assert (False); + null; + end case; + + P := Defining_Unit_Name (Specification (P_Unit)); + if Nkind (P) = N_Defining_Program_Unit_Name then -- Retrieve entity of child package @@ -3047,16 +3307,37 @@ package body Sem_Ch10 is P := Defining_Identifier (P); end if; + -- A common usage of the limited-with is to have a limited-with + -- in the package spec, and a normal with in its package body. + -- For example: + + -- limited with X; -- [1] + -- package A is ... + + -- with X; -- [2] + -- package body A is ... + + -- The compilation of A's body installs the entities of its + -- withed packages (the context clauses found at [2]) and + -- then the context clauses of its specification (found at [1]). + + -- As a consequence, at point [1] the specification of X has been + -- analyzed and it is immediately visible. According to the semantics + -- of the limited-with context clauses we don't install the limited + -- view because the full view of X supersedes its limited view. + if Analyzed (Cunit (Unum)) and then Is_Immediately_Visible (P) then - -- disallow naming in a limited with clause a unit (or renaming - -- thereof) that is mentioned in an enclosing normal with clause. - Error_Msg_N ("limited_with not allowed on unit already withed", N); - return; end if; + if Debug_Flag_I then + Write_Str ("install limited view of "); + Write_Name (Chars (P)); + Write_Eol; + end if; + if not Analyzed (Cunit (Unum)) then Set_Ekind (P, E_Package); Set_Etype (P, Standard_Void_Type); @@ -3067,6 +3348,13 @@ package body Sem_Ch10 is if Current_Entity (P) /= P then Set_Homonym (P, Current_Entity (P)); Set_Current_Entity (P); + + if Debug_Flag_I then + Write_Str (" (homonym) chain "); + Write_Name (Chars (P)); + Write_Eol; + end if; + end if; if Is_Child_Package then @@ -3084,7 +3372,9 @@ package body Sem_Ch10 is Set_Scope (P, Parent_Id); end; end if; + else + -- If the unit appears in a previous regular with_clause, the -- regular entities must be unchained before the shadow ones -- are made accessible. @@ -3099,6 +3389,7 @@ package body Sem_Ch10 is Next_Entity (Ent); end loop; end; + end if; -- The package must be visible while the with_type clause is active, @@ -3116,6 +3407,13 @@ package body Sem_Ch10 is if not In_Chain (Lim_Typ) then Set_Homonym (Lim_Typ, Current_Entity (Lim_Typ)); Set_Current_Entity (Lim_Typ); + + if Debug_Flag_I then + Write_Str (" (homonym) chain "); + Write_Name (Chars (Lim_Typ)); + Write_Eol; + end if; + end if; Next_Elmt (Lim_Elmt); @@ -3125,6 +3423,7 @@ package body Sem_Ch10 is -- accordingly, to uninstall it when the context is removed. Set_Limited_View_Installed (N); + Set_From_With_Type (P); end Install_Limited_Withed_Unit; ------------------------- @@ -3136,6 +3435,13 @@ package body Sem_Ch10 is P : constant Entity_Id := Scope (Uname); begin + + if Debug_Flag_I then + Write_Str ("install withed unit "); + Write_Name (Chars (Uname)); + Write_Eol; + end if; + -- We do not apply the restrictions to an internal unit unless -- we are compiling the internal unit as a main unit. This check -- is also skipped for dummy units (for missing packages). @@ -3308,6 +3614,13 @@ package body Sem_Ch10 is -- Construct list of shadow entities and attach it to entity of -- package that is mentioned in a limited_with clause. + function New_Internal_Shadow_Entity + (Kind : Entity_Kind; + Sloc_Value : Source_Ptr; + Id_Char : Character) return Entity_Id; + -- This function is similar to New_Internal_Entity, except that the + -- entity is not added to the scope's list of entities. + ------------------------------ -- Decorate_Incomplete_Type -- ------------------------------ @@ -3324,7 +3637,6 @@ package body Sem_Ch10 is Set_Stored_Constraint (E, No_Elist); Set_Full_View (E, Empty); Init_Size_Align (E); - Set_Has_Unknown_Discriminants (E); end Decorate_Incomplete_Type; -------------------------- @@ -3374,22 +3686,54 @@ package body Sem_Ch10 is Set_Etype (P, Standard_Void_Type); end Decorate_Package_Specification; + ------------------------- + -- New_Internal_Entity -- + ------------------------- + + function New_Internal_Shadow_Entity + (Kind : Entity_Kind; + Sloc_Value : Source_Ptr; + Id_Char : Character) return Entity_Id + is + N : constant Entity_Id := + Make_Defining_Identifier (Sloc_Value, + Chars => New_Internal_Name (Id_Char)); + + begin + Set_Ekind (N, Kind); + Set_Is_Internal (N, True); + + if Kind in Type_Kind then + Init_Size_Align (N); + end if; + + return N; + end New_Internal_Shadow_Entity; + ----------------- -- Build_Chain -- ----------------- + -- Could use more comments below ??? + procedure Build_Chain (Spec : Node_Id; Scope : Entity_Id) is - Decl : Node_Id; + Decl : Node_Id; + Analyzed_Unit : Boolean := Analyzed (Cunit (Unum)); + Is_Tagged : Boolean; begin Decl := First (Visible_Declarations (Spec)); while Present (Decl) loop if Nkind (Decl) = N_Full_Type_Declaration then + Is_Tagged := + Nkind (Type_Definition (Decl)) = N_Record_Definition + and then Tagged_Present (Type_Definition (Decl)); + Comp_Typ := Defining_Identifier (Decl); - if not Analyzed (Cunit (Unum)) then - if Tagged_Present (Type_Definition (Decl)) then + if not Analyzed_Unit then + if Is_Tagged then Decorate_Tagged_Type (Sloc (Decl), Comp_Typ, Scope); else Decorate_Incomplete_Type (Comp_Typ, Scope); @@ -3398,9 +3742,8 @@ package body Sem_Ch10 is -- Create shadow entity for type - Lim_Typ := New_Internal_Entity + Lim_Typ := New_Internal_Shadow_Entity (Kind => Ekind (Comp_Typ), - Scope_Id => Scope, Sloc_Value => Sloc (Comp_Typ), Id_Char => 'Z'); @@ -3408,17 +3751,13 @@ package body Sem_Ch10 is Set_Parent (Lim_Typ, Parent (Comp_Typ)); Set_From_With_Type (Lim_Typ); - if Tagged_Present (Type_Definition (Decl)) then + if Is_Tagged then Decorate_Tagged_Type (Sloc (Decl), Lim_Typ, Scope); else Decorate_Incomplete_Type (Lim_Typ, Scope); end if; Set_Non_Limited_View (Lim_Typ, Comp_Typ); - - -- Add each entity to the proper list - - Append_Elmt (Comp_Typ, To => Non_Limited_Views (P)); Append_Elmt (Lim_Typ, To => Limited_Views (P)); elsif Nkind (Decl) = N_Private_Type_Declaration @@ -3426,13 +3765,12 @@ package body Sem_Ch10 is then Comp_Typ := Defining_Identifier (Decl); - if not Analyzed (Cunit (Unum)) then + if not Analyzed_Unit then Decorate_Tagged_Type (Sloc (Decl), Comp_Typ, Scope); end if; - Lim_Typ := New_Internal_Entity + Lim_Typ := New_Internal_Shadow_Entity (Kind => Ekind (Comp_Typ), - Scope_Id => Scope, Sloc_Value => Sloc (Comp_Typ), Id_Char => 'Z'); @@ -3443,10 +3781,6 @@ package body Sem_Ch10 is Decorate_Tagged_Type (Sloc (Decl), Lim_Typ, Scope); Set_Non_Limited_View (Lim_Typ, Comp_Typ); - - -- Add the entities to the proper list - - Append_Elmt (Comp_Typ, To => Non_Limited_Views (P)); Append_Elmt (Lim_Typ, To => Limited_Views (P)); elsif Nkind (Decl) = N_Package_Declaration then @@ -3464,9 +3798,8 @@ package body Sem_Ch10 is Set_Scope (Comp_Typ, Scope); end if; - Lim_Typ := New_Internal_Entity + Lim_Typ := New_Internal_Shadow_Entity (Kind => Ekind (Comp_Typ), - Scope_Id => Scope, Sloc_Value => Sloc (Comp_Typ), Id_Char => 'Z'); @@ -3480,8 +3813,6 @@ package body Sem_Ch10 is -- Note: The non_limited_view attribute is not used -- for local packages. - -- Add the entities to the proper list. - Append_Elmt (Comp_Typ, To => Non_Limited_Views (P)); Append_Elmt (Lim_Typ, To => Limited_Views (P)); Build_Chain (Spec, Scope => Lim_Typ); @@ -3497,14 +3828,45 @@ package body Sem_Ch10 is begin pragma Assert (Limited_Present (N)); - -- Limited withed subprograms are not allowed. Therefore, we - -- don't need to build the limited-view auxiliary chain. + -- A library_item mentioned in a limited_with_clause shall be + -- a package_declaration, not a subprogram_declaration, + -- generic_declaration, generic_instantiation, or + -- package_renaming_declaration - if Nkind (Parent (P)) = N_Function_Specification - or else Nkind (Parent (P)) = N_Procedure_Specification - then - return; - end if; + case Nkind (Unit (Library_Unit (N))) is + + when N_Package_Declaration => + null; + + when N_Subprogram_Declaration => + Error_Msg_N ("subprograms not allowed in " + & "limited with_clauses", N); + return; + + when N_Generic_Package_Declaration | + N_Generic_Subprogram_Declaration => + Error_Msg_N ("generics not allowed in " + & "limited with_clauses", N); + return; + + when N_Package_Instantiation | + N_Function_Instantiation | + N_Procedure_Instantiation => + Error_Msg_N ("generic instantiations not allowed in " + & "limited with_clauses", N); + return; + + when N_Generic_Package_Renaming_Declaration | + N_Generic_Procedure_Renaming_Declaration | + N_Generic_Function_Renaming_Declaration => + Error_Msg_N ("generic renamings not allowed in " + & "limited with_clauses", N); + return; + + when others => + pragma Assert (False); + null; + end case; -- Check if the chain is already built @@ -3516,7 +3878,6 @@ package body Sem_Ch10 is Set_Ekind (P, E_Package); Set_Limited_Views (P, New_Elmt_List); - Set_Non_Limited_Views (P, New_Elmt_List); -- Set_Entity (Name (N), P); -- Create the auxiliary chain @@ -3650,11 +4011,33 @@ package body Sem_Ch10 is Unit_Name : Entity_Id; begin + -- Ada0Y (AI-50217): We remove the context clauses in two phases: + -- limited-views first and regular-views later (to maintain the + -- stack model). - -- Loop through context items and undo with_clauses and use_clauses. + -- First Phase: Remove limited_with context clauses Item := First (Context_Items (N)); + while Present (Item) loop + + -- We are interested only in with clauses which got installed + -- on entry. + + if Nkind (Item) = N_With_Clause + and then Limited_Present (Item) + and then Limited_View_Installed (Item) + then + Remove_Limited_With_Clause (Item); + + end if; + + Next (Item); + end loop; + -- Second Phase: Loop through context items and undo regular + -- with_clauses and use_clauses. + + Item := First (Context_Items (N)); while Present (Item) loop -- We are interested only in with clauses which got installed @@ -3664,7 +4047,7 @@ package body Sem_Ch10 is and then Limited_Present (Item) and then Limited_View_Installed (Item) then - Remove_Limited_With_Clause (Item); + null; elsif Nkind (Item) = N_With_Clause and then Context_Installed (Item) @@ -3687,7 +4070,6 @@ package body Sem_Ch10 is Next (Item); end loop; - end Remove_Context_Clauses; -------------------------------- @@ -3697,7 +4079,6 @@ package body Sem_Ch10 is procedure Remove_Limited_With_Clause (N : Node_Id) is P_Unit : Entity_Id := Unit (Library_Unit (N)); P : Entity_Id := Defining_Unit_Name (Specification (P_Unit)); - Lim_Elmt : Elmt_Id; Lim_Typ : Entity_Id; @@ -3709,6 +4090,13 @@ package body Sem_Ch10 is P := Defining_Identifier (P); end if; + if Debug_Flag_I then + Write_Str ("remove limited view of "); + Write_Name (Chars (P)); + Write_Str (" from visibility"); + Write_Eol; + end if; + -- Remove all shadow entities from visibility Lim_Elmt := First_Elmt (Limited_Views (P)); @@ -3720,6 +4108,11 @@ package body Sem_Ch10 is Next_Elmt (Lim_Elmt); end loop; + -- Indicate that the limited view of the package is not installed + + Set_From_With_Type (P, False); + Set_Limited_View_Installed (N, False); + -- If the exporting package has previously been analyzed, it -- has appeared in the closure already and should be left alone. -- Otherwise, remove package itself from visibility. @@ -3731,9 +4124,40 @@ package body Sem_Ch10 is Set_Ekind (P, E_Void); Set_Scope (P, Empty); Set_Is_Immediately_Visible (P, False); - end if; - Set_Limited_View_Installed (N, False); + else + + -- Reinstall visible entities (entities removed from visibility in + -- Install_Limited_Withed to install the shadow entities). + + declare + Ent : Entity_Id; + + begin + Ent := First_Entity (P); + while Present (Ent) and then Ent /= First_Private_Entity (P) loop + + -- Shadow entities have not been added to the list of + -- entities associated to the package spec. Therefore we + -- just have to re-chain all its visible entities. + + if not Is_Class_Wide_Type (Ent) then + + Set_Homonym (Ent, Current_Entity (Ent)); + Set_Current_Entity (Ent); + + if Debug_Flag_I then + Write_Str (" (homonym) chain "); + Write_Name (Chars (Ent)); + Write_Eol; + end if; + + end if; + + Next_Entity (Ent); + end loop; + end; + end if; end Remove_Limited_With_Clause; -------------------- @@ -3819,6 +4243,8 @@ package body Sem_Ch10 is end if; end Unchain; + -- Start of Remove_With_Type_Clause + begin if Nkind (Name) = N_Selected_Component then Typ := Entity (Selector_Name (Name)); @@ -3882,8 +4308,9 @@ package body Sem_Ch10 is begin if Debug_Flag_I then - Write_Str ("remove withed unit "); + Write_Str ("remove unit "); Write_Name (Chars (Unit_Name)); + Write_Str (" from visibility"); Write_Eol; end if; @@ -3923,5 +4350,12 @@ package body Sem_Ch10 is Set_Homonym (Prev, Homonym (E)); end if; end if; + + if Debug_Flag_I then + Write_Str (" (homonym) unchain "); + Write_Name (Chars (E)); + Write_Eol; + end if; + end Unchain; end Sem_Ch10; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 60dbbe595c3..1676ee85491 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -543,22 +543,22 @@ package body Sem_Ch12 is -- those nodes that contain global information. At instantiation, the -- information from the associated node is placed on the new copy, so -- that name resolution is not repeated. - + -- -- Three kinds of source nodes have associated nodes: - + -- -- a) those that can reference (denote) entities, that is identifiers, -- character literals, expanded_names, operator symbols, operators, -- and attribute reference nodes. These nodes have an Entity field -- and are the set of nodes that are in N_Has_Entity. - + -- -- b) aggregates (N_Aggregate and N_Extension_Aggregate) - + -- -- c) selected components (N_Selected_Component) - + -- -- For the first class, the associated node preserves the entity if it is - -- global. If the generic contains nested instantiations, the associated_ + -- global. If the generic contains nested instantiations, the associated -- node itself has been recopied, and a chain of them must be followed. - + -- -- For aggregates, the associated node allows retrieval of the type, which -- may otherwise not appear in the generic. The view of this type may be -- different between generic and instantiation, and the full view can be @@ -566,14 +566,14 @@ package body Sem_Ch12 is -- type extensions, the same view exchange may have to be performed for -- some of the ancestor types, if their view is private at the point of -- instantiation. - + -- -- Nodes that are selected components in the parse tree may be rewritten -- as expanded names after resolution, and must be treated as potential -- entity holders. which is why they also have an Associated_Node. - + -- -- Nodes that do not come from source, such as freeze nodes, do not appear -- in the generic tree, and need not have an associated node. - + -- -- The associated node is stored in the Associated_Node field. Note that -- this field overlaps Entity, which is fine, because the whole point is -- that we don't need or want the normal Entity field in this situation. @@ -757,9 +757,11 @@ package body Sem_Ch12 is F_Copy : List_Id) return List_Id is - Actual_Types : constant Elist_Id := New_Elmt_List; - Assoc : constant List_Id := New_List; - Defaults : constant Elist_Id := New_Elmt_List; + Actual_Types : constant Elist_Id := New_Elmt_List; + Assoc : constant List_Id := New_List; + Defaults : constant Elist_Id := New_Elmt_List; + Gen_Unit : constant Entity_Id := Defining_Entity + (Parent (F_Copy)); Actuals : List_Id; Actual : Node_Id; Formal : Node_Id; @@ -985,8 +987,12 @@ package body Sem_Ch12 is Defining_Identifier (Analyzed_Formal)); if No (Match) then - Error_Msg_NE ("missing actual for instantiation of &", - Instantiation_Node, Defining_Identifier (Formal)); + Error_Msg_Sloc := Sloc (Gen_Unit); + Error_Msg_NE + ("missing actual&", + Instantiation_Node, Defining_Identifier (Formal)); + Error_Msg_NE ("\in instantiation of & declared#", + Instantiation_Node, Gen_Unit); Abandon_Instantiation (Instantiation_Node); else @@ -1070,10 +1076,12 @@ package body Sem_Ch12 is Defining_Identifier (Original_Node (Analyzed_Formal))); if No (Match) then + Error_Msg_Sloc := Sloc (Gen_Unit); Error_Msg_NE - ("missing actual for instantiation of&", - Instantiation_Node, - Defining_Identifier (Formal)); + ("missing actual&", + Instantiation_Node, Defining_Identifier (Formal)); + Error_Msg_NE ("\in instantiation of & declared#", + Instantiation_Node, Gen_Unit); Abandon_Instantiation (Instantiation_Node); @@ -1105,8 +1113,19 @@ package body Sem_Ch12 is end loop; if Num_Actuals > Num_Matched then - Error_Msg_N - ("unmatched actuals in instantiation", Instantiation_Node); + Error_Msg_Sloc := Sloc (Gen_Unit); + + if Present (Selector_Name (Actual)) then + Error_Msg_NE + ("unmatched actual&", + Actual, Selector_Name (Actual)); + Error_Msg_NE ("\in instantiation of& declared#", + Actual, Gen_Unit); + else + Error_Msg_NE + ("unmatched actual in instantiation of& declared#", + Actual, Gen_Unit); + end if; end if; elsif Present (Actuals) then @@ -1447,7 +1466,10 @@ package body Sem_Ch12 is end if; if K = E_Generic_In_Parameter then - if Is_Limited_Type (T) then + + -- Ada0Y (AI-287): Limited aggregates allowed in generic formals + + if not Extensions_Allowed and then Is_Limited_Type (T) then Error_Msg_N ("generic formal of mode IN must not be of limited type", N); Explain_Limited_Type (T, N); @@ -2332,8 +2354,17 @@ package body Sem_Ch12 is return; elsif Ekind (Gen_Unit) /= E_Generic_Package then - Error_Msg_N - ("expect name of generic package in instantiation", Gen_Id); + + -- Ada0Y (AI-50217): Instance can not be used in limited with_clause + + if From_With_Type (Gen_Unit) then + Error_Msg_N + ("cannot instantiate a limited withed package", Gen_Id); + else + Error_Msg_N + ("expect name of generic package in instantiation", Gen_Id); + end if; + Restore_Env; return; end if; @@ -2887,7 +2918,7 @@ package body Sem_Ch12 is -- Remove entities in current scopes from visibility, so -- than instance body is compiled in a clean environment. - Save_Scope_Stack; + Save_Scope_Stack (Handle_Use => False); if Is_Child_Unit (S) then @@ -2951,7 +2982,7 @@ package body Sem_Ch12 is end loop; end if; - Restore_Scope_Stack; + Restore_Scope_Stack (Handle_Use => False); end if; -- Restore use clauses. For a child unit, use clauses in the @@ -4634,19 +4665,37 @@ package body Sem_Ch12 is else -- If the associated node is still defined, the entity in -- it is global, and must be copied to the instance. + -- If this copy is being made for a body to inline, it is + -- applied to an instantiated tree, and the entity is already + -- present and must be also preserved. - if Present (Get_Associated_Node (N)) then - if Nkind (Get_Associated_Node (N)) = Nkind (N) then - Set_Entity (New_N, Entity (Get_Associated_Node (N))); - Check_Private_View (N); + declare + Assoc : constant Node_Id := Get_Associated_Node (N); + begin + if Present (Assoc) then + if Nkind (Assoc) = Nkind (N) then + Set_Entity (New_N, Entity (Assoc)); + Check_Private_View (N); + + elsif Nkind (Assoc) = N_Function_Call then + Set_Entity (New_N, Entity (Name (Assoc))); + + elsif (Nkind (Assoc) = N_Defining_Identifier + or else Nkind (Assoc) = N_Defining_Character_Literal + or else Nkind (Assoc) = N_Defining_Operator_Symbol) + and then Expander_Active + then + -- Inlining case: we are copying a tree that contains + -- global entities, which are preserved in the copy + -- to be used for subsequent inlining. - elsif Nkind (Get_Associated_Node (N)) = N_Function_Call then - Set_Entity (New_N, Entity (Name (Get_Associated_Node (N)))); + null; - else - Set_Entity (New_N, Empty); + else + Set_Entity (New_N, Empty); + end if; end if; - end if; + end; end if; -- For expanded name, we must copy the Prefix and Selector_Name @@ -5611,6 +5660,8 @@ package body Sem_Ch12 is Generic_Flags.Init; Generic_Renamings_HTable.Reset; Circularity_Detected := False; + Exchanged_Views := No_Elist; + Hidden_Entities := No_Elist; end Initialize; ---------------------------- @@ -6578,9 +6629,12 @@ package body Sem_Ch12 is end if; else + Error_Msg_Sloc := Sloc (Scope (Analyzed_S)); + Error_Msg_NE + ("missing actual&", Instantiation_Node, Formal_Sub); Error_Msg_NE - ("missing actual for instantiation of &", - Instantiation_Node, Formal_Sub); + ("\in instantiation of & declared#", + Instantiation_Node, Scope (Analyzed_S)); Abandon_Instantiation (Instantiation_Node); end if; @@ -6702,6 +6756,9 @@ package body Sem_Ch12 is Subt_Decl : Node_Id := Empty; begin + -- Sloc for error message on missing actual. + Error_Msg_Sloc := Sloc (Scope (Defining_Identifier (Analyzed_Formal))); + if Get_Instance_Of (Formal_Id) /= Formal_Id then Error_Msg_N ("duplicate instantiation of generic parameter", Actual); end if; @@ -6722,8 +6779,12 @@ package body Sem_Ch12 is if No (Actual) then Error_Msg_NE - ("missing actual for instantiation of &", + ("missing actual&", Instantiation_Node, Formal_Id); + Error_Msg_NE + ("\in instantiation of & declared#", + Instantiation_Node, + Scope (Defining_Identifier (Analyzed_Formal))); Abandon_Instantiation (Instantiation_Node); end if; @@ -6886,8 +6947,11 @@ package body Sem_Ch12 is else Error_Msg_NE - ("missing actual for instantiation of &", - Instantiation_Node, Formal_Id); + ("missing actual&", + Instantiation_Node, Formal_Id); + Error_Msg_NE ("\in instantiation of & declared#", + Instantiation_Node, + Scope (Defining_Identifier (Analyzed_Formal))); if Is_Scalar_Type (Etype (Defining_Identifier (Analyzed_Formal))) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 83b209570ed..ca7ca0fb6c8 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1881,7 +1881,7 @@ package body Sem_Ch13 is Biased : Boolean; Max_Bit_So_Far : Uint; - -- Records the maximum bit position so far. If all field positoins + -- Records the maximum bit position so far. If all field positions -- are monotonically increasing, then we can skip the circuit for -- checking for overlap, since no overlap is possible. @@ -2153,33 +2153,9 @@ package body Sem_Ch13 is CC, Rectype); end if; - -- Test for large object that is not on a storage unit - -- boundary, defined as a large packed array not - -- represented by a modular type, or an object for - -- which a size of greater than 64 bits is specified. - - if Fbit mod SSU /= 0 then - if (Is_Packed_Array_Type (Etype (Comp)) - and then Is_Array_Type - (Packed_Array_Type (Etype (Comp)))) - or else Esize (Etype (Comp)) > Max_Unaligned_Field - then - if SSU = 8 then - Error_Msg_N - ("large component must be on byte boundary", - First_Bit (CC)); - else - Error_Msg_N - ("large component must be on word boundary", - First_Bit (CC)); - end if; - end if; - 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. + -- 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. Ocomp := Original_Record_Component (Comp); @@ -2602,6 +2578,9 @@ package body Sem_Ch13 is -------------------------- procedure Check_Expr_Constants (Nod : Node_Id) is + Loc_U_Ent : constant Source_Ptr := Sloc (U_Ent); + Ent : Entity_Id := Empty; + begin if Nkind (Nod) in N_Has_Etype and then Etype (Nod) = Any_Type @@ -2614,6 +2593,7 @@ package body Sem_Ch13 is return; when N_Identifier | N_Expanded_Name => + Ent := Entity (Nod); -- We need to look at the original node if it is different -- from the node, since we may have rewritten things and @@ -2627,85 +2607,92 @@ package body Sem_Ch13 is -- is not constant, even if the constituents might be -- acceptable, as in A'Address + offset. - if Ekind (Entity (Nod)) = E_Variable - and then Nkind (Declaration_Node (Entity (Nod))) + if Ekind (Ent) = E_Variable + and then Nkind (Declaration_Node (Ent)) = N_Object_Declaration and then - No (Expression (Declaration_Node (Entity (Nod)))) + No (Expression (Declaration_Node (Ent))) + then + Error_Msg_NE + ("invalid address clause for initialized object &!", + Nod, U_Ent); + + -- If entity is constant, it may be the result of expanding + -- a check. We must verify that its declaration appears + -- before the object in question, else we also reject the + -- address clause. + + elsif Ekind (Ent) = E_Constant + and then In_Same_Source_Unit (Ent, U_Ent) + and then Sloc (Ent) > Loc_U_Ent then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); end if; + return; end if; -- Otherwise look at the identifier and see if it is OK. - declare - Ent : constant Entity_Id := Entity (Nod); - Loc_Ent : constant Source_Ptr := Sloc (Ent); - Loc_U_Ent : constant Source_Ptr := Sloc (U_Ent); - - begin - if Ekind (Ent) = E_Named_Integer - or else - Ekind (Ent) = E_Named_Real - or else - Is_Type (Ent) - then - return; - - elsif - Ekind (Ent) = E_Constant - or else - Ekind (Ent) = E_In_Parameter - then - -- This is the case where we must have Ent defined - -- before U_Ent. Clearly if they are in different - -- units this requirement is met since the unit - -- containing Ent is already processed. - - if not In_Same_Source_Unit (Ent, U_Ent) then - return; + if Ekind (Ent) = E_Named_Integer + or else + Ekind (Ent) = E_Named_Real + or else + Is_Type (Ent) + then + return; - -- Otherwise location of Ent must be before the - -- location of U_Ent, that's what prior defined means. + elsif + Ekind (Ent) = E_Constant + or else + Ekind (Ent) = E_In_Parameter + then + -- This is the case where we must have Ent defined + -- before U_Ent. Clearly if they are in different + -- units this requirement is met since the unit + -- containing Ent is already processed. - elsif Loc_Ent < Loc_U_Ent then - return; + if not In_Same_Source_Unit (Ent, U_Ent) then + return; - else - Error_Msg_NE - ("invalid address clause for initialized object &!", - Nod, U_Ent); - Error_Msg_Name_1 := Chars (Ent); - Error_Msg_Name_2 := Chars (U_Ent); - Error_Msg_N - ("\% must be defined before % ('R'M 13.1(22))!", - Nod); - end if; + -- Otherwise location of Ent must be before the + -- location of U_Ent, that's what prior defined means. - elsif Nkind (Original_Node (Nod)) = N_Function_Call then - Check_Expr_Constants (Original_Node (Nod)); + elsif Sloc (Ent) < Loc_U_Ent then + return; else Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); + Error_Msg_Name_1 := Chars (Ent); + Error_Msg_Name_2 := Chars (U_Ent); + Error_Msg_N + ("\% must be defined before % ('R'M 13.1(22))!", + Nod); + end if; - if Comes_From_Source (Ent) then - Error_Msg_Name_1 := Chars (Ent); - Error_Msg_N - ("\reference to variable% not allowed" - & " ('R'M 13.1(22))!", Nod); - else - Error_Msg_N - ("non-static expression not allowed" - & " ('R'M 13.1(22))!", Nod); - end if; + elsif Nkind (Original_Node (Nod)) = N_Function_Call then + Check_Expr_Constants (Original_Node (Nod)); + + else + Error_Msg_NE + ("invalid address clause for initialized object &!", + Nod, U_Ent); + + if Comes_From_Source (Ent) then + Error_Msg_Name_1 := Chars (Ent); + Error_Msg_N + ("\reference to variable% not allowed" + & " ('R'M 13.1(22))!", Nod); + else + Error_Msg_N + ("non-static expression not allowed" + & " ('R'M 13.1(22))!", Nod); end if; - end; + end if; when N_Integer_Literal | N_Real_Literal | @@ -2860,21 +2847,70 @@ package body Sem_Ch13 is begin Biased := False; - -- Immediate return if size is same as standard size or if composite - -- item, or generic type, or type with previous errors. + -- Dismiss cases for generic types or types with previous errors if No (UT) or else UT = Any_Type or else Is_Generic_Type (UT) or else Is_Generic_Type (Root_Type (UT)) - or else Is_Composite_Type (UT) - or else (Known_Esize (UT) and then Siz = Esize (UT)) then return; + -- Check case of bit packed array + + elsif Is_Array_Type (UT) + and then Known_Static_Component_Size (UT) + and then Is_Bit_Packed_Array (UT) + then + declare + Asiz : Uint; + Indx : Node_Id; + Ityp : Entity_Id; + + begin + Asiz := Component_Size (UT); + Indx := First_Index (UT); + loop + Ityp := Etype (Indx); + + -- If non-static bound, then we are not in the business of + -- trying to check the length, and indeed an error will be + -- issued elsewhere, since sizes of non-static array types + -- cannot be set implicitly or explicitly. + + if not Is_Static_Subtype (Ityp) then + return; + end if; + + -- Otherwise accumulate next dimension + + Asiz := Asiz * (Expr_Value (Type_High_Bound (Ityp)) - + Expr_Value (Type_Low_Bound (Ityp)) + + Uint_1); + + Next_Index (Indx); + exit when No (Indx); + end loop; + + if Asiz <= Siz then + return; + else + Error_Msg_Uint_1 := Asiz; + Error_Msg_NE + ("size for& too small, minimum allowed is ^", N, T); + Set_Esize (T, Asiz); + Set_RM_Size (T, Asiz); + end if; + end; + + -- All other composite types are ignored + + elsif Is_Composite_Type (UT) then + return; + -- For fixed-point types, don't check minimum if type is not frozen, - -- since type is not known till then - -- at freeze time. + -- since we don't know all the characteristics of the type that can + -- affect the size (e.g. a specified small) till freeze time. elsif Is_Fixed_Point_Type (UT) and then not Is_Frozen (UT) @@ -2884,6 +2920,14 @@ package body Sem_Ch13 is -- Cases for which a minimum check is required else + -- Ignore if specified size is correct for the type + + if Known_Esize (UT) and then Siz = Esize (UT) then + return; + end if; + + -- Otherwise get minimum size + M := UI_From_Int (Minimum_Size (UT)); if Siz < M then @@ -2897,6 +2941,8 @@ package body Sem_Ch13 is Error_Msg_Uint_1 := M; Error_Msg_NE ("size for& too small, minimum allowed is ^", N, T); + Set_Esize (T, M); + Set_RM_Size (T, M); else Biased := True; end if; diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 2f520cd5e3a..3abdffb8073 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -79,14 +79,17 @@ package Sem_Ch13 is Biased : out Boolean); -- Called when size Siz is specified for subtype T. This subprogram checks -- that the size is appropriate, posting errors on node N as required. - -- For non-elementary types, a check is only made if an explicit size - -- has been given for the type (and the specified size must match). The - -- parameter Biased is set False if the size specified did not require + -- This check is effective for elementary types and bit-packed arrays. + -- For other non-elementary types, a check is only made if an explicit + -- size has been given for the type (and the specified size must match). + -- The parameter Biased is set False if the size specified did not require -- the use of biased representation, and True if biased representation -- was required to meet the size requirement. Note that Biased is only -- set if the type is not currently biased, but biasing it is the only -- way to meet the requirement. If the type is currently biased, then -- this biased size is used in the initial check, and Biased is False. + -- If the size is too small, and an error message is given, then both + -- Esize and RM_Size are reset to the allowed minimum value in T. procedure Record_Rep_Item (T : Entity_Id; N : Node_Id); -- N is the node for either a representation pragma or an attribute diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 839081dbbfd..93593cfaee0 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -548,9 +548,9 @@ package body Sem_Ch3 is -- Create new modular type. Verify that modulus is in bounds and is -- a power of two (implementation restriction). - procedure New_Binary_Operator (Op_Name : Name_Id; Typ : Entity_Id); + procedure New_Concatenation_Op (Typ : Entity_Id); -- Create an abbreviated declaration for an operator in order to - -- materialize minimally operators on derived types. + -- materialize concatenation on array types. procedure Ordinary_Fixed_Point_Type_Declaration (T : Entity_Id; @@ -690,6 +690,10 @@ package body Sem_Ch3 is -- if the designated type is. Set_Is_Public (Anon_Type, Is_Public (Scope (Anon_Type))); + + -- Ada0Y (AI-50217): Propagate the attribute that indicates that the + -- designated type comes from the limited view (for back-end purposes). + Set_From_With_Type (Anon_Type, From_With_Type (Desig_Type)); -- The context is either a subprogram declaration or an access @@ -857,9 +861,9 @@ package body Sem_Ch3 is -- access type is also imported, and therefore restricted in its use. -- The access type may already be imported, so keep setting otherwise. - -- If the non-limited view of the designated type is available, use - -- it as the designated type of the access type, so that the back-end - -- gets a usable entity. + -- Ada0Y (AI-50217): If the non-limited view of the designated type is + -- available, use it as the designated type of the access type, so that + -- the back-end gets a usable entity. if From_With_Type (Desig) then Set_From_With_Type (T); @@ -2448,9 +2452,11 @@ package body Sem_Ch3 is begin Prev := Find_Type_Name (N); - -- The full view, if present, now points to the current type. If the - -- type was previously decorated when imported through a LIMITED WITH - -- clause, it appears as incomplete but has no full view. + -- The full view, if present, now points to the current type + + -- Ada0Y (AI-50217): If the type was previously decorated when imported + -- through a LIMITED WITH clause, it appears as incomplete but has no + -- full view. if Ekind (Prev) = E_Incomplete_Type and then Present (Full_View (Prev)) @@ -2859,7 +2865,7 @@ package body Sem_Ch3 is if Number_Dimensions (T) = 1 and then not Is_Packed_Array_Type (T) then - New_Binary_Operator (Name_Op_Concat, T); + New_Concatenation_Op (T); end if; -- In the case of an unconstrained array the parser has already @@ -3055,14 +3061,21 @@ package body Sem_Ch3 is -- declared in a closed scope (e.g., a subprogram), then we -- need to explicitly introduce the new type's concatenation -- operator since Derive_Subprograms will not inherit the - -- parent's operator. + -- parent's operator. If the parent type is unconstrained, the + -- operator is of the unconstrained base type. if Number_Dimensions (Parent_Type) = 1 and then not Is_Limited_Type (Parent_Type) and then not Is_Derived_Type (Parent_Type) and then not Is_Package (Scope (Base_Type (Parent_Type))) then - New_Binary_Operator (Name_Op_Concat, Derived_Type); + if not Is_Constrained (Parent_Type) + and then Is_Constrained (Derived_Type) + then + New_Concatenation_Op (Implicit_Base); + else + New_Concatenation_Op (Derived_Type); + end if; end if; end Build_Derived_Array_Type; @@ -6233,10 +6246,21 @@ package body Sem_Ch3 is if (Is_Limited_Type (T) or else Is_Limited_Composite (T)) and then not In_Instance + and then not In_Inlined_Body then - Error_Msg_N - ("cannot initialize entities of limited type", Exp); - Explain_Limited_Type (T, Exp); + -- Ada0Y (AI-287): Relax the strictness of the front-end in case of + -- limited aggregates and extension aggregates. + + if Extensions_Allowed + and then (Nkind (Exp) = N_Aggregate + or else Nkind (Exp) = N_Extension_Aggregate) + then + null; + else + Error_Msg_N + ("cannot initialize entities of limited type", Exp); + Explain_Limited_Type (T, Exp); + end if; end if; end Check_Initialization; @@ -7691,8 +7715,8 @@ package body Sem_Ch3 is if not Error_Posted (S) and then (Nkind (S) /= N_Range - or else Base_Type (T) /= Base_Type (Etype (Low_Bound (S))) - or else Base_Type (T) /= Base_Type (Etype (High_Bound (S)))) + or else not Covers (T, (Etype (Low_Bound (S)))) + or else not Covers (T, (Etype (High_Bound (S))))) then if Base_Type (T) /= Any_Type and then Etype (Low_Bound (S)) /= Any_Type @@ -8415,18 +8439,6 @@ package body Sem_Ch3 is Init_Size_Align (Implicit_Base); - -- Complete entity for first subtype - - Set_Ekind (T, E_Decimal_Fixed_Point_Subtype); - Set_Etype (T, Implicit_Base); - Set_Size_Info (T, Implicit_Base); - Set_First_Rep_Item (T, First_Rep_Item (Implicit_Base)); - Set_Digits_Value (T, Digs_Val); - Set_Delta_Value (T, Delta_Val); - Set_Small_Value (T, Delta_Val); - Set_Scale_Value (T, Scale_Val); - Set_Is_Constrained (T); - -- If there are bounds given in the declaration use them as the -- bounds of the first named subtype. @@ -8469,6 +8481,17 @@ package body Sem_Ch3 is Set_Fixed_Range (T, Loc, -Bound_Val, Bound_Val); end if; + -- Complete entity for first subtype + + Set_Ekind (T, E_Decimal_Fixed_Point_Subtype); + Set_Etype (T, Implicit_Base); + Set_Size_Info (T, Implicit_Base); + Set_First_Rep_Item (T, First_Rep_Item (Implicit_Base)); + Set_Digits_Value (T, Digs_Val); + Set_Delta_Value (T, Delta_Val); + Set_Small_Value (T, Delta_Val); + Set_Scale_Value (T, Scale_Val); + Set_Is_Constrained (T); end Decimal_Fixed_Point_Type_Declaration; ----------------------- @@ -10929,11 +10952,11 @@ package body Sem_Ch3 is end Modular_Type_Declaration; - ------------------------- - -- New_Binary_Operator -- - ------------------------- + -------------------------- + -- New_Concatenation_Op -- + -------------------------- - procedure New_Binary_Operator (Op_Name : Name_Id; Typ : Entity_Id) is + procedure New_Concatenation_Op (Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (Typ); Op : Entity_Id; @@ -10955,26 +10978,26 @@ package body Sem_Ch3 is return Formal; end Make_Op_Formal; - -- Start of processing for New_Binary_Operator + -- Start of processing for New_Concatenation_Op begin - Op := Make_Defining_Operator_Symbol (Loc, Op_Name); + Op := Make_Defining_Operator_Symbol (Loc, Name_Op_Concat); Set_Ekind (Op, E_Operator); Set_Scope (Op, Current_Scope); Set_Etype (Op, Typ); - Set_Homonym (Op, Get_Name_Entity_Id (Op_Name)); + Set_Homonym (Op, Get_Name_Entity_Id (Name_Op_Concat)); Set_Is_Immediately_Visible (Op); Set_Is_Intrinsic_Subprogram (Op); Set_Has_Completion (Op); Append_Entity (Op, Current_Scope); - Set_Name_Entity_Id (Op_Name, Op); + Set_Name_Entity_Id (Name_Op_Concat, Op); Append_Entity (Make_Op_Formal (Typ, Op), Op); Append_Entity (Make_Op_Formal (Typ, Op), Op); - end New_Binary_Operator; + end New_Concatenation_Op; ------------------------------------------- -- Ordinary_Fixed_Point_Type_Declaration -- diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 81c4e2ab22e..e122af79423 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -342,8 +342,18 @@ package body Sem_Ch4 is and then Comes_From_Source (N) and then not In_Instance_Body then - Error_Msg_N ("initialization not allowed for limited types", N); - Explain_Limited_Type (Type_Id, N); + -- Ada0Y (AI-287): Do not post an error if the expression corres- + -- ponds to a limited aggregate. Limited aggregates are checked in + -- sem_aggr in a per-component manner (cf. Get_Value subprogram). + + if Extensions_Allowed + and then Nkind (Expression (E)) = N_Aggregate + then + null; + else + Error_Msg_N ("initialization not allowed for limited types", N); + Explain_Limited_Type (Type_Id, N); + end if; end if; Analyze_And_Resolve (Expression (E), Type_Id); @@ -3436,6 +3446,9 @@ package body Sem_Ch4 is Actual := First_Actual (N); while Present (Actual) loop + -- Ada0Y (AI-50217): Post an error in case of premature usage of + -- an entity from the limited view. + if not Analyzed (Etype (Actual)) and then From_With_Type (Etype (Actual)) then diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 227bb140446..ecb00348fa0 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -33,6 +33,7 @@ with Exp_Util; use Exp_Util; with Freeze; use Freeze; with Lib.Xref; use Lib.Xref; with Nlists; use Nlists; +with Nmake; use Nmake; with Opt; use Opt; with Sem; use Sem; with Sem_Case; use Sem_Case; @@ -114,11 +115,9 @@ package body Sem_Ch5 is -- Some special bad cases of entity names elsif Is_Entity_Name (N) then - if Ekind (Entity (N)) = E_In_Parameter then Error_Msg_N ("assignment to IN mode parameter not allowed", N); - return; -- Private declarations in a protected object are turned into -- constants when compiling a protected function. @@ -132,27 +131,38 @@ package body Sem_Ch5 is then Error_Msg_N ("protected function cannot modify protected object", N); - return; elsif Ekind (Entity (N)) = E_Loop_Parameter then Error_Msg_N ("assignment to loop parameter not allowed", N); - return; + else + Error_Msg_N + ("left hand side of assignment must be a variable", N); end if; - -- For indexed components, or selected components, test prefix + -- For indexed components or selected components, test prefix - elsif Nkind (N) = N_Indexed_Component - or else Nkind (N) = N_Selected_Component - then + elsif Nkind (N) = N_Indexed_Component then Diagnose_Non_Variable_Lhs (Prefix (N)); - return; - end if; - -- If we fall through, we have no special message to issue! + -- Another special case for assignment to discriminant. + + elsif Nkind (N) = N_Selected_Component then + if Present (Entity (Selector_Name (N))) + and then Ekind (Entity (Selector_Name (N))) = E_Discriminant + then + Error_Msg_N + ("assignment to discriminant not allowed", N); + else + Diagnose_Non_Variable_Lhs (Prefix (N)); + end if; + + else + -- If we fall through, we have no special message to issue! - Error_Msg_N ("left hand side of assignment must be a variable", N); + Error_Msg_N ("left hand side of assignment must be a variable", N); + end if; end Diagnose_Non_Variable_Lhs; ------------------------- @@ -395,7 +405,6 @@ package body Sem_Ch5 is (Nkind (Rhs) /= N_Type_Conversion or else Is_Constrained (Etype (Rhs))) then - -- Assignment verifies that the length of the Lsh and Rhs are equal, -- but of course the indices do not have to match. If the right-hand -- side is a type conversion to an unconstrained type, a length check @@ -596,7 +605,7 @@ package body Sem_Ch5 is Process_Non_Static_Choice => Non_Static_Choice_Error, Process_Associated_Node => Process_Statements); use Case_Choices_Processing; - -- Instantiation of the generic choice processing package. + -- Instantiation of the generic choice processing package ----------------------------- -- Non_Static_Choice_Error -- @@ -667,11 +676,10 @@ package body Sem_Ch5 is return; end if; - -- If the case expression is a formal object of mode in out, - -- then treat it as having a nonstatic subtype by forcing - -- use of the base type (which has to get passed to - -- Check_Case_Choices below). Also use base type when - -- the case expression is parenthesized. + -- If the case expression is a formal object of mode in out, then + -- treat it as having a nonstatic subtype by forcing use of the base + -- type (which has to get passed to Check_Case_Choices below). Also + -- use base type when the case expression is parenthesized. if Paren_Count (Exp) > 0 or else (Is_Entity_Name (Exp) @@ -680,7 +688,7 @@ package body Sem_Ch5 is Exp_Type := Exp_Btype; end if; - -- Call the instantiated Analyze_Choices which does the rest of the work + -- Call instantiated Analyze_Choices which does the rest of the work Analyze_Choices (N, Exp_Type, Case_Table, Last_Choice, Dont_Care, Others_Present); @@ -777,7 +785,7 @@ package body Sem_Ch5 is end if; end loop; - -- Verify that if present the condition is a Boolean expression. + -- Verify that if present the condition is a Boolean expression if Present (Cond) then Analyze_And_Resolve (Cond, Any_Boolean); @@ -990,7 +998,6 @@ package body Sem_Ch5 is procedure Analyze_Implicit_Label_Declaration (N : Node_Id) is Id : constant Node_Id := Defining_Identifier (N); - begin Enter_Name (Id); Set_Ekind (Id, E_Label); @@ -1003,6 +1010,62 @@ package body Sem_Ch5 is ------------------------------ procedure Analyze_Iteration_Scheme (N : Node_Id) is + procedure Check_Controlled_Array_Attribute (DS : Node_Id); + -- If the bounds are given by a 'Range reference on a function call + -- that returns a controlled array, introduce an explicit declaration + -- to capture the bounds, so that the function result can be finalized + -- in timely fashion. + + -------------------------------------- + -- Check_Controlled_Array_Attribute -- + -------------------------------------- + + procedure Check_Controlled_Array_Attribute (DS : Node_Id) is + begin + if Nkind (DS) = N_Attribute_Reference + and then Is_Entity_Name (Prefix (DS)) + and then Ekind (Entity (Prefix (DS))) = E_Function + and then Is_Array_Type (Etype (Entity (Prefix (DS)))) + and then + Is_Controlled ( + Component_Type (Etype (Entity (Prefix (DS))))) + and then Expander_Active + then + declare + Loc : constant Source_Ptr := Sloc (N); + Arr : constant Entity_Id := + Etype (Entity (Prefix (DS))); + Indx : constant Entity_Id := + Base_Type (Etype (First_Index (Arr))); + Subt : constant Entity_Id := + Make_Defining_Identifier + (Loc, New_Internal_Name ('S')); + Decl : Node_Id; + + begin + Decl := + Make_Subtype_Declaration (Loc, + Defining_Identifier => Subt, + Subtype_Indication => + Make_Subtype_Indication (Loc, + Subtype_Mark => New_Reference_To (Indx, Loc), + Constraint => + Make_Range_Constraint (Loc, + Relocate_Node (DS)))); + Insert_Before (Parent (N), Decl); + Analyze (Decl); + + Rewrite (DS, + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Subt, Loc), + Attribute_Name => Attribute_Name (DS))); + Analyze (DS); + end; + end if; + end Check_Controlled_Array_Attribute; + + -- Start of processing for Analyze_Iteration_Scheme + begin -- For an infinite loop, there is no iteration scheme @@ -1043,7 +1106,6 @@ package body Sem_Ch5 is declare H : constant Entity_Id := Homonym (Id); - begin if Present (H) and then Enclosing_Dynamic_Scope (H) = @@ -1080,6 +1142,7 @@ package body Sem_Ch5 is Set_Etype (DS, Any_Type); end if; + Check_Controlled_Array_Attribute (DS); Make_Index (DS, LP); Set_Ekind (Id, E_Loop_Parameter); @@ -1189,7 +1252,6 @@ package body Sem_Ch5 is procedure Analyze_Label (N : Node_Id) is pragma Warnings (Off, N); - begin Kill_Current_Values; end Analyze_Label; @@ -1270,7 +1332,6 @@ package body Sem_Ch5 is procedure Analyze_Null_Statement (N : Node_Id) is pragma Warnings (Off, N); - begin null; end Analyze_Null_Statement; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 6c9b3990328..d28109b1c54 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -82,11 +82,7 @@ package body Sem_Ch6 is -- Analyze a generic subprogram body. N is the body to be analyzed, -- and Gen_Id is the defining entity Id for the corresponding spec. - function Build_Body_To_Inline - (N : Node_Id; - Subp : Entity_Id; - Orig_Body : Node_Id) - return Boolean; + procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id); -- If a subprogram has pragma Inline and inlining is active, use generic -- machinery to build an unexpanded body for the subprogram. This body is -- subsequenty used for inline expansions at call sites. If subprogram can @@ -132,8 +128,7 @@ package body Sem_Ch6 is function Is_Non_Overriding_Operation (Prev_E : Entity_Id; - New_E : Entity_Id) - return Boolean; + New_E : Entity_Id) return Boolean; -- Enforce the rule given in 12.3(18): a private operation in an instance -- overrides an inherited operation only if the corresponding operation -- was overriding in the generic. This can happen for primitive operations @@ -156,8 +151,7 @@ package body Sem_Ch6 is (T1 : Entity_Id; T2 : Entity_Id; Ctype : Conformance_Type; - Get_Inst : Boolean := False) - return Boolean; + Get_Inst : Boolean := False) return Boolean; -- Check that two formal parameter types conform, checking both -- for equality of base types, and where required statically -- matching subtypes, depending on the setting of Ctype. @@ -1142,9 +1136,7 @@ package body Sem_Ch6 is (Front_End_Inlining or else Configurable_Run_Time_Mode))) then - if Build_Body_To_Inline (N, Spec_Id, Copy_Separate_Tree (N)) then - null; - end if; + Build_Body_To_Inline (N, Spec_Id); end if; -- Now we can go on to analyze the body @@ -1492,12 +1484,7 @@ package body Sem_Ch6 is -- Build_Body_To_Inline -- -------------------------- - function Build_Body_To_Inline - (N : Node_Id; - Subp : Entity_Id; - Orig_Body : Node_Id) - return Boolean - is + procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id) is Decl : constant Node_Id := Unit_Declaration_Node (Subp); Original_Body : Node_Id; Body_To_Analyze : Node_Id; @@ -1732,7 +1719,7 @@ package body Sem_Ch6 is if Nkind (Decl) = N_Subprogram_Declaration and then Present (Body_To_Inline (Decl)) then - return True; -- Done already. + return; -- Done already. -- Functions that return unconstrained composite types will require -- secondary stack handling, and cannot currently be inlined. @@ -1744,64 +1731,13 @@ package body Sem_Ch6 is then Cannot_Inline ("cannot inline & (unconstrained return type)?", N, Subp); - return False; - end if; - - -- We need to capture references to the formals in order to substitute - -- the actuals at the point of inlining, i.e. instantiation. To treat - -- the formals as globals to the body to inline, we nest it within - -- a dummy parameterless subprogram, declared within the real one. - - Original_Body := Orig_Body; - - -- Within an instance, the current tree is already the result of - -- a generic copy, and not what we need for subsequent inlining. - -- We create the required body by doing an instantiating copy, to - -- obtain the proper partially analyzed tree. - - if In_Instance then - if No (Generic_Parent (Specification (N))) then - return False; - - elsif Is_Child_Unit (Scope (Current_Scope)) then - return False; - - elsif Scope (Current_Scope) = Cunit_Entity (Main_Unit) then - - -- compiling an instantiation. There is no point in generating - -- bodies to inline, because they will not be used. - - return False; - - else - Body_To_Analyze := - Copy_Generic_Node - (Generic_Parent (Specification (N)), Empty, - Instantiating => True); - end if; - - -- Case of not in an instance - - else - Body_To_Analyze := - Copy_Generic_Node (Original_Body, Empty, - Instantiating => False); - end if; - - Set_Parameter_Specifications (Specification (Original_Body), No_List); - Set_Defining_Unit_Name (Specification (Original_Body), - Make_Defining_Identifier (Sloc (N), New_Internal_Name ('S'))); - Set_Corresponding_Spec (Original_Body, Empty); - - if Ekind (Subp) = E_Function then - Set_Subtype_Mark (Specification (Original_Body), - New_Occurrence_Of (Etype (Subp), Sloc (N))); + return; end if; - if Present (Declarations (Orig_Body)) - and then Has_Excluded_Declaration (Declarations (Orig_Body)) + if Present (Declarations (N)) + and then Has_Excluded_Declaration (Declarations (N)) then - return False; + return; end if; if Present (Handled_Statement_Sequence (N)) then @@ -1810,12 +1746,12 @@ package body Sem_Ch6 is ("cannot inline& (exception handler)?", First (Exception_Handlers (Handled_Statement_Sequence (N))), Subp); - return False; + return; elsif Has_Excluded_Statement (Statements (Handled_Statement_Sequence (N))) then - return False; + return; end if; end if; @@ -1827,16 +1763,36 @@ package body Sem_Ch6 is and then not Is_Always_Inlined (Subp) then Cannot_Inline ("cannot inline& (body too large)?", N, Subp); - return False; + return; end if; if Has_Pending_Instantiation then Cannot_Inline ("cannot inline& (forward instance within enclosing body)?", N, Subp); - return False; + return; + end if; + + -- Within an instance, the body to inline must be treated as a nested + -- generic, so that the proper global references are preserved. + + if In_Instance then + Save_Env (Scope (Current_Scope), Scope (Current_Scope)); + Original_Body := Copy_Generic_Node (N, Empty, True); + else + Original_Body := Copy_Separate_Tree (N); end if; + -- We need to capture references to the formals in order to substitute + -- the actuals at the point of inlining, i.e. instantiation. To treat + -- the formals as globals to the body to inline, we nest it within + -- a dummy parameterless subprogram, declared within the real one. + + Set_Parameter_Specifications (Specification (Original_Body), No_List); + Set_Defining_Unit_Name (Specification (Original_Body), + Make_Defining_Identifier (Sloc (N), New_Internal_Name ('S'))); + Set_Corresponding_Spec (Original_Body, Empty); + Body_To_Analyze := Copy_Generic_Node (Original_Body, Empty, False); -- Set return type of function, which is also global and does not need @@ -1866,7 +1822,10 @@ package body Sem_Ch6 is Set_Body_To_Inline (Decl, Original_Body); Set_Ekind (Defining_Entity (Original_Body), Ekind (Subp)); Set_Is_Inlined (Subp); - return True; + + if In_Instance then + Restore_Env; + end if; end Build_Body_To_Inline; ------------------- @@ -2972,8 +2931,7 @@ package body Sem_Ch6 is (T1 : Entity_Id; T2 : Entity_Id; Ctype : Conformance_Type; - Get_Inst : Boolean := False) - return Boolean + Get_Inst : Boolean := False) return Boolean is Type_1 : Entity_Id := T1; Type_2 : Entity_Id := T2; @@ -3475,8 +3433,7 @@ package body Sem_Ch6 is function Fully_Conformant_Expressions (Given_E1 : Node_Id; - Given_E2 : Node_Id) - return Boolean + Given_E2 : Node_Id) return Boolean is E1 : constant Node_Id := Original_Node (Given_E1); E2 : constant Node_Id := Original_Node (Given_E2); @@ -3849,8 +3806,7 @@ package body Sem_Ch6 is function Fully_Conformant_Discrete_Subtypes (Given_S1 : Node_Id; - Given_S2 : Node_Id) - return Boolean + Given_S2 : Node_Id) return Boolean is S1 : constant Node_Id := Original_Node (Given_S1); S2 : constant Node_Id := Original_Node (Given_S2); @@ -3942,8 +3898,7 @@ package body Sem_Ch6 is function Is_Non_Overriding_Operation (Prev_E : Entity_Id; - New_E : Entity_Id) - return Boolean + New_E : Entity_Id) return Boolean is Formal : Entity_Id; F_Typ : Entity_Id; @@ -3956,8 +3911,7 @@ package body Sem_Ch6 is function Types_Correspond (P_Type : Entity_Id; - N_Type : Entity_Id) - return Boolean; + N_Type : Entity_Id) return Boolean; -- Returns true if and only if the types (or designated types -- in the case of anonymous access types) are the same or N_Type -- is derived directly or indirectly from P_Type. @@ -4005,8 +3959,7 @@ package body Sem_Ch6 is function Types_Correspond (P_Type : Entity_Id; - N_Type : Entity_Id) - return Boolean + N_Type : Entity_Id) return Boolean is Prev_Type : Entity_Id := Base_Type (P_Type); New_Type : Entity_Id := Base_Type (N_Type); @@ -4887,9 +4840,9 @@ package body Sem_Ch6 is and then Ekind (Root_Type (Formal_Type)) = E_Incomplete_Type) then - - -- Incomplete tagged types that are made visible through - -- a limited with_clause are valid formal types. + -- Ada0Y (AI-50217): Incomplete tagged types that are made + -- visible through a limited with_clause are valid formal + -- types. if From_With_Type (Formal_Type) and then Is_Tagged_Type (Formal_Type) @@ -5245,7 +5198,6 @@ package body Sem_Ch6 is function Type_Conformant (New_Id, Old_Id : Entity_Id) return Boolean is Result : Boolean; - begin Check_Conformance (New_Id, Old_Id, Type_Conformant, False, Result); return Result; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index da29d208cef..6c65a7b5ecd 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -789,8 +789,16 @@ package body Sem_Ch8 is end if; if Etype (Old_P) = Any_Type then - Error_Msg_N - ("expect package name in renaming", Name (N)); + Error_Msg_N + ("expect package name in renaming", Name (N)); + + -- Ada0Y (AI-50217): Limited withed packages can not be renamed + + elsif Ekind (Old_P) = E_Package + and then From_With_Type (Old_P) + then + Error_Msg_N + ("limited withed package cannot be renamed", Name (N)); elsif Ekind (Old_P) /= E_Package and then not (Ekind (Old_P) = E_Generic_Package @@ -811,11 +819,6 @@ package body Sem_Ch8 is Set_Ekind (New_P, E_Package); Set_Etype (New_P, Standard_Void_Type); - elsif Ekind (Old_P) = E_Package - and then From_With_Type (Old_P) - then - Error_Msg_N ("imported package cannot be renamed", Name (N)); - else -- Entities in the old package are accessible through the -- renaming entity. The simplest implementation is to have @@ -3388,6 +3391,8 @@ package body Sem_Ch8 is Set_Chars (Selector, Chars (Id)); end if; + -- Ada0Y (AI-50217): Check usage of entities in limited withed units + if Ekind (P_Name) = E_Package and then From_With_Type (P_Name) then @@ -3397,7 +3402,8 @@ package body Sem_Ch8 is null; else Error_Msg_N - ("imported package can only be used to access imported type", + ("limited withed package can only be used to access " + & " incomplete types", N); end if; end if; @@ -4058,6 +4064,14 @@ package body Sem_Ch8 is Error_Msg_N ( "invalid prefix in selected component&", P); + if Is_Access_Type (P_Type) + and then Ekind (Designated_Type (P_Type)) = E_Incomplete_Type + then + Error_Msg_N + ("\dereference must not be of an incomplete type " & + "('R'M 3.10.1)", P); + end if; + else Error_Msg_N ( "invalid prefix in selected component", P); @@ -5072,7 +5086,7 @@ package body Sem_Ch8 is -- Restore_Scope_Stack -- ------------------------- - procedure Restore_Scope_Stack is + procedure Restore_Scope_Stack (Handle_Use : Boolean := True) is E : Entity_Id; S : Entity_Id; Comp_Unit : Node_Id; @@ -5174,6 +5188,7 @@ package body Sem_Ch8 is if SS_Last >= Scope_Stack.First and then Scope_Stack.Table (SS_Last).Entity /= Standard_Standard + and then Handle_Use then Install_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause); end if; @@ -5183,7 +5198,7 @@ package body Sem_Ch8 is -- Save_Scope_Stack -- ---------------------- - procedure Save_Scope_Stack is + procedure Save_Scope_Stack (Handle_Use : Boolean := True) is E : Entity_Id; S : Entity_Id; SS_Last : constant Int := Scope_Stack.Last; @@ -5192,8 +5207,9 @@ package body Sem_Ch8 is if SS_Last >= Scope_Stack.First and then Scope_Stack.Table (SS_Last).Entity /= Standard_Standard then - - End_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause); + if Handle_Use then + End_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause); + end if; -- If the call is from within a compilation unit, as when -- called from Rtsfind, make current entries in scope stack @@ -5282,8 +5298,10 @@ package body Sem_Ch8 is Set_In_Use (P); + -- Ada0Y (AI-50217): Check restriction. + if From_With_Type (P) then - Error_Msg_N ("imported package cannot appear in use clause", N); + Error_Msg_N ("limited withed package cannot appear in use clause", N); end if; -- Find enclosing instance, if any. diff --git a/gcc/ada/sem_ch8.ads b/gcc/ada/sem_ch8.ads index 87db07a074d..bdd3d53d646 100644 --- a/gcc/ada/sem_ch8.ads +++ b/gcc/ada/sem_ch8.ads @@ -135,14 +135,18 @@ package Sem_Ch8 is -- or else a with-clause on system. N is absent when the function is -- called to find the visibility of implicit operators. - procedure Restore_Scope_Stack; - procedure Save_Scope_Stack; + procedure Restore_Scope_Stack (Handle_Use : Boolean := True); + procedure Save_Scope_Stack (Handle_Use : Boolean := True); -- These two procedures are called from Semantics, when a unit U1 is -- to be compiled in the course of the compilation of another unit U2. -- This happens whenever Rtsfind is called. U1, the unit retrieved by -- Rtsfind, must be compiled in its own context, and the current scope -- stack containing U2 and local scopes must be made unreachable. On -- return, the contents of the scope stack must be made accessible again. + -- The flag Handle_Use indicates whether local use clauses must be + -- removed/installed. In the case of inlining of instance bodies, the + -- visiblity handling is done fully in Inline_Instance_Body, and use + -- clauses are handled there. procedure Set_Use (L : List_Id); -- Find use clauses that are declarative items in a package declaration diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 653774fdee1..d7bff861585 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -294,6 +294,7 @@ package body Sem_Ch9 is while Present (E1) loop if Ekind (E1) = E_Procedure + and then Chars (E1) = Chars (Entry_Nam) and then Type_Conformant (E1, Entry_Nam) then Error_Msg_N ("entry name is not visible", N); diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 8e6e2e1d83a..f189fe127db 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -325,6 +325,16 @@ package body Sem_Elab is -- we ignore this flag. begin + -- If the call is known to be within a local Suppress Elaboration + -- pragma, nothing to check. This can happen in task bodies. + + if (Nkind (N) = N_Function_Call + or else Nkind (N) = N_Procedure_Call_Statement) + and then No_Elaboration_Check (N) + then + return; + end if; + -- Go to parent for derived subprogram, or to original subprogram -- in the case of a renaming (Alias covers both these cases) @@ -826,10 +836,41 @@ package body Sem_Elab is (N : Node_Id; Outer_Scope : Entity_Id := Empty) is - Nam : Node_Id; Ent : Entity_Id; P : Node_Id; + function Get_Called_Ent return Entity_Id; + -- Retrieve called entity. If this is a call to a protected subprogram, + -- entity is a selected component. The callable entity may be absent, + -- in which case there is no check to perform. This happens with + -- non-analyzed calls in nested generics. + + -------------------- + -- Get_Called_Ent -- + -------------------- + + function Get_Called_Ent return Entity_Id is + Nam : Node_Id; + + begin + Nam := Name (N); + + if No (Nam) then + return Empty; + + elsif Nkind (Nam) = N_Selected_Component then + return Entity (Selector_Name (Nam)); + + elsif not Is_Entity_Name (Nam) then + return Empty; + + else + return Entity (Nam); + end if; + end Get_Called_Ent; + + -- Start of processing for Check_Elab_Call + begin -- For an entry call, check relevant restriction @@ -1014,6 +1055,26 @@ package body Sem_Elab is exit; + elsif Nkind (P) = N_Task_Body then + + -- The check is deferred until Check_Task_Activation + -- but we need to capture local suppress pragmas + -- that may inhibit checks on this call. + + Ent := Get_Called_Ent; + + if No (Ent) then + return; + + elsif Elaboration_Checks_Suppressed (Current_Scope) + or else Elaboration_Checks_Suppressed (Ent) + or else Elaboration_Checks_Suppressed (Scope (Ent)) + then + Set_No_Elaboration_Check (N); + end if; + + return; + -- Static model, call is not in elaboration code, we -- never need to worry, because in the static model -- the top level caller always takes care of things. @@ -1027,25 +1088,7 @@ package body Sem_Elab is end if; end if; - -- Retrieve called entity. If this is a call to a protected subprogram, - -- the entity is a selected component. - -- The callable entity may be absent, in which case there is nothing - -- to do. This happens with non-analyzed calls in nested generics. - - Nam := Name (N); - - if No (Nam) then - return; - - elsif Nkind (Nam) = N_Selected_Component then - Ent := Entity (Selector_Name (Nam)); - - elsif not Is_Entity_Name (Nam) then - return; - - else - Ent := Entity (Nam); - end if; + Ent := Get_Called_Ent; if No (Ent) then return; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 57712b06d9c..f080512468b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -432,8 +432,7 @@ package body Sem_Prag is function Is_Before_First_Decl (Pragma_Node : Node_Id; - Decls : List_Id) - return Boolean; + Decls : List_Id) return Boolean; -- Return True if Pragma_Node is before the first declarative item in -- Decls where Decls is the list of declarative items. @@ -1122,7 +1121,6 @@ package body Sem_Prag is when N_Index_Or_Discriminant_Constraint => declare IDC : Entity_Id := First (Constraints (Constr)); - begin while Present (IDC) loop Check_Static_Constraint (IDC); @@ -1506,8 +1504,7 @@ package body Sem_Prag is function Is_Before_First_Decl (Pragma_Node : Node_Id; - Decls : List_Id) - return Boolean + Decls : List_Id) return Boolean is Item : Node_Id := First (Decls); @@ -2185,8 +2182,7 @@ package body Sem_Prag is function Same_Base_Type (Ptype : Node_Id; - Formal : Entity_Id) - return Boolean; + Formal : Entity_Id) return Boolean; -- Determines if Ptype references the type of Formal. Note that -- only the base types need to match according to the spec. Ptype -- here is the argument from the pragma, which is either a type @@ -2196,7 +2192,10 @@ package body Sem_Prag is -- Same_Base_Type -- -------------------- - function Same_Base_Type (Ptype, Formal : Entity_Id) return Boolean is + function Same_Base_Type + (Ptype : Node_Id; + Formal : Entity_Id) return Boolean + is Ftyp : constant Entity_Id := Base_Type (Etype (Formal)); Pref : Node_Id; @@ -2823,9 +2822,8 @@ package body Sem_Prag is if Nkind (Parent (N)) = N_Compilation_Unit_Aux then declare Cunit : constant Node_Id := Parent (Parent (N)); - begin - Set_Body_Required (Cunit, False); + Set_Body_Required (Cunit, False); end; end if; end Process_Import_Or_Interface; @@ -2869,10 +2867,21 @@ package body Sem_Prag is elsif Nkind (Decl) = N_Subprogram_Declaration and then Present (Corresponding_Body (Decl)) then - return - Present (Exception_Handlers - (Handled_Statement_Sequence - (Unit_Declaration_Node (Corresponding_Body (Decl))))); + -- If the subprogram is a renaming as body, the body is + -- just a call to the renamed subprogram, and inlining is + -- trivially possible. + + if Nkind (Unit_Declaration_Node (Corresponding_Body (Decl))) = + N_Subprogram_Renaming_Declaration + then + return False; + + else + return + Present (Exception_Handlers + (Handled_Statement_Sequence + (Unit_Declaration_Node (Corresponding_Body (Decl))))); + end if; else -- If body is not available, assume the best, the check is -- performed again when compiling enclosing package bodies. @@ -3701,11 +3710,9 @@ package body Sem_Prag is declare Arg_Node : Node_Id; - begin Arg_Count := 0; Arg_Node := Arg1; - while Present (Arg_Node) loop Arg_Count := Arg_Count + 1; Next (Arg_Node); @@ -4480,7 +4487,6 @@ package body Sem_Prag is when Pragma_Convention => Convention : declare C : Convention_Id; E : Entity_Id; - begin Check_Ada_83_Warning; Check_Arg_Count (2); @@ -7477,7 +7483,9 @@ package body Sem_Prag is Error_Pragma ("pragma% ignored, cannot pack aliased components?"); - elsif Has_Atomic_Components (Typ) then + elsif Has_Atomic_Components (Typ) + or else Is_Atomic (Component_Type (Typ)) + then Error_Pragma ("?pragma% ignored, cannot pack atomic components"); @@ -9080,6 +9088,80 @@ package body Sem_Prag is end if; end Task_Storage; + ----------------- + -- Thread_Body -- + ----------------- + + -- pragma Thread_Body + -- ( [Entity =>] LOCAL_NAME + -- [,[Secondary_Stack_Size =>] static_integer_EXPRESSION]); + + when Pragma_Thread_Body => Thread_Body : declare + Id : Node_Id; + SS : Node_Id; + E : Entity_Id; + + begin + GNAT_Pragma; + Check_At_Least_N_Arguments (1); + Check_At_Most_N_Arguments (2); + Check_Optional_Identifier (Arg1, Name_Entity); + Check_Arg_Is_Local_Name (Arg1); + + Id := Expression (Arg1); + + if not Is_Entity_Name (Id) + or else not Is_Subprogram (Entity (Id)) + then + Error_Pragma_Arg ("subprogram name required", Arg1); + end if; + + E := Entity (Id); + + -- Go to renamed subprogram if present, since Thread_Body applies + -- to the actual renamed entity, not to the renaming entity. + + if Present (Alias (E)) + and then Nkind (Parent (Declaration_Node (E))) = + N_Subprogram_Renaming_Declaration + then + E := Alias (E); + end if; + + -- Various error checks + + if Nkind (Parent (Declaration_Node (E))) = N_Subprogram_Body then + Error_Pragma + ("pragma% requires separate spec and must come before body"); + + elsif Rep_Item_Too_Early (E, N) + or else + Rep_Item_Too_Late (E, N) + then + raise Pragma_Exit; + + elsif Is_Thread_Body (E) then + Error_Pragma_Arg + ("only one thread body pragma allowed", Arg1); + + elsif Present (Homonym (E)) + and then Scope (Homonym (E)) = Current_Scope + then + Error_Pragma_Arg + ("thread body subprogram must not be overloaded", Arg1); + end if; + + Set_Is_Thread_Body (E); + + -- Deal with secondary stack argument + + if Arg_Count = 2 then + Check_Optional_Identifier (Arg2, Name_Secondary_Stack_Size); + SS := Expression (Arg2); + Analyze_And_Resolve (SS, Any_Integer); + end if; + end Thread_Body; + ---------------- -- Time_Slice -- ---------------- @@ -9555,6 +9637,16 @@ package body Sem_Prag is E_Id := Expression (Arg2); Analyze (E_Id); + -- In the expansion of an inlined body, a reference to + -- the formal may be wrapped in a conversion if the actual + -- is a conversion. Retrieve the real entity name. + + if In_Instance_Body + and then Nkind (E_Id) = N_Unchecked_Type_Conversion + then + E_Id := Expression (E_Id); + end if; + if not Is_Entity_Name (E_Id) then Error_Pragma_Arg ("second argument of pragma% must be entity name", @@ -9810,6 +9902,7 @@ package body Sem_Prag is Pragma_Task_Info => -1, Pragma_Task_Name => -1, Pragma_Task_Storage => 0, + Pragma_Thread_Body => +2, Pragma_Time_Slice => -1, Pragma_Title => -1, Pragma_Unchecked_Union => -1, diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 68c45f65409..51971d135d3 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -88,6 +88,11 @@ package body Sem_Res is -- Give list of candidate interpretations when a character literal cannot -- be resolved. + procedure Check_Direct_Boolean_Op (N : Node_Id); + -- N is a binary operator node which may possibly operate on Boolean + -- operands. If the operator does have Boolean operands, then a call is + -- made to check the restriction No_Direct_Boolean_Operators. + 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). @@ -342,6 +347,17 @@ package body Sem_Res is end if; end Analyze_And_Resolve; + ----------------------------- + -- Check_Direct_Boolean_Op -- + ----------------------------- + + procedure Check_Direct_Boolean_Op (N : Node_Id) is + begin + if Root_Type (Etype (Left_Opnd (N))) = Standard_Boolean then + Check_Restriction (No_Direct_Boolean_Operators, N); + end if; + end Check_Direct_Boolean_Op; + ---------------------------- -- Check_Discriminant_Use -- ---------------------------- @@ -1940,9 +1956,25 @@ package body Sem_Res is if Is_Overloaded (N) and then Nkind (N) = N_Function_Call then - Error_Msg_Node_2 := Typ; - Error_Msg_NE ("no visible interpretation of&" & - " matches expected type&", N, Name (N)); + declare + Subp_Name : Node_Id; + begin + if Is_Entity_Name (Name (N)) then + Subp_Name := Name (N); + + elsif Nkind (Name (N)) = N_Selected_Component then + + -- Protected operation: retrieve operation name. + + Subp_Name := Selector_Name (Name (N)); + else + raise Program_Error; + end if; + + Error_Msg_Node_2 := Typ; + Error_Msg_NE ("no visible interpretation of&" & + " matches expected type&", N, Subp_Name); + end; if All_Errors_Mode then declare @@ -3315,7 +3347,6 @@ package body Sem_Res is -- dereference made explicit in Analyze_Call. if Ekind (Etype (Subp)) = E_Subprogram_Type then - if not Is_Overloaded (Subp) then Nam := Etype (Subp); @@ -3423,6 +3454,12 @@ package body Sem_Res is end; end if; + -- Cannot call thread body directly + + if Is_Thread_Body (Nam) then + Error_Msg_N ("cannot call thread body directly", N); + end if; + -- If the subprogram is not global, then kill all checks. This is -- a bit conservative, since in many cases we could do better, but -- it is not worth the effort. Similarly, we kill constant values. @@ -3690,6 +3727,13 @@ package body Sem_Res is Establish_Transient_Scope (N, Sec_Stack => not Functions_Return_By_DSP_On_Target); + -- If the call appears within the bounds of a loop, it will + -- be rewritten and reanalyzed, nothing left to do here. + + if Nkind (N) /= N_Function_Call then + return; + end if; + elsif Is_Init_Proc (Nam) and then not Within_Init_Proc then @@ -3831,6 +3875,8 @@ package body Sem_Res is T : Entity_Id; begin + Check_Direct_Boolean_Op (N); + -- If this is an intrinsic operation which is not predefined, use -- the types of its declared arguments to resolve the possibly -- overloaded operands. Otherwise the operands are unambiguous and @@ -4570,6 +4616,8 @@ package body Sem_Res is -- Start of processing for Resolve_Equality_Op begin + Check_Direct_Boolean_Op (N); + Set_Etype (N, Base_Type (Typ)); Generate_Reference (T, N, ' '); @@ -4951,6 +4999,8 @@ package body Sem_Res is B_Typ : Entity_Id; begin + Check_Direct_Boolean_Op (N); + -- Predefined operations on scalar types yield the base type. On -- the other hand, logical operations on arrays yield the type of -- the arguments (and the context). @@ -6157,6 +6207,12 @@ package body Sem_Res is Error_Msg_N ("\as Duration, and will lose precision?", Rop); end if; + elsif Is_Numeric_Type (Typ) + and then Nkind (Operand) in N_Op + and then Unique_Fixed_Point_Type (N) /= Any_Type + then + Set_Etype (Operand, Standard_Duration); + else Error_Msg_N ("invalid context for mixed mode operation", N); Set_Etype (Operand, Any_Type); diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 105dc53bc55..57bbb3de759 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -824,6 +824,9 @@ package body Sem_Type is then return True; + -- Ada0Y (AI-50217): Additional branches to make the shadow entity + -- compatible with its real entity. + elsif From_With_Type (T1) then -- If the expected type is the non-limited view of a type, the @@ -2134,15 +2137,19 @@ package body Sem_Type is if B1 = B2 then return B1; - elsif (T1 = Universal_Integer and then Is_Integer_Type (T2)) - or else (T1 = Universal_Real and then Is_Real_Type (T2)) - or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2)) + elsif False + or else (T1 = Universal_Integer and then Is_Integer_Type (T2)) + or else (T1 = Universal_Real and then Is_Real_Type (T2)) + or else (T1 = Universal_Fixed and then Is_Fixed_Point_Type (T2)) + or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2)) then return B2; - elsif (T2 = Universal_Integer and then Is_Integer_Type (T1)) - or else (T2 = Universal_Real and then Is_Real_Type (T1)) - or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1)) + elsif False + or else (T2 = Universal_Integer and then Is_Integer_Type (T1)) + or else (T2 = Universal_Real and then Is_Real_Type (T1)) + or else (T2 = Universal_Fixed and then Is_Fixed_Point_Type (T1)) + or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1)) then return B1; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index dc67b50db51..57f93173b54 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -818,8 +818,8 @@ package body Sem_Util is begin if Ekind (T) = E_Incomplete_Type then - -- If the type is available through a limited_with_clause, - -- verify that its full view has been analyzed. + -- Ada0Y (AI-50217): If the type is available through a limited + -- with_clause, verify that its full view has been analyzed. if From_With_Type (T) and then Present (Non_Limited_View (T)) @@ -6371,6 +6371,12 @@ package body Sem_Util is Error_Msg_N ( "operator of the type is not directly visible!", Expr); + elsif Ekind (Found_Type) = E_Void + and then Present (Parent (Found_Type)) + and then Nkind (Parent (Found_Type)) = N_Full_Type_Declaration + then + Error_Msg_NE ("found premature usage of}!", Expr, Found_Type); + else Error_Msg_NE ("found}!", Expr, Found_Type); end if; diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index b77d49b9940..0d57ac00f66 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1440,14 +1440,16 @@ package body Sem_Warn is when E_Variable => -- Case of variable that is assigned but not read. We - -- suppress the message if the variable is volatile or - -- has an address clause. + -- suppress the message if the variable is volatile, + -- has an address clause, or is imported. if Referenced_As_LHS (E) and then No (Address_Clause (E)) and then not Is_Volatile (E) then - if Warn_On_Modified_Unread then + if Warn_On_Modified_Unread + and then not Is_Imported (E) + then Error_Msg_N ("variable & is assigned but never read?", E); end if; diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index 22b8137ed39..f8d22784d0c 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -297,6 +297,7 @@ package body Sinfo is (N : Node_Id) return Boolean is begin pragma Assert (False + or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration); return Flag15 (N); @@ -930,6 +931,15 @@ package body Sinfo is return Node4 (N); end Entity; + function Entity_Or_Associated_Node + (N : Node_Id) return Node_Id is + begin + pragma Assert (False + or else NT (N).Nkind in N_Has_Entity + or else NT (N).Nkind = N_Freeze_Entity); + return Node4 (N); + end Entity_Or_Associated_Node; + function Entry_Body_Formal_Part (N : Node_Id) return Node_Id is begin @@ -1754,6 +1764,15 @@ package body Sinfo is return Flag7 (N); end No_Ctrl_Actions; + function No_Elaboration_Check + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Function_Call + or else NT (N).Nkind = N_Procedure_Call_Statement); + return Flag14 (N); + end No_Elaboration_Check; + function No_Entities_Ref_In_Spec (N : Node_Id) return Boolean is begin @@ -2720,6 +2739,7 @@ package body Sinfo is (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False + or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration); Set_Flag15 (N, Val); @@ -4176,6 +4196,15 @@ package body Sinfo is Set_Flag7 (N, Val); end Set_No_Ctrl_Actions; + procedure Set_No_Elaboration_Check + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Function_Call + or else NT (N).Nkind = N_Procedure_Call_Statement); + Set_Flag14 (N, Val); + end Set_No_Elaboration_Check; + procedure Set_No_Entities_Ref_In_Spec (N : Node_Id; Val : Boolean := True) is begin diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 014228b5a9c..de8b23eb7d0 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -244,7 +244,7 @@ package Sinfo is -- Variant := First (Variants (N)); -- while Present (Variant) loop -- ... - -- Alt := Next (Alt); + -- Variant := Next (Variant); -- end loop; -- or @@ -252,7 +252,7 @@ package Sinfo is -- Variant := First_Non_Pragma (Variants (N)); -- while Present (Variant) loop -- ... - -- Alt := Next_Non_Pragma (Alt); + -- Variant := Next_Non_Pragma (Variant); -- end loop; -- In the first form of the loop, Variant can either be an N_Pragma or @@ -393,7 +393,7 @@ package Sinfo is -- abbreviations are used: -- Note: the utility program that creates the Treeprs spec (in the file - -- treeprs.ads) knows about the special fields here, so it must be + -- xtreeprs.adb) knows about the special fields here, so it must be -- modified if any change is made to these fields. -- "plus fields for binary operator" @@ -567,14 +567,18 @@ package Sinfo is -- Associated_Node (Node4-Sem) -- Present in nodes that can denote an entity: identifiers, character - -- literals, operator symbols, expanded names, operator nodes and + -- literals, operator symbols, expanded names, operator nodes, and -- attribute reference nodes (all these nodes have an Entity field). -- This field is also present in N_Aggregate, N_Selected_Component, - -- and N_Extension_Aggregate nodes. This field is used during generic - -- processing to relate nodes in the original template to nodes in the - -- generic copy. It overlaps the Entity field, and is used to capture - -- global references in the analyzed copy and place them in the template. - -- See description in Sem_Ch12 for further details on this usage. + -- and N_Extension_Aggregate nodes. This field is used in generic + -- processing to create links between the generic template and the + -- generic copy. See Sem_Ch12.Get_Associated_Node for full details. + -- Note that this field overlaps Entity, which is fine, since, as + -- explained in Sem_Ch12, the normal function of Entity is not + -- required at the point where the Associated_Node is set. Note + -- also, that in generic templates, this means that the Entity field + -- does not necessarily point to an Entity. Since the back end is + -- expected to ignore generic templates, this is harmless. -- At_End_Proc (Node1) -- This field is present in an N_Handled_Sequence_Of_Statements node. @@ -861,8 +865,16 @@ package Sinfo is -- incorrect (e.g. during overload resolution, Entity is initially -- set to the first possible correct interpretation, and then later -- modified if necessary to contain the correct value after resolution). - -- Note that Associated_Node overlays this field during the processing - -- of generics. See Sem_Ch12 for further details. + -- Note that this field overlaps Associated_Node, which is used during + -- generic processing (see Sem_Ch12 for details). Note also that in + -- generic templates, this means that the Entity field does not always + -- point to an Entity. Since the back end is expected to ignore + -- generic templates, this is harmless. + + -- Entity_Or_Associated_Node (Node4-Sem) + -- A synonym for both Entity and Asasociated_Node. Used by convention + -- in the code when referencing this field in cases where it is not + -- known whether the field contains an Entity or an Associated_Node. -- Etype (Node5-Sem) -- Appears in all expression nodes, all direct names, and all @@ -1254,6 +1266,13 @@ package Sinfo is -- where the generated assignments are more initialisations than real -- assignments. + -- No_Elaboration_Check (Flag14-Sem) + -- Present in N_Function_Call and N_Procedure_Call_Statement. Indicates + -- that no elaboration check is needed on the call, because it appears + -- in the context of a local Suppress pragma. This is used on calls + -- within task bodies, where the actual elaboration checks are applied + -- after analysis, when the local scope stack is not present. + -- No_Entities_Ref_In_Spec (Flag8-Sem) -- Present in N_With_Clause nodes. Set if the with clause is on the -- package or subprogram spec where the main unit is the corresponding @@ -2996,13 +3015,15 @@ package Sinfo is -- Choices (List1) -- Loop_Actions (List2-Sem) -- Expression (Node3) + -- Box_Present (Flag15) -- Note: this structure is used for both record component associations -- and array component associations, since the two cases aren't always -- separable by the parser. The choices list may represent either a -- list of selector names in the record aggregate case, or a list of -- discrete choices in the array aggregate case or an N_Others_Choice - -- node (which appears as a singleton list). + -- node (which appears as a singleton list). Box_Present gives support + -- to Ada0Y (AI-287). ------------------------------------ -- 4.3.1 Commponent Choice List -- @@ -4029,6 +4050,7 @@ package Sinfo is -- First_Named_Actual (Node4-Sem) -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching) -- Do_Tag_Check (Flag13-Sem) + -- No_Elaboration_Check (Flag14-Sem) -- Parameter_List_Truncated (Flag17-Sem) -- ABE_Is_Certain (Flag18-Sem) -- plus fields for expression @@ -4059,6 +4081,7 @@ package Sinfo is -- First_Named_Actual (Node4-Sem) -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching) -- Do_Tag_Check (Flag13-Sem) + -- No_Elaboration_Check (Flag14-Sem) -- Parameter_List_Truncated (Flag17-Sem) -- ABE_Is_Certain (Flag18-Sem) -- plus fields for expression @@ -5077,6 +5100,9 @@ package Sinfo is -- Unreferenced_In_Spec (Flag7-Sem) -- No_Entities_Ref_In_Spec (Flag8-Sem) + -- Note: Limited_Present and Limited_View_Installed give support to + -- Ada0Y (AI-50217). + ---------------------- -- With_Type clause -- ---------------------- @@ -7107,6 +7133,9 @@ package Sinfo is function Entity (N : Node_Id) return Node_Id; -- Node4 + function Entity_Or_Associated_Node + (N : Node_Id) return Node_Id; -- Node4 + function Entry_Body_Formal_Part (N : Node_Id) return Node_Id; -- Node5 @@ -7371,6 +7400,9 @@ package Sinfo is function No_Ctrl_Actions (N : Node_Id) return Boolean; -- Flag7 + function No_Elaboration_Check + (N : Node_Id) return Boolean; -- Flag14 + function No_Entities_Ref_In_Spec (N : Node_Id) return Boolean; -- Flag8 @@ -8145,6 +8177,9 @@ package Sinfo is procedure Set_No_Ctrl_Actions (N : Node_Id; Val : Boolean := True); -- Flag7 + procedure Set_No_Elaboration_Check + (N : Node_Id; Val : Boolean := True); -- Flag14 + procedure Set_No_Entities_Ref_In_Spec (N : Node_Id; Val : Boolean := True); -- Flag8 @@ -8491,6 +8526,7 @@ package Sinfo is pragma Inline (End_Label); pragma Inline (End_Span); pragma Inline (Entity); + pragma Inline (Entity_Or_Associated_Node); pragma Inline (Entry_Body_Formal_Part); pragma Inline (Entry_Call_Alternative); pragma Inline (Entry_Call_Statement); @@ -8579,6 +8615,7 @@ package Sinfo is pragma Inline (Next_Rep_Item); pragma Inline (Next_Use_Clause); pragma Inline (No_Ctrl_Actions); + pragma Inline (No_Elaboration_Check); pragma Inline (No_Entities_Ref_In_Spec); pragma Inline (No_Initialization); pragma Inline (No_Truncation); @@ -8833,6 +8870,7 @@ package Sinfo is pragma Inline (Set_Next_Named_Actual); pragma Inline (Set_Next_Use_Clause); pragma Inline (Set_No_Ctrl_Actions); + pragma Inline (Set_No_Elaboration_Check); pragma Inline (Set_No_Entities_Ref_In_Spec); pragma Inline (Set_No_Initialization); pragma Inline (Set_No_Truncation); diff --git a/gcc/ada/sinfo.h b/gcc/ada/sinfo.h deleted file mode 100644 index fd5d13d2b89..00000000000 --- a/gcc/ada/sinfo.h +++ /dev/null @@ -1,840 +0,0 @@ -/*--------------------------------------------------------------------------*/ -/* */ -/* GNAT COMPILER COMPONENTS */ -/* */ -/* S I N F O */ -/* */ -/* C Header File */ -/* */ -/* Copyright (C) 1992-2003, Free Software Foundation, Inc. */ -/* */ -/* GNAT is 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 2, 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 COPYING. If not, write */ -/* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, */ -/* MA 02111-1307, USA. */ -/* */ -/* As a special exception, if other files instantiate generics from this */ -/* unit, or you link this unit with other files to produce an executable, */ -/* this unit does not by itself cause the resulting executable to be */ -/* covered by the GNU General Public License. This exception does not */ -/* however invalidate any other reasons why the executable file might be */ -/* covered by the GNU Public License. */ -/* */ -/* GNAT was originally developed by the GNAT team at New York University. */ -/* Extensive contributions were provided by Ada Core Technologies Inc. */ -/* */ -/*--------------------------------------------------------------------------*/ - - #define N_Unused_At_Start 0 - #define N_At_Clause 1 - #define N_Component_Clause 2 - #define N_Enumeration_Representation_Clause 3 - #define N_Mod_Clause 4 - #define N_Record_Representation_Clause 5 - #define N_Attribute_Definition_Clause 6 - #define N_Empty 7 - #define N_Pragma 8 - #define N_Pragma_Argument_Association 9 - #define N_Error 10 - #define N_Defining_Character_Literal 11 - #define N_Defining_Identifier 12 - #define N_Defining_Operator_Symbol 13 - #define N_Expanded_Name 14 - #define N_Identifier 15 - #define N_Operator_Symbol 16 - #define N_Character_Literal 17 - #define N_Op_Add 18 - #define N_Op_Concat 19 - #define N_Op_Expon 20 - #define N_Op_Subtract 21 - #define N_Op_Divide 22 - #define N_Op_Mod 23 - #define N_Op_Multiply 24 - #define N_Op_Rem 25 - #define N_Op_And 26 - #define N_Op_Eq 27 - #define N_Op_Ge 28 - #define N_Op_Gt 29 - #define N_Op_Le 30 - #define N_Op_Lt 31 - #define N_Op_Ne 32 - #define N_Op_Or 33 - #define N_Op_Xor 34 - #define N_Op_Rotate_Left 35 - #define N_Op_Rotate_Right 36 - #define N_Op_Shift_Left 37 - #define N_Op_Shift_Right 38 - #define N_Op_Shift_Right_Arithmetic 39 - #define N_Op_Abs 40 - #define N_Op_Minus 41 - #define N_Op_Not 42 - #define N_Op_Plus 43 - #define N_Attribute_Reference 44 - #define N_And_Then 45 - #define N_Conditional_Expression 46 - #define N_Explicit_Dereference 47 - #define N_Function_Call 48 - #define N_In 49 - #define N_Indexed_Component 50 - #define N_Integer_Literal 51 - #define N_Not_In 52 - #define N_Null 53 - #define N_Or_Else 54 - #define N_Procedure_Call_Statement 55 - #define N_Qualified_Expression 56 - #define N_Raise_Constraint_Error 57 - #define N_Raise_Program_Error 58 - #define N_Raise_Storage_Error 59 - #define N_Aggregate 60 - #define N_Allocator 61 - #define N_Extension_Aggregate 62 - #define N_Range 63 - #define N_Real_Literal 64 - #define N_Reference 65 - #define N_Selected_Component 66 - #define N_Slice 67 - #define N_String_Literal 68 - #define N_Subprogram_Info 69 - #define N_Type_Conversion 70 - #define N_Unchecked_Expression 71 - #define N_Unchecked_Type_Conversion 72 - #define N_Subtype_Indication 73 - #define N_Component_Declaration 74 - #define N_Entry_Declaration 75 - #define N_Formal_Object_Declaration 76 - #define N_Formal_Type_Declaration 77 - #define N_Full_Type_Declaration 78 - #define N_Incomplete_Type_Declaration 79 - #define N_Loop_Parameter_Specification 80 - #define N_Object_Declaration 81 - #define N_Protected_Type_Declaration 82 - #define N_Private_Extension_Declaration 83 - #define N_Private_Type_Declaration 84 - #define N_Subtype_Declaration 85 - #define N_Function_Specification 86 - #define N_Procedure_Specification 87 - #define N_Entry_Index_Specification 88 - #define N_Freeze_Entity 89 - #define N_Access_Function_Definition 90 - #define N_Access_Procedure_Definition 91 - #define N_Task_Type_Declaration 92 - #define N_Package_Body_Stub 93 - #define N_Protected_Body_Stub 94 - #define N_Subprogram_Body_Stub 95 - #define N_Task_Body_Stub 96 - #define N_Function_Instantiation 97 - #define N_Package_Instantiation 98 - #define N_Procedure_Instantiation 99 - #define N_Package_Body 100 - #define N_Subprogram_Body 101 - #define N_Protected_Body 102 - #define N_Task_Body 103 - #define N_Implicit_Label_Declaration 104 - #define N_Package_Declaration 105 - #define N_Single_Task_Declaration 106 - #define N_Subprogram_Declaration 107 - #define N_Use_Package_Clause 108 - #define N_Generic_Package_Declaration 109 - #define N_Generic_Subprogram_Declaration 110 - #define N_Constrained_Array_Definition 111 - #define N_Unconstrained_Array_Definition 112 - #define N_Exception_Renaming_Declaration 113 - #define N_Object_Renaming_Declaration 114 - #define N_Package_Renaming_Declaration 115 - #define N_Subprogram_Renaming_Declaration 116 - #define N_Generic_Function_Renaming_Declaration 117 - #define N_Generic_Package_Renaming_Declaration 118 - #define N_Generic_Procedure_Renaming_Declaration 119 - #define N_Abort_Statement 120 - #define N_Accept_Statement 121 - #define N_Assignment_Statement 122 - #define N_Asynchronous_Select 123 - #define N_Block_Statement 124 - #define N_Case_Statement 125 - #define N_Code_Statement 126 - #define N_Conditional_Entry_Call 127 - #define N_Delay_Relative_Statement 128 - #define N_Delay_Until_Statement 129 - #define N_Entry_Call_Statement 130 - #define N_Free_Statement 131 - #define N_Goto_Statement 132 - #define N_Loop_Statement 133 - #define N_Null_Statement 134 - #define N_Raise_Statement 135 - #define N_Requeue_Statement 136 - #define N_Return_Statement 137 - #define N_Selective_Accept 138 - #define N_Timed_Entry_Call 139 - #define N_Exit_Statement 140 - #define N_If_Statement 141 - #define N_Accept_Alternative 142 - #define N_Delay_Alternative 143 - #define N_Elsif_Part 144 - #define N_Entry_Body_Formal_Part 145 - #define N_Iteration_Scheme 146 - #define N_Terminate_Alternative 147 - #define N_Abortable_Part 148 - #define N_Abstract_Subprogram_Declaration 149 - #define N_Access_Definition 150 - #define N_Access_To_Object_Definition 151 - #define N_Case_Statement_Alternative 152 - #define N_Compilation_Unit 153 - #define N_Compilation_Unit_Aux 154 - #define N_Component_Association 155 - #define N_Component_List 156 - #define N_Derived_Type_Definition 157 - #define N_Decimal_Fixed_Point_Definition 158 - #define N_Defining_Program_Unit_Name 159 - #define N_Delta_Constraint 160 - #define N_Designator 161 - #define N_Digits_Constraint 162 - #define N_Discriminant_Association 163 - #define N_Discriminant_Specification 164 - #define N_Enumeration_Type_Definition 165 - #define N_Entry_Body 166 - #define N_Entry_Call_Alternative 167 - #define N_Exception_Declaration 168 - #define N_Exception_Handler 169 - #define N_Floating_Point_Definition 170 - #define N_Formal_Decimal_Fixed_Point_Definition 171 - #define N_Formal_Derived_Type_Definition 172 - #define N_Formal_Discrete_Type_Definition 173 - #define N_Formal_Floating_Point_Definition 174 - #define N_Formal_Modular_Type_Definition 175 - #define N_Formal_Ordinary_Fixed_Point_Definition 176 - #define N_Formal_Package_Declaration 177 - #define N_Formal_Private_Type_Definition 178 - #define N_Formal_Signed_Integer_Type_Definition 179 - #define N_Formal_Subprogram_Declaration 180 - #define N_Generic_Association 181 - #define N_Handled_Sequence_Of_Statements 182 - #define N_Index_Or_Discriminant_Constraint 183 - #define N_Itype_Reference 184 - #define N_Label 185 - #define N_Modular_Type_Definition 186 - #define N_Number_Declaration 187 - #define N_Ordinary_Fixed_Point_Definition 188 - #define N_Others_Choice 189 - #define N_Package_Specification 190 - #define N_Parameter_Association 191 - #define N_Parameter_Specification 192 - #define N_Protected_Definition 193 - #define N_Range_Constraint 194 - #define N_Real_Range_Specification 195 - #define N_Record_Definition 196 - #define N_Signed_Integer_Type_Definition 197 - #define N_Single_Protected_Declaration 198 - #define N_Subunit 199 - #define N_Task_Definition 200 - #define N_Triggering_Alternative 201 - #define N_Use_Type_Clause 202 - #define N_Validate_Unchecked_Conversion 203 - #define N_Variant 204 - #define N_Variant_Part 205 - #define N_With_Clause 206 - #define N_With_Type_Clause 207 - #define N_Unused_At_End 208 - - #define Number_Node_Kinds 209 - SUBTYPE (N_Access_To_Subprogram_Definition, Node_Kind, - N_Access_Function_Definition, - N_Access_Procedure_Definition) - SUBTYPE (N_Array_Type_Definition, Node_Kind, - N_Constrained_Array_Definition, - N_Unconstrained_Array_Definition) - SUBTYPE (N_Binary_Op, Node_Kind, - N_Op_Add, - N_Op_Shift_Right_Arithmetic) - SUBTYPE (N_Body_Stub, Node_Kind, - N_Package_Body_Stub, - N_Task_Body_Stub) - SUBTYPE (N_Declaration, Node_Kind, - N_Component_Declaration, - N_Procedure_Specification) - SUBTYPE (N_Direct_Name, Node_Kind, - N_Identifier, - N_Character_Literal) - SUBTYPE (N_Entity, Node_Kind, - N_Defining_Character_Literal, - N_Defining_Operator_Symbol) - SUBTYPE (N_Generic_Declaration, Node_Kind, - N_Generic_Package_Declaration, - N_Generic_Subprogram_Declaration) - SUBTYPE (N_Generic_Instantiation, Node_Kind, - N_Function_Instantiation, - N_Procedure_Instantiation) - SUBTYPE (N_Generic_Renaming_Declaration, Node_Kind, - N_Generic_Function_Renaming_Declaration, - N_Generic_Procedure_Renaming_Declaration) - SUBTYPE (N_Has_Chars, Node_Kind, - N_Attribute_Definition_Clause, - N_Op_Plus) - SUBTYPE (N_Has_Entity, Node_Kind, - N_Expanded_Name, - N_Attribute_Reference) - SUBTYPE (N_Has_Etype, Node_Kind, - N_Error, - N_Subtype_Indication) - SUBTYPE (N_Has_Treat_Fixed_As_Integer, Node_Kind, - N_Op_Divide, - N_Op_Rem) - SUBTYPE (N_Later_Decl_Item, Node_Kind, - N_Task_Type_Declaration, - N_Generic_Subprogram_Declaration) - SUBTYPE (N_Op, Node_Kind, - N_Op_Add, - N_Op_Plus) - SUBTYPE (N_Op_Boolean, Node_Kind, - N_Op_And, - N_Op_Xor) - SUBTYPE (N_Op_Compare, Node_Kind, - N_Op_Eq, - N_Op_Ne) - SUBTYPE (N_Op_Shift, Node_Kind, - N_Op_Rotate_Left, - N_Op_Shift_Right_Arithmetic) - SUBTYPE (N_Proper_Body, Node_Kind, - N_Package_Body, - N_Task_Body) - SUBTYPE (N_Raise_xxx_Error, Node_Kind, - N_Raise_Constraint_Error, - N_Raise_Storage_Error) - SUBTYPE (N_Renaming_Declaration, Node_Kind, - N_Exception_Renaming_Declaration, - N_Generic_Procedure_Renaming_Declaration) - SUBTYPE (N_Representation_Clause, Node_Kind, - N_At_Clause, - N_Attribute_Definition_Clause) - SUBTYPE (N_Statement_Other_Than_Procedure_Call, Node_Kind, - N_Abort_Statement, - N_If_Statement) - SUBTYPE (N_Has_Condition, Node_Kind, - N_Exit_Statement, - N_Terminate_Alternative) - SUBTYPE (N_Subexpr, Node_Kind, - N_Expanded_Name, - N_Unchecked_Type_Conversion) - SUBTYPE (N_Subprogram_Specification, Node_Kind, - N_Function_Specification, - N_Procedure_Specification) - SUBTYPE (N_Unary_Op, Node_Kind, - N_Op_Abs, - N_Op_Plus) - SUBTYPE (N_Unit_Body, Node_Kind, - N_Package_Body, - N_Subprogram_Body) - INLINE Boolean ABE_Is_Certain (Node_Id N) - { return Flag18 (N); } - INLINE Boolean Abort_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Abortable_Part (Node_Id N) - { return Node2 (N); } - INLINE Boolean Abstract_Present (Node_Id N) - { return Flag4 (N); } - INLINE List_Id Accept_Handler_Records (Node_Id N) - { return List5 (N); } - INLINE Node_Id Accept_Statement (Node_Id N) - { return Node2 (N); } - INLINE Elist_Id Access_Types_To_Process (Node_Id N) - { return Elist2 (N); } - INLINE List_Id Actions (Node_Id N) - { return List1 (N); } - INLINE Node_Id Activation_Chain_Entity (Node_Id N) - { return Node3 (N); } - INLINE Boolean Acts_As_Spec (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Aggregate_Bounds (Node_Id N) - { return Node3 (N); } - INLINE Boolean Aliased_Present (Node_Id N) - { return Flag4 (N); } - INLINE Boolean All_Others (Node_Id N) - { return Flag11 (N); } - INLINE Boolean All_Present (Node_Id N) - { return Flag15 (N); } - INLINE List_Id Alternatives (Node_Id N) - { return List4 (N); } - INLINE Node_Id Ancestor_Part (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Array_Aggregate (Node_Id N) - { return Node3 (N); } - INLINE Boolean Assignment_OK (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Associated_Node (Node_Id N) - { return Node4 (N); } - INLINE Node_Id At_End_Proc (Node_Id N) - { return Node1 (N); } - INLINE Name_Id Attribute_Name (Node_Id N) - { return Name2 (N); } - INLINE Node_Id Aux_Decls_Node (Node_Id N) - { return Node5 (N); } - INLINE Boolean Backwards_OK (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Bad_Is_Detected (Node_Id N) - { return Flag15 (N); } - INLINE Boolean By_Ref (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Body_Required (Node_Id N) - { return Flag13 (N); } - INLINE Node_Id Body_To_Inline (Node_Id N) - { return Node3 (N); } - INLINE Boolean Box_Present (Node_Id N) - { return Flag15 (N); } - INLINE Char_Code Char_Literal_Value (Node_Id N) - { return Char_Code2 (N); } - INLINE Name_Id Chars (Node_Id N) - { return Name1 (N); } - INLINE Boolean Check_Address_Alignment (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Choice_Parameter (Node_Id N) - { return Node2 (N); } - INLINE List_Id Choices (Node_Id N) - { return List1 (N); } - INLINE Boolean Compile_Time_Known_Aggregate (Node_Id N) - { return Flag18 (N); } - INLINE List_Id Component_Associations (Node_Id N) - { return List2 (N); } - INLINE List_Id Component_Clauses (Node_Id N) - { return List3 (N); } - INLINE List_Id Component_Items (Node_Id N) - { return List3 (N); } - INLINE Node_Id Component_List (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Component_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Condition (Node_Id N) - { return Node1 (N); } - INLINE List_Id Condition_Actions (Node_Id N) - { return List3 (N); } - INLINE List_Id Config_Pragmas (Node_Id N) - { return List4 (N); } - INLINE Boolean Constant_Present (Node_Id N) - { return Flag17 (N); } - INLINE Node_Id Constraint (Node_Id N) - { return Node3 (N); } - INLINE List_Id Constraints (Node_Id N) - { return List1 (N); } - INLINE Boolean Context_Installed (Node_Id N) - { return Flag13 (N); } - INLINE List_Id Context_Items (Node_Id N) - { return List1 (N); } - INLINE Node_Id Controlling_Argument (Node_Id N) - { return Node1 (N); } - INLINE Boolean Conversion_OK (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Corresponding_Body (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Corresponding_Generic_Association (Node_Id N) - { return Node5 (N); } - INLINE Uint Corresponding_Integer_Value (Node_Id N) - { return Uint4 (N); } - INLINE Node_Id Corresponding_Spec (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Corresponding_Stub (Node_Id N) - { return Node3 (N); } - INLINE Entity_Id Dcheck_Function (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Debug_Statement (Node_Id N) - { return Node3 (N); } - INLINE List_Id Declarations (Node_Id N) - { return List2 (N); } - INLINE Node_Id Default_Expression (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Default_Name (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Defining_Identifier (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Defining_Unit_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Delay_Alternative (Node_Id N) - { return Node4 (N); } - INLINE Boolean Delay_Finalize_Attach (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Delay_Statement (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Delta_Expression (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Digits_Expression (Node_Id N) - { return Node2 (N); } - INLINE Boolean Discr_Check_Funcs_Built (Node_Id N) - { return Flag11 (N); } - INLINE List_Id Discrete_Choices (Node_Id N) - { return List4 (N); } - INLINE Node_Id Discrete_Range (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Discrete_Subtype_Definition (Node_Id N) - { return Node4 (N); } - INLINE List_Id Discrete_Subtype_Definitions (Node_Id N) - { return List2 (N); } - INLINE List_Id Discriminant_Specifications (Node_Id N) - { return List4 (N); } - INLINE Node_Id Discriminant_Type (Node_Id N) - { return Node5 (N); } - INLINE Boolean Do_Accessibility_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Discriminant_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Division_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Length_Check (Node_Id N) - { return Flag4 (N); } - INLINE Boolean Do_Overflow_Check (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Do_Range_Check (Node_Id N) - { return Flag9 (N); } - INLINE Boolean Do_Storage_Check (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Do_Tag_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Elaborate_All_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Elaborate_Present (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Elaboration_Boolean (Node_Id N) - { return Node2 (N); } - INLINE List_Id Else_Actions (Node_Id N) - { return List3 (N); } - INLINE List_Id Else_Statements (Node_Id N) - { return List4 (N); } - INLINE List_Id Elsif_Parts (Node_Id N) - { return List3 (N); } - INLINE Node_Id Enclosing_Variant (Node_Id N) - { return Node2 (N); } - INLINE Node_Id End_Label (Node_Id N) - { return Node4 (N); } - INLINE Uint End_Span (Node_Id N) - { return Uint5 (N); } - INLINE Node_Id Entity (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Entry_Body_Formal_Part (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Entry_Call_Alternative (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Call_Statement (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Direct_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Index (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Entry_Index_Specification (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Etype (Node_Id N) - { return Node5 (N); } - INLINE List_Id Exception_Choices (Node_Id N) - { return List4 (N); } - INLINE List_Id Exception_Handlers (Node_Id N) - { return List5 (N); } - INLINE Boolean Exception_Junk (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Explicit_Actual_Parameter (Node_Id N) - { return Node3 (N); } - INLINE Boolean Expansion_Delayed (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Explicit_Generic_Actual_Parameter (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Expression (Node_Id N) - { return Node3 (N); } - INLINE List_Id Expressions (Node_Id N) - { return List1 (N); } - INLINE Node_Id First_Bit (Node_Id N) - { return Node3 (N); } - INLINE Entity_Id First_Inlined_Subprogram (Node_Id N) - { return Node3 (N); } - INLINE Boolean First_Name (Node_Id N) - { return Flag5 (N); } - INLINE Node_Id First_Named_Actual (Node_Id N) - { return Node4 (N); } - INLINE Node_Id First_Real_Statement (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id First_Subtype_Link (Node_Id N) - { return Node5 (N); } - INLINE Boolean Float_Truncate (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Formal_Type_Definition (Node_Id N) - { return Node3 (N); } - INLINE Boolean Forwards_OK (Node_Id N) - { return Flag5 (N); } - INLINE Boolean From_At_Mod (Node_Id N) - { return Flag4 (N); } - INLINE List_Id Generic_Associations (Node_Id N) - { return List3 (N); } - INLINE List_Id Generic_Formal_Declarations (Node_Id N) - { return List2 (N); } - INLINE Node_Id Generic_Parent (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Generic_Parent_Type (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Handled_Statement_Sequence (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Handler_List_Entry (Node_Id N) - { return Node2 (N); } - INLINE Boolean Has_Created_Identifier (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Has_Dynamic_Length_Check (Node_Id N) - { return Flag10 (N); } - INLINE Boolean Has_Dynamic_Range_Check (Node_Id N) - { return Flag12 (N); } - INLINE Boolean Has_No_Elaboration_Code (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Has_Priority_Pragma (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Has_Private_View (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Has_Storage_Size_Pragma (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Has_Task_Info_Pragma (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Has_Task_Name_Pragma (Node_Id N) - { return Flag8 (N); } - INLINE Boolean Has_Wide_Character (Node_Id N) - { return Flag11 (N); } - INLINE Elist_Id Hidden_By_Use_Clause (Node_Id N) - { return Elist4 (N); } - INLINE Node_Id High_Bound (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Identifier (Node_Id N) - { return Node1 (N); } - INLINE Boolean Implicit_With (Node_Id N) - { return Flag16 (N); } - INLINE Boolean In_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Includes_Infinities (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Instance_Spec (Node_Id N) - { return Node5 (N); } - INLINE Uint Intval (Node_Id N) - { return Uint3 (N); } - INLINE Boolean Is_Asynchronous_Call_Block (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Is_Component_Left_Opnd (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Is_Component_Right_Opnd (Node_Id N) - { return Flag14 (N); } - INLINE Boolean Is_Controlling_Actual (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_In_Discriminant_Check (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Is_Machine_Number (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Is_Null_Loop (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_Overloaded (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Is_Power_Of_2_For_Shift (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Is_Protected_Subprogram_Body (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Is_Static_Expression (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Is_Subprogram_Descriptor (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_Task_Allocation_Block (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Is_Task_Master (Node_Id N) - { return Flag5 (N); } - INLINE Node_Id Iteration_Scheme (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Itype (Node_Id N) - { return Node1 (N); } - INLINE Boolean Kill_Range_Check (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Label_Construct (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Left_Opnd (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Last_Bit (Node_Id N) - { return Node4 (N); } - INLINE Boolean Last_Name (Node_Id N) - { return Flag6 (N); } - INLINE Node_Id Library_Unit (Node_Id N) - { return Node4 (N); } - INLINE Boolean Limited_View_Installed (Node_Id N) - { return Flag18 (N); } - INLINE Boolean Limited_Present (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Literals (Node_Id N) - { return List1 (N); } - INLINE List_Id Loop_Actions (Node_Id N) - { return List2 (N); } - INLINE Node_Id Loop_Parameter_Specification (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Low_Bound (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Mod_Clause (Node_Id N) - { return Node2 (N); } - INLINE Boolean More_Ids (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Must_Be_Byte_Aligned (Node_Id N) - { return Flag14 (N); } - INLINE Boolean Must_Not_Freeze (Node_Id N) - { return Flag8 (N); } - INLINE Node_Id Name (Node_Id N) - { return Node2 (N); } - INLINE List_Id Names (Node_Id N) - { return List2 (N); } - INLINE Node_Id Next_Entity (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Next_Named_Actual (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Next_Rep_Item (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Next_Use_Clause (Node_Id N) - { return Node3 (N); } - INLINE Boolean No_Ctrl_Actions (Node_Id N) - { return Flag7 (N); } - INLINE Boolean No_Entities_Ref_In_Spec (Node_Id N) - { return Flag8 (N); } - INLINE Boolean No_Initialization (Node_Id N) - { return Flag13 (N); } - INLINE Boolean No_Truncation (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Null_Present (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Null_Record_Present (Node_Id N) - { return Flag17 (N); } - INLINE Node_Id Object_Definition (Node_Id N) - { return Node4 (N); } - INLINE Boolean OK_For_Stream (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Original_Discriminant (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Original_Entity (Node_Id N) - { return Node2 (N); } - INLINE List_Id Others_Discrete_Choices (Node_Id N) - { return List1 (N); } - INLINE Boolean Out_Present (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Parameter_Associations (Node_Id N) - { return List3 (N); } - INLINE Boolean Parameter_List_Truncated (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Parameter_Specifications (Node_Id N) - { return List3 (N); } - INLINE Node_Id Parameter_Type (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Parent_Spec (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Position (Node_Id N) - { return Node2 (N); } - INLINE List_Id Pragma_Argument_Associations (Node_Id N) - { return List2 (N); } - INLINE List_Id Pragmas_After (Node_Id N) - { return List5 (N); } - INLINE List_Id Pragmas_Before (Node_Id N) - { return List4 (N); } - INLINE Node_Id Prefix (Node_Id N) - { return Node3 (N); } - INLINE Uint Present_Expr (Node_Id N) - { return Uint3 (N); } - INLINE Boolean Prev_Ids (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Print_In_Hex (Node_Id N) - { return Flag13 (N); } - INLINE List_Id Private_Declarations (Node_Id N) - { return List3 (N); } - INLINE Boolean Private_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Procedure_To_Call (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Proper_Body (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Protected_Definition (Node_Id N) - { return Node3 (N); } - INLINE Boolean Protected_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Raises_Constraint_Error (Node_Id N) - { return Flag7 (N); } - INLINE Node_Id Range_Constraint (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Range_Expression (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Real_Range_Specification (Node_Id N) - { return Node4 (N); } - INLINE Ureal Realval (Node_Id N) - { return Ureal3 (N); } - INLINE Uint Reason (Node_Id N) - { return Uint3 (N); } - INLINE Node_Id Record_Extension_Part (Node_Id N) - { return Node3 (N); } - INLINE Boolean Redundant_Use (Node_Id N) - { return Flag13 (N); } - INLINE Node_Id Return_Type (Node_Id N) - { return Node2 (N); } - INLINE Boolean Reverse_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Right_Opnd (Node_Id N) - { return Node3 (N); } - INLINE Boolean Rounded_Result (Node_Id N) - { return Flag18 (N); } - INLINE Node_Id Scope (Node_Id N) - { return Node3 (N); } - INLINE List_Id Select_Alternatives (Node_Id N) - { return List1 (N); } - INLINE Node_Id Selector_Name (Node_Id N) - { return Node2 (N); } - INLINE List_Id Selector_Names (Node_Id N) - { return List1 (N); } - INLINE Boolean Shift_Count_OK (Node_Id N) - { return Flag4 (N); } - INLINE Entity_Id Source_Type (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Specification (Node_Id N) - { return Node1 (N); } - INLINE List_Id Statements (Node_Id N) - { return List3 (N); } - INLINE Boolean Static_Processing_OK (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Storage_Pool (Node_Id N) - { return Node1 (N); } - INLINE String_Id Strval (Node_Id N) - { return Str3 (N); } - INLINE Node_Id Subtype_Indication (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Subtype_Mark (Node_Id N) - { return Node4 (N); } - INLINE List_Id Subtype_Marks (Node_Id N) - { return List2 (N); } - INLINE Boolean Tagged_Present (Node_Id N) - { return Flag15 (N); } - INLINE Entity_Id Target_Type (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Task_Body_Procedure (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Task_Definition (Node_Id N) - { return Node3 (N); } - INLINE List_Id Then_Actions (Node_Id N) - { return List2 (N); } - INLINE List_Id Then_Statements (Node_Id N) - { return List2 (N); } - INLINE Boolean Treat_Fixed_As_Integer (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Triggering_Alternative (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Triggering_Statement (Node_Id N) - { return Node1 (N); } - INLINE Elist_Id TSS_Elist (Node_Id N) - { return Elist3 (N); } - INLINE Node_Id Type_Definition (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Unit (Node_Id N) - { return Node2 (N); } - INLINE Boolean Unknown_Discriminants_Present (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Unreferenced_In_Spec (Node_Id N) - { return Flag7 (N); } - INLINE Node_Id Variant_Part (Node_Id N) - { return Node4 (N); } - INLINE List_Id Variants (Node_Id N) - { return List1 (N); } - INLINE List_Id Visible_Declarations (Node_Id N) - { return List2 (N); } - INLINE Boolean Was_Originally_Stub (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Zero_Cost_Handling (Node_Id N) - { return Flag5 (N); } - diff --git a/gcc/ada/sinput-p.adb b/gcc/ada/sinput-p.adb index 5edc13bf9ae..89befb6a0c6 100644 --- a/gcc/ada/sinput-p.adb +++ b/gcc/ada/sinput-p.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -24,7 +24,6 @@ -- -- ------------------------------------------------------------------------------ -with Prj; use Prj; with Prj.Err; with Sinput.C; @@ -97,7 +96,7 @@ package body Sinput.P is or else Token = Tok_Private or else (Token not in Token_Class_Cunit and then Token /= Tok_EOF) loop - Scan; + Prj.Err.Scanner.Scan; end loop; return Token = Tok_Separate; diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb index 25b74a8c694..3ab47c7106a 100644 --- a/gcc/ada/sinput.adb +++ b/gcc/ada/sinput.adb @@ -1110,17 +1110,31 @@ package body Sinput is function Source_First (S : SFI) return Source_Ptr is begin - return Source_File.Table (S).Source_First; + if S = Internal_Source_File then + return Internal_Source'First; + else + return Source_File.Table (S).Source_First; + end if; end Source_First; function Source_Last (S : SFI) return Source_Ptr is begin - return Source_File.Table (S).Source_Last; + if S = Internal_Source_File then + return Internal_Source'Last; + else + return Source_File.Table (S).Source_Last; + end if; + end Source_Last; function Source_Text (S : SFI) return Source_Buffer_Ptr is begin - return Source_File.Table (S).Source_Text; + if S = Internal_Source_File then + return Internal_Source_Ptr; + else + return Source_File.Table (S).Source_Text; + end if; + end Source_Text; function Template (S : SFI) return SFI is diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb index 944fe9c397c..85294fe3159 100644 --- a/gcc/ada/snames.adb +++ b/gcc/ada/snames.adb @@ -62,8 +62,8 @@ package body Snames is "off#" & "space#" & "time#" & - "_alignment#" & "_abort_signal#" & + "_alignment#" & "_assign#" & "_chain#" & "_clean#" & @@ -77,6 +77,8 @@ package body Snames is "_master#" & "_object#" & "_priority#" & + "_process_atsd#" & + "_secondary_stack#" & "_service#" & "_size#" & "_tags#" & @@ -274,6 +276,7 @@ package body Snames is "task_info#" & "task_name#" & "task_storage#" & + "thread_body#" & "time_slice#" & "title#" & "unchecked_union#" & @@ -336,6 +339,7 @@ package body Snames is "result_type#" & "runtime#" & "sb#" & + "secondary_stack_size#" & "section#" & "semaphore#" & "spec_file_name#" & @@ -614,8 +618,10 @@ package body Snames is "library_kind#" & "library_name#" & "library_options#" & + "library_reference_symbol_file#" & "library_src_dir#" & "library_symbol_file#" & + "library_symbol_policy#" & "library_version#" & "linker#" & "local_configuration_pragmas#" & diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads index 3d1705e584c..df33ca06bb0 100644 --- a/gcc/ada/snames.ads +++ b/gcc/ada/snames.ads @@ -145,8 +145,8 @@ package Snames is -- at the start of these names get translated to extra underscores. These -- names are only referenced internally by expander generated code. - Name_uAlignment : constant Name_Id := N + 005; - Name_uAbort_Signal : constant Name_Id := N + 006; + Name_uAbort_Signal : constant Name_Id := N + 005; + Name_uAlignment : constant Name_Id := N + 006; Name_uAssign : constant Name_Id := N + 007; Name_uChain : constant Name_Id := N + 008; Name_uClean : constant Name_Id := N + 009; @@ -160,113 +160,115 @@ package Snames is Name_uMaster : constant Name_Id := N + 017; Name_uObject : constant Name_Id := N + 018; Name_uPriority : constant Name_Id := N + 019; - Name_uService : constant Name_Id := N + 020; - Name_uSize : constant Name_Id := N + 021; - Name_uTags : constant Name_Id := N + 022; - Name_uTask : constant Name_Id := N + 023; - Name_uTask_Id : constant Name_Id := N + 024; - Name_uTask_Info : constant Name_Id := N + 025; - Name_uTask_Name : constant Name_Id := N + 026; - Name_uTrace_Sp : constant Name_Id := N + 027; + Name_uProcess_ATSD : constant Name_Id := N + 020; + Name_uSecondary_Stack : constant Name_Id := N + 021; + Name_uService : constant Name_Id := N + 022; + Name_uSize : constant Name_Id := N + 023; + Name_uTags : constant Name_Id := N + 024; + Name_uTask : constant Name_Id := N + 025; + Name_uTask_Id : constant Name_Id := N + 026; + Name_uTask_Info : constant Name_Id := N + 027; + Name_uTask_Name : constant Name_Id := N + 028; + Name_uTrace_Sp : constant Name_Id := N + 029; -- Names of routines in Ada.Finalization, needed by expander - Name_Initialize : constant Name_Id := N + 028; - Name_Adjust : constant Name_Id := N + 029; - Name_Finalize : constant Name_Id := N + 030; + Name_Initialize : constant Name_Id := N + 030; + Name_Adjust : constant Name_Id := N + 031; + Name_Finalize : constant Name_Id := N + 032; -- Names of fields declared in System.Finalization_Implementation, -- needed by the expander when generating code for finalization. - Name_Next : constant Name_Id := N + 031; - Name_Prev : constant Name_Id := N + 032; + Name_Next : constant Name_Id := N + 033; + Name_Prev : constant Name_Id := N + 034; -- Names of allocation routines, also needed by expander - Name_Allocate : constant Name_Id := N + 033; - Name_Deallocate : constant Name_Id := N + 034; - Name_Dereference : constant Name_Id := N + 035; + Name_Allocate : constant Name_Id := N + 035; + Name_Deallocate : constant Name_Id := N + 036; + Name_Dereference : constant Name_Id := N + 037; -- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge) - First_Text_IO_Package : constant Name_Id := N + 036; - Name_Decimal_IO : constant Name_Id := N + 036; - Name_Enumeration_IO : constant Name_Id := N + 037; - Name_Fixed_IO : constant Name_Id := N + 038; - Name_Float_IO : constant Name_Id := N + 039; - Name_Integer_IO : constant Name_Id := N + 040; - Name_Modular_IO : constant Name_Id := N + 041; - Last_Text_IO_Package : constant Name_Id := N + 041; + First_Text_IO_Package : constant Name_Id := N + 038; + Name_Decimal_IO : constant Name_Id := N + 038; + Name_Enumeration_IO : constant Name_Id := N + 039; + Name_Fixed_IO : constant Name_Id := N + 040; + Name_Float_IO : constant Name_Id := N + 041; + Name_Integer_IO : constant Name_Id := N + 042; + Name_Modular_IO : constant Name_Id := N + 043; + Last_Text_IO_Package : constant Name_Id := N + 043; subtype Text_IO_Package_Name is Name_Id range First_Text_IO_Package .. Last_Text_IO_Package; -- Names of files in library for Ada.Text_IO and Ada.Wide_Text_IO - Name_a_textio : constant Name_Id := N + 042; - Name_a_witeio : constant Name_Id := N + 043; + Name_a_textio : constant Name_Id := N + 044; + Name_a_witeio : constant Name_Id := N + 045; -- Some miscellaneous names used for error detection/recovery - Name_Const : constant Name_Id := N + 044; - Name_Error : constant Name_Id := N + 045; - Name_Go : constant Name_Id := N + 046; - Name_Put : constant Name_Id := N + 047; - Name_Put_Line : constant Name_Id := N + 048; - Name_To : constant Name_Id := N + 049; + Name_Const : constant Name_Id := N + 046; + Name_Error : constant Name_Id := N + 047; + Name_Go : constant Name_Id := N + 048; + Name_Put : constant Name_Id := N + 049; + Name_Put_Line : constant Name_Id := N + 050; + Name_To : constant Name_Id := N + 051; -- Names for packages that are treated specially by the compiler - Name_Finalization : constant Name_Id := N + 050; - Name_Finalization_Root : constant Name_Id := N + 051; - Name_Interfaces : constant Name_Id := N + 052; - Name_Standard : constant Name_Id := N + 053; - Name_System : constant Name_Id := N + 054; - Name_Text_IO : constant Name_Id := N + 055; - Name_Wide_Text_IO : constant Name_Id := N + 056; + Name_Finalization : constant Name_Id := N + 052; + Name_Finalization_Root : constant Name_Id := N + 053; + Name_Interfaces : constant Name_Id := N + 054; + Name_Standard : constant Name_Id := N + 055; + Name_System : constant Name_Id := N + 056; + Name_Text_IO : constant Name_Id := N + 057; + Name_Wide_Text_IO : constant Name_Id := N + 058; -- Names of identifiers used in expanding distribution stubs - Name_Addr : constant Name_Id := N + 057; - Name_Async : constant Name_Id := N + 058; - Name_Get_Active_Partition_ID : constant Name_Id := N + 059; - Name_Get_RCI_Package_Receiver : constant Name_Id := N + 060; - Name_Origin : constant Name_Id := N + 061; - Name_Params : constant Name_Id := N + 062; - Name_Partition : constant Name_Id := N + 063; - Name_Partition_Interface : constant Name_Id := N + 064; - Name_Ras : constant Name_Id := N + 065; - Name_RCI_Name : constant Name_Id := N + 066; - Name_Receiver : constant Name_Id := N + 067; - Name_Result : constant Name_Id := N + 068; - Name_Rpc : constant Name_Id := N + 069; - Name_Subp_Id : constant Name_Id := N + 070; + Name_Addr : constant Name_Id := N + 059; + Name_Async : constant Name_Id := N + 060; + Name_Get_Active_Partition_ID : constant Name_Id := N + 061; + Name_Get_RCI_Package_Receiver : constant Name_Id := N + 062; + Name_Origin : constant Name_Id := N + 063; + Name_Params : constant Name_Id := N + 064; + Name_Partition : constant Name_Id := N + 065; + Name_Partition_Interface : constant Name_Id := N + 066; + Name_Ras : constant Name_Id := N + 067; + Name_RCI_Name : constant Name_Id := N + 068; + Name_Receiver : constant Name_Id := N + 069; + Name_Result : constant Name_Id := N + 070; + Name_Rpc : constant Name_Id := N + 071; + Name_Subp_Id : constant Name_Id := N + 072; -- Operator Symbol entries. The actual names have an upper case O at -- the start in place of the Op_ prefix (e.g. the actual name that -- corresponds to Name_Op_Abs is "Oabs". - First_Operator_Name : constant Name_Id := N + 071; - Name_Op_Abs : constant Name_Id := N + 071; -- "abs" - Name_Op_And : constant Name_Id := N + 072; -- "and" - Name_Op_Mod : constant Name_Id := N + 073; -- "mod" - Name_Op_Not : constant Name_Id := N + 074; -- "not" - Name_Op_Or : constant Name_Id := N + 075; -- "or" - Name_Op_Rem : constant Name_Id := N + 076; -- "rem" - Name_Op_Xor : constant Name_Id := N + 077; -- "xor" - Name_Op_Eq : constant Name_Id := N + 078; -- "=" - Name_Op_Ne : constant Name_Id := N + 079; -- "/=" - Name_Op_Lt : constant Name_Id := N + 080; -- "<" - Name_Op_Le : constant Name_Id := N + 081; -- "<=" - Name_Op_Gt : constant Name_Id := N + 082; -- ">" - Name_Op_Ge : constant Name_Id := N + 083; -- ">=" - Name_Op_Add : constant Name_Id := N + 084; -- "+" - Name_Op_Subtract : constant Name_Id := N + 085; -- "-" - Name_Op_Concat : constant Name_Id := N + 086; -- "&" - Name_Op_Multiply : constant Name_Id := N + 087; -- "*" - Name_Op_Divide : constant Name_Id := N + 088; -- "/" - Name_Op_Expon : constant Name_Id := N + 089; -- "**" - Last_Operator_Name : constant Name_Id := N + 089; + First_Operator_Name : constant Name_Id := N + 073; + Name_Op_Abs : constant Name_Id := N + 073; -- "abs" + Name_Op_And : constant Name_Id := N + 074; -- "and" + Name_Op_Mod : constant Name_Id := N + 075; -- "mod" + Name_Op_Not : constant Name_Id := N + 076; -- "not" + Name_Op_Or : constant Name_Id := N + 077; -- "or" + Name_Op_Rem : constant Name_Id := N + 078; -- "rem" + Name_Op_Xor : constant Name_Id := N + 079; -- "xor" + Name_Op_Eq : constant Name_Id := N + 080; -- "=" + Name_Op_Ne : constant Name_Id := N + 081; -- "/=" + Name_Op_Lt : constant Name_Id := N + 082; -- "<" + Name_Op_Le : constant Name_Id := N + 083; -- "<=" + Name_Op_Gt : constant Name_Id := N + 084; -- ">" + Name_Op_Ge : constant Name_Id := N + 085; -- ">=" + Name_Op_Add : constant Name_Id := N + 086; -- "+" + Name_Op_Subtract : constant Name_Id := N + 087; -- "-" + Name_Op_Concat : constant Name_Id := N + 088; -- "&" + Name_Op_Multiply : constant Name_Id := N + 089; -- "*" + Name_Op_Divide : constant Name_Id := N + 090; -- "/" + Name_Op_Expon : constant Name_Id := N + 091; -- "**" + Last_Operator_Name : constant Name_Id := N + 091; -- Names for all pragmas recognized by GNAT. The entries with the comment -- "Ada 83" are pragmas that are defined in Ada 83, but not in Ada 95. @@ -286,59 +288,59 @@ package Snames is -- only in GNAT for the AAMP. They are ignored in other versions with -- appropriate warnings. - First_Pragma_Name : constant Name_Id := N + 090; + First_Pragma_Name : constant Name_Id := N + 092; -- Configuration pragmas are grouped at start - Name_Ada_83 : constant Name_Id := N + 090; -- GNAT - Name_Ada_95 : constant Name_Id := N + 091; -- GNAT - Name_C_Pass_By_Copy : constant Name_Id := N + 092; -- GNAT - Name_Compile_Time_Warning : constant Name_Id := N + 093; -- GNAT - Name_Component_Alignment : constant Name_Id := N + 094; -- GNAT - Name_Convention_Identifier : constant Name_Id := N + 095; -- GNAT - Name_Discard_Names : constant Name_Id := N + 096; - Name_Elaboration_Checks : constant Name_Id := N + 097; -- GNAT - Name_Eliminate : constant Name_Id := N + 098; -- GNAT - Name_Explicit_Overriding : constant Name_Id := N + 099; - Name_Extend_System : constant Name_Id := N + 100; -- GNAT - Name_Extensions_Allowed : constant Name_Id := N + 101; -- GNAT - Name_External_Name_Casing : constant Name_Id := N + 102; -- GNAT - Name_Float_Representation : constant Name_Id := N + 103; -- GNAT - Name_Initialize_Scalars : constant Name_Id := N + 104; -- GNAT - Name_Interrupt_State : constant Name_Id := N + 105; -- GNAT - Name_License : constant Name_Id := N + 106; -- GNAT - Name_Locking_Policy : constant Name_Id := N + 107; - Name_Long_Float : constant Name_Id := N + 108; -- VMS - Name_No_Run_Time : constant Name_Id := N + 109; -- GNAT - Name_Normalize_Scalars : constant Name_Id := N + 110; - Name_Polling : constant Name_Id := N + 111; -- GNAT - Name_Persistent_Data : constant Name_Id := N + 112; -- GNAT - Name_Persistent_Object : constant Name_Id := N + 113; -- GNAT - Name_Propagate_Exceptions : constant Name_Id := N + 114; -- GNAT - Name_Queuing_Policy : constant Name_Id := N + 115; - Name_Ravenscar : constant Name_Id := N + 116; - Name_Restricted_Run_Time : constant Name_Id := N + 117; - Name_Restrictions : constant Name_Id := N + 118; - Name_Restriction_Warnings : constant Name_Id := N + 119; -- GNAT - Name_Reviewable : constant Name_Id := N + 120; - Name_Source_File_Name : constant Name_Id := N + 121; -- GNAT - Name_Source_File_Name_Project : constant Name_Id := N + 122; -- GNAT - Name_Style_Checks : constant Name_Id := N + 123; -- GNAT - Name_Suppress : constant Name_Id := N + 124; - Name_Suppress_Exception_Locations : constant Name_Id := N + 125; -- GNAT - Name_Task_Dispatching_Policy : constant Name_Id := N + 126; - Name_Universal_Data : constant Name_Id := N + 127; -- AAMP - Name_Unsuppress : constant Name_Id := N + 128; -- GNAT - Name_Use_VADS_Size : constant Name_Id := N + 129; -- GNAT - Name_Validity_Checks : constant Name_Id := N + 130; -- GNAT - Name_Warnings : constant Name_Id := N + 131; -- GNAT - Last_Configuration_Pragma_Name : constant Name_Id := N + 131; + Name_Ada_83 : constant Name_Id := N + 092; -- GNAT + Name_Ada_95 : constant Name_Id := N + 093; -- GNAT + Name_C_Pass_By_Copy : constant Name_Id := N + 094; -- GNAT + Name_Compile_Time_Warning : constant Name_Id := N + 095; -- GNAT + Name_Component_Alignment : constant Name_Id := N + 096; -- GNAT + Name_Convention_Identifier : constant Name_Id := N + 097; -- GNAT + Name_Discard_Names : constant Name_Id := N + 098; + Name_Elaboration_Checks : constant Name_Id := N + 099; -- GNAT + Name_Eliminate : constant Name_Id := N + 100; -- GNAT + Name_Explicit_Overriding : constant Name_Id := N + 101; + Name_Extend_System : constant Name_Id := N + 102; -- GNAT + Name_Extensions_Allowed : constant Name_Id := N + 103; -- GNAT + Name_External_Name_Casing : constant Name_Id := N + 104; -- GNAT + Name_Float_Representation : constant Name_Id := N + 105; -- GNAT + Name_Initialize_Scalars : constant Name_Id := N + 106; -- GNAT + Name_Interrupt_State : constant Name_Id := N + 107; -- GNAT + Name_License : constant Name_Id := N + 108; -- GNAT + Name_Locking_Policy : constant Name_Id := N + 109; + Name_Long_Float : constant Name_Id := N + 110; -- VMS + Name_No_Run_Time : constant Name_Id := N + 111; -- GNAT + Name_Normalize_Scalars : constant Name_Id := N + 112; + Name_Polling : constant Name_Id := N + 113; -- GNAT + Name_Persistent_Data : constant Name_Id := N + 114; -- GNAT + Name_Persistent_Object : constant Name_Id := N + 115; -- GNAT + Name_Propagate_Exceptions : constant Name_Id := N + 116; -- GNAT + Name_Queuing_Policy : constant Name_Id := N + 117; + Name_Ravenscar : constant Name_Id := N + 118; + Name_Restricted_Run_Time : constant Name_Id := N + 119; + Name_Restrictions : constant Name_Id := N + 120; + Name_Restriction_Warnings : constant Name_Id := N + 121; -- GNAT + Name_Reviewable : constant Name_Id := N + 122; + Name_Source_File_Name : constant Name_Id := N + 123; -- GNAT + Name_Source_File_Name_Project : constant Name_Id := N + 124; -- GNAT + Name_Style_Checks : constant Name_Id := N + 125; -- GNAT + Name_Suppress : constant Name_Id := N + 126; + Name_Suppress_Exception_Locations : constant Name_Id := N + 127; -- GNAT + Name_Task_Dispatching_Policy : constant Name_Id := N + 128; + Name_Universal_Data : constant Name_Id := N + 129; -- AAMP + Name_Unsuppress : constant Name_Id := N + 130; -- GNAT + Name_Use_VADS_Size : constant Name_Id := N + 131; -- GNAT + Name_Validity_Checks : constant Name_Id := N + 132; -- GNAT + Name_Warnings : constant Name_Id := N + 133; -- GNAT + Last_Configuration_Pragma_Name : constant Name_Id := N + 133; -- Remaining pragma names - Name_Abort_Defer : constant Name_Id := N + 132; -- GNAT - Name_All_Calls_Remote : constant Name_Id := N + 133; - Name_Annotate : constant Name_Id := N + 134; -- GNAT + Name_Abort_Defer : constant Name_Id := N + 134; -- GNAT + Name_All_Calls_Remote : constant Name_Id := N + 135; + Name_Annotate : constant Name_Id := N + 136; -- GNAT -- Note: AST_Entry is not in this list because its name matches the -- name of the corresponding attribute. However, it is included in the @@ -346,78 +348,78 @@ package Snames is -- and Check_Pragma_Id correctly recognize and process Name_AST_Entry. -- AST_Entry is a VMS specific pragma. - Name_Assert : constant Name_Id := N + 135; -- GNAT - Name_Asynchronous : constant Name_Id := N + 136; - Name_Atomic : constant Name_Id := N + 137; - Name_Atomic_Components : constant Name_Id := N + 138; - Name_Attach_Handler : constant Name_Id := N + 139; - Name_Comment : constant Name_Id := N + 140; -- GNAT - Name_Common_Object : constant Name_Id := N + 141; -- GNAT - Name_Complex_Representation : constant Name_Id := N + 142; -- GNAT - Name_Controlled : constant Name_Id := N + 143; - Name_Convention : constant Name_Id := N + 144; - Name_CPP_Class : constant Name_Id := N + 145; -- GNAT - Name_CPP_Constructor : constant Name_Id := N + 146; -- GNAT - Name_CPP_Virtual : constant Name_Id := N + 147; -- GNAT - Name_CPP_Vtable : constant Name_Id := N + 148; -- GNAT - Name_Debug : constant Name_Id := N + 149; -- GNAT - Name_Elaborate : constant Name_Id := N + 150; -- Ada 83 - Name_Elaborate_All : constant Name_Id := N + 151; - Name_Elaborate_Body : constant Name_Id := N + 152; - Name_Export : constant Name_Id := N + 153; - Name_Export_Exception : constant Name_Id := N + 154; -- VMS - Name_Export_Function : constant Name_Id := N + 155; -- GNAT - Name_Export_Object : constant Name_Id := N + 156; -- GNAT - Name_Export_Procedure : constant Name_Id := N + 157; -- GNAT - Name_Export_Value : constant Name_Id := N + 158; -- GNAT - Name_Export_Valued_Procedure : constant Name_Id := N + 159; -- GNAT - Name_External : constant Name_Id := N + 160; -- GNAT - Name_Finalize_Storage_Only : constant Name_Id := N + 161; -- GNAT - Name_Ident : constant Name_Id := N + 162; -- VMS - Name_Import : constant Name_Id := N + 163; - Name_Import_Exception : constant Name_Id := N + 164; -- VMS - Name_Import_Function : constant Name_Id := N + 165; -- GNAT - Name_Import_Object : constant Name_Id := N + 166; -- GNAT - Name_Import_Procedure : constant Name_Id := N + 167; -- GNAT - Name_Import_Valued_Procedure : constant Name_Id := N + 168; -- GNAT - Name_Inline : constant Name_Id := N + 169; - Name_Inline_Always : constant Name_Id := N + 170; -- GNAT - Name_Inline_Generic : constant Name_Id := N + 171; -- GNAT - Name_Inspection_Point : constant Name_Id := N + 172; - Name_Interface : constant Name_Id := N + 173; -- Ada 83 - Name_Interface_Name : constant Name_Id := N + 174; -- GNAT - Name_Interrupt_Handler : constant Name_Id := N + 175; - Name_Interrupt_Priority : constant Name_Id := N + 176; - Name_Java_Constructor : constant Name_Id := N + 177; -- GNAT - Name_Java_Interface : constant Name_Id := N + 178; -- GNAT - Name_Keep_Names : constant Name_Id := N + 179; -- GNAT - Name_Link_With : constant Name_Id := N + 180; -- GNAT - Name_Linker_Alias : constant Name_Id := N + 181; -- GNAT - Name_Linker_Options : constant Name_Id := N + 182; - Name_Linker_Section : constant Name_Id := N + 183; -- GNAT - Name_List : constant Name_Id := N + 184; - Name_Machine_Attribute : constant Name_Id := N + 185; -- GNAT - Name_Main : constant Name_Id := N + 186; -- GNAT - Name_Main_Storage : constant Name_Id := N + 187; -- GNAT - Name_Memory_Size : constant Name_Id := N + 188; -- Ada 83 - Name_No_Return : constant Name_Id := N + 189; -- GNAT - Name_Obsolescent : constant Name_Id := N + 190; -- GNAT - Name_Optimize : constant Name_Id := N + 191; - Name_Optional_Overriding : constant Name_Id := N + 192; - Name_Overriding : constant Name_Id := N + 193; - Name_Pack : constant Name_Id := N + 194; - Name_Page : constant Name_Id := N + 195; - Name_Passive : constant Name_Id := N + 196; -- GNAT - Name_Preelaborate : constant Name_Id := N + 197; - Name_Priority : constant Name_Id := N + 198; - Name_Psect_Object : constant Name_Id := N + 199; -- VMS - Name_Pure : constant Name_Id := N + 200; - Name_Pure_Function : constant Name_Id := N + 201; -- GNAT - Name_Remote_Call_Interface : constant Name_Id := N + 202; - Name_Remote_Types : constant Name_Id := N + 203; - Name_Share_Generic : constant Name_Id := N + 204; -- GNAT - Name_Shared : constant Name_Id := N + 205; -- Ada 83 - Name_Shared_Passive : constant Name_Id := N + 206; + Name_Assert : constant Name_Id := N + 137; -- GNAT + Name_Asynchronous : constant Name_Id := N + 138; + Name_Atomic : constant Name_Id := N + 139; + Name_Atomic_Components : constant Name_Id := N + 140; + Name_Attach_Handler : constant Name_Id := N + 141; + Name_Comment : constant Name_Id := N + 142; -- GNAT + Name_Common_Object : constant Name_Id := N + 143; -- GNAT + Name_Complex_Representation : constant Name_Id := N + 144; -- GNAT + Name_Controlled : constant Name_Id := N + 145; + Name_Convention : constant Name_Id := N + 146; + Name_CPP_Class : constant Name_Id := N + 147; -- GNAT + Name_CPP_Constructor : constant Name_Id := N + 148; -- GNAT + Name_CPP_Virtual : constant Name_Id := N + 149; -- GNAT + Name_CPP_Vtable : constant Name_Id := N + 150; -- GNAT + Name_Debug : constant Name_Id := N + 151; -- GNAT + Name_Elaborate : constant Name_Id := N + 152; -- Ada 83 + Name_Elaborate_All : constant Name_Id := N + 153; + Name_Elaborate_Body : constant Name_Id := N + 154; + Name_Export : constant Name_Id := N + 155; + Name_Export_Exception : constant Name_Id := N + 156; -- VMS + Name_Export_Function : constant Name_Id := N + 157; -- GNAT + Name_Export_Object : constant Name_Id := N + 158; -- GNAT + Name_Export_Procedure : constant Name_Id := N + 159; -- GNAT + Name_Export_Value : constant Name_Id := N + 160; -- GNAT + Name_Export_Valued_Procedure : constant Name_Id := N + 161; -- GNAT + Name_External : constant Name_Id := N + 162; -- GNAT + Name_Finalize_Storage_Only : constant Name_Id := N + 163; -- GNAT + Name_Ident : constant Name_Id := N + 164; -- VMS + Name_Import : constant Name_Id := N + 165; + Name_Import_Exception : constant Name_Id := N + 166; -- VMS + Name_Import_Function : constant Name_Id := N + 167; -- GNAT + Name_Import_Object : constant Name_Id := N + 168; -- GNAT + Name_Import_Procedure : constant Name_Id := N + 169; -- GNAT + Name_Import_Valued_Procedure : constant Name_Id := N + 170; -- GNAT + Name_Inline : constant Name_Id := N + 171; + Name_Inline_Always : constant Name_Id := N + 172; -- GNAT + Name_Inline_Generic : constant Name_Id := N + 173; -- GNAT + Name_Inspection_Point : constant Name_Id := N + 174; + Name_Interface : constant Name_Id := N + 175; -- Ada 83 + Name_Interface_Name : constant Name_Id := N + 176; -- GNAT + Name_Interrupt_Handler : constant Name_Id := N + 177; + Name_Interrupt_Priority : constant Name_Id := N + 178; + Name_Java_Constructor : constant Name_Id := N + 179; -- GNAT + Name_Java_Interface : constant Name_Id := N + 180; -- GNAT + Name_Keep_Names : constant Name_Id := N + 181; -- GNAT + Name_Link_With : constant Name_Id := N + 182; -- GNAT + Name_Linker_Alias : constant Name_Id := N + 183; -- GNAT + Name_Linker_Options : constant Name_Id := N + 184; + Name_Linker_Section : constant Name_Id := N + 185; -- GNAT + Name_List : constant Name_Id := N + 186; + Name_Machine_Attribute : constant Name_Id := N + 187; -- GNAT + Name_Main : constant Name_Id := N + 188; -- GNAT + Name_Main_Storage : constant Name_Id := N + 189; -- GNAT + Name_Memory_Size : constant Name_Id := N + 190; -- Ada 83 + Name_No_Return : constant Name_Id := N + 191; -- GNAT + Name_Obsolescent : constant Name_Id := N + 192; -- GNAT + Name_Optimize : constant Name_Id := N + 193; + Name_Optional_Overriding : constant Name_Id := N + 194; + Name_Overriding : constant Name_Id := N + 195; + Name_Pack : constant Name_Id := N + 196; + Name_Page : constant Name_Id := N + 197; + Name_Passive : constant Name_Id := N + 198; -- GNAT + Name_Preelaborate : constant Name_Id := N + 199; + Name_Priority : constant Name_Id := N + 200; + Name_Psect_Object : constant Name_Id := N + 201; -- VMS + Name_Pure : constant Name_Id := N + 202; + Name_Pure_Function : constant Name_Id := N + 203; -- GNAT + Name_Remote_Call_Interface : constant Name_Id := N + 204; + Name_Remote_Types : constant Name_Id := N + 205; + Name_Share_Generic : constant Name_Id := N + 206; -- GNAT + Name_Shared : constant Name_Id := N + 207; -- Ada 83 + Name_Shared_Passive : constant Name_Id := N + 208; -- Note: Storage_Size is not in this list because its name matches the -- name of the corresponding attribute. However, it is included in the @@ -427,26 +429,27 @@ package Snames is -- Note: Storage_Unit is also omitted from the list because of a clash -- with an attribute name, and is treated similarly. - Name_Source_Reference : constant Name_Id := N + 207; -- GNAT - Name_Stream_Convert : constant Name_Id := N + 208; -- GNAT - Name_Subtitle : constant Name_Id := N + 209; -- GNAT - Name_Suppress_All : constant Name_Id := N + 210; -- GNAT - Name_Suppress_Debug_Info : constant Name_Id := N + 211; -- GNAT - Name_Suppress_Initialization : constant Name_Id := N + 212; -- GNAT - Name_System_Name : constant Name_Id := N + 213; -- Ada 83 - Name_Task_Info : constant Name_Id := N + 214; -- GNAT - Name_Task_Name : constant Name_Id := N + 215; -- GNAT - Name_Task_Storage : constant Name_Id := N + 216; -- VMS - Name_Time_Slice : constant Name_Id := N + 217; -- GNAT - Name_Title : constant Name_Id := N + 218; -- GNAT - Name_Unchecked_Union : constant Name_Id := N + 219; -- GNAT - Name_Unimplemented_Unit : constant Name_Id := N + 220; -- GNAT - Name_Unreferenced : constant Name_Id := N + 221; -- GNAT - Name_Unreserve_All_Interrupts : constant Name_Id := N + 222; -- GNAT - Name_Volatile : constant Name_Id := N + 223; - Name_Volatile_Components : constant Name_Id := N + 224; - Name_Weak_External : constant Name_Id := N + 225; -- GNAT - Last_Pragma_Name : constant Name_Id := N + 225; + Name_Source_Reference : constant Name_Id := N + 209; -- GNAT + Name_Stream_Convert : constant Name_Id := N + 210; -- GNAT + Name_Subtitle : constant Name_Id := N + 211; -- GNAT + Name_Suppress_All : constant Name_Id := N + 212; -- GNAT + Name_Suppress_Debug_Info : constant Name_Id := N + 213; -- GNAT + Name_Suppress_Initialization : constant Name_Id := N + 214; -- GNAT + Name_System_Name : constant Name_Id := N + 215; -- Ada 83 + Name_Task_Info : constant Name_Id := N + 216; -- GNAT + Name_Task_Name : constant Name_Id := N + 217; -- GNAT + Name_Task_Storage : constant Name_Id := N + 218; -- VMS + Name_Thread_Body : constant Name_Id := N + 219; -- GNAT + Name_Time_Slice : constant Name_Id := N + 220; -- GNAT + Name_Title : constant Name_Id := N + 221; -- GNAT + Name_Unchecked_Union : constant Name_Id := N + 222; -- GNAT + Name_Unimplemented_Unit : constant Name_Id := N + 223; -- GNAT + Name_Unreferenced : constant Name_Id := N + 224; -- GNAT + Name_Unreserve_All_Interrupts : constant Name_Id := N + 225; -- GNAT + Name_Volatile : constant Name_Id := N + 226; + Name_Volatile_Components : constant Name_Id := N + 227; + Name_Weak_External : constant Name_Id := N + 228; -- GNAT + Last_Pragma_Name : constant Name_Id := N + 228; -- Language convention names for pragma Convention/Export/Import/Interface -- Note that Name_C is not included in this list, since it was already @@ -457,95 +460,96 @@ package Snames is -- Entry and Protected, this is because these conventions cannot be -- specified by a pragma. - First_Convention_Name : constant Name_Id := N + 226; - Name_Ada : constant Name_Id := N + 226; - Name_Assembler : constant Name_Id := N + 227; - Name_COBOL : constant Name_Id := N + 228; - Name_CPP : constant Name_Id := N + 229; - Name_Fortran : constant Name_Id := N + 230; - Name_Intrinsic : constant Name_Id := N + 231; - Name_Java : constant Name_Id := N + 232; - Name_Stdcall : constant Name_Id := N + 233; - Name_Stubbed : constant Name_Id := N + 234; - Last_Convention_Name : constant Name_Id := N + 234; + First_Convention_Name : constant Name_Id := N + 229; + Name_Ada : constant Name_Id := N + 229; + Name_Assembler : constant Name_Id := N + 230; + Name_COBOL : constant Name_Id := N + 231; + Name_CPP : constant Name_Id := N + 232; + Name_Fortran : constant Name_Id := N + 233; + Name_Intrinsic : constant Name_Id := N + 234; + Name_Java : constant Name_Id := N + 235; + Name_Stdcall : constant Name_Id := N + 236; + Name_Stubbed : constant Name_Id := N + 237; + Last_Convention_Name : constant Name_Id := N + 237; -- The following names are preset as synonyms for Assembler - Name_Asm : constant Name_Id := N + 235; - Name_Assembly : constant Name_Id := N + 236; + Name_Asm : constant Name_Id := N + 238; + Name_Assembly : constant Name_Id := N + 239; -- The following names are preset as synonyms for C - Name_Default : constant Name_Id := N + 237; + Name_Default : constant Name_Id := N + 240; -- Name_Exernal (previously defined as pragma) -- The following names are present as synonyms for Stdcall - Name_DLL : constant Name_Id := N + 238; - Name_Win32 : constant Name_Id := N + 239; + Name_DLL : constant Name_Id := N + 241; + Name_Win32 : constant Name_Id := N + 242; -- Other special names used in processing pragma arguments - Name_As_Is : constant Name_Id := N + 240; - Name_Body_File_Name : constant Name_Id := N + 241; - Name_Casing : constant Name_Id := N + 242; - Name_Code : constant Name_Id := N + 243; - Name_Component : constant Name_Id := N + 244; - Name_Component_Size_4 : constant Name_Id := N + 245; - Name_Copy : constant Name_Id := N + 246; - Name_D_Float : constant Name_Id := N + 247; - Name_Descriptor : constant Name_Id := N + 248; - Name_Dot_Replacement : constant Name_Id := N + 249; - Name_Dynamic : constant Name_Id := N + 250; - Name_Entity : constant Name_Id := N + 251; - Name_External_Name : constant Name_Id := N + 252; - Name_First_Optional_Parameter : constant Name_Id := N + 253; - Name_Form : constant Name_Id := N + 254; - Name_G_Float : constant Name_Id := N + 255; - Name_Gcc : constant Name_Id := N + 256; - Name_Gnat : constant Name_Id := N + 257; - Name_GPL : constant Name_Id := N + 258; - Name_IEEE_Float : constant Name_Id := N + 259; - Name_Homonym_Number : constant Name_Id := N + 260; - Name_Internal : constant Name_Id := N + 261; - Name_Link_Name : constant Name_Id := N + 262; - Name_Lowercase : constant Name_Id := N + 263; - Name_Max_Size : constant Name_Id := N + 264; - Name_Mechanism : constant Name_Id := N + 265; - Name_Mixedcase : constant Name_Id := N + 266; - Name_Modified_GPL : constant Name_Id := N + 267; - Name_Name : constant Name_Id := N + 268; - Name_NCA : constant Name_Id := N + 269; - Name_No : constant Name_Id := N + 270; - Name_On : constant Name_Id := N + 271; - Name_Parameter_Types : constant Name_Id := N + 272; - Name_Reference : constant Name_Id := N + 273; - Name_Restricted : constant Name_Id := N + 274; - Name_Result_Mechanism : constant Name_Id := N + 275; - Name_Result_Type : constant Name_Id := N + 276; - Name_Runtime : constant Name_Id := N + 277; - Name_SB : constant Name_Id := N + 278; - Name_Section : constant Name_Id := N + 279; - Name_Semaphore : constant Name_Id := N + 280; - Name_Spec_File_Name : constant Name_Id := N + 281; - Name_Static : constant Name_Id := N + 282; - Name_Stack_Size : constant Name_Id := N + 283; - Name_Subunit_File_Name : constant Name_Id := N + 284; - Name_Task_Stack_Size_Default : constant Name_Id := N + 285; - Name_Task_Type : constant Name_Id := N + 286; - Name_Time_Slicing_Enabled : constant Name_Id := N + 287; - Name_Top_Guard : constant Name_Id := N + 288; - Name_UBA : constant Name_Id := N + 289; - Name_UBS : constant Name_Id := N + 290; - Name_UBSB : constant Name_Id := N + 291; - Name_Unit_Name : constant Name_Id := N + 292; - Name_Unknown : constant Name_Id := N + 293; - Name_Unrestricted : constant Name_Id := N + 294; - Name_Uppercase : constant Name_Id := N + 295; - Name_User : constant Name_Id := N + 296; - Name_VAX_Float : constant Name_Id := N + 297; - Name_VMS : constant Name_Id := N + 298; - Name_Working_Storage : constant Name_Id := N + 299; + Name_As_Is : constant Name_Id := N + 243; + Name_Body_File_Name : constant Name_Id := N + 244; + Name_Casing : constant Name_Id := N + 245; + Name_Code : constant Name_Id := N + 246; + Name_Component : constant Name_Id := N + 247; + Name_Component_Size_4 : constant Name_Id := N + 248; + Name_Copy : constant Name_Id := N + 249; + Name_D_Float : constant Name_Id := N + 250; + Name_Descriptor : constant Name_Id := N + 251; + Name_Dot_Replacement : constant Name_Id := N + 252; + Name_Dynamic : constant Name_Id := N + 253; + Name_Entity : constant Name_Id := N + 254; + Name_External_Name : constant Name_Id := N + 255; + Name_First_Optional_Parameter : constant Name_Id := N + 256; + Name_Form : constant Name_Id := N + 257; + Name_G_Float : constant Name_Id := N + 258; + Name_Gcc : constant Name_Id := N + 259; + Name_Gnat : constant Name_Id := N + 260; + Name_GPL : constant Name_Id := N + 261; + Name_IEEE_Float : constant Name_Id := N + 262; + Name_Homonym_Number : constant Name_Id := N + 263; + Name_Internal : constant Name_Id := N + 264; + Name_Link_Name : constant Name_Id := N + 265; + Name_Lowercase : constant Name_Id := N + 266; + Name_Max_Size : constant Name_Id := N + 267; + Name_Mechanism : constant Name_Id := N + 268; + Name_Mixedcase : constant Name_Id := N + 269; + Name_Modified_GPL : constant Name_Id := N + 270; + Name_Name : constant Name_Id := N + 271; + Name_NCA : constant Name_Id := N + 272; + Name_No : constant Name_Id := N + 273; + Name_On : constant Name_Id := N + 274; + Name_Parameter_Types : constant Name_Id := N + 275; + Name_Reference : constant Name_Id := N + 276; + Name_Restricted : constant Name_Id := N + 277; + Name_Result_Mechanism : constant Name_Id := N + 278; + Name_Result_Type : constant Name_Id := N + 279; + Name_Runtime : constant Name_Id := N + 280; + Name_SB : constant Name_Id := N + 281; + Name_Secondary_Stack_Size : constant Name_Id := N + 282; + Name_Section : constant Name_Id := N + 283; + Name_Semaphore : constant Name_Id := N + 284; + Name_Spec_File_Name : constant Name_Id := N + 285; + Name_Static : constant Name_Id := N + 286; + Name_Stack_Size : constant Name_Id := N + 287; + Name_Subunit_File_Name : constant Name_Id := N + 288; + Name_Task_Stack_Size_Default : constant Name_Id := N + 289; + Name_Task_Type : constant Name_Id := N + 290; + Name_Time_Slicing_Enabled : constant Name_Id := N + 291; + Name_Top_Guard : constant Name_Id := N + 292; + Name_UBA : constant Name_Id := N + 293; + Name_UBS : constant Name_Id := N + 294; + Name_UBSB : constant Name_Id := N + 295; + Name_Unit_Name : constant Name_Id := N + 296; + Name_Unknown : constant Name_Id := N + 297; + Name_Unrestricted : constant Name_Id := N + 298; + Name_Uppercase : constant Name_Id := N + 299; + Name_User : constant Name_Id := N + 300; + Name_VAX_Float : constant Name_Id := N + 301; + Name_VMS : constant Name_Id := N + 302; + Name_Working_Storage : constant Name_Id := N + 303; -- Names of recognized attributes. The entries with the comment "Ada 83" -- are attributes that are defined in Ada 83, but not in Ada 95. These @@ -559,158 +563,158 @@ package Snames is -- The entries marked VMS are recognized only in OpenVMS implementations -- of GNAT, and are treated as illegal in all other contexts. - First_Attribute_Name : constant Name_Id := N + 300; - Name_Abort_Signal : constant Name_Id := N + 300; -- GNAT - Name_Access : constant Name_Id := N + 301; - Name_Address : constant Name_Id := N + 302; - Name_Address_Size : constant Name_Id := N + 303; -- GNAT - Name_Aft : constant Name_Id := N + 304; - Name_Alignment : constant Name_Id := N + 305; - Name_Asm_Input : constant Name_Id := N + 306; -- GNAT - Name_Asm_Output : constant Name_Id := N + 307; -- GNAT - Name_AST_Entry : constant Name_Id := N + 308; -- VMS - Name_Bit : constant Name_Id := N + 309; -- GNAT - Name_Bit_Order : constant Name_Id := N + 310; - Name_Bit_Position : constant Name_Id := N + 311; -- GNAT - Name_Body_Version : constant Name_Id := N + 312; - Name_Callable : constant Name_Id := N + 313; - Name_Caller : constant Name_Id := N + 314; - Name_Code_Address : constant Name_Id := N + 315; -- GNAT - Name_Component_Size : constant Name_Id := N + 316; - Name_Compose : constant Name_Id := N + 317; - Name_Constrained : constant Name_Id := N + 318; - Name_Count : constant Name_Id := N + 319; - Name_Default_Bit_Order : constant Name_Id := N + 320; -- GNAT - Name_Definite : constant Name_Id := N + 321; - Name_Delta : constant Name_Id := N + 322; - Name_Denorm : constant Name_Id := N + 323; - Name_Digits : constant Name_Id := N + 324; - Name_Elaborated : constant Name_Id := N + 325; -- GNAT - Name_Emax : constant Name_Id := N + 326; -- Ada 83 - Name_Enum_Rep : constant Name_Id := N + 327; -- GNAT - Name_Epsilon : constant Name_Id := N + 328; -- Ada 83 - Name_Exponent : constant Name_Id := N + 329; - Name_External_Tag : constant Name_Id := N + 330; - Name_First : constant Name_Id := N + 331; - Name_First_Bit : constant Name_Id := N + 332; - Name_Fixed_Value : constant Name_Id := N + 333; -- GNAT - Name_Fore : constant Name_Id := N + 334; - Name_Has_Discriminants : constant Name_Id := N + 335; -- GNAT - Name_Identity : constant Name_Id := N + 336; - Name_Img : constant Name_Id := N + 337; -- GNAT - Name_Integer_Value : constant Name_Id := N + 338; -- GNAT - Name_Large : constant Name_Id := N + 339; -- Ada 83 - Name_Last : constant Name_Id := N + 340; - Name_Last_Bit : constant Name_Id := N + 341; - Name_Leading_Part : constant Name_Id := N + 342; - Name_Length : constant Name_Id := N + 343; - Name_Machine_Emax : constant Name_Id := N + 344; - Name_Machine_Emin : constant Name_Id := N + 345; - Name_Machine_Mantissa : constant Name_Id := N + 346; - Name_Machine_Overflows : constant Name_Id := N + 347; - Name_Machine_Radix : constant Name_Id := N + 348; - Name_Machine_Rounds : constant Name_Id := N + 349; - Name_Machine_Size : constant Name_Id := N + 350; -- GNAT - Name_Mantissa : constant Name_Id := N + 351; -- Ada 83 - Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 352; - Name_Maximum_Alignment : constant Name_Id := N + 353; -- GNAT - Name_Mechanism_Code : constant Name_Id := N + 354; -- GNAT - Name_Model_Emin : constant Name_Id := N + 355; - Name_Model_Epsilon : constant Name_Id := N + 356; - Name_Model_Mantissa : constant Name_Id := N + 357; - Name_Model_Small : constant Name_Id := N + 358; - Name_Modulus : constant Name_Id := N + 359; - Name_Null_Parameter : constant Name_Id := N + 360; -- GNAT - Name_Object_Size : constant Name_Id := N + 361; -- GNAT - Name_Partition_ID : constant Name_Id := N + 362; - Name_Passed_By_Reference : constant Name_Id := N + 363; -- GNAT - Name_Pool_Address : constant Name_Id := N + 364; - Name_Pos : constant Name_Id := N + 365; - Name_Position : constant Name_Id := N + 366; - Name_Range : constant Name_Id := N + 367; - Name_Range_Length : constant Name_Id := N + 368; -- GNAT - Name_Round : constant Name_Id := N + 369; - Name_Safe_Emax : constant Name_Id := N + 370; -- Ada 83 - Name_Safe_First : constant Name_Id := N + 371; - Name_Safe_Large : constant Name_Id := N + 372; -- Ada 83 - Name_Safe_Last : constant Name_Id := N + 373; - Name_Safe_Small : constant Name_Id := N + 374; -- Ada 83 - Name_Scale : constant Name_Id := N + 375; - Name_Scaling : constant Name_Id := N + 376; - Name_Signed_Zeros : constant Name_Id := N + 377; - Name_Size : constant Name_Id := N + 378; - Name_Small : constant Name_Id := N + 379; - Name_Storage_Size : constant Name_Id := N + 380; - Name_Storage_Unit : constant Name_Id := N + 381; -- GNAT - Name_Tag : constant Name_Id := N + 382; - Name_Target_Name : constant Name_Id := N + 383; -- GNAT - Name_Terminated : constant Name_Id := N + 384; - Name_To_Address : constant Name_Id := N + 385; -- GNAT - Name_Type_Class : constant Name_Id := N + 386; -- GNAT - Name_UET_Address : constant Name_Id := N + 387; -- GNAT - Name_Unbiased_Rounding : constant Name_Id := N + 388; - Name_Unchecked_Access : constant Name_Id := N + 389; - Name_Unconstrained_Array : constant Name_Id := N + 390; - Name_Universal_Literal_String : constant Name_Id := N + 391; -- GNAT - Name_Unrestricted_Access : constant Name_Id := N + 392; -- GNAT - Name_VADS_Size : constant Name_Id := N + 393; -- GNAT - Name_Val : constant Name_Id := N + 394; - Name_Valid : constant Name_Id := N + 395; - Name_Value_Size : constant Name_Id := N + 396; -- GNAT - Name_Version : constant Name_Id := N + 397; - Name_Wchar_T_Size : constant Name_Id := N + 398; -- GNAT - Name_Wide_Width : constant Name_Id := N + 399; - Name_Width : constant Name_Id := N + 400; - Name_Word_Size : constant Name_Id := N + 401; -- GNAT + First_Attribute_Name : constant Name_Id := N + 304; + Name_Abort_Signal : constant Name_Id := N + 304; -- GNAT + Name_Access : constant Name_Id := N + 305; + Name_Address : constant Name_Id := N + 306; + Name_Address_Size : constant Name_Id := N + 307; -- GNAT + Name_Aft : constant Name_Id := N + 308; + Name_Alignment : constant Name_Id := N + 309; + Name_Asm_Input : constant Name_Id := N + 310; -- GNAT + Name_Asm_Output : constant Name_Id := N + 311; -- GNAT + Name_AST_Entry : constant Name_Id := N + 312; -- VMS + Name_Bit : constant Name_Id := N + 313; -- GNAT + Name_Bit_Order : constant Name_Id := N + 314; + Name_Bit_Position : constant Name_Id := N + 315; -- GNAT + Name_Body_Version : constant Name_Id := N + 316; + Name_Callable : constant Name_Id := N + 317; + Name_Caller : constant Name_Id := N + 318; + Name_Code_Address : constant Name_Id := N + 319; -- GNAT + Name_Component_Size : constant Name_Id := N + 320; + Name_Compose : constant Name_Id := N + 321; + Name_Constrained : constant Name_Id := N + 322; + Name_Count : constant Name_Id := N + 323; + Name_Default_Bit_Order : constant Name_Id := N + 324; -- GNAT + Name_Definite : constant Name_Id := N + 325; + Name_Delta : constant Name_Id := N + 326; + Name_Denorm : constant Name_Id := N + 327; + Name_Digits : constant Name_Id := N + 328; + Name_Elaborated : constant Name_Id := N + 329; -- GNAT + Name_Emax : constant Name_Id := N + 330; -- Ada 83 + Name_Enum_Rep : constant Name_Id := N + 331; -- GNAT + Name_Epsilon : constant Name_Id := N + 332; -- Ada 83 + Name_Exponent : constant Name_Id := N + 333; + Name_External_Tag : constant Name_Id := N + 334; + Name_First : constant Name_Id := N + 335; + Name_First_Bit : constant Name_Id := N + 336; + Name_Fixed_Value : constant Name_Id := N + 337; -- GNAT + Name_Fore : constant Name_Id := N + 338; + Name_Has_Discriminants : constant Name_Id := N + 339; -- GNAT + Name_Identity : constant Name_Id := N + 340; + Name_Img : constant Name_Id := N + 341; -- GNAT + Name_Integer_Value : constant Name_Id := N + 342; -- GNAT + Name_Large : constant Name_Id := N + 343; -- Ada 83 + Name_Last : constant Name_Id := N + 344; + Name_Last_Bit : constant Name_Id := N + 345; + Name_Leading_Part : constant Name_Id := N + 346; + Name_Length : constant Name_Id := N + 347; + Name_Machine_Emax : constant Name_Id := N + 348; + Name_Machine_Emin : constant Name_Id := N + 349; + Name_Machine_Mantissa : constant Name_Id := N + 350; + Name_Machine_Overflows : constant Name_Id := N + 351; + Name_Machine_Radix : constant Name_Id := N + 352; + Name_Machine_Rounds : constant Name_Id := N + 353; + Name_Machine_Size : constant Name_Id := N + 354; -- GNAT + Name_Mantissa : constant Name_Id := N + 355; -- Ada 83 + Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 356; + Name_Maximum_Alignment : constant Name_Id := N + 357; -- GNAT + Name_Mechanism_Code : constant Name_Id := N + 358; -- GNAT + Name_Model_Emin : constant Name_Id := N + 359; + Name_Model_Epsilon : constant Name_Id := N + 360; + Name_Model_Mantissa : constant Name_Id := N + 361; + Name_Model_Small : constant Name_Id := N + 362; + Name_Modulus : constant Name_Id := N + 363; + Name_Null_Parameter : constant Name_Id := N + 364; -- GNAT + Name_Object_Size : constant Name_Id := N + 365; -- GNAT + Name_Partition_ID : constant Name_Id := N + 366; + Name_Passed_By_Reference : constant Name_Id := N + 367; -- GNAT + Name_Pool_Address : constant Name_Id := N + 368; + Name_Pos : constant Name_Id := N + 369; + Name_Position : constant Name_Id := N + 370; + Name_Range : constant Name_Id := N + 371; + Name_Range_Length : constant Name_Id := N + 372; -- GNAT + Name_Round : constant Name_Id := N + 373; + Name_Safe_Emax : constant Name_Id := N + 374; -- Ada 83 + Name_Safe_First : constant Name_Id := N + 375; + Name_Safe_Large : constant Name_Id := N + 376; -- Ada 83 + Name_Safe_Last : constant Name_Id := N + 377; + Name_Safe_Small : constant Name_Id := N + 378; -- Ada 83 + Name_Scale : constant Name_Id := N + 379; + Name_Scaling : constant Name_Id := N + 380; + Name_Signed_Zeros : constant Name_Id := N + 381; + Name_Size : constant Name_Id := N + 382; + Name_Small : constant Name_Id := N + 383; + Name_Storage_Size : constant Name_Id := N + 384; + Name_Storage_Unit : constant Name_Id := N + 385; -- GNAT + Name_Tag : constant Name_Id := N + 386; + Name_Target_Name : constant Name_Id := N + 387; -- GNAT + Name_Terminated : constant Name_Id := N + 388; + Name_To_Address : constant Name_Id := N + 389; -- GNAT + Name_Type_Class : constant Name_Id := N + 390; -- GNAT + Name_UET_Address : constant Name_Id := N + 391; -- GNAT + Name_Unbiased_Rounding : constant Name_Id := N + 392; + Name_Unchecked_Access : constant Name_Id := N + 393; + Name_Unconstrained_Array : constant Name_Id := N + 394; + Name_Universal_Literal_String : constant Name_Id := N + 395; -- GNAT + Name_Unrestricted_Access : constant Name_Id := N + 396; -- GNAT + Name_VADS_Size : constant Name_Id := N + 397; -- GNAT + Name_Val : constant Name_Id := N + 398; + Name_Valid : constant Name_Id := N + 399; + Name_Value_Size : constant Name_Id := N + 400; -- GNAT + Name_Version : constant Name_Id := N + 401; + Name_Wchar_T_Size : constant Name_Id := N + 402; -- GNAT + Name_Wide_Width : constant Name_Id := N + 403; + Name_Width : constant Name_Id := N + 404; + Name_Word_Size : constant Name_Id := N + 405; -- GNAT -- Attributes that designate attributes returning renamable functions, -- i.e. functions that return other than a universal value. - First_Renamable_Function_Attribute : constant Name_Id := N + 402; - Name_Adjacent : constant Name_Id := N + 402; - Name_Ceiling : constant Name_Id := N + 403; - Name_Copy_Sign : constant Name_Id := N + 404; - Name_Floor : constant Name_Id := N + 405; - Name_Fraction : constant Name_Id := N + 406; - Name_Image : constant Name_Id := N + 407; - Name_Input : constant Name_Id := N + 408; - Name_Machine : constant Name_Id := N + 409; - Name_Max : constant Name_Id := N + 410; - Name_Min : constant Name_Id := N + 411; - Name_Model : constant Name_Id := N + 412; - Name_Pred : constant Name_Id := N + 413; - Name_Remainder : constant Name_Id := N + 414; - Name_Rounding : constant Name_Id := N + 415; - Name_Succ : constant Name_Id := N + 416; - Name_Truncation : constant Name_Id := N + 417; - Name_Value : constant Name_Id := N + 418; - Name_Wide_Image : constant Name_Id := N + 419; - Name_Wide_Value : constant Name_Id := N + 420; - Last_Renamable_Function_Attribute : constant Name_Id := N + 420; + First_Renamable_Function_Attribute : constant Name_Id := N + 406; + Name_Adjacent : constant Name_Id := N + 406; + Name_Ceiling : constant Name_Id := N + 407; + Name_Copy_Sign : constant Name_Id := N + 408; + Name_Floor : constant Name_Id := N + 409; + Name_Fraction : constant Name_Id := N + 410; + Name_Image : constant Name_Id := N + 411; + Name_Input : constant Name_Id := N + 412; + Name_Machine : constant Name_Id := N + 413; + Name_Max : constant Name_Id := N + 414; + Name_Min : constant Name_Id := N + 415; + Name_Model : constant Name_Id := N + 416; + Name_Pred : constant Name_Id := N + 417; + Name_Remainder : constant Name_Id := N + 418; + Name_Rounding : constant Name_Id := N + 419; + Name_Succ : constant Name_Id := N + 420; + Name_Truncation : constant Name_Id := N + 421; + Name_Value : constant Name_Id := N + 422; + Name_Wide_Image : constant Name_Id := N + 423; + Name_Wide_Value : constant Name_Id := N + 424; + Last_Renamable_Function_Attribute : constant Name_Id := N + 424; -- Attributes that designate procedures - First_Procedure_Attribute : constant Name_Id := N + 421; - Name_Output : constant Name_Id := N + 421; - Name_Read : constant Name_Id := N + 422; - Name_Write : constant Name_Id := N + 423; - Last_Procedure_Attribute : constant Name_Id := N + 423; + First_Procedure_Attribute : constant Name_Id := N + 425; + Name_Output : constant Name_Id := N + 425; + Name_Read : constant Name_Id := N + 426; + Name_Write : constant Name_Id := N + 427; + Last_Procedure_Attribute : constant Name_Id := N + 427; -- Remaining attributes are ones that return entities - First_Entity_Attribute_Name : constant Name_Id := N + 424; - Name_Elab_Body : constant Name_Id := N + 424; -- GNAT - Name_Elab_Spec : constant Name_Id := N + 425; -- GNAT - Name_Storage_Pool : constant Name_Id := N + 426; + First_Entity_Attribute_Name : constant Name_Id := N + 428; + Name_Elab_Body : constant Name_Id := N + 428; -- GNAT + Name_Elab_Spec : constant Name_Id := N + 429; -- GNAT + Name_Storage_Pool : constant Name_Id := N + 430; -- These attributes are the ones that return types - First_Type_Attribute_Name : constant Name_Id := N + 427; - Name_Base : constant Name_Id := N + 427; - Name_Class : constant Name_Id := N + 428; - Last_Type_Attribute_Name : constant Name_Id := N + 428; - Last_Entity_Attribute_Name : constant Name_Id := N + 428; - Last_Attribute_Name : constant Name_Id := N + 428; + First_Type_Attribute_Name : constant Name_Id := N + 431; + Name_Base : constant Name_Id := N + 431; + Name_Class : constant Name_Id := N + 432; + Last_Type_Attribute_Name : constant Name_Id := N + 432; + Last_Entity_Attribute_Name : constant Name_Id := N + 432; + Last_Attribute_Name : constant Name_Id := N + 432; -- Names of recognized locking policy identifiers @@ -718,10 +722,10 @@ package Snames is -- name (e.g. C for Ceiling_Locking). If new policy names are added, -- the first character must be distinct. - First_Locking_Policy_Name : constant Name_Id := N + 429; - Name_Ceiling_Locking : constant Name_Id := N + 429; - Name_Inheritance_Locking : constant Name_Id := N + 430; - Last_Locking_Policy_Name : constant Name_Id := N + 430; + First_Locking_Policy_Name : constant Name_Id := N + 433; + Name_Ceiling_Locking : constant Name_Id := N + 433; + Name_Inheritance_Locking : constant Name_Id := N + 434; + Last_Locking_Policy_Name : constant Name_Id := N + 434; -- Names of recognized queuing policy identifiers. @@ -729,10 +733,10 @@ package Snames is -- name (e.g. F for FIFO_Queuing). If new policy names are added, -- the first character must be distinct. - First_Queuing_Policy_Name : constant Name_Id := N + 431; - Name_FIFO_Queuing : constant Name_Id := N + 431; - Name_Priority_Queuing : constant Name_Id := N + 432; - Last_Queuing_Policy_Name : constant Name_Id := N + 432; + First_Queuing_Policy_Name : constant Name_Id := N + 435; + Name_FIFO_Queuing : constant Name_Id := N + 435; + Name_Priority_Queuing : constant Name_Id := N + 436; + Last_Queuing_Policy_Name : constant Name_Id := N + 436; -- Names of recognized task dispatching policy identifiers @@ -740,191 +744,193 @@ package Snames is -- name (e.g. F for FIFO_WIthinn_Priorities). If new policy names -- are added, the first character must be distinct. - First_Task_Dispatching_Policy_Name : constant Name_Id := N + 433; - Name_Fifo_Within_Priorities : constant Name_Id := N + 433; - Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 433; + First_Task_Dispatching_Policy_Name : constant Name_Id := N + 437; + Name_Fifo_Within_Priorities : constant Name_Id := N + 437; + Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 437; -- Names of recognized checks for pragma Suppress - First_Check_Name : constant Name_Id := N + 434; - Name_Access_Check : constant Name_Id := N + 434; - Name_Accessibility_Check : constant Name_Id := N + 435; - Name_Discriminant_Check : constant Name_Id := N + 436; - Name_Division_Check : constant Name_Id := N + 437; - Name_Elaboration_Check : constant Name_Id := N + 438; - Name_Index_Check : constant Name_Id := N + 439; - Name_Length_Check : constant Name_Id := N + 440; - Name_Overflow_Check : constant Name_Id := N + 441; - Name_Range_Check : constant Name_Id := N + 442; - Name_Storage_Check : constant Name_Id := N + 443; - Name_Tag_Check : constant Name_Id := N + 444; - Name_All_Checks : constant Name_Id := N + 445; - Last_Check_Name : constant Name_Id := N + 445; + First_Check_Name : constant Name_Id := N + 438; + Name_Access_Check : constant Name_Id := N + 438; + Name_Accessibility_Check : constant Name_Id := N + 439; + Name_Discriminant_Check : constant Name_Id := N + 440; + Name_Division_Check : constant Name_Id := N + 441; + Name_Elaboration_Check : constant Name_Id := N + 442; + Name_Index_Check : constant Name_Id := N + 443; + Name_Length_Check : constant Name_Id := N + 444; + Name_Overflow_Check : constant Name_Id := N + 445; + Name_Range_Check : constant Name_Id := N + 446; + Name_Storage_Check : constant Name_Id := N + 447; + Name_Tag_Check : constant Name_Id := N + 448; + Name_All_Checks : constant Name_Id := N + 449; + Last_Check_Name : constant Name_Id := N + 449; -- Names corresponding to reserved keywords, excluding those already -- declared in the attribute list (Access, Delta, Digits, Range). - Name_Abort : constant Name_Id := N + 446; - Name_Abs : constant Name_Id := N + 447; - Name_Accept : constant Name_Id := N + 448; - Name_And : constant Name_Id := N + 449; - Name_All : constant Name_Id := N + 450; - Name_Array : constant Name_Id := N + 451; - Name_At : constant Name_Id := N + 452; - Name_Begin : constant Name_Id := N + 453; - Name_Body : constant Name_Id := N + 454; - Name_Case : constant Name_Id := N + 455; - Name_Constant : constant Name_Id := N + 456; - Name_Declare : constant Name_Id := N + 457; - Name_Delay : constant Name_Id := N + 458; - Name_Do : constant Name_Id := N + 459; - Name_Else : constant Name_Id := N + 460; - Name_Elsif : constant Name_Id := N + 461; - Name_End : constant Name_Id := N + 462; - Name_Entry : constant Name_Id := N + 463; - Name_Exception : constant Name_Id := N + 464; - Name_Exit : constant Name_Id := N + 465; - Name_For : constant Name_Id := N + 466; - Name_Function : constant Name_Id := N + 467; - Name_Generic : constant Name_Id := N + 468; - Name_Goto : constant Name_Id := N + 469; - Name_If : constant Name_Id := N + 470; - Name_In : constant Name_Id := N + 471; - Name_Is : constant Name_Id := N + 472; - Name_Limited : constant Name_Id := N + 473; - Name_Loop : constant Name_Id := N + 474; - Name_Mod : constant Name_Id := N + 475; - Name_New : constant Name_Id := N + 476; - Name_Not : constant Name_Id := N + 477; - Name_Null : constant Name_Id := N + 478; - Name_Of : constant Name_Id := N + 479; - Name_Or : constant Name_Id := N + 480; - Name_Others : constant Name_Id := N + 481; - Name_Out : constant Name_Id := N + 482; - Name_Package : constant Name_Id := N + 483; - Name_Pragma : constant Name_Id := N + 484; - Name_Private : constant Name_Id := N + 485; - Name_Procedure : constant Name_Id := N + 486; - Name_Raise : constant Name_Id := N + 487; - Name_Record : constant Name_Id := N + 488; - Name_Rem : constant Name_Id := N + 489; - Name_Renames : constant Name_Id := N + 490; - Name_Return : constant Name_Id := N + 491; - Name_Reverse : constant Name_Id := N + 492; - Name_Select : constant Name_Id := N + 493; - Name_Separate : constant Name_Id := N + 494; - Name_Subtype : constant Name_Id := N + 495; - Name_Task : constant Name_Id := N + 496; - Name_Terminate : constant Name_Id := N + 497; - Name_Then : constant Name_Id := N + 498; - Name_Type : constant Name_Id := N + 499; - Name_Use : constant Name_Id := N + 500; - Name_When : constant Name_Id := N + 501; - Name_While : constant Name_Id := N + 502; - Name_With : constant Name_Id := N + 503; - Name_Xor : constant Name_Id := N + 504; + Name_Abort : constant Name_Id := N + 450; + Name_Abs : constant Name_Id := N + 451; + Name_Accept : constant Name_Id := N + 452; + Name_And : constant Name_Id := N + 453; + Name_All : constant Name_Id := N + 454; + Name_Array : constant Name_Id := N + 455; + Name_At : constant Name_Id := N + 456; + Name_Begin : constant Name_Id := N + 457; + Name_Body : constant Name_Id := N + 458; + Name_Case : constant Name_Id := N + 459; + Name_Constant : constant Name_Id := N + 460; + Name_Declare : constant Name_Id := N + 461; + Name_Delay : constant Name_Id := N + 462; + Name_Do : constant Name_Id := N + 463; + Name_Else : constant Name_Id := N + 464; + Name_Elsif : constant Name_Id := N + 465; + Name_End : constant Name_Id := N + 466; + Name_Entry : constant Name_Id := N + 467; + Name_Exception : constant Name_Id := N + 468; + Name_Exit : constant Name_Id := N + 469; + Name_For : constant Name_Id := N + 470; + Name_Function : constant Name_Id := N + 471; + Name_Generic : constant Name_Id := N + 472; + Name_Goto : constant Name_Id := N + 473; + Name_If : constant Name_Id := N + 474; + Name_In : constant Name_Id := N + 475; + Name_Is : constant Name_Id := N + 476; + Name_Limited : constant Name_Id := N + 477; + Name_Loop : constant Name_Id := N + 478; + Name_Mod : constant Name_Id := N + 479; + Name_New : constant Name_Id := N + 480; + Name_Not : constant Name_Id := N + 481; + Name_Null : constant Name_Id := N + 482; + Name_Of : constant Name_Id := N + 483; + Name_Or : constant Name_Id := N + 484; + Name_Others : constant Name_Id := N + 485; + Name_Out : constant Name_Id := N + 486; + Name_Package : constant Name_Id := N + 487; + Name_Pragma : constant Name_Id := N + 488; + Name_Private : constant Name_Id := N + 489; + Name_Procedure : constant Name_Id := N + 490; + Name_Raise : constant Name_Id := N + 491; + Name_Record : constant Name_Id := N + 492; + Name_Rem : constant Name_Id := N + 493; + Name_Renames : constant Name_Id := N + 494; + Name_Return : constant Name_Id := N + 495; + Name_Reverse : constant Name_Id := N + 496; + Name_Select : constant Name_Id := N + 497; + Name_Separate : constant Name_Id := N + 498; + Name_Subtype : constant Name_Id := N + 499; + Name_Task : constant Name_Id := N + 500; + Name_Terminate : constant Name_Id := N + 501; + Name_Then : constant Name_Id := N + 502; + Name_Type : constant Name_Id := N + 503; + Name_Use : constant Name_Id := N + 504; + Name_When : constant Name_Id := N + 505; + Name_While : constant Name_Id := N + 506; + Name_With : constant Name_Id := N + 507; + Name_Xor : constant Name_Id := N + 508; -- Names of intrinsic subprograms -- Note: Asm is missing from this list, since Asm is a legitimate -- convention name. So is To_Adress, which is a GNAT attribute. - First_Intrinsic_Name : constant Name_Id := N + 505; - Name_Divide : constant Name_Id := N + 505; - Name_Enclosing_Entity : constant Name_Id := N + 506; - Name_Exception_Information : constant Name_Id := N + 507; - Name_Exception_Message : constant Name_Id := N + 508; - Name_Exception_Name : constant Name_Id := N + 509; - Name_File : constant Name_Id := N + 510; - Name_Import_Address : constant Name_Id := N + 511; - Name_Import_Largest_Value : constant Name_Id := N + 512; - Name_Import_Value : constant Name_Id := N + 513; - Name_Is_Negative : constant Name_Id := N + 514; - Name_Line : constant Name_Id := N + 515; - Name_Rotate_Left : constant Name_Id := N + 516; - Name_Rotate_Right : constant Name_Id := N + 517; - Name_Shift_Left : constant Name_Id := N + 518; - Name_Shift_Right : constant Name_Id := N + 519; - Name_Shift_Right_Arithmetic : constant Name_Id := N + 520; - Name_Source_Location : constant Name_Id := N + 521; - Name_Unchecked_Conversion : constant Name_Id := N + 522; - Name_Unchecked_Deallocation : constant Name_Id := N + 523; - Name_To_Pointer : constant Name_Id := N + 524; - Last_Intrinsic_Name : constant Name_Id := N + 524; + First_Intrinsic_Name : constant Name_Id := N + 509; + Name_Divide : constant Name_Id := N + 509; + Name_Enclosing_Entity : constant Name_Id := N + 510; + Name_Exception_Information : constant Name_Id := N + 511; + Name_Exception_Message : constant Name_Id := N + 512; + Name_Exception_Name : constant Name_Id := N + 513; + Name_File : constant Name_Id := N + 514; + Name_Import_Address : constant Name_Id := N + 515; + Name_Import_Largest_Value : constant Name_Id := N + 516; + Name_Import_Value : constant Name_Id := N + 517; + Name_Is_Negative : constant Name_Id := N + 518; + Name_Line : constant Name_Id := N + 519; + Name_Rotate_Left : constant Name_Id := N + 520; + Name_Rotate_Right : constant Name_Id := N + 521; + Name_Shift_Left : constant Name_Id := N + 522; + Name_Shift_Right : constant Name_Id := N + 523; + Name_Shift_Right_Arithmetic : constant Name_Id := N + 524; + Name_Source_Location : constant Name_Id := N + 525; + Name_Unchecked_Conversion : constant Name_Id := N + 526; + Name_Unchecked_Deallocation : constant Name_Id := N + 527; + Name_To_Pointer : constant Name_Id := N + 528; + Last_Intrinsic_Name : constant Name_Id := N + 528; -- Reserved words used only in Ada 95 - First_95_Reserved_Word : constant Name_Id := N + 525; - Name_Abstract : constant Name_Id := N + 525; - Name_Aliased : constant Name_Id := N + 526; - Name_Protected : constant Name_Id := N + 527; - Name_Until : constant Name_Id := N + 528; - Name_Requeue : constant Name_Id := N + 529; - Name_Tagged : constant Name_Id := N + 530; - Last_95_Reserved_Word : constant Name_Id := N + 530; + First_95_Reserved_Word : constant Name_Id := N + 529; + Name_Abstract : constant Name_Id := N + 529; + Name_Aliased : constant Name_Id := N + 530; + Name_Protected : constant Name_Id := N + 531; + Name_Until : constant Name_Id := N + 532; + Name_Requeue : constant Name_Id := N + 533; + Name_Tagged : constant Name_Id := N + 534; + Last_95_Reserved_Word : constant Name_Id := N + 534; subtype Ada_95_Reserved_Words is Name_Id range First_95_Reserved_Word .. Last_95_Reserved_Word; -- Miscellaneous names used in semantic checking - Name_Raise_Exception : constant Name_Id := N + 531; + Name_Raise_Exception : constant Name_Id := N + 535; -- Additional reserved words in GNAT Project Files -- Note that Name_External is already previously declared - Name_Binder : constant Name_Id := N + 532; - Name_Body_Suffix : constant Name_Id := N + 533; - Name_Builder : constant Name_Id := N + 534; - Name_Compiler : constant Name_Id := N + 535; - Name_Cross_Reference : constant Name_Id := N + 536; - Name_Default_Switches : constant Name_Id := N + 537; - Name_Exec_Dir : constant Name_Id := N + 538; - Name_Executable : constant Name_Id := N + 539; - Name_Executable_Suffix : constant Name_Id := N + 540; - Name_Extends : constant Name_Id := N + 541; - Name_Finder : constant Name_Id := N + 542; - Name_Global_Configuration_Pragmas : constant Name_Id := N + 543; - Name_Gnatls : constant Name_Id := N + 544; - Name_Gnatstub : constant Name_Id := N + 545; - Name_Implementation : constant Name_Id := N + 546; - Name_Implementation_Exceptions : constant Name_Id := N + 547; - Name_Implementation_Suffix : constant Name_Id := N + 548; - Name_Languages : constant Name_Id := N + 549; - Name_Library_Dir : constant Name_Id := N + 550; - Name_Library_Auto_Init : constant Name_Id := N + 551; - Name_Library_GCC : constant Name_Id := N + 552; - Name_Library_Interface : constant Name_Id := N + 553; - Name_Library_Kind : constant Name_Id := N + 554; - Name_Library_Name : constant Name_Id := N + 555; - Name_Library_Options : constant Name_Id := N + 556; - Name_Library_Src_Dir : constant Name_Id := N + 557; - Name_Library_Symbol_File : constant Name_Id := N + 558; - Name_Library_Version : constant Name_Id := N + 559; - Name_Linker : constant Name_Id := N + 560; - Name_Local_Configuration_Pragmas : constant Name_Id := N + 561; - Name_Locally_Removed_Files : constant Name_Id := N + 562; - Name_Naming : constant Name_Id := N + 563; - Name_Object_Dir : constant Name_Id := N + 564; - Name_Pretty_Printer : constant Name_Id := N + 565; - Name_Project : constant Name_Id := N + 566; - Name_Separate_Suffix : constant Name_Id := N + 567; - Name_Source_Dirs : constant Name_Id := N + 568; - Name_Source_Files : constant Name_Id := N + 569; - Name_Source_List_File : constant Name_Id := N + 570; - Name_Spec : constant Name_Id := N + 571; - Name_Spec_Suffix : constant Name_Id := N + 572; - Name_Specification : constant Name_Id := N + 573; - Name_Specification_Exceptions : constant Name_Id := N + 574; - Name_Specification_Suffix : constant Name_Id := N + 575; - Name_Switches : constant Name_Id := N + 576; + Name_Binder : constant Name_Id := N + 536; + Name_Body_Suffix : constant Name_Id := N + 537; + Name_Builder : constant Name_Id := N + 538; + Name_Compiler : constant Name_Id := N + 539; + Name_Cross_Reference : constant Name_Id := N + 540; + Name_Default_Switches : constant Name_Id := N + 541; + Name_Exec_Dir : constant Name_Id := N + 542; + Name_Executable : constant Name_Id := N + 543; + Name_Executable_Suffix : constant Name_Id := N + 544; + Name_Extends : constant Name_Id := N + 545; + Name_Finder : constant Name_Id := N + 546; + Name_Global_Configuration_Pragmas : constant Name_Id := N + 547; + Name_Gnatls : constant Name_Id := N + 548; + Name_Gnatstub : constant Name_Id := N + 549; + Name_Implementation : constant Name_Id := N + 550; + Name_Implementation_Exceptions : constant Name_Id := N + 551; + Name_Implementation_Suffix : constant Name_Id := N + 552; + Name_Languages : constant Name_Id := N + 553; + Name_Library_Dir : constant Name_Id := N + 554; + Name_Library_Auto_Init : constant Name_Id := N + 555; + Name_Library_GCC : constant Name_Id := N + 556; + Name_Library_Interface : constant Name_Id := N + 557; + Name_Library_Kind : constant Name_Id := N + 558; + Name_Library_Name : constant Name_Id := N + 559; + Name_Library_Options : constant Name_Id := N + 560; + Name_Library_Reference_Symbol_File : constant Name_Id := N + 561; + Name_Library_Src_Dir : constant Name_Id := N + 562; + Name_Library_Symbol_File : constant Name_Id := N + 563; + Name_Library_Symbol_Policy : constant Name_Id := N + 564; + Name_Library_Version : constant Name_Id := N + 565; + Name_Linker : constant Name_Id := N + 566; + Name_Local_Configuration_Pragmas : constant Name_Id := N + 567; + Name_Locally_Removed_Files : constant Name_Id := N + 568; + Name_Naming : constant Name_Id := N + 569; + Name_Object_Dir : constant Name_Id := N + 570; + Name_Pretty_Printer : constant Name_Id := N + 571; + Name_Project : constant Name_Id := N + 572; + Name_Separate_Suffix : constant Name_Id := N + 573; + Name_Source_Dirs : constant Name_Id := N + 574; + Name_Source_Files : constant Name_Id := N + 575; + Name_Source_List_File : constant Name_Id := N + 576; + Name_Spec : constant Name_Id := N + 577; + Name_Spec_Suffix : constant Name_Id := N + 578; + Name_Specification : constant Name_Id := N + 579; + Name_Specification_Exceptions : constant Name_Id := N + 580; + Name_Specification_Suffix : constant Name_Id := N + 581; + Name_Switches : constant Name_Id := N + 582; -- Other miscellaneous names used in front end - Name_Unaligned_Valid : constant Name_Id := N + 577; + Name_Unaligned_Valid : constant Name_Id := N + 583; -- Mark last defined name for consistency check in Snames body - Last_Predefined_Name : constant Name_Id := N + 577; + Last_Predefined_Name : constant Name_Id := N + 583; subtype Any_Operator_Name is Name_Id range First_Operator_Name .. Last_Operator_Name; @@ -1257,6 +1263,7 @@ package Snames is Pragma_Task_Info, Pragma_Task_Name, Pragma_Task_Storage, + Pragma_Thread_Body, Pragma_Time_Slice, Pragma_Title, Pragma_Unchecked_Union, diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h index b71c60b8998..d81122763c0 100644 --- a/gcc/ada/snames.h +++ b/gcc/ada/snames.h @@ -326,21 +326,22 @@ extern unsigned char Get_Pragma_Id (int); #define Pragma_Task_Info 124 #define Pragma_Task_Name 125 #define Pragma_Task_Storage 126 -#define Pragma_Time_Slice 127 -#define Pragma_Title 128 -#define Pragma_Unchecked_Union 129 -#define Pragma_Unimplemented_Unit 130 -#define Pragma_Unreferenced 131 -#define Pragma_Unreserve_All_Interrupts 132 -#define Pragma_Volatile 133 -#define Pragma_Volatile_Components 134 -#define Pragma_Weak_External 135 +#define Pragma_Thread_Body 127 +#define Pragma_Time_Slice 128 +#define Pragma_Title 129 +#define Pragma_Unchecked_Union 130 +#define Pragma_Unimplemented_Unit 131 +#define Pragma_Unreferenced 132 +#define Pragma_Unreserve_All_Interrupts 133 +#define Pragma_Volatile 134 +#define Pragma_Volatile_Components 135 +#define Pragma_Weak_External 136 /* The following are deliberately out of alphabetical order, see Snames */ -#define Pragma_AST_Entry 136 -#define Pragma_Storage_Size 137 -#define Pragma_Storage_Unit 138 +#define Pragma_AST_Entry 137 +#define Pragma_Storage_Size 138 +#define Pragma_Storage_Unit 139 /* Define the numeric values for the conventions. */ diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index f660975fcba..89b8163fada 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -66,19 +66,18 @@ #include "raise.h" -extern void __gnat_free_socket_set PARAMS ((fd_set *)); -extern void __gnat_last_socket_in_set PARAMS ((fd_set *, int *)); -extern void __gnat_get_socket_from_set PARAMS ((fd_set *, int *, int *)); -extern void __gnat_insert_socket_in_set PARAMS ((fd_set *, int)); -extern int __gnat_is_socket_in_set PARAMS ((fd_set *, int)); -extern fd_set *__gnat_new_socket_set PARAMS ((fd_set *)); -extern void __gnat_remove_socket_from_set PARAMS ((fd_set *, int)); +extern void __gnat_free_socket_set (fd_set *); +extern void __gnat_last_socket_in_set (fd_set *, int *); +extern void __gnat_get_socket_from_set (fd_set *, int *, int *); +extern void __gnat_insert_socket_in_set (fd_set *, int); +extern int __gnat_is_socket_in_set (fd_set *, int); +extern fd_set *__gnat_new_socket_set (fd_set *); +extern void __gnat_remove_socket_from_set (fd_set *, int); /* Free socket set. */ void -__gnat_free_socket_set (set) - fd_set *set; +__gnat_free_socket_set (fd_set *set) { __gnat_free (set); } @@ -89,9 +88,7 @@ __gnat_free_socket_set (set) actual largest socket in the socket set. */ void -__gnat_last_socket_in_set (set, last) - fd_set *set; - int *last; +__gnat_last_socket_in_set (fd_set *set, int *last) { int s; int l; @@ -122,10 +119,7 @@ __gnat_last_socket_in_set (set, last) socket in the socket set. */ void -__gnat_get_socket_from_set (set, last, socket) - fd_set *set; - int *last; - int *socket; +__gnat_get_socket_from_set (fd_set *set, int *last, int *socket) { *socket = *last; FD_CLR (*socket, set); @@ -135,9 +129,7 @@ __gnat_get_socket_from_set (set, last, socket) /* Insert SOCKET in the socket set SET. */ void -__gnat_insert_socket_in_set (set, socket) - fd_set *set; - int socket; +__gnat_insert_socket_in_set (fd_set *set, int socket) { FD_SET (socket, set); } @@ -145,9 +137,7 @@ __gnat_insert_socket_in_set (set, socket) /* Check whether a given SOCKET is in the socket set SET. */ int -__gnat_is_socket_in_set (set, socket) - fd_set *set; - int socket; +__gnat_is_socket_in_set (fd_set *set, int socket) { return FD_ISSET (socket, set); } @@ -155,8 +145,7 @@ __gnat_is_socket_in_set (set, socket) /* Allocate a new socket set and set it as empty. */ fd_set * -__gnat_new_socket_set (set) - fd_set *set; +__gnat_new_socket_set (fd_set *set) { fd_set *new; @@ -173,9 +162,7 @@ __gnat_new_socket_set (set) /* Remove SOCKET from the socket set SET. */ void -__gnat_remove_socket_from_set (set, socket) - fd_set *set; - int socket; +__gnat_remove_socket_from_set (fd_set *set, int socket) { FD_CLR (socket, set); } diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 0cb991802e4..c0ac7bcd2b1 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2003, Free Software Foundation, Inc. -- -- -- -- GNAT is 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,7 +61,7 @@ package body Sprint is Dump_Generated_Only : Boolean; -- Set True if the -gnatG (dump generated tree) debug flag is set - -- or for Print_Generated_Code (-gnatG) or Dump_Gnerated_Code (-gnatD). + -- or for Print_Generated_Code (-gnatG) or Dump_Generated_Code (-gnatD). Dump_Freeze_Null : Boolean; -- Set True if freeze nodes and non-source null statements output @@ -928,7 +928,14 @@ package body Sprint is Set_Debug_Sloc; Sprint_Bar_List (Choices (Node)); Write_Str (" => "); - Sprint_Node (Expression (Node)); + + -- Ada0Y (AI-287): Print the mbox if present + + if Box_Present (Node) then + Write_Str_With_Col_Check ("<>"); + else + Sprint_Node (Expression (Node)); + end if; when N_Component_Clause => Write_Indent; @@ -2490,7 +2497,15 @@ package body Sprint is else if First_Name (Node) or else not Dump_Original_Only then - Write_Indent_Str ("with "); + + -- Ada0Y (AI-50217): Print limited with_clauses + + if Limited_Present (Node) then + Write_Indent_Str ("limited with "); + else + Write_Indent_Str ("with "); + end if; + else Write_Str (", "); end if; @@ -2503,7 +2518,6 @@ package body Sprint is end if; when N_With_Type_Clause => - Write_Indent_Str ("with type "); Sprint_Node_Sloc (Name (Node)); @@ -2777,10 +2791,11 @@ package body Sprint is then Write_Id (Entity (Parent (N))); - -- For any other kind of node with an associated entity, output it. + -- For any other node with an associated entity, output it elsif Nkind (N) in N_Has_Entity - and then Present (Entity (N)) + and then Present (Entity_Or_Associated_Node (N)) + and then Nkind (Entity_Or_Associated_Node (N)) in N_Entity then Write_Id (Entity (N)); diff --git a/gcc/ada/stamp-xgnatug b/gcc/ada/stamp-xgnatug new file mode 100644 index 00000000000..9788f70238c --- /dev/null +++ b/gcc/ada/stamp-xgnatug @@ -0,0 +1 @@ +timestamp diff --git a/gcc/ada/stringt.h b/gcc/ada/stringt.h index 1260909ac30..f204ea6cf71 100644 --- a/gcc/ada/stringt.h +++ b/gcc/ada/stringt.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2001 Free Software Foundation, Inc. * + * Copyright (C) 1992-2003 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -26,23 +26,23 @@ /* This file is the C file that corresponds to the Ada package spec Stringt. It was created manually from stringt.ads and stringt.adb - + Note: only the access functions are provided, since the tree transformer is not allowed to modify the tree or its auxiliary structures. - + This package contains routines for handling the strings table which is used to store string constants encountered in the source, and also those additional string constants generated by compile time concatenation and other similar processing. - + A string constant in this table consists of a series of Char_Code values, so that 16-bit character codes can be properly handled if this feature is implemented in the scanner. - + There is no guarantee that hashing is used in the implementation. This means that the caller cannot count on having the same Id value for two identical strings stored separately. - + The String_Id values reference entries in the Strings table, which contains String_Entry records that record the length of each stored string and its starting location in the String_Chars table. */ diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index c76c4a1af55..2387cec446f 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -96,8 +96,8 @@ package body Switch.C is when False => - -- There are only two front-end switches that - -- do not start with -gnat, namely -I and --RTS + -- There are few front-end switches that + -- do not start with -gnat: -I, --RTS if Switch_Chars (Ptr) = 'I' then Store_Switch := False; @@ -216,6 +216,10 @@ package body Switch.C is Ptr := Ptr + 1; Operating_Mode := Check_Semantics; + if Tree_Output then + ASIS_Mode := True; + end if; + -- Processing for d switch when 'd' => @@ -284,20 +288,21 @@ package body Switch.C is Xref_Active := False; Set_Debug_Flag ('g'); - -- Processing for e switch + -- -gnate? (extended switches) when 'e' => - -- Only -gnateD and -gnatep= are stored - Ptr := Ptr + 1; + -- The -gnate? switches are all double character switches + -- so we must always have a character after the e. + if Ptr > Max then raise Bad_Switch; end if; case Switch_Chars (Ptr) is - -- Configuration pragmas + -- -gnatec (configuration pragmas) when 'c' => Store_Switch := False; @@ -347,7 +352,7 @@ package body Switch.C is return; - -- Symbol definition + -- -gnateD switch (symbol definition) when 'D' => Store_Switch := False; @@ -369,7 +374,7 @@ package body Switch.C is (Storing'First .. First_Stored + Max - Ptr + 2)); return; - -- Full source path for brief error messages + -- -gnatef (full source path for brief error messages) when 'f' => Store_Switch := False; @@ -377,7 +382,7 @@ package body Switch.C is Full_Path_Name_For_Brief_Errors := True; return; - -- Mapping file + -- -gnatem (mapping file) when 'm' => Store_Switch := False; @@ -398,7 +403,7 @@ package body Switch.C is new String'(Switch_Chars (Ptr .. Max)); return; - -- Preprocessing data file + -- -gnatep (preprocessing data file) when 'p' => Store_Switch := False; @@ -433,19 +438,21 @@ package body Switch.C is Store_Compilation_Switch (To_Store); end; - return; + return; + + -- All other -gnate? switches are unassigned when others => raise Bad_Switch; end case; - -- Processing for E switch + -- -gnatE (dynamic elaboration checks) when 'E' => Ptr := Ptr + 1; Dynamic_Elaboration_Checks := True; - -- Processing for f switch + -- -gnatf (full error messages) when 'f' => Ptr := Ptr + 1; @@ -633,12 +640,22 @@ package body Switch.C is Ptr := Ptr + 1; Operating_Mode := Check_Syntax; + -- Processing for S switch + + when 'S' => + Print_Standard := True; + Ptr := Ptr + 1; + -- Processing for t switch when 't' => Ptr := Ptr + 1; Tree_Output := True; - ASIS_Mode := True; + + if Operating_Mode = Check_Semantics then + ASIS_Mode := True; + end if; + Back_Annotate_Rep_Info := True; -- Processing for T switch diff --git a/gcc/ada/symbols.adb b/gcc/ada/symbols.adb index 2c3e7d0ac08..0ccd4cbf666 100644 --- a/gcc/ada/symbols.adb +++ b/gcc/ada/symbols.adb @@ -36,14 +36,18 @@ package body Symbols is ---------------- procedure Initialize - (Symbol_File : String; - Force : Boolean; - Quiet : Boolean; - Success : out Boolean) + (Symbol_File : String; + Reference : String; + Symbol_Policy : Policy; + Quiet : Boolean; + Version : String; + Success : out Boolean) is pragma Unreferenced (Symbol_File); - pragma Unreferenced (Force); + pragma Unreferenced (Reference); + pragma Unreferenced (Symbol_Policy); pragma Unreferenced (Quiet); + pragma Unreferenced (Version); begin Put_Line ("creation of symbol files are not supported on this platform"); diff --git a/gcc/ada/symbols.ads b/gcc/ada/symbols.ads index 9e823eff74c..73fa2c8863c 100644 --- a/gcc/ada/symbols.ads +++ b/gcc/ada/symbols.ads @@ -33,6 +33,20 @@ with GNAT.OS_Lib; use GNAT.OS_Lib; package Symbols is + type Policy is + -- Symbol policy: + + (Autonomous, + -- Create a symbol file without considering any reference + + Compliant, + -- Either create a symbol file with the same major and minor IDs if + -- all symbols are already found in the reference file or with an + -- incremented minor ID, if not. + + Controlled); + -- Fail if symbols are not the same as those in the reference file + type Symbol_Kind is (Data, Proc); -- To distinguish between the different kinds of symbols @@ -52,16 +66,18 @@ package Symbols is -- The symbol tables Original_Symbols : Symbol_Table.Instance; - -- The symbols, if any, found in the original symbol table + -- The symbols, if any, found in the reference symbol table Complete_Symbols : Symbol_Table.Instance; -- The symbols, if any, found in the objects files procedure Initialize - (Symbol_File : String; - Force : Boolean; - Quiet : Boolean; - Success : out Boolean); + (Symbol_File : String; + Reference : String; + Symbol_Policy : Policy; + Quiet : Boolean; + Version : String; + Success : out Boolean); -- Initialize a symbol file. This procedure must be called before -- Processing any object file. Depending on the platforms and the -- circumstances, additional messages may be issued if Quiet is False. diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 836f3d53528..fcca318c7f5 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -44,7 +44,10 @@ #include "tsystem.h" #include #include -#include "time.h" +#include +#ifdef VMS +#include +#endif #else #include "config.h" #include "system.h" @@ -157,15 +160,13 @@ static const char *mode_append_binary_plus = "a+b"; const char __gnat_text_translation_required = 1; void -__gnat_set_binary_mode (handle) - int handle; +__gnat_set_binary_mode (int handle) { _setmode (handle, O_BINARY); } void -__gnat_set_text_mode (handle) - int handle; +__gnat_set_text_mode (int handle) { _setmode (handle, O_TEXT); } @@ -178,8 +179,7 @@ __gnat_set_text_mode (handle) "console". */ char * -__gnat_ttyname (filedes) - int filedes; +__gnat_ttyname (int filedes) { if (isatty (filedes)) return "console"; @@ -206,22 +206,22 @@ __gnat_ttyname (filedes) Calling FlushConsoleInputBuffer just after getch() fix the bug under 95/98. */ -static void winflush_init PARAMS ((void)); +static void winflush_init (void); -static void winflush_95 PARAMS ((void)); +static void winflush_95 (void); -static void winflush_nt PARAMS ((void)); +static void winflush_nt (void); /* winflusfunction is set first to the winflushinit function which will check the OS version 95/98 or NT/2000 */ -static void (*winflush_function) PARAMS ((void)) = winflush_init; +static void (*winflush_function) (void) = winflush_init; /* This function does the runtime check of the OS version and then sets winflush_function to the appropriate function and then call it. */ static void -winflush_init () +winflush_init (void) { DWORD dwVersion = GetVersion(); @@ -234,12 +234,12 @@ winflush_init () } -static void winflush_95 () +static void winflush_95 (void) { FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE)); } -static void winflush_nt () +static void winflush_nt (void) { /* Does nothing as there is no problem under NT. */ } @@ -264,22 +264,19 @@ const char __gnat_text_translation_required = 0; /* These functions do nothing in non-DOS systems. */ void -__gnat_set_binary_mode (handle) - int handle ATTRIBUTE_UNUSED; +__gnat_set_binary_mode (int handle ATTRIBUTE_UNUSED) { } void -__gnat_set_text_mode (handle) - int handle ATTRIBUTE_UNUSED; +__gnat_set_text_mode (int handle ATTRIBUTE_UNUSED) { } char * -__gnat_ttyname (filedes) - int filedes; +__gnat_ttyname (int filedes) { #ifndef __vxworks - extern char *ttyname PARAMS ((int)); + extern char *ttyname (int); return ttyname (filedes); @@ -293,7 +290,8 @@ __gnat_ttyname (filedes) #if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \ || (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT) \ || defined (__MACHTEN__) || defined (hpux) || defined (_AIX) \ - || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) + || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \ + || defined (__CYGWIN__) || defined (__FreeBSD__) #ifdef __MINGW32__ #if OLD_MINGW @@ -315,18 +313,14 @@ static int initted = 0; /* Implements the common processing for getc_immediate and getc_immediate_nowait. */ -extern void getc_immediate PARAMS ((FILE *, int *, int *)); -extern void getc_immediate_nowait PARAMS ((FILE *, int *, int *, int *)); -extern void getc_immediate_common PARAMS ((FILE *, int *, int *, - int *, int)); +extern void getc_immediate (FILE *, int *, int *); +extern void getc_immediate_nowait (FILE *, int *, int *, int *); +extern void getc_immediate_common (FILE *, int *, int *, int *, int); /* Called by Get_Immediate (Foo); */ void -getc_immediate (stream, ch, end_of_file) - FILE *stream; - int *ch; - int *end_of_file; +getc_immediate (FILE *stream, int *ch, int *end_of_file) { int avail; @@ -336,11 +330,7 @@ getc_immediate (stream, ch, end_of_file) /* Called by Get_Immediate (Foo, Available); */ void -getc_immediate_nowait (stream, ch, end_of_file, avail) - FILE *stream; - int *ch; - int *end_of_file; - int *avail; +getc_immediate_nowait (FILE *stream, int *ch, int *end_of_file, int *avail) { getc_immediate_common (stream, ch, end_of_file, avail, 0); } @@ -348,18 +338,17 @@ getc_immediate_nowait (stream, ch, end_of_file, avail) /* Called by getc_immediate () and getc_immediate_nowait () */ void -getc_immediate_common (stream, ch, end_of_file, avail, waiting) - FILE *stream; - int *ch; - int *end_of_file; - int *avail; - int waiting; +getc_immediate_common (FILE *stream, + int *ch, + int *end_of_file, + int *avail, + int waiting) { #if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \ || (defined (__osf__) && ! defined (__alpha_vxworks)) \ || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (hpux) \ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ - || defined (__Lynx__) + || defined (__Lynx__) || defined (__FreeBSD__) char c; int nread; int good_one = 0; @@ -378,7 +367,7 @@ getc_immediate_common (stream, ch, end_of_file, avail, waiting) #if defined(linux) || defined (sun) || defined (sgi) || defined (__EMX__) \ || defined (__osf__) || defined (__MACHTEN__) || defined (hpux) \ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ - || defined (__Lynx__) + || defined (__Lynx__) || defined (__FreeBSD__) eof_ch = termios_rec.c_cc[VEOF]; /* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for @@ -614,31 +603,31 @@ getc_immediate_common (stream, ch, end_of_file, avail, waiting) will want to import these). We use the same names as the routines used by AdaMagic for compatibility. */ -char *rts_get_hInstance PARAMS ((void)); -char *rts_get_hPrevInstance PARAMS ((void)); -char *rts_get_lpCommandLine PARAMS ((void)); -int rts_get_nShowCmd PARAMS ((void)); +char *rts_get_hInstance (void); +char *rts_get_hPrevInstance (void); +char *rts_get_lpCommandLine (void); +int rts_get_nShowCmd (void); char * -rts_get_hInstance () +rts_get_hInstance (void) { return (char *)GetModuleHandleA (0); } char * -rts_get_hPrevInstance () +rts_get_hPrevInstance (void) { return 0; } char * -rts_get_lpCommandLine () +rts_get_lpCommandLine (void) { return GetCommandLineA (); } int -rts_get_nShowCmd () +rts_get_nShowCmd (void) { return 1; } @@ -650,10 +639,10 @@ rts_get_nShowCmd () #include -extern long get_gmtoff PARAMS ((void)); +extern long get_gmtoff (void); long -get_gmtoff () +get_gmtoff (void) { time_t t; struct tm *ts; @@ -668,22 +657,19 @@ get_gmtoff () #if defined (_AIX) || defined (__EMX__) #define Lock_Task system__soft_links__lock_task -extern void (*Lock_Task) PARAMS ((void)); +extern void (*Lock_Task) (void); #define Unlock_Task system__soft_links__unlock_task -extern void (*Unlock_Task) PARAMS ((void)); +extern void (*Unlock_Task) (void); /* Provide reentrant version of localtime on Aix and OS/2. Note that AiX does provide localtime_r, but in the library libc_r which doesn't get included systematically, so we can't use it. */ -extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, - struct tm *)); +extern struct tm *__gnat_localtime_r (const time_t *, struct tm *); struct tm * -__gnat_localtime_r (timer, tp) - const time_t *timer; - struct tm *tp; +__gnat_localtime_r (const time_t *timer, struct tm *tp) { struct tm *tmp; @@ -703,12 +689,10 @@ __gnat_localtime_r (timer, tp) spec is required. Only use when ___THREADS_POSIX4ad4__ is defined, the Lynx convention when building against the legacy API. */ -extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *)); +extern struct tm *__gnat_localtime_r (const time_t *, struct tm *); struct tm * -__gnat_localtime_r (timer, tp) - const time_t *timer; - struct tm *tp; +__gnat_localtime_r (const time_t *timer, struct tm *tp) { localtime_r (tp, timer); return NULL; @@ -723,12 +707,10 @@ __gnat_localtime_r (timer, tp) /* All other targets provide a standard localtime_r */ -extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *)); +extern struct tm *__gnat_localtime_r (const time_t *, struct tm *); struct tm * -__gnat_localtime_r (timer, tp) - const time_t *timer; - struct tm *tp; +__gnat_localtime_r (const time_t *timer, struct tm *tp) { return (struct tm *) localtime_r (timer, tp); } diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads index cf7aa2398ba..942b501af18 100644 --- a/gcc/ada/targparm.ads +++ b/gcc/ada/targparm.ads @@ -322,12 +322,6 @@ package Targparm is -- -- The variable __gnat_exit_status is generated within the binder file -- instead of being imported from the run-time library. - -- - -- No -Ldir switches are added for the linker step - -- - -- No standard switches are added after user file entries to the - -- linker line. All such switches must be explicit. In other words - -- the option -nostdlib is implicit with a configurable run-time. Suppress_Standard_Library_On_Target : Boolean; -- If this flag is True, then the standard library is not included by diff --git a/gcc/ada/targtyps.c b/gcc/ada/targtyps.c index 4315c00f023..465edb672ad 100644 --- a/gcc/ada/targtyps.c +++ b/gcc/ada/targtyps.c @@ -69,86 +69,87 @@ to determine the sizes that are used for various C types. */ Pos -get_target_bits_per_unit () +get_target_bits_per_unit (void) { return BITS_PER_UNIT; } Pos -get_target_bits_per_word () +get_target_bits_per_word (void) { return BITS_PER_WORD; } Pos -get_target_char_size () +get_target_char_size (void) { return CHAR_TYPE_SIZE; } Pos -get_target_wchar_t_size () +get_target_wchar_t_size (void) { /* We never want wide chacters less than "short" in Ada. */ return MAX (SHORT_TYPE_SIZE, WCHAR_TYPE_SIZE); } Pos -get_target_short_size () +get_target_short_size (void) { return SHORT_TYPE_SIZE; } Pos -get_target_int_size () +get_target_int_size (void) { return INT_TYPE_SIZE; } Pos -get_target_long_size () +get_target_long_size (void) { return ADA_LONG_TYPE_SIZE; } Pos -get_target_long_long_size () +get_target_long_long_size (void) { return LONG_LONG_TYPE_SIZE; } Pos -get_target_float_size () +get_target_float_size (void) { - return FLOAT_TYPE_SIZE; + return fp_prec_to_size (FLOAT_TYPE_SIZE); } Pos -get_target_double_size () +get_target_double_size (void) { - return DOUBLE_TYPE_SIZE; + return fp_prec_to_size (DOUBLE_TYPE_SIZE); } Pos -get_target_long_double_size () +get_target_long_double_size (void) { - return WIDEST_HARDWARE_FP_SIZE; + return fp_prec_to_size (WIDEST_HARDWARE_FP_SIZE); } + Pos -get_target_pointer_size () +get_target_pointer_size (void) { return POINTER_SIZE; } Pos -get_target_maximum_alignment () +get_target_maximum_alignment (void) { return BIGGEST_ALIGNMENT / BITS_PER_UNIT; } Boolean -get_target_no_dollar_in_label () +get_target_no_dollar_in_label (void) { #ifdef NO_DOLLAR_IN_LABEL return 1; @@ -162,31 +163,31 @@ get_target_no_dollar_in_label () #endif Nat -get_float_words_be () +get_float_words_be (void) { return FLOAT_WORDS_BIG_ENDIAN; } Nat -get_words_be () +get_words_be (void) { return WORDS_BIG_ENDIAN; } Nat -get_bytes_be () +get_bytes_be (void) { return BYTES_BIG_ENDIAN; } Nat -get_bits_be () +get_bits_be (void) { return BITS_BIG_ENDIAN; } Nat -get_strict_alignment () +get_strict_alignment (void) { return STRICT_ALIGNMENT; } diff --git a/gcc/ada/tb-alvms.c b/gcc/ada/tb-alvms.c index fecedd396f0..60effcc0504 100644 --- a/gcc/ada/tb-alvms.c +++ b/gcc/ada/tb-alvms.c @@ -40,33 +40,38 @@ document, sections of which we will refer to as ABI-. */ #include +#include +#include +#include -/* We still use a number of macros similar to the ones for the generic - __gnat_backtrace implementation. */ -#define SKIP_FRAME 1 -#define PC_ADJUST -4 - -#define STOP_FRAME (frame_state.saved_ra == RA_STOP) - -/* Mask for PDSC$V_BASE_FRAME in procedure descriptors, missing from the - header file included above. */ +/* A couple of items missing from the header file included above. */ +extern void * SYS$GL_CALL_HANDL; #define PDSC$M_BASE_FRAME (1 << 10) -typedef unsigned long REG; +/* Registers are 64bit wide and addresses are 32bit wide on alpha-vms. */ +typedef void * ADDR; +typedef unsigned long long REG; + +#define REG_AT(addr) (*(REG *)(addr)) -#define REG_AT(address) (*(REG *)(address)) +#define AS_REG(addr) ((REG)(unsigned long)(addr)) +#define AS_ADDR(reg) ((ADDR)(unsigned long)(reg)) +#define ADDR_IN(reg) (AS_ADDR(reg)) /* The following structure defines the state maintained during the unwinding process. */ typedef struct { - void * pc; /* Address of the call insn involved in the chain. */ - void * sp; /* Stack Pointer at the time of this call. */ - void * fp; /* Frame Pointer at the time of this call. */ + ADDR pc; /* Address of the call insn involved in the chain. */ + ADDR sp; /* Stack Pointer at the time of this call. */ + ADDR fp; /* Frame Pointer at the time of this call. */ + + /* The values above are fetched as saved REGisters on the stack. They are + typed ADDR because this is what the values in those registers are. */ /* Values of the registers saved by the functions in the chain, - incrementally updated through consecutive calls to the "unwind" - function below. */ + incrementally updated through consecutive calls to the "unwind" function + below. */ REG saved_regs [32]; } frame_state_t; @@ -79,68 +84,111 @@ typedef struct This is from ABI-3.1.1 [Integer Registers]. */ -#define saved_fp saved_regs[29] -#define saved_sp saved_regs[30] -#define saved_ra saved_regs[26] -#define saved_pv saved_regs[27] +#define saved_fpr saved_regs[29] +#define saved_spr saved_regs[30] +#define saved_rar saved_regs[26] +#define saved_pvr saved_regs[27] -/* Special values for saved_ra, used to control the overall unwinding +/* Special values for saved_rar, used to control the overall unwinding process. */ #define RA_UNKNOWN ((REG)~0) #define RA_STOP ((REG)0) +/* We still use a number of macros similar to the ones for the generic + __gnat_backtrace implementation. */ +#define PC_ADJUST 4 +#define STOP_FRAME (frame_state.saved_rar == RA_STOP) + +/* Compute Procedure Value from Frame Pointer value. This follows the rules + in ABI-3.6.1 [Current Procedure]. */ +#define PV_FOR(FP) \ + (((FP) != 0) \ + ? (((REG_AT (FP) & 0x7) == 0) ? *(PDSCDEF **)(FP) : (PDSCDEF *)(FP)) : 0) + + /********** * unwind * **********/ -/* Helper for __gnat_backtrace. Update FS->pc/sp/fp to represent the - state computed in FS->saved_regs during the previous call, and update - FS->saved_regs in preparation of the next call. */ +/* Helper for __gnat_backtrace. + + FS represents some call frame, identified by a pc and associated frame + pointer in FS->pc and FS->fp. FS->saved_regs contains the state of the + general registers upon entry in this frame. Of most interest in this set + are the saved return address and frame pointer registers, which actually + allow identifying the caller's frame. + + This routine "unwinds" the input frame state by adjusting it to eventually + represent its caller's frame. The basic principle is to shift the fp and pc + saved values into the current state, and then compute the corresponding new + saved registers set. + + If the call chain goes through a signal handler, special processing is + required when we process the kernel frame which has called the handler, to + switch it to the interrupted context frame. */ + +#define K_HANDLER_FRAME(fs) (PV_FOR ((fs)->fp) == SYS$GL_CALL_HANDL) + +static void unwind_regular_code (frame_state_t * fs); +static void unwind_kernel_handler (frame_state_t * fs); void unwind (frame_state_t * fs) { - REG frame_base; - PDSCDEF * pv; - /* Don't do anything if requested so. */ - if (fs->saved_ra == RA_STOP) + if (fs->saved_rar == RA_STOP) return; /* Retrieve the values of interest computed during the previous call. PC_ADJUST gets us from the return address to the call insn address. */ - fs->pc = (void *) fs->saved_ra + PC_ADJUST; - fs->sp = (void *) fs->saved_sp; - fs->fp = (void *) fs->saved_fp; + fs->pc = ADDR_IN (fs->saved_rar) - PC_ADJUST; + fs->sp = ADDR_IN (fs->saved_spr); + fs->fp = ADDR_IN (fs->saved_fpr); /* Unless we are able to determine otherwise, set the frame state's saved return address such that the unwinding process will stop. */ - fs->saved_ra = RA_STOP; + fs->saved_rar = RA_STOP; - /* Now we want to update fs->saved_regs to reflect what the procedure - described by pc/fp/sp has done. */ + /* Now we want to update fs->saved_regs to reflect the state of the caller + of the procedure described by pc/fp. - /* Compute the corresponding "procedure value", following the rules in - ABI-3.6.1 [Current Procedure]. Return immediatly if this value mandates - us to stop. */ - if (fs->fp == 0) - return; + The condition to check for a special kernel frame which has called a + signal handler is stated in ABI-6.7.1 [Signaler's Registers] : "The frame + of the call to the handler can be identified by the return address of + SYS$CALL_HANDL+4". We use the equivalent procedure value identification + here because SYS$CALL_HANDL appears to be undefined. */ - if ((REG_AT (fs->fp) & 0x7) == 0) - pv = *(PDSCDEF **)fs->fp; + if (K_HANDLER_FRAME (fs)) + unwind_kernel_handler (fs); else - pv = (PDSCDEF *) fs->fp; + unwind_regular_code (fs); +} + +/*********************** + * unwind_regular_code * + ***********************/ + +/* Helper for unwind, for the case of unwinding through regular code which + is not a signal handler. */ + +static void +unwind_regular_code (frame_state_t * fs) +{ + PDSCDEF * pv = PV_FOR (fs->fp); + + ADDR frame_base; + + /* Use the procedure value to unwind, in a way depending on the kind of + procedure at hand. See ABI-3.3 [Procedure Representation] and ABI-3.4 + [Procedure Types]. */ if (pv == 0 || pv->pdsc$w_flags & PDSC$M_BASE_FRAME) return; - /* Use the procedure value to unwind, in a way depending on the kind of - procedure at hand. This is based on ABI-3.3 [Procedure Representation] - and ABI-3.4 [Procedure Types]. */ frame_base - = (REG) ((pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP) ? fs->fp : fs->sp); + = (pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP) ? fs->fp : fs->sp; switch (pv->pdsc$w_flags & 0xf) { @@ -148,21 +196,21 @@ unwind (frame_state_t * fs) /* Stack Frame Procedure (ABI-3.4.1). Retrieve the necessary registers from the Register Save Area in the frame. */ { - REG rsa_base = frame_base + pv->pdsc$w_rsa_offset; + ADDR rsa_base = frame_base + pv->pdsc$w_rsa_offset; int i, j; - fs->saved_ra = REG_AT (rsa_base); - fs->saved_pv = REG_AT (frame_base); - + fs->saved_rar = REG_AT (rsa_base); + fs->saved_pvr = REG_AT (frame_base); + for (i = 0, j = 0; i < 32; i++) if (pv->pdsc$l_ireg_mask & (1 << i)) fs->saved_regs[i] = REG_AT (rsa_base + 8 * ++j); - /* Note that the loop above is guaranteed to set fs->saved_fp, because - "The preserved register set must always include R29(FP) since it - will always be used." (ABI-3.4.3.4 [Register Save Area for All - Stack Frames]). - + /* Note that the loop above is guaranteed to set fs->saved_fpr, + because "The preserved register set must always include R29(FP) + since it will always be used." (ABI-3.4.3.4 [Register Save Area for + All Stack Frames]). + Also note that we need to run through all the registers to ensure that unwinding through register procedures (see below) gets the right values out of the saved_regs array. */ @@ -173,8 +221,8 @@ unwind (frame_state_t * fs) /* Register Procedure (ABI-3.4.4). Retrieve the necessary registers from the registers where they have been saved. */ { - fs->saved_ra = fs->saved_regs[pv->pdsc$b_save_ra]; - fs->saved_fp = fs->saved_regs[pv->pdsc$b_save_fp]; + fs->saved_rar = fs->saved_regs[pv->pdsc$b_save_ra]; + fs->saved_fpr = fs->saved_regs[pv->pdsc$b_save_fp]; } break; @@ -186,22 +234,111 @@ unwind (frame_state_t * fs) /* SP is actually never part of the saved registers area, so we use the corresponding entry in the saved_regs array to manually keep track of it's evolution. */ - fs->saved_sp = frame_base + pv->pdsc$l_size; + fs->saved_spr = AS_REG (frame_base) + pv->pdsc$l_size; +} + +/************************* + * unwind_kernel_handler * + *************************/ + +/* Helper for unwind, for the specific case of unwinding through a signal + handler. + + The input frame state describes the kernel frame which has called a signal + handler. We fill the corresponding saved_regs to have it's "caller" frame + represented as the interrupted context. */ + +static void +unwind_kernel_handler (frame_state_t * fs) +{ + PDSCDEF * pv = PV_FOR (fs->fp); + + CHFDEF1 *sigargs; + CHFDEF2 *mechargs; + + /* Retrieve the arguments passed to the handler, by way of a VMS service + providing the corresponding "Invocation Context Block". */ + { + long handler_ivhandle; + INVO_CONTEXT_BLK handler_ivcb; + + CHFCTX *chfctx; + + handler_ivcb.libicb$q_ireg [29] = AS_REG (fs->fp); + handler_ivcb.libicb$q_ireg [30] = 0; + + handler_ivhandle = LIB$GET_INVO_HANDLE (&handler_ivcb); + + if ((LIB$GET_INVO_CONTEXT (handler_ivhandle, &handler_ivcb) & 1) != 1) + return; + + chfctx = (CHFCTX *) AS_ADDR (handler_ivcb.libicb$ph_chfctx_addr); + + sigargs = (CHFDEF1 *) AS_ADDR (chfctx->chfctx$q_sigarglst); + mechargs = (CHFDEF2 *) AS_ADDR (chfctx->chfctx$q_mcharglst); + } + + /* Compute the saved return address as the PC of the instruction causing the + condition, accounting for the fact that it will be adjusted by the next + call to "unwind" as if it was an actual call return address. */ + { + /* ABI-6.5.1.1 [Signal Argument Vector]: The signal occurrence address + is available from the sigargs argument to the handler, designed to + support both 32 and 64 bit addresses. The initial reference we get + is a pointer to the 32bit form, from which one may extract a pointer + to the 64bit version if need be. We work directly from the 32bit + form here. */ + + /* The sigargs vector structure for 32bits addresses is: + + <......32bit......> + +-----------------+ + | Vsize | :chf$is_sig_args + +-----------------+ -+- + | Condition Value | : [0] + +-----------------+ : + | ... | : + +-----------------+ : vector of Vsize entries + | Signal PC | : + +-----------------+ : + | PS | : [Vsize - 1] + +-----------------+ -+- + + */ + + unsigned long * sigargs_vector + = ((unsigned long *) (&sigargs->chf$is_sig_args)) + 1; + + long sigargs_vsize + = sigargs->chf$is_sig_args; + + fs->saved_rar = (REG) sigargs_vector [sigargs_vsize - 2] + PC_ADJUST; + } + + fs->saved_spr = RA_UNKNOWN; + fs->saved_fpr = (REG) mechargs->chf$q_mch_frame; + fs->saved_pvr = (REG) mechargs->chf$q_mch_savr27; + + fs->saved_regs[16] = (REG) mechargs->chf$q_mch_savr16; + fs->saved_regs[17] = (REG) mechargs->chf$q_mch_savr17; + fs->saved_regs[18] = (REG) mechargs->chf$q_mch_savr18; + fs->saved_regs[19] = (REG) mechargs->chf$q_mch_savr19; + fs->saved_regs[20] = (REG) mechargs->chf$q_mch_savr20; } /* Structure representing a traceback entry in the tracebacks array to be - filled by __gnat_backtrace below. This should match the declaration of - Traceback_Entry in System.Traceback_Entries. + filled by __gnat_backtrace below. + + !! This should match what is in System.Traceback_Entries, so beware of + !! the REG/ADDR difference here. The use of a structure is motivated by the potential necessity of having several fields to fill for each entry, for instance if later calls to VMS system functions need more than just a mere PC to compute info on a frame (e.g. for non-symbolic->symbolic translation purposes). */ - typedef struct { - void * pc; /* Address of the call instruction in the chain. */ - void * sp; /* Stack Pointer value at the point of this call. */ - void * fp; /* Frame Pointer value at the point of this call. */ + ADDR pc; + ADDR pv; } tb_entry_t; /******************** @@ -209,12 +346,8 @@ typedef struct { ********************/ int -__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) - void **array; - int size; - void *exclude_min; - void *exclude_max; - int skip_frames; +__gnat_backtrace (void **array, int size, + void *exclude_min, void *exclude_max, int skip_frames) { int cnt; @@ -226,9 +359,9 @@ __gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) register REG this_FP __asm__("$29"); register REG this_SP __asm__("$30"); - frame_state.saved_fp = this_FP; - frame_state.saved_sp = this_SP; - frame_state.saved_ra = RA_UNKNOWN; + frame_state.saved_fpr = this_FP; + frame_state.saved_spr = this_SP; + frame_state.saved_rar = RA_UNKNOWN; unwind (&frame_state); @@ -242,16 +375,18 @@ __gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) cnt = 0; while (cnt < size) { + PDSCDEF * pv = PV_FOR (frame_state.fp); + + /* Stop if either the frame contents or the unwinder say so. */ if (STOP_FRAME) break; - if (frame_state.pc < exclude_min - || frame_state.pc > exclude_max) + if (! K_HANDLER_FRAME (&frame_state) + && (frame_state.pc < exclude_min || frame_state.pc > exclude_max)) { - tbe->pc = frame_state.pc; - tbe->sp = frame_state.sp; - tbe->fp = frame_state.fp; - + tbe->pc = (ADDR) frame_state.pc; + tbe->pv = (ADDR) PV_FOR (frame_state.fp); + cnt ++; tbe ++; } diff --git a/gcc/ada/tb-alvxw.c b/gcc/ada/tb-alvxw.c index 0c022aad63b..b86091f7742 100644 --- a/gcc/ada/tb-alvxw.c +++ b/gcc/ada/tb-alvxw.c @@ -39,7 +39,7 @@ #include #include -extern void kerTaskEntry(); +extern void kerTaskEntry(void); /* We still use a number of macros similar to the ones for the generic __gnat_backtrace implementation. */ @@ -259,8 +259,7 @@ struct alloc_chain struct alloc_chain *trace_alloc_chain; static void * -trace_alloc (n) - unsigned int n; +trace_alloc (unsigned int n) { struct alloc_chain * result = malloc (n + sizeof(struct alloc_chain)); @@ -270,7 +269,7 @@ trace_alloc (n) } static void -free_trace_alloc () +free_trace_alloc (void) { while (trace_alloc_chain != 0) { @@ -285,9 +284,7 @@ free_trace_alloc () otherwise. */ static int -read_memory_safe4 (addr, dest) - CORE_ADDR addr; - unsigned int *dest; +read_memory_safe4 (CORE_ADDR addr, unsigned int *dest) { *dest = *((unsigned int*) addr); return 0; @@ -297,17 +294,14 @@ read_memory_safe4 (addr, dest) otherwise. */ static int -read_memory_safe8 (addr, dest) - CORE_ADDR addr; - CORE_ADDR *dest; +read_memory_safe8 (CORE_ADDR addr, CORE_ADDR *dest) { *dest = *((CORE_ADDR*) addr); return 0; } static CORE_ADDR -read_register (regno) - int regno; +read_register (int regno) { if (regno >= 0 && regno < 31) return theRegisters[regno]; @@ -316,23 +310,20 @@ read_register (regno) } static void -frame_saved_regs_zalloc (fi) - struct frame_info *fi; +frame_saved_regs_zalloc (struct frame_info *fi) { fi->saved_regs = (CORE_ADDR *) trace_alloc (SIZEOF_FRAME_SAVED_REGS); memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS); } static void * -frame_obstack_alloc (size) - unsigned long size; +frame_obstack_alloc (unsigned long size) { return (void *) trace_alloc (size); } static int -inside_entry_file (addr) - CORE_ADDR addr; +inside_entry_file (CORE_ADDR addr) { if (addr == 0) return 1; @@ -341,8 +332,7 @@ inside_entry_file (addr) } static CORE_ADDR -alpha_saved_pc_after_call (frame) - struct frame_info *frame; +alpha_saved_pc_after_call (struct frame_info *frame) { CORE_ADDR pc = frame->pc; alpha_extra_func_info_t proc_desc; @@ -358,8 +348,7 @@ alpha_saved_pc_after_call (frame) NULL). */ static void -alpha_find_saved_regs (frame) - struct frame_info *frame; +alpha_find_saved_regs (struct frame_info *frame) { int ireg; CORE_ADDR reg_position; @@ -430,9 +419,7 @@ alpha_find_saved_regs (frame) } static CORE_ADDR -read_next_frame_reg (fi, regno) - struct frame_info *fi; - int regno; +read_next_frame_reg (struct frame_info *fi, int regno) { CORE_ADDR result; for (; fi; fi = fi->next) @@ -460,8 +447,7 @@ read_next_frame_reg (fi, regno) } static CORE_ADDR -alpha_frame_saved_pc (frame) - struct frame_info *frame; +alpha_frame_saved_pc (struct frame_info *frame) { return read_next_frame_reg (frame, frame->pc_reg); } @@ -472,8 +458,7 @@ static struct alpha_extra_func_info temp_proc_desc; $zero,($ra),1" on alpha. */ static int -alpha_about_to_return (pc) - CORE_ADDR pc; +alpha_about_to_return (CORE_ADDR pc) { int inst; @@ -485,8 +470,7 @@ alpha_about_to_return (pc) containing address PC. Returns 0 if none detected. */ static CORE_ADDR -heuristic_proc_start (pc) - CORE_ADDR pc; +heuristic_proc_start (CORE_ADDR pc) { CORE_ADDR start_pc = pc; CORE_ADDR fence = start_pc - heuristic_fence_post; @@ -512,11 +496,10 @@ heuristic_proc_start (pc) } static alpha_extra_func_info_t -heuristic_proc_desc (start_pc, limit_pc, next_frame, saved_regs_p) - CORE_ADDR start_pc; - CORE_ADDR limit_pc; - struct frame_info *next_frame; - struct frame_saved_regs *saved_regs_p; +heuristic_proc_desc (CORE_ADDR start_pc, + CORE_ADDR limit_pc, + struct frame_info *next_frame, + struct frame_saved_regs *saved_regs_p) { CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); CORE_ADDR cur_pc; @@ -641,10 +624,9 @@ heuristic_proc_desc (start_pc, limit_pc, next_frame, saved_regs_p) } static alpha_extra_func_info_t -find_proc_desc (pc, next_frame, saved_regs) - CORE_ADDR pc; - struct frame_info *next_frame; - struct frame_saved_regs *saved_regs; +find_proc_desc (CORE_ADDR pc, + struct frame_info *next_frame, + struct frame_saved_regs *saved_regs) { CORE_ADDR startaddr; @@ -660,8 +642,7 @@ find_proc_desc (pc, next_frame, saved_regs) } static CORE_ADDR -alpha_frame_chain (frame) - struct frame_info *frame; +alpha_frame_chain (struct frame_info *frame) { alpha_extra_func_info_t proc_desc; CORE_ADDR saved_pc = FRAME_SAVED_PC (frame); @@ -685,8 +666,7 @@ alpha_frame_chain (frame) } static void -init_extra_frame_info (frame) - struct frame_info *frame; +init_extra_frame_info (struct frame_info *frame) { struct frame_saved_regs temp_saved_regs; alpha_extra_func_info_t proc_desc = @@ -729,9 +709,7 @@ init_extra_frame_info (frame) Always returns a non-NULL value. */ static struct frame_info * -create_new_frame (addr, pc) - CORE_ADDR addr; - CORE_ADDR pc; +create_new_frame (CORE_ADDR addr, CORE_ADDR pc) { struct frame_info *fi; @@ -754,19 +732,19 @@ create_new_frame (addr, pc) static CORE_ADDR current_pc; static void -set_current_pc () +set_current_pc (void) { current_pc = (CORE_ADDR) __builtin_return_address (0); } static CORE_ADDR -read_pc () +read_pc (void) { return current_pc; } static struct frame_info * -get_current_frame () +get_current_frame (void) { return create_new_frame (0, read_pc ()); } @@ -775,8 +753,7 @@ get_current_frame () If FI is the original frame (it has no caller), return 0. */ static struct frame_info * -get_prev_frame (next_frame) - struct frame_info *next_frame; +get_prev_frame (struct frame_info *next_frame) { CORE_ADDR address = 0; struct frame_info *prev; @@ -897,12 +874,11 @@ get_prev_frame (next_frame) "stq $" #regno ", " #disp "(%0)\n" int -__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) - void **array; - int size; - void *exclude_min; - void *exclude_max; - int skip_frames; +__gnat_backtrace (void **array, + int size, + void *exclude_min, + void *exclude_max, + int skip_frames) { struct frame_info* top; struct frame_info* current; diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 5c9b9f690b4..59ed396d266 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -58,7 +58,7 @@ #include "system.h" #endif -extern int __gnat_backtrace PARAMS ((void **, int, void *, void *, int)); +extern int __gnat_backtrace (void **, int, void *, void *, int); /* The point is to provide an implementation of the __gnat_bactrace function above, called by the default implementation of the System.Traceback @@ -77,10 +77,10 @@ extern int __gnat_backtrace PARAMS ((void **, int, void *, void *, int)); function is still referenced by the default System.Traceback. */ #define Lock_Task system__soft_links__lock_task -extern void (*Lock_Task) PARAMS ((void)); +extern void (*Lock_Task) (void); #define Unlock_Task system__soft_links__unlock_task -extern void (*Unlock_Task) PARAMS ((void)); +extern void (*Unlock_Task) (void); /*-------------------------------------* *-- Target specific implementations --* @@ -339,12 +339,11 @@ static void forced_callee () {} #endif int -__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) - void **array; - int size; - void *exclude_min; - void *exclude_max; - int skip_frames; +__gnat_backtrace (void **array, + int size, + void *exclude_min, + void *exclude_max, + int skip_frames) { struct layout *current; void *top_frame; diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index d28ded8f305..9f443a6f9fb 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -103,24 +103,22 @@ Node_Id error_gnat_node; a return in some functions. See processing for N_Subprogram_Body. */ static GTY(()) tree gnu_return_label_stack; -static tree tree_transform PARAMS((Node_Id)); -static void elaborate_all_entities PARAMS((Node_Id)); -static void process_freeze_entity PARAMS((Node_Id)); -static void process_inlined_subprograms PARAMS((Node_Id)); -static void process_decls PARAMS((List_Id, List_Id, Node_Id, - int, int)); -static tree emit_range_check PARAMS((tree, Node_Id)); -static tree emit_index_check PARAMS((tree, tree, tree, tree)); -static tree emit_check PARAMS((tree, tree, int)); -static tree convert_with_check PARAMS((Entity_Id, tree, - int, int, int)); -static int addressable_p PARAMS((tree)); -static tree assoc_to_constructor PARAMS((Node_Id, tree)); -static tree extract_values PARAMS((tree, tree)); -static tree pos_to_constructor PARAMS((Node_Id, tree, Entity_Id)); -static tree maybe_implicit_deref PARAMS((tree)); -static tree gnat_stabilize_reference_1 PARAMS((tree, int)); -static int build_unit_elab PARAMS((Entity_Id, int, tree)); +static tree tree_transform (Node_Id); +static void elaborate_all_entities (Node_Id); +static void process_freeze_entity (Node_Id); +static void process_inlined_subprograms (Node_Id); +static void process_decls (List_Id, List_Id, Node_Id, int, int); +static tree emit_range_check (tree, Node_Id); +static tree emit_index_check (tree, tree, tree, tree); +static tree emit_check (tree, tree, int); +static tree convert_with_check (Entity_Id, tree, int, int, int); +static int addressable_p (tree); +static tree assoc_to_constructor (Node_Id, tree); +static tree extract_values (tree, tree); +static tree pos_to_constructor (Node_Id, tree, Entity_Id); +static tree maybe_implicit_deref (tree); +static tree gnat_stabilize_reference_1 (tree, int); +static int build_unit_elab (Entity_Id, int, tree); /* Constants for +0.5 and -0.5 for float-to-integer rounding. */ static REAL_VALUE_TYPE dconstp5; @@ -130,27 +128,23 @@ static REAL_VALUE_TYPE dconstmp5; structures and then generates code. */ void -gigi (gnat_root, max_gnat_node, number_name, nodes_ptr, next_node_ptr, - prev_node_ptr, elists_ptr, elmts_ptr, strings_ptr, string_chars_ptr, - list_headers_ptr, number_units, file_info_ptr, standard_integer, - standard_long_long_float, standard_exception_type, gigi_operating_mode) - Node_Id gnat_root; - int max_gnat_node; - int number_name; - struct Node *nodes_ptr; - Node_Id *next_node_ptr; - Node_Id *prev_node_ptr; - struct Elist_Header *elists_ptr; - struct Elmt_Item *elmts_ptr; - struct String_Entry *strings_ptr; - Char_Code *string_chars_ptr; - struct List_Header *list_headers_ptr; - Int number_units ATTRIBUTE_UNUSED; - char *file_info_ptr ATTRIBUTE_UNUSED; - Entity_Id standard_integer; - Entity_Id standard_long_long_float; - Entity_Id standard_exception_type; - Int gigi_operating_mode; +gigi (Node_Id gnat_root, + int max_gnat_node, + int number_name, + struct Node *nodes_ptr, + Node_Id *next_node_ptr, + Node_Id *prev_node_ptr, + struct Elist_Header *elists_ptr, + struct Elmt_Item *elmts_ptr, + struct String_Entry *strings_ptr, + Char_Code *string_chars_ptr, + struct List_Header *list_headers_ptr, + Int number_units ATTRIBUTE_UNUSED, + char *file_info_ptr ATTRIBUTE_UNUSED, + Entity_Id standard_integer, + Entity_Id standard_long_long_float, + Entity_Id standard_exception_type, + Int gigi_operating_mode) { tree gnu_standard_long_long_float; tree gnu_standard_exception_type; @@ -233,8 +227,7 @@ gigi (gnat_root, max_gnat_node, number_name, nodes_ptr, next_node_ptr, part of the tree. */ void -gnat_to_code (gnat_node) - Node_Id gnat_node; +gnat_to_code (Node_Id gnat_node) { tree gnu_root; @@ -243,9 +236,13 @@ gnat_to_code (gnat_node) gnu_root = tree_transform (gnat_node); + /* If we return a statement, generate code for it. */ + if (IS_STMT (gnu_root)) + expand_expr_stmt (gnu_root); + /* This should just generate code, not return a value. If it returns a value, something is wrong. */ - if (gnu_root != error_mark_node) + else if (gnu_root != error_mark_node) gigi_abort (302); } @@ -255,8 +252,7 @@ gnat_to_code (gnat_node) code. */ tree -gnat_to_gnu (gnat_node) - Node_Id gnat_node; +gnat_to_gnu (Node_Id gnat_node) { tree gnu_root; @@ -282,8 +278,7 @@ gnat_to_gnu (gnat_node) in the above two routines for most purposes. */ static tree -tree_transform (gnat_node) - Node_Id gnat_node; +tree_transform (Node_Id gnat_node) { tree gnu_result = error_mark_node; /* Default to no value. */ tree gnu_result_type = void_type_node; @@ -997,7 +992,9 @@ tree_transform (gnat_node) gnu_prefix = gnat_stabilize_reference (gnu_prefix, 0); gnu_result - = build_component_ref (gnu_prefix, NULL_TREE, gnu_field); + = build_component_ref (gnu_prefix, NULL_TREE, gnu_field, + (Nkind (Parent (gnat_node)) + == N_Attribute_Reference)); } if (gnu_result == 0) @@ -2058,8 +2055,6 @@ tree_transform (gnat_node) gnu_rhs = maybe_unconstrained_array (gnat_to_gnu (Expression (gnat_node))); - set_lineno (gnat_node, 1); - /* If range check is needed, emit code to generate it */ if (Do_Range_Check (Expression (gnat_node))) gnu_rhs = emit_range_check (gnu_rhs, Etype (Name (gnat_node))); @@ -2071,10 +2066,12 @@ tree_transform (gnat_node) && TREE_OVERFLOW (TYPE_SIZE (TREE_TYPE (gnu_lhs)))) || (TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_rhs))) == INTEGER_CST && TREE_OVERFLOW (TYPE_SIZE (TREE_TYPE (gnu_rhs))))) - expand_expr_stmt (build_call_raise (SE_Object_Too_Large)); + gnu_result = build_call_raise (SE_Object_Too_Large); else - expand_expr_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, - gnu_lhs, gnu_rhs)); + gnu_result + = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_lhs, gnu_rhs); + + gnu_result = build_nt (EXPR_STMT, gnu_result); break; case N_If_Statement: @@ -3168,7 +3165,7 @@ tree_transform (gnat_node) = length == 1 ? gnu_subprog_call : build_component_ref (gnu_subprog_call, NULL_TREE, - TREE_PURPOSE (scalar_return_list)); + TREE_PURPOSE (scalar_return_list), 0); int unchecked_conversion = Nkind (gnat_actual) == N_Unchecked_Type_Conversion; /* If the actual is a conversion, get the inner expression, @@ -3614,7 +3611,8 @@ tree_transform (gnat_node) (build_unary_op (INDIRECT_REF, NULL_TREE, TREE_VALUE (gnu_except_ptr_stack)), - get_identifier ("not_handled_by_others"), NULL_TREE)), + get_identifier ("not_handled_by_others"), NULL_TREE, + 0)), integer_zero_node); } @@ -3643,7 +3641,7 @@ tree_transform (gnat_node) (build_unary_op (INDIRECT_REF, NULL_TREE, TREE_VALUE (gnu_except_ptr_stack)), - get_identifier ("import_code"), NULL_TREE), + get_identifier ("import_code"), NULL_TREE, 0), gnu_expr); else this_choice @@ -3664,7 +3662,7 @@ tree_transform (gnat_node) (build_unary_op (INDIRECT_REF, NULL_TREE, TREE_VALUE (gnu_except_ptr_stack)), - get_identifier ("lang"), NULL_TREE); + get_identifier ("lang"), NULL_TREE, 0); this_choice = build_binary_op @@ -4024,8 +4022,17 @@ tree_transform (gnat_node) gigi_abort (321); } + /* If the result is a statement, set needed flags and return it. */ + if (IS_STMT (gnu_result)) + { + TREE_TYPE (gnu_result) = void_type_node; + TREE_THIS_VOLATILE (gnu_result) = TREE_SIDE_EFFECTS (gnu_result) = 1; + TREE_SLOC (gnu_result) = Sloc (gnat_node); + return gnu_result; + } + /* If the result is a constant that overflows, raise constraint error. */ - if (TREE_CODE (gnu_result) == INTEGER_CST + else if (TREE_CODE (gnu_result) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (gnu_result)) { post_error ("Constraint_Error will be raised at run-time?", gnat_node); @@ -4137,6 +4144,24 @@ tree_transform (gnat_node) return gnu_result; } +/* GNU_STMT is a statement. We generate code for that statement. */ + +void +gnat_expand_stmt (tree gnu_stmt) +{ + set_lineno_from_sloc (TREE_SLOC (gnu_stmt), 1); + + switch (TREE_CODE (gnu_stmt)) + { + case EXPR_STMT: + expand_expr_stmt (EXPR_STMT_EXPR (gnu_stmt)); + break; + + default: + abort (); + } +} + /* Force references to each of the entities in packages GNAT_NODE with's so that the debugging information for all of them are identical in all clients. Operate recursively on anything it with's, but check @@ -4158,8 +4183,7 @@ tree_transform (gnat_node) information for types in withed units, for ASIS use */ static void -elaborate_all_entities (gnat_node) - Node_Id gnat_node; +elaborate_all_entities (Node_Id gnat_node) { Entity_Id gnat_with_clause, gnat_entity; @@ -4225,8 +4249,7 @@ elaborate_all_entities (gnat_node) /* Do the processing of N_Freeze_Entity, GNAT_NODE. */ static void -process_freeze_entity (gnat_node) - Node_Id gnat_node; +process_freeze_entity (Node_Id gnat_node) { Entity_Id gnat_entity = Entity (gnat_node); tree gnu_old; @@ -4334,8 +4357,7 @@ process_freeze_entity (gnat_node) N_Compilation_Unit. */ static void -process_inlined_subprograms (gnat_node) - Node_Id gnat_node; +process_inlined_subprograms (Node_Id gnat_node) { Entity_Id gnat_entity; Node_Id gnat_body; @@ -4381,10 +4403,11 @@ process_inlined_subprograms (gnat_node) correspond to the public and private parts of a package. */ static void -process_decls (gnat_decls, gnat_decls2, gnat_end_list, pass1p, pass2p) - List_Id gnat_decls, gnat_decls2; - Node_Id gnat_end_list; - int pass1p, pass2p; +process_decls (List_Id gnat_decls, + List_Id gnat_decls2, + Node_Id gnat_end_list, + int pass1p, + int pass2p) { List_Id gnat_decl_array[2]; Node_Id gnat_decl; @@ -4501,9 +4524,7 @@ process_decls (gnat_decls, gnat_decls2, gnat_end_list, pass1p, pass2p) which we have to check. */ static tree -emit_range_check (gnu_expr, gnat_range_type) - tree gnu_expr; - Entity_Id gnat_range_type; +emit_range_check (tree gnu_expr, Entity_Id gnat_range_type) { tree gnu_range_type = get_unpadded_type (gnat_range_type); tree gnu_low = TYPE_MIN_VALUE (gnu_range_type); @@ -4553,11 +4574,10 @@ emit_range_check (gnu_expr, gnat_range_type) subprograms having unconstrained array formal parameters */ static tree -emit_index_check (gnu_array_object, gnu_expr, gnu_low, gnu_high) - tree gnu_array_object; - tree gnu_expr; - tree gnu_low; - tree gnu_high; +emit_index_check (tree gnu_array_object, + tree gnu_expr, + tree gnu_low, + tree gnu_high) { tree gnu_expr_check; @@ -4600,10 +4620,7 @@ emit_index_check (gnu_array_object, gnu_expr, gnu_low, gnu_high) why the exception was raised. */ static tree -emit_check (gnu_cond, gnu_expr, reason) - tree gnu_cond; - tree gnu_expr; - int reason; +emit_check (tree gnu_cond, tree gnu_expr, int reason) { tree gnu_call; tree gnu_result; @@ -4641,12 +4658,11 @@ emit_check (gnu_cond, gnu_expr, reason) truncation; otherwise round. */ static tree -convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p) - Entity_Id gnat_type; - tree gnu_expr; - int overflow_p; - int range_p; - int truncate_p; +convert_with_check (Entity_Id gnat_type, + tree gnu_expr, + int overflow_p, + int range_p, + int truncate_p) { tree gnu_type = get_unpadded_type (gnat_type); tree gnu_in_type = TREE_TYPE (gnu_expr); @@ -4785,8 +4801,7 @@ convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p) cases. */ static int -addressable_p (gnu_expr) - tree gnu_expr; +addressable_p (tree gnu_expr) { switch (TREE_CODE (gnu_expr)) { @@ -4848,8 +4863,7 @@ addressable_p (gnu_expr) make a GCC type for GNAT_ENTITY and set up the correspondance. */ void -process_type (gnat_entity) - Entity_Id gnat_entity; +process_type (Entity_Id gnat_entity) { tree gnu_old = present_gnu_tree (gnat_entity) ? get_gnu_tree (gnat_entity) : 0; @@ -4944,9 +4958,7 @@ process_type (gnat_entity) Return a CONSTRUCTOR to build the record. */ static tree -assoc_to_constructor (gnat_assoc, gnu_type) - Node_Id gnat_assoc; - tree gnu_type; +assoc_to_constructor (Node_Id gnat_assoc, tree gnu_type) { tree gnu_field, gnu_list, gnu_result; @@ -4995,10 +5007,9 @@ assoc_to_constructor (gnat_assoc, gnu_type) of the array component. It is needed for range checking. */ static tree -pos_to_constructor (gnat_expr, gnu_array_type, gnat_component_type) - Node_Id gnat_expr; - tree gnu_array_type; - Entity_Id gnat_component_type; +pos_to_constructor (Node_Id gnat_expr, + tree gnu_array_type, + Entity_Id gnat_component_type) { tree gnu_expr; tree gnu_expr_list = NULL_TREE; @@ -5039,9 +5050,7 @@ pos_to_constructor (gnat_expr, gnu_array_type, gnat_component_type) record, make a recursive call to fill it in as well. */ static tree -extract_values (values, record_type) - tree values; - tree record_type; +extract_values (tree values, tree record_type) { tree result = NULL_TREE; tree field, tem; @@ -5088,8 +5097,7 @@ extract_values (values, record_type) an access object and perform the required dereferences. */ static tree -maybe_implicit_deref (exp) - tree exp; +maybe_implicit_deref (tree exp) { /* If the type is a pointer, dereference it. */ @@ -5107,8 +5115,7 @@ maybe_implicit_deref (exp) /* Protect EXP from multiple evaluation. This may make a SAVE_EXPR. */ tree -protect_multiple_eval (exp) - tree exp; +protect_multiple_eval (tree exp) { tree type = TREE_TYPE (exp); @@ -5147,13 +5154,11 @@ protect_multiple_eval (exp) whether to force evaluation of everything. */ tree -gnat_stabilize_reference (ref, force) - tree ref; - int force; +gnat_stabilize_reference (tree ref, int force) { - register tree type = TREE_TYPE (ref); - register enum tree_code code = TREE_CODE (ref); - register tree result; + tree type = TREE_TYPE (ref); + enum tree_code code = TREE_CODE (ref); + tree result; switch (code) { @@ -5245,13 +5250,11 @@ gnat_stabilize_reference (ref, force) arg to force a SAVE_EXPR for everything. */ static tree -gnat_stabilize_reference_1 (e, force) - tree e; - int force; +gnat_stabilize_reference_1 (tree e, int force) { - register enum tree_code code = TREE_CODE (e); - register tree type = TREE_TYPE (e); - register tree result; + enum tree_code code = TREE_CODE (e); + tree type = TREE_TYPE (e); + tree result; /* We cannot ignore const expressions because it might be a reference to a const array but whose index contains side-effects. But we can @@ -5310,10 +5313,7 @@ gnat_stabilize_reference_1 (e, force) Return 1 if we didn't need an elaboration function, zero otherwise. */ static int -build_unit_elab (gnat_unit, body_p, gnu_elab_list) - Entity_Id gnat_unit; - int body_p; - tree gnu_elab_list; +build_unit_elab (Entity_Id gnat_unit, int body_p, tree gnu_elab_list) { tree gnu_decl; rtx insn; @@ -5394,19 +5394,25 @@ build_unit_elab (gnat_unit, body_p, gnu_elab_list) return result; } -extern char *__gnat_to_canonical_file_spec PARAMS ((char *)); +extern char *__gnat_to_canonical_file_spec (char *); /* Determine the input_filename and the input_line from the source location (Sloc) of GNAT_NODE node. Set the global variable input_filename and input_line. If WRITE_NOTE_P is true, emit a line number note. */ void -set_lineno (gnat_node, write_note_p) - Node_Id gnat_node; - int write_note_p; +set_lineno (Node_Id gnat_node, int write_note_p) { Source_Ptr source_location = Sloc (gnat_node); + set_lineno_from_sloc (source_location, write_note_p); +} + +/* Likewise, but passed a Sloc. */ + +void +set_lineno_from_sloc (Source_Ptr source_location, int write_note_p) +{ /* If node not from source code, ignore. */ if (source_location < 0) return; @@ -5441,9 +5447,7 @@ set_lineno (gnat_node, write_note_p) "&" substitution. */ void -post_error (msg, node) - const char *msg; - Node_Id node; +post_error (const char *msg, Node_Id node) { String_Template temp; Fat_Pointer fp; @@ -5458,10 +5462,7 @@ post_error (msg, node) is the node to use for the "&" substitution. */ void -post_error_ne (msg, node, ent) - const char *msg; - Node_Id node; - Entity_Id ent; +post_error_ne (const char *msg, Node_Id node, Entity_Id ent) { String_Template temp; Fat_Pointer fp; @@ -5476,11 +5477,7 @@ post_error_ne (msg, node, ent) to use for the "&" substitution, and N is the number to use for the ^. */ void -post_error_ne_num (msg, node, ent, n) - const char *msg; - Node_Id node; - Entity_Id ent; - int n; +post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n) { String_Template temp; Fat_Pointer fp; @@ -5500,11 +5497,7 @@ post_error_ne_num (msg, node, ent, n) and the text inside square brackets will be output instead. */ void -post_error_ne_tree (msg, node, ent, t) - const char *msg; - Node_Id node; - Entity_Id ent; - tree t; +post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t) { char *newmsg = alloca (strlen (msg) + 1); String_Template temp = {1, 0}; @@ -5552,12 +5545,11 @@ post_error_ne_tree (msg, node, ent, t) integer to write in the message. */ void -post_error_ne_tree_2 (msg, node, ent, t, num) - const char *msg; - Node_Id node; - Entity_Id ent; - tree t; - int num; +post_error_ne_tree_2 (const char *msg, + Node_Id node, + Entity_Id ent, + tree t, + int num) { Error_Msg_Uint_2 = UI_From_Int (num); post_error_ne_tree (msg, node, ent, t); @@ -5566,8 +5558,7 @@ post_error_ne_tree_2 (msg, node, ent, t, num) /* Set the node for a second '&' in the error message. */ void -set_second_error_entity (e) - Entity_Id e; +set_second_error_entity (Entity_Id e) { Error_Msg_Node_2 = e; } @@ -5576,8 +5567,7 @@ set_second_error_entity (e) as the relevant node that provides the location info for the error */ void -gigi_abort (code) - int code; +gigi_abort (int code) { String_Template temp = {1, 10}; Fat_Pointer fp; @@ -5592,7 +5582,7 @@ gigi_abort (code) binary and unary operations. */ void -init_code_table () +init_code_table (void) { gnu_codes[N_And_Then] = TRUTH_ANDIF_EXPR; gnu_codes[N_Or_Else] = TRUTH_ORIF_EXPR; diff --git a/gcc/ada/treeprs.ads b/gcc/ada/treeprs.ads deleted file mode 100644 index 433cb081975..00000000000 --- a/gcc/ada/treeprs.ads +++ /dev/null @@ -1,796 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- T R E E P R S -- --- -- --- S p e c -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is 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 2, 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - - --- This package contains the declaration of the string used by the Tree_Print --- package. It must be updated whenever the arrangements of the field names --- in package Sinfo is changed. The utility program XTREEPRS is used to --- do this update correctly using the template treeprs.adt as input. - -with Sinfo; use Sinfo; - -package Treeprs is - - -------------------------------- - -- String Data for Node Print -- - -------------------------------- - - -- String data for print out. The Pchars array is a long string with the - -- the entry for each node type consisting of a single blank, followed by - -- a series of entries, one for each Op or Flag field used for the node. - -- Each entry has a single character which identifies the field, followed - -- by the synonym name. The starting location for a given node type is - -- found from the corresponding entry in the Pchars_Pos_Array. - - -- The following characters identify the field. These are characters - -- which could never occur in a field name, so they also mark the - -- end of the previous name. - - subtype Fchar is Character range '#' .. '9'; - - F_Field1 : constant Fchar := '#'; -- Character'Val (16#23#) - F_Field2 : constant Fchar := '$'; -- Character'Val (16#24#) - F_Field3 : constant Fchar := '%'; -- Character'Val (16#25#) - F_Field4 : constant Fchar := '&'; -- Character'Val (16#26#) - F_Field5 : constant Fchar := '''; -- Character'Val (16#27#) - F_Flag1 : constant Fchar := '('; -- Character'Val (16#28#) - F_Flag2 : constant Fchar := ')'; -- Character'Val (16#29#) - F_Flag3 : constant Fchar := '*'; -- Character'Val (16#2A#) - F_Flag4 : constant Fchar := '+'; -- Character'Val (16#2B#) - F_Flag5 : constant Fchar := ','; -- Character'Val (16#2C#) - F_Flag6 : constant Fchar := '-'; -- Character'Val (16#2D#) - F_Flag7 : constant Fchar := '.'; -- Character'Val (16#2E#) - F_Flag8 : constant Fchar := '/'; -- Character'Val (16#2F#) - F_Flag9 : constant Fchar := '0'; -- Character'Val (16#30#) - F_Flag10 : constant Fchar := '1'; -- Character'Val (16#31#) - F_Flag11 : constant Fchar := '2'; -- Character'Val (16#32#) - F_Flag12 : constant Fchar := '3'; -- Character'Val (16#33#) - F_Flag13 : constant Fchar := '4'; -- Character'Val (16#34#) - F_Flag14 : constant Fchar := '5'; -- Character'Val (16#35#) - F_Flag15 : constant Fchar := '6'; -- Character'Val (16#36#) - F_Flag16 : constant Fchar := '7'; -- Character'Val (16#37#) - F_Flag17 : constant Fchar := '8'; -- Character'Val (16#38#) - F_Flag18 : constant Fchar := '9'; -- Character'Val (16#39#) - - -- Note this table does not include entity field and flags whose access - -- functions are in Einfo (these are handled by the Print_Entity_Info - -- procedure in Treepr, which uses the routines in Einfo to get the - -- proper symbolic information). In addition, the following fields are - -- handled by Treepr, and do not appear in the Pchars array: - - -- Analyzed - -- Cannot_Be_Constant - -- Chars - -- Comes_From_Source - -- Error_Posted - -- Etype - -- Is_Controlling_Actual - -- Is_Overloaded - -- Is_Static_Expression - -- Left_Opnd - -- Must_Check_Expr - -- Must_Not_Freeze - -- No_Overflow_Expr - -- Paren_Count - -- Raises_Constraint_Error - -- Right_Opnd - - Pchars : constant String := - -- Unused_At_Start - "" & - -- At_Clause - "#Identifier%Expression" & - -- Component_Clause - "#Component_Name$Position%First_Bit&Last_Bit" & - -- Enumeration_Representation_Clause - "#Identifier%Array_Aggregate&Next_Rep_Item" & - -- Mod_Clause - "%Expression&Pragmas_Before" & - -- Record_Representation_Clause - "#Identifier$Mod_Clause%Component_Clauses&Next_Rep_Item" & - -- Attribute_Definition_Clause - "$Name%Expression&Next_Rep_Item+From_At_Mod2Check_Address_Alignment" & - -- Empty - "" & - -- Pragma - "$Pragma_Argument_Associations%Debug_Statement&Next_Rep_Item" & - -- Pragma_Argument_Association - "%Expression" & - -- Error - "" & - -- Defining_Character_Literal - "$Next_Entity%Scope" & - -- Defining_Identifier - "$Next_Entity%Scope" & - -- Defining_Operator_Symbol - "$Next_Entity%Scope" & - -- Expanded_Name - "%Prefix$Selector_Name&Entity&Associated_Node4Redundant_Use2Has_Privat" & - "e_View" & - -- Identifier - "&Entity&Associated_Node$Original_Discriminant4Redundant_Use2Has_Priva" & - "te_View" & - -- Operator_Symbol - "%Strval&Entity&Associated_Node2Has_Private_View" & - -- Character_Literal - "$Char_Literal_Value&Entity&Associated_Node2Has_Private_View" & - -- Op_Add - "" & - -- Op_Concat - "4Is_Component_Left_Opnd5Is_Component_Right_Opnd" & - -- Op_Expon - "4Is_Power_Of_2_For_Shift" & - -- Op_Subtract - "" & - -- Op_Divide - "5Treat_Fixed_As_Integer4Do_Division_Check9Rounded_Result" & - -- Op_Mod - "5Treat_Fixed_As_Integer4Do_Division_Check" & - -- Op_Multiply - "5Treat_Fixed_As_Integer9Rounded_Result" & - -- Op_Rem - "5Treat_Fixed_As_Integer4Do_Division_Check" & - -- Op_And - "+Do_Length_Check" & - -- Op_Eq - "" & - -- Op_Ge - "" & - -- Op_Gt - "" & - -- Op_Le - "" & - -- Op_Lt - "" & - -- Op_Ne - "" & - -- Op_Or - "+Do_Length_Check" & - -- Op_Xor - "+Do_Length_Check" & - -- Op_Rotate_Left - "+Shift_Count_OK" & - -- Op_Rotate_Right - "+Shift_Count_OK" & - -- Op_Shift_Left - "+Shift_Count_OK" & - -- Op_Shift_Right - "+Shift_Count_OK" & - -- Op_Shift_Right_Arithmetic - "+Shift_Count_OK" & - -- Op_Abs - "" & - -- Op_Minus - "" & - -- Op_Not - "" & - -- Op_Plus - "" & - -- Attribute_Reference - "%Prefix$Attribute_Name#Expressions&Entity&Associated_Node8Do_Overflow" & - "_Check4Redundant_Use+OK_For_Stream5Must_Be_Byte_Aligned" & - -- And_Then - "#Actions" & - -- Conditional_Expression - "#Expressions$Then_Actions%Else_Actions" & - -- Explicit_Dereference - "%Prefix" & - -- Function_Call - "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" & - "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" & - -- In - "" & - -- Indexed_Component - "%Prefix#Expressions" & - -- Integer_Literal - "$Original_Entity%Intval4Print_In_Hex" & - -- Not_In - "" & - -- Null - "" & - -- Or_Else - "#Actions" & - -- Procedure_Call_Statement - "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" & - "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" & - -- Qualified_Expression - "&Subtype_Mark%Expression" & - -- Raise_Constraint_Error - "#Condition%Reason" & - -- Raise_Program_Error - "#Condition%Reason" & - -- Raise_Storage_Error - "#Condition%Reason" & - -- Aggregate - "#Expressions$Component_Associations8Null_Record_Present%Aggregate_Bou" & - "nds&Associated_Node+Static_Processing_OK9Compile_Time_Known_Aggreg" & - "ate2Expansion_Delayed" & - -- Allocator - "%Expression#Storage_Pool&Procedure_To_Call4No_Initialization8Do_Stora" & - "ge_Check" & - -- Extension_Aggregate - "%Ancestor_Part&Associated_Node#Expressions$Component_Associations8Nul" & - "l_Record_Present2Expansion_Delayed" & - -- Range - "#Low_Bound$High_Bound2Includes_Infinities" & - -- Real_Literal - "$Original_Entity%Realval&Corresponding_Integer_Value2Is_Machine_Numbe" & - "r" & - -- Reference - "%Prefix" & - -- Selected_Component - "%Prefix$Selector_Name&Associated_Node4Do_Discriminant_Check2Is_In_Dis" & - "criminant_Check" & - -- Slice - "%Prefix&Discrete_Range" & - -- String_Literal - "%Strval2Has_Wide_Character" & - -- Subprogram_Info - "#Identifier" & - -- Type_Conversion - "&Subtype_Mark%Expression4Do_Tag_Check+Do_Length_Check8Do_Overflow_Che" & - "ck2Float_Truncate9Rounded_Result5Conversion_OK" & - -- Unchecked_Expression - "%Expression" & - -- Unchecked_Type_Conversion - "&Subtype_Mark%Expression2Kill_Range_Check8No_Truncation" & - -- Subtype_Indication - "&Subtype_Mark%Constraint/Must_Not_Freeze" & - -- Component_Declaration - "#Defining_Identifier+Aliased_Present'Subtype_Indication%Expression,Mo" & - "re_Ids-Prev_Ids" & - -- Entry_Declaration - "#Defining_Identifier&Discrete_Subtype_Definition%Parameter_Specificat" & - "ions'Corresponding_Body" & - -- Formal_Object_Declaration - "#Defining_Identifier6In_Present8Out_Present&Subtype_Mark%Expression,M" & - "ore_Ids-Prev_Ids" & - -- Formal_Type_Declaration - "#Defining_Identifier%Formal_Type_Definition&Discriminant_Specificatio" & - "ns4Unknown_Discriminants_Present" & - -- Full_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications%Type_Definition2Disc" & - "r_Check_Funcs_Built" & - -- Incomplete_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present" & - -- Loop_Parameter_Specification - "#Defining_Identifier6Reverse_Present&Discrete_Subtype_Definition" & - -- Object_Declaration - "#Defining_Identifier+Aliased_Present8Constant_Present&Object_Definiti" & - "on%Expression$Handler_List_Entry'Corresponding_Generic_Association" & - ",More_Ids-Prev_Ids4No_Initialization6Assignment_OK2Exception_Junk5" & - "Delay_Finalize_Attach7Is_Subprogram_Descriptor" & - -- Protected_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications%Protected_Definition" & - "'Corresponding_Body" & - -- Private_Extension_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present+Abstract_Present'Subtype_Indication" & - -- Private_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present+Abstract_Present6Tagged_Present8Limited_Present" & - -- Subtype_Declaration - "#Defining_Identifier'Subtype_Indication&Generic_Parent_Type2Exception" & - "_Junk" & - -- Function_Specification - "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications&Subt" & - "ype_Mark'Generic_Parent" & - -- Procedure_Specification - "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications'Gene" & - "ric_Parent" & - -- Entry_Index_Specification - "#Defining_Identifier&Discrete_Subtype_Definition" & - -- Freeze_Entity - "&Entity$Access_Types_To_Process%TSS_Elist#Actions'First_Subtype_Link" & - -- Access_Function_Definition - "6Protected_Present%Parameter_Specifications&Subtype_Mark" & - -- Access_Procedure_Definition - "6Protected_Present%Parameter_Specifications" & - -- Task_Type_Declaration - "#Defining_Identifier$Task_Body_Procedure&Discriminant_Specifications%" & - "Task_Definition'Corresponding_Body" & - -- Package_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Protected_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Subprogram_Body_Stub - "#Specification&Library_Unit'Corresponding_Body" & - -- Task_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Function_Instantiation - "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Package_Instantiation - "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Procedure_Instantiation - "#Defining_Unit_Name$Name&Parent_Spec%Generic_Associations'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Package_Body - "#Defining_Unit_Name$Declarations&Handled_Statement_Sequence'Correspon" & - "ding_Spec4Was_Originally_Stub" & - -- Subprogram_Body - "#Specification$Declarations&Handled_Statement_Sequence%Activation_Cha" & - "in_Entity'Corresponding_Spec+Acts_As_Spec6Bad_Is_Detected8Do_Stora" & - "ge_Check-Has_Priority_Pragma.Is_Protected_Subprogram_Body,Is_Task_" & - "Master4Was_Originally_Stub" & - -- Protected_Body - "#Defining_Identifier$Declarations&End_Label'Corresponding_Spec4Was_Or" & - "iginally_Stub" & - -- Task_Body - "#Defining_Identifier$Declarations&Handled_Statement_Sequence,Is_Task_" & - "Master%Activation_Chain_Entity'Corresponding_Spec4Was_Originally_S" & - "tub" & - -- Implicit_Label_Declaration - "#Defining_Identifier$Label_Construct" & - -- Package_Declaration - "#Specification'Corresponding_Body&Parent_Spec%Activation_Chain_Entity" & - -- Single_Task_Declaration - "#Defining_Identifier%Task_Definition" & - -- Subprogram_Declaration - "#Specification%Body_To_Inline'Corresponding_Body&Parent_Spec" & - -- Use_Package_Clause - "$Names%Next_Use_Clause&Hidden_By_Use_Clause" & - -- Generic_Package_Declaration - "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" & - "Spec%Activation_Chain_Entity" & - -- Generic_Subprogram_Declaration - "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" & - "Spec" & - -- Constrained_Array_Definition - "$Discrete_Subtype_Definitions+Aliased_Present'Subtype_Indication" & - -- Unconstrained_Array_Definition - "$Subtype_Marks+Aliased_Present'Subtype_Indication" & - -- Exception_Renaming_Declaration - "#Defining_Identifier$Name" & - -- Object_Renaming_Declaration - "#Defining_Identifier&Subtype_Mark$Name'Corresponding_Generic_Associat" & - "ion" & - -- Package_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Subprogram_Renaming_Declaration - "#Specification$Name&Parent_Spec'Corresponding_Spec" & - -- Generic_Function_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Generic_Package_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Generic_Procedure_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Abort_Statement - "$Names" & - -- Accept_Statement - "#Entry_Direct_Name'Entry_Index%Parameter_Specifications&Handled_State" & - "ment_Sequence$Declarations" & - -- Assignment_Statement - "$Name%Expression4Do_Tag_Check+Do_Length_Check,Forwards_OK-Backwards_O" & - "K.No_Ctrl_Actions" & - -- Asynchronous_Select - "#Triggering_Alternative$Abortable_Part" & - -- Block_Statement - "#Identifier$Declarations&Handled_Statement_Sequence,Is_Task_Master%Ac" & - "tivation_Chain_Entity6Has_Created_Identifier-Is_Task_Allocation_Bl" & - "ock.Is_Asynchronous_Call_Block" & - -- Case_Statement - "%Expression&Alternatives'End_Span" & - -- Code_Statement - "%Expression" & - -- Conditional_Entry_Call - "#Entry_Call_Alternative&Else_Statements" & - -- Delay_Relative_Statement - "%Expression" & - -- Delay_Until_Statement - "%Expression" & - -- Entry_Call_Statement - "$Name%Parameter_Associations&First_Named_Actual" & - -- Free_Statement - "%Expression#Storage_Pool&Procedure_To_Call" & - -- Goto_Statement - "$Name2Exception_Junk" & - -- Loop_Statement - "#Identifier$Iteration_Scheme%Statements&End_Label6Has_Created_Identif" & - "ier7Is_Null_Loop" & - -- Null_Statement - "" & - -- Raise_Statement - "$Name" & - -- Requeue_Statement - "$Name6Abort_Present" & - -- Return_Statement - "%Expression#Storage_Pool&Procedure_To_Call4Do_Tag_Check$Return_Type,B" & - "y_Ref" & - -- Selective_Accept - "#Select_Alternatives&Else_Statements" & - -- Timed_Entry_Call - "#Entry_Call_Alternative&Delay_Alternative" & - -- Exit_Statement - "$Name#Condition" & - -- If_Statement - "#Condition$Then_Statements%Elsif_Parts&Else_Statements'End_Span" & - -- Accept_Alternative - "$Accept_Statement#Condition%Statements&Pragmas_Before'Accept_Handler_" & - "Records" & - -- Delay_Alternative - "$Delay_Statement#Condition%Statements&Pragmas_Before" & - -- Elsif_Part - "#Condition$Then_Statements%Condition_Actions" & - -- Entry_Body_Formal_Part - "&Entry_Index_Specification%Parameter_Specifications#Condition" & - -- Iteration_Scheme - "#Condition%Condition_Actions&Loop_Parameter_Specification" & - -- Terminate_Alternative - "#Condition&Pragmas_Before'Pragmas_After" & - -- Abortable_Part - "%Statements" & - -- Abstract_Subprogram_Declaration - "#Specification" & - -- Access_Definition - "&Subtype_Mark" & - -- Access_To_Object_Definition - "6All_Present'Subtype_Indication8Constant_Present" & - -- Case_Statement_Alternative - "&Discrete_Choices%Statements" & - -- Compilation_Unit - "&Library_Unit#Context_Items6Private_Present$Unit'Aux_Decls_Node8Has_N" & - "o_Elaboration_Code4Body_Required+Acts_As_Spec%First_Inlined_Subpro" & - "gram" & - -- Compilation_Unit_Aux - "$Declarations#Actions'Pragmas_After&Config_Pragmas" & - -- Component_Association - "#Choices$Loop_Actions%Expression" & - -- Component_List - "%Component_Items&Variant_Part4Null_Present" & - -- Derived_Type_Definition - "+Abstract_Present'Subtype_Indication%Record_Extension_Part" & - -- Decimal_Fixed_Point_Definition - "%Delta_Expression$Digits_Expression&Real_Range_Specification" & - -- Defining_Program_Unit_Name - "$Name#Defining_Identifier" & - -- Delta_Constraint - "%Delta_Expression&Range_Constraint" & - -- Designator - "$Name#Identifier" & - -- Digits_Constraint - "$Digits_Expression&Range_Constraint" & - -- Discriminant_Association - "#Selector_Names%Expression" & - -- Discriminant_Specification - "#Defining_Identifier'Discriminant_Type%Expression,More_Ids-Prev_Ids" & - -- Enumeration_Type_Definition - "#Literals&End_Label" & - -- Entry_Body - "#Defining_Identifier'Entry_Body_Formal_Part$Declarations&Handled_Stat" & - "ement_Sequence%Activation_Chain_Entity" & - -- Entry_Call_Alternative - "#Entry_Call_Statement%Statements&Pragmas_Before" & - -- Exception_Declaration - "#Defining_Identifier%Expression,More_Ids-Prev_Ids" & - -- Exception_Handler - "$Choice_Parameter&Exception_Choices%Statements,Zero_Cost_Handling" & - -- Floating_Point_Definition - "$Digits_Expression&Real_Range_Specification" & - -- Formal_Decimal_Fixed_Point_Definition - "" & - -- Formal_Derived_Type_Definition - "&Subtype_Mark6Private_Present+Abstract_Present" & - -- Formal_Discrete_Type_Definition - "" & - -- Formal_Floating_Point_Definition - "" & - -- Formal_Modular_Type_Definition - "" & - -- Formal_Ordinary_Fixed_Point_Definition - "" & - -- Formal_Package_Declaration - "#Defining_Identifier$Name%Generic_Associations6Box_Present'Instance_S" & - "pec9ABE_Is_Certain" & - -- Formal_Private_Type_Definition - "+Abstract_Present6Tagged_Present8Limited_Present" & - -- Formal_Signed_Integer_Type_Definition - "" & - -- Formal_Subprogram_Declaration - "#Specification$Default_Name6Box_Present" & - -- Generic_Association - "$Selector_Name#Explicit_Generic_Actual_Parameter" & - -- Handled_Sequence_Of_Statements - "%Statements&End_Label'Exception_Handlers#At_End_Proc$First_Real_State" & - "ment,Zero_Cost_Handling" & - -- Index_Or_Discriminant_Constraint - "#Constraints" & - -- Itype_Reference - "#Itype" & - -- Label - "#Identifier2Exception_Junk" & - -- Modular_Type_Definition - "%Expression" & - -- Number_Declaration - "#Defining_Identifier%Expression,More_Ids-Prev_Ids" & - -- Ordinary_Fixed_Point_Definition - "%Delta_Expression&Real_Range_Specification" & - -- Others_Choice - "#Others_Discrete_Choices2All_Others" & - -- Package_Specification - "#Defining_Unit_Name$Visible_Declarations%Private_Declarations&End_Lab" & - "el'Generic_Parent9Limited_View_Installed" & - -- Parameter_Association - "$Selector_Name%Explicit_Actual_Parameter&Next_Named_Actual" & - -- Parameter_Specification - "#Defining_Identifier6In_Present8Out_Present$Parameter_Type%Expression" & - "4Do_Accessibility_Check,More_Ids-Prev_Ids'Default_Expression" & - -- Protected_Definition - "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" & - "gma" & - -- Range_Constraint - "&Range_Expression" & - -- Real_Range_Specification - "#Low_Bound$High_Bound" & - -- Record_Definition - "&End_Label+Abstract_Present6Tagged_Present8Limited_Present#Component_" & - "List4Null_Present" & - -- Signed_Integer_Type_Definition - "#Low_Bound$High_Bound" & - -- Single_Protected_Declaration - "#Defining_Identifier%Protected_Definition" & - -- Subunit - "$Name#Proper_Body%Corresponding_Stub" & - -- Task_Definition - "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" & - "gma,Has_Storage_Size_Pragma.Has_Task_Info_Pragma/Has_Task_Name_Pra" & - "gma" & - -- Triggering_Alternative - "#Triggering_Statement%Statements&Pragmas_Before" & - -- Use_Type_Clause - "$Subtype_Marks%Next_Use_Clause&Hidden_By_Use_Clause" & - -- Validate_Unchecked_Conversion - "#Source_Type$Target_Type" & - -- Variant - "&Discrete_Choices#Component_List$Enclosing_Variant%Present_Expr'Dchec" & - "k_Function" & - -- Variant_Part - "$Name#Variants" & - -- With_Clause - "$Name&Library_Unit'Corresponding_Spec,First_Name-Last_Name4Context_In" & - "stalled+Elaborate_Present6Elaborate_All_Present7Implicit_With8Limi" & - "ted_Present9Limited_View_Installed.Unreferenced_In_Spec/No_Entitie" & - "s_Ref_In_Spec" & - -- With_Type_Clause - "$Name6Tagged_Present" & - -- Unused_At_End - ""; - - type Pchar_Pos_Array is array (Node_Kind) of Positive; - Pchar_Pos : constant Pchar_Pos_Array := Pchar_Pos_Array'( - N_Unused_At_Start => 1, - N_At_Clause => 1, - N_Component_Clause => 23, - N_Enumeration_Representation_Clause => 66, - N_Mod_Clause => 107, - N_Record_Representation_Clause => 133, - N_Attribute_Definition_Clause => 187, - N_Empty => 253, - N_Pragma => 253, - N_Pragma_Argument_Association => 312, - N_Error => 323, - N_Defining_Character_Literal => 323, - N_Defining_Identifier => 341, - N_Defining_Operator_Symbol => 359, - N_Expanded_Name => 377, - N_Identifier => 452, - N_Operator_Symbol => 528, - N_Character_Literal => 575, - N_Op_Add => 634, - N_Op_Concat => 634, - N_Op_Expon => 681, - N_Op_Subtract => 705, - N_Op_Divide => 705, - N_Op_Mod => 761, - N_Op_Multiply => 802, - N_Op_Rem => 840, - N_Op_And => 881, - N_Op_Eq => 897, - N_Op_Ge => 897, - N_Op_Gt => 897, - N_Op_Le => 897, - N_Op_Lt => 897, - N_Op_Ne => 897, - N_Op_Or => 897, - N_Op_Xor => 913, - N_Op_Rotate_Left => 929, - N_Op_Rotate_Right => 944, - N_Op_Shift_Left => 959, - N_Op_Shift_Right => 974, - N_Op_Shift_Right_Arithmetic => 989, - N_Op_Abs => 1004, - N_Op_Minus => 1004, - N_Op_Not => 1004, - N_Op_Plus => 1004, - N_Attribute_Reference => 1004, - N_And_Then => 1128, - N_Conditional_Expression => 1136, - N_Explicit_Dereference => 1174, - N_Function_Call => 1181, - N_In => 1302, - N_Indexed_Component => 1302, - N_Integer_Literal => 1321, - N_Not_In => 1357, - N_Null => 1357, - N_Or_Else => 1357, - N_Procedure_Call_Statement => 1365, - N_Qualified_Expression => 1486, - N_Raise_Constraint_Error => 1510, - N_Raise_Program_Error => 1527, - N_Raise_Storage_Error => 1544, - N_Aggregate => 1561, - N_Allocator => 1717, - N_Extension_Aggregate => 1794, - N_Range => 1897, - N_Real_Literal => 1938, - N_Reference => 2008, - N_Selected_Component => 2015, - N_Slice => 2099, - N_String_Literal => 2121, - N_Subprogram_Info => 2147, - N_Type_Conversion => 2158, - N_Unchecked_Expression => 2273, - N_Unchecked_Type_Conversion => 2284, - N_Subtype_Indication => 2339, - N_Component_Declaration => 2379, - N_Entry_Declaration => 2463, - N_Formal_Object_Declaration => 2555, - N_Formal_Type_Declaration => 2640, - N_Full_Type_Declaration => 2741, - N_Incomplete_Type_Declaration => 2829, - N_Loop_Parameter_Specification => 2907, - N_Object_Declaration => 2971, - N_Protected_Type_Declaration => 3218, - N_Private_Extension_Declaration => 3306, - N_Private_Type_Declaration => 3420, - N_Subtype_Declaration => 3546, - N_Function_Specification => 3620, - N_Procedure_Specification => 3712, - N_Entry_Index_Specification => 3791, - N_Freeze_Entity => 3839, - N_Access_Function_Definition => 3907, - N_Access_Procedure_Definition => 3963, - N_Task_Type_Declaration => 4006, - N_Package_Body_Stub => 4109, - N_Protected_Body_Stub => 4161, - N_Subprogram_Body_Stub => 4213, - N_Task_Body_Stub => 4259, - N_Function_Instantiation => 4311, - N_Package_Instantiation => 4397, - N_Procedure_Instantiation => 4483, - N_Package_Body => 4569, - N_Subprogram_Body => 4667, - N_Protected_Body => 4894, - N_Task_Body => 4976, - N_Implicit_Label_Declaration => 5114, - N_Package_Declaration => 5150, - N_Single_Task_Declaration => 5219, - N_Subprogram_Declaration => 5255, - N_Use_Package_Clause => 5315, - N_Generic_Package_Declaration => 5358, - N_Generic_Subprogram_Declaration => 5455, - N_Constrained_Array_Definition => 5528, - N_Unconstrained_Array_Definition => 5592, - N_Exception_Renaming_Declaration => 5641, - N_Object_Renaming_Declaration => 5666, - N_Package_Renaming_Declaration => 5738, - N_Subprogram_Renaming_Declaration => 5774, - N_Generic_Function_Renaming_Declaration => 5824, - N_Generic_Package_Renaming_Declaration => 5860, - N_Generic_Procedure_Renaming_Declaration => 5896, - N_Abort_Statement => 5932, - N_Accept_Statement => 5938, - N_Assignment_Statement => 6033, - N_Asynchronous_Select => 6119, - N_Block_Statement => 6157, - N_Case_Statement => 6322, - N_Code_Statement => 6355, - N_Conditional_Entry_Call => 6366, - N_Delay_Relative_Statement => 6405, - N_Delay_Until_Statement => 6416, - N_Entry_Call_Statement => 6427, - N_Free_Statement => 6474, - N_Goto_Statement => 6516, - N_Loop_Statement => 6536, - N_Null_Statement => 6621, - N_Raise_Statement => 6621, - N_Requeue_Statement => 6626, - N_Return_Statement => 6645, - N_Selective_Accept => 6719, - N_Timed_Entry_Call => 6755, - N_Exit_Statement => 6796, - N_If_Statement => 6811, - N_Accept_Alternative => 6874, - N_Delay_Alternative => 6950, - N_Elsif_Part => 7002, - N_Entry_Body_Formal_Part => 7046, - N_Iteration_Scheme => 7107, - N_Terminate_Alternative => 7164, - N_Abortable_Part => 7203, - N_Abstract_Subprogram_Declaration => 7214, - N_Access_Definition => 7228, - N_Access_To_Object_Definition => 7241, - N_Case_Statement_Alternative => 7289, - N_Compilation_Unit => 7317, - N_Compilation_Unit_Aux => 7456, - N_Component_Association => 7506, - N_Component_List => 7538, - N_Derived_Type_Definition => 7580, - N_Decimal_Fixed_Point_Definition => 7638, - N_Defining_Program_Unit_Name => 7698, - N_Delta_Constraint => 7723, - N_Designator => 7757, - N_Digits_Constraint => 7773, - N_Discriminant_Association => 7808, - N_Discriminant_Specification => 7834, - N_Enumeration_Type_Definition => 7901, - N_Entry_Body => 7920, - N_Entry_Call_Alternative => 8027, - N_Exception_Declaration => 8074, - N_Exception_Handler => 8123, - N_Floating_Point_Definition => 8188, - N_Formal_Decimal_Fixed_Point_Definition => 8231, - N_Formal_Derived_Type_Definition => 8231, - N_Formal_Discrete_Type_Definition => 8277, - N_Formal_Floating_Point_Definition => 8277, - N_Formal_Modular_Type_Definition => 8277, - N_Formal_Ordinary_Fixed_Point_Definition => 8277, - N_Formal_Package_Declaration => 8277, - N_Formal_Private_Type_Definition => 8364, - N_Formal_Signed_Integer_Type_Definition => 8412, - N_Formal_Subprogram_Declaration => 8412, - N_Generic_Association => 8451, - N_Handled_Sequence_Of_Statements => 8499, - N_Index_Or_Discriminant_Constraint => 8591, - N_Itype_Reference => 8603, - N_Label => 8609, - N_Modular_Type_Definition => 8635, - N_Number_Declaration => 8646, - N_Ordinary_Fixed_Point_Definition => 8695, - N_Others_Choice => 8737, - N_Package_Specification => 8772, - N_Parameter_Association => 8881, - N_Parameter_Specification => 8939, - N_Protected_Definition => 9068, - N_Range_Constraint => 9140, - N_Real_Range_Specification => 9157, - N_Record_Definition => 9178, - N_Signed_Integer_Type_Definition => 9264, - N_Single_Protected_Declaration => 9285, - N_Subunit => 9326, - N_Task_Definition => 9362, - N_Triggering_Alternative => 9500, - N_Use_Type_Clause => 9547, - N_Validate_Unchecked_Conversion => 9598, - N_Variant => 9622, - N_Variant_Part => 9701, - N_With_Clause => 9715, - N_With_Type_Clause => 9929, - N_Unused_At_End => 9949); - -end Treeprs; diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index a93dbb47054..a2c15984cf6 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -569,9 +569,14 @@ pragma Preelaborate (Types); No_Unit : constant Unit_Number_Type := -1; -- Special value used to signal no unit - type Source_File_Index is new Nat; + type Source_File_Index is new Int range -1 .. Int'Last; -- Type used to index the source file table (see package Sinput) + Internal_Source_File : constant Source_File_Index := + Source_File_Index'First; + -- Value used to indicate the buffer for the source-code-like strings + -- internally created withing the compiler (see package Sinput) + No_Source_File : constant Source_File_Index := 0; -- Value used to indicate no source file present diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index dad6005376b..c729f483791 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -235,7 +235,7 @@ begin -- Line for -gnatN switch Write_Switch_Char ("N"); - Write_Line ("Full (frontend) inlining of subprograqms"); + Write_Line ("Full (frontend) inlining of subprograms"); -- Line for -gnato switch @@ -277,6 +277,11 @@ begin Write_Switch_Char ("s"); Write_Line ("Syntax check only"); + -- Lines for -gnatS switch + + Write_Switch_Char ("S"); + Write_Line ("Print listing of package Standard"); + -- Lines for -gnatt switch Write_Switch_Char ("t"); diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index c1c5ccf4ce4..423634ea64d 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -144,22 +144,21 @@ struct language_function GTY(()) int unused; }; -static tree merge_sizes PARAMS ((tree, tree, tree, int, int)); -static tree compute_related_constant PARAMS ((tree, tree)); -static tree split_plus PARAMS ((tree, tree *)); -static int value_zerop PARAMS ((tree)); -static tree float_type_for_size PARAMS ((int, enum machine_mode)); -static tree convert_to_fat_pointer PARAMS ((tree, tree)); -static tree convert_to_thin_pointer PARAMS ((tree, tree)); -static tree make_descriptor_field PARAMS ((const char *,tree, tree, - tree)); -static int value_factor_p PARAMS ((tree, int)); -static int potential_alignment_gap PARAMS ((tree, tree, tree)); +static tree merge_sizes (tree, tree, tree, int, int); +static tree compute_related_constant (tree, tree); +static tree split_plus (tree, tree *); +static int value_zerop (tree); +static tree float_type_for_precision (int, enum machine_mode); +static tree convert_to_fat_pointer (tree, tree); +static tree convert_to_thin_pointer (tree, tree); +static tree make_descriptor_field (const char *,tree, tree, tree); +static int value_factor_p (tree, int); +static int potential_alignment_gap (tree, tree, tree); /* Initialize the association of GNAT nodes to GCC trees. */ void -init_gnat_to_gnu () +init_gnat_to_gnu (void) { associate_gnat_to_gnu = (tree *) ggc_alloc_cleared (max_gnat_nodes * sizeof (tree)); @@ -174,10 +173,7 @@ init_gnat_to_gnu () If GNU_DECL is zero, a previous association is to be reset. */ void -save_gnu_tree (gnat_entity, gnu_decl, no_check) - Entity_Id gnat_entity; - tree gnu_decl; - int no_check; +save_gnu_tree (Entity_Id gnat_entity, tree gnu_decl, int no_check) { /* Check that GNAT_ENTITY is not already defined and that it is being set to something which is a decl. Raise gigi 401 if not. Usually, this @@ -199,8 +195,7 @@ save_gnu_tree (gnat_entity, gnu_decl, no_check) be elaborated only once, GNAT_ENTITY is really not an entity. */ tree -get_gnu_tree (gnat_entity) - Entity_Id gnat_entity; +get_gnu_tree (Entity_Id gnat_entity) { if (! associate_gnat_to_gnu[gnat_entity - First_Node_Id]) gigi_abort (402); @@ -211,8 +206,7 @@ get_gnu_tree (gnat_entity) /* Return nonzero if a GCC tree has been associated with GNAT_ENTITY. */ int -present_gnu_tree (gnat_entity) - Entity_Id gnat_entity; +present_gnu_tree (Entity_Id gnat_entity) { return (associate_gnat_to_gnu[gnat_entity - First_Node_Id] != NULL_TREE); } @@ -221,7 +215,7 @@ present_gnu_tree (gnat_entity) /* Return non-zero if we are currently in the global binding level. */ int -global_bindings_p () +global_bindings_p (void) { return (force_global != 0 || current_binding_level == global_binding_level ? -1 : 0); @@ -231,7 +225,7 @@ global_bindings_p () is in reverse order (it has to be so for back-end compatibility). */ tree -getdecls () +getdecls (void) { return current_binding_level->names; } @@ -239,7 +233,7 @@ getdecls () /* Nonzero if the current level needs to have a BLOCK made. */ int -kept_level_p () +kept_level_p (void) { return (current_binding_level->names != 0); } @@ -248,8 +242,7 @@ kept_level_p () specified for back-end compatibility. */ void -pushlevel (ignore) - int ignore ATTRIBUTE_UNUSED; +pushlevel (int ignore ATTRIBUTE_UNUSED) { struct binding_level *newlevel = NULL; @@ -287,10 +280,7 @@ pushlevel (ignore) them into the BLOCK. */ tree -poplevel (keep, reverse, functionbody) - int keep; - int reverse; - int functionbody; +poplevel (int keep, int reverse, int functionbody) { /* Points to a GCC BLOCK tree node. This is the BLOCK node construted for the binding level that we are about to exit and which is returned by this @@ -396,8 +386,7 @@ poplevel (keep, reverse, functionbody) to handle the BLOCK node inside the BIND_EXPR. */ void -insert_block (block) - tree block; +insert_block (tree block) { TREE_USED (block) = 1; current_binding_level->blocks @@ -408,8 +397,7 @@ insert_block (block) (the one we are currently in). */ void -set_block (block) - tree block; +set_block (tree block) { current_binding_level->this_block = block; current_binding_level->names = chainon (current_binding_level->names, @@ -422,8 +410,7 @@ set_block (block) Returns the ..._DECL node. */ tree -pushdecl (decl) - tree decl; +pushdecl (tree decl) { struct binding_level *b; @@ -478,7 +465,7 @@ pushdecl (decl) front end has been run. */ void -gnat_init_decl_processing () +gnat_init_decl_processing (void) { input_line = 0; @@ -516,8 +503,7 @@ gnat_init_decl_processing () in the gcc back-end and initialize the global binding level. */ void -init_gigi_decls (long_long_float_type, exception_type) - tree long_long_float_type, exception_type; +init_gigi_decls (tree long_long_float_type, tree exception_type) { tree endlink, decl; unsigned int i; @@ -689,7 +675,7 @@ init_gigi_decls (long_long_float_type, exception_type) a jmpbuf. */ setjmp_decl = create_subprog_decl - (get_identifier ("setjmp"), NULL_TREE, + (get_identifier ("__builtin_setjmp"), NULL_TREE, build_function_type (integer_type_node, tree_cons (NULL_TREE, jmpbuf_ptr_type, endlink)), NULL_TREE, 0, 1, 1, 0); @@ -708,11 +694,10 @@ init_gigi_decls (long_long_float_type, exception_type) on this type; it will be done later. */ void -finish_record_type (record_type, fieldlist, has_rep, defer_debug) - tree record_type; - tree fieldlist; - int has_rep; - int defer_debug; +finish_record_type (tree record_type, + tree fieldlist, + int has_rep, + int defer_debug) { enum tree_code code = TREE_CODE (record_type); tree ada_size = bitsize_zero_node; @@ -1030,11 +1015,11 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug) We return an expression for the size. */ static tree -merge_sizes (last_size, first_bit, size, special, has_rep) - tree last_size; - tree first_bit, size; - int special; - int has_rep; +merge_sizes (tree last_size, + tree first_bit, + tree size, + int special, + int has_rep) { tree type = TREE_TYPE (last_size); tree new; @@ -1070,8 +1055,7 @@ merge_sizes (last_size, first_bit, size, special, has_rep) related by the addition of a constant. Return that constant if so. */ static tree -compute_related_constant (op0, op1) - tree op0, op1; +compute_related_constant (tree op0, tree op1) { tree op0_var, op1_var; tree op0_con = split_plus (op0, &op0_var); @@ -1092,9 +1076,7 @@ compute_related_constant (op0, op1) bitsizetype. */ static tree -split_plus (in, pvar) - tree in; - tree *pvar; +split_plus (tree in, tree *pvar) { /* Strip NOPS in order to ease the tree traversal and maximize the potential for constant or plus/minus discovery. We need to be careful @@ -1137,12 +1119,12 @@ split_plus (in, pvar) depressed stack pointer. */ tree -create_subprog_type (return_type, param_decl_list, cico_list, - returns_unconstrained, returns_by_ref, returns_with_dsp) - tree return_type; - tree param_decl_list; - tree cico_list; - int returns_unconstrained, returns_by_ref, returns_with_dsp; +create_subprog_type (tree return_type, + tree param_decl_list, + tree cico_list, + int returns_unconstrained, + int returns_by_ref, + int returns_with_dsp) { /* A chain of TREE_LIST nodes whose TREE_VALUEs are the data type nodes of the subprogram formal parameters. This list is generated by traversing the @@ -1186,8 +1168,7 @@ create_subprog_type (return_type, param_decl_list, cico_list, /* Return a copy of TYPE but safe to modify in any way. */ tree -copy_type (type) - tree type; +copy_type (tree type) { tree new = copy_node (type); @@ -1207,9 +1188,7 @@ copy_type (type) TYPE_INDEX_TYPE is INDEX. */ tree -create_index_type (min, max, index) - tree min, max; - tree index; +create_index_type (tree min, tree max, tree index) { /* First build a type for the desired range. */ tree type = build_index_2_type (min, max); @@ -1235,12 +1214,11 @@ create_index_type (min, max, index) information about this type. */ tree -create_type_decl (type_name, type, attr_list, artificial_p, debug_info_p) - tree type_name; - tree type; - struct attrib *attr_list; - int artificial_p; - int debug_info_p; +create_type_decl (tree type_name, + tree type, + struct attrib *attr_list, + int artificial_p, + int debug_info_p) { tree type_decl = build_decl (TYPE_DECL, type_name, type); enum tree_code code = TREE_CODE (type); @@ -1282,17 +1260,15 @@ create_type_decl (type_name, type, attr_list, artificial_p, debug_info_p) it indicates whether to always allocate storage to the variable. */ tree -create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag, - extern_flag, static_flag, attr_list) - tree var_name; - tree asm_name; - tree type; - tree var_init; - int const_flag; - int public_flag; - int extern_flag; - int static_flag; - struct attrib *attr_list; +create_var_decl (tree var_name, + tree asm_name, + tree type, + tree var_init, + int const_flag, + int public_flag, + int extern_flag, + int static_flag, + struct attrib *attr_list) { int init_const = (var_init == 0 @@ -1397,14 +1373,13 @@ create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag, the address of this field for aliasing purposes. */ tree -create_field_decl (field_name, field_type, record_type, packed, size, pos, - addressable) - tree field_name; - tree field_type; - tree record_type; - int packed; - tree size, pos; - int addressable; +create_field_decl (tree field_name, + tree field_type, + tree record_type, + int packed, + tree size, + tree pos, + int addressable) { tree field_decl = build_decl (FIELD_DECL, field_name, field_type); @@ -1515,8 +1490,7 @@ create_field_decl (field_name, field_type, record_type, packed, size, pos, effects, has the value of zero. */ static int -value_zerop (exp) - tree exp; +value_zerop (tree exp) { if (TREE_CODE (exp) == COMPOUND_EXPR) return value_zerop (TREE_OPERAND (exp, 1)); @@ -1530,10 +1504,7 @@ value_zerop (exp) parameter). */ tree -create_param_decl (param_name, param_type, readonly) - tree param_name; - tree param_type; - int readonly; +create_param_decl (tree param_name, tree param_type, int readonly) { tree param_decl = build_decl (PARM_DECL, param_name, param_type); @@ -1570,9 +1541,7 @@ create_param_decl (param_name, param_type, readonly) /* Given a DECL and ATTR_LIST, process the listed attributes. */ void -process_attributes (decl, attr_list) - tree decl; - struct attrib *attr_list; +process_attributes (tree decl, struct attrib *attr_list) { for (; attr_list; attr_list = attr_list->next) switch (attr_list->type) @@ -1613,9 +1582,7 @@ process_attributes (decl, attr_list) /* Add some pending elaborations on the list. */ void -add_pending_elaborations (var_decl, var_init) - tree var_decl; - tree var_init; +add_pending_elaborations (tree var_decl, tree var_init) { if (var_init != 0) Check_Elaboration_Code_Allowed (error_gnat_node); @@ -1627,7 +1594,7 @@ add_pending_elaborations (var_decl, var_init) /* Obtain any pending elaborations and clear the old list. */ tree -get_pending_elaborations () +get_pending_elaborations (void) { /* Each thing added to the list went on the end; we want it on the beginning. */ @@ -1641,9 +1608,7 @@ get_pending_elaborations () of 2. */ static int -value_factor_p (value, factor) - tree value; - int factor; +value_factor_p (tree value, int factor) { if (host_integerp (value, 1)) return tree_low_cst (value, 1) % factor == 0; @@ -1662,10 +1627,7 @@ value_factor_p (value, factor) position of CURR_FIELD. It is ignored if null. */ static int -potential_alignment_gap (prev_field, curr_field, offset) - tree prev_field; - tree curr_field; - tree offset; +potential_alignment_gap (tree prev_field, tree curr_field, tree offset) { /* If this is the first field of the record, there cannot be any gap */ if (!prev_field) @@ -1707,7 +1669,7 @@ potential_alignment_gap (prev_field, curr_field, offset) /* Return nonzero if there are pending elaborations. */ int -pending_elaborations_p () +pending_elaborations_p (void) { return TREE_CHAIN (pending_elaborations) != 0; } @@ -1716,7 +1678,7 @@ pending_elaborations_p () one. */ void -push_pending_elaborations () +push_pending_elaborations (void) { struct e_stack *p = (struct e_stack *) ggc_alloc (sizeof (struct e_stack)); @@ -1729,7 +1691,7 @@ push_pending_elaborations () /* Pop the stack of pending elaborations. */ void -pop_pending_elaborations () +pop_pending_elaborations (void) { struct e_stack *p = elist_stack; @@ -1741,7 +1703,7 @@ pop_pending_elaborations () elaborations after that point. */ tree -get_elaboration_location () +get_elaboration_location (void) { return tree_last (pending_elaborations); } @@ -1750,8 +1712,7 @@ get_elaboration_location () list. */ void -insert_elaboration_list (elab) - tree elab; +insert_elaboration_list (tree elab) { tree next = TREE_CHAIN (elab); @@ -1766,8 +1727,7 @@ insert_elaboration_list (elab) /* Returns a LABEL_DECL node for LABEL_NAME. */ tree -create_label_decl (label_name) - tree label_name; +create_label_decl (tree label_name) { tree label_decl = build_decl (LABEL_DECL, label_name, void_type_node); @@ -1787,16 +1747,14 @@ create_label_decl (label_name) appropriate fields in the FUNCTION_DECL. */ tree -create_subprog_decl (subprog_name, asm_name, subprog_type, param_decl_list, - inline_flag, public_flag, extern_flag, attr_list) - tree subprog_name; - tree asm_name; - tree subprog_type; - tree param_decl_list; - int inline_flag; - int public_flag; - int extern_flag; - struct attrib *attr_list; +create_subprog_decl (tree subprog_name, + tree asm_name, + tree subprog_type, + tree param_decl_list, + int inline_flag, + int public_flag, + int extern_flag, + struct attrib *attr_list) { tree return_type = TREE_TYPE (subprog_type); tree subprog_decl = build_decl (FUNCTION_DECL, subprog_name, subprog_type); @@ -1842,8 +1800,7 @@ static int function_nesting_depth; appearing in the subprogram. */ void -begin_subprog_body (subprog_decl) - tree subprog_decl; +begin_subprog_body (tree subprog_decl) { tree param_decl_list; tree param_decl; @@ -1905,7 +1862,7 @@ begin_subprog_body (subprog_decl) to assembler language output. */ void -end_subprog_body () +end_subprog_body (void) { tree decl; tree cico_list; @@ -1979,13 +1936,12 @@ end_subprog_body () ATTRS is nonzero, use that for the function attribute list. */ tree -builtin_function (name, type, function_code, class, library_name, attrs) - const char *name; - tree type; - int function_code; - enum built_in_class class; - const char *library_name; - tree attrs; +builtin_function (const char *name, + tree type, + int function_code, + enum built_in_class class, + const char *library_name, + tree attrs) { tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); @@ -2007,9 +1963,7 @@ builtin_function (name, type, function_code, class, library_name, attrs) it is a signed type. */ tree -gnat_type_for_size (precision, unsignedp) - unsigned precision; - int unsignedp; +gnat_type_for_size (unsigned precision, int unsignedp) { tree t; char type_name[20]; @@ -2038,9 +1992,7 @@ gnat_type_for_size (precision, unsignedp) /* Likewise for floating-point types. */ static tree -float_type_for_size (precision, mode) - int precision; - enum machine_mode mode; +float_type_for_precision (int precision, enum machine_mode mode) { tree t; char type_name[20]; @@ -2068,12 +2020,10 @@ float_type_for_size (precision, mode) an unsigned type; otherwise a signed type is returned. */ tree -gnat_type_for_mode (mode, unsignedp) - enum machine_mode mode; - int unsignedp; +gnat_type_for_mode (enum machine_mode mode, int unsignedp) { if (GET_MODE_CLASS (mode) == MODE_FLOAT) - return float_type_for_size (GET_MODE_BITSIZE (mode), mode); + return float_type_for_precision (GET_MODE_PRECISION (mode), mode); else return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp); } @@ -2081,8 +2031,7 @@ gnat_type_for_mode (mode, unsignedp) /* Return the unsigned version of a TYPE_NODE, a scalar type. */ tree -gnat_unsigned_type (type_node) - tree type_node; +gnat_unsigned_type (tree type_node) { tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1); @@ -2105,8 +2054,7 @@ gnat_unsigned_type (type_node) /* Return the signed version of a TYPE_NODE, a scalar type. */ tree -gnat_signed_type (type_node) - tree type_node; +gnat_signed_type (tree type_node) { tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 0); @@ -2130,9 +2078,7 @@ gnat_signed_type (type_node) UNSIGNEDP. */ tree -gnat_signed_or_unsigned_type (unsignedp, type) - int unsignedp; - tree type; +gnat_signed_or_unsigned_type (int unsignedp, tree type) { if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp) return type; @@ -2145,9 +2091,7 @@ gnat_signed_or_unsigned_type (unsignedp, type) minimum (if ! MAX_P) possible value of the discriminant. */ tree -max_size (exp, max_p) - tree exp; - int max_p; +max_size (tree exp, int max_p) { enum tree_code code = TREE_CODE (exp); tree type = TREE_TYPE (exp); @@ -2246,10 +2190,7 @@ max_size (exp, max_p) Return a constructor for the template. */ tree -build_template (template_type, array_type, expr) - tree template_type; - tree array_type; - tree expr; +build_template (tree template_type, tree array_type, tree expr) { tree template_elts = NULL_TREE; tree bound_list = NULL_TREE; @@ -2318,10 +2259,7 @@ build_template (template_type, array_type, expr) an object of that type and also for the name. */ tree -build_vms_descriptor (type, mech, gnat_entity) - tree type; - Mechanism_Type mech; - Entity_Id gnat_entity; +build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) { tree record_type = make_node (RECORD_TYPE); tree field_list = 0; @@ -2368,7 +2306,7 @@ build_vms_descriptor (type, mech, gnat_entity) case INTEGER_TYPE: case ENUMERAL_TYPE: if (TYPE_VAX_FLOATING_POINT_P (type)) - switch ((int) TYPE_DIGITS_VALUE (type)) + switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) { case 6: dtype = 10; @@ -2408,7 +2346,7 @@ build_vms_descriptor (type, mech, gnat_entity) case COMPLEX_TYPE: if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE && TYPE_VAX_FLOATING_POINT_P (type)) - switch ((int) TYPE_DIGITS_VALUE (type)) + switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) { case 6: dtype = 12; @@ -2606,11 +2544,8 @@ build_vms_descriptor (type, mech, gnat_entity) /* Utility routine for above code to make a field. */ static tree -make_descriptor_field (name, type, rec_type, initial) - const char *name; - tree type; - tree rec_type; - tree initial; +make_descriptor_field (const char *name, tree type, + tree rec_type, tree initial) { tree field = create_field_decl (get_identifier (name), type, rec_type, 0, 0, 0, 0); @@ -2627,10 +2562,7 @@ make_descriptor_field (name, type, rec_type, initial) as the name of the record. */ tree -build_unc_object_type (template_type, object_type, name) - tree template_type; - tree object_type; - tree name; +build_unc_object_type (tree template_type, tree object_type, tree name) { tree type = make_node (RECORD_TYPE); tree template_field = create_field_decl (get_identifier ("BOUNDS"), @@ -2653,9 +2585,7 @@ build_unc_object_type (template_type, object_type, name) if NEW is an UNCONSTRAINED_ARRAY_TYPE. */ void -update_pointer_to (old_type, new_type) - tree old_type; - tree new_type; +update_pointer_to (tree old_type, tree new_type) { tree ptr = TYPE_POINTER_TO (old_type); tree ref = TYPE_REFERENCE_TO (old_type); @@ -2792,9 +2722,7 @@ update_pointer_to (old_type, new_type) pointer. This involves making or finding a template. */ static tree -convert_to_fat_pointer (type, expr) - tree type; - tree expr; +convert_to_fat_pointer (tree type, tree expr) { tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type)))); tree template, template_addr; @@ -2825,10 +2753,10 @@ convert_to_fat_pointer (type, expr) else expr = build1 (INDIRECT_REF, TREE_TYPE (etype), expr); - template = build_component_ref (expr, NULL_TREE, fields); + template = build_component_ref (expr, NULL_TREE, fields, 0); expr = build_unary_op (ADDR_EXPR, NULL_TREE, build_component_ref (expr, NULL_TREE, - TREE_CHAIN (fields))); + TREE_CHAIN (fields), 0)); } else /* Otherwise, build the constructor for the template. */ @@ -2861,9 +2789,7 @@ convert_to_fat_pointer (type, expr) is not already a fat pointer. */ static tree -convert_to_thin_pointer (type, expr) - tree type; - tree expr; +convert_to_thin_pointer (tree type, tree expr) { if (! TYPE_FAT_POINTER_P (TREE_TYPE (expr))) expr @@ -2872,7 +2798,8 @@ convert_to_thin_pointer (type, expr) /* We get the pointer to the data and use a NOP_EXPR to make it the proper GCC type. */ - expr = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (TREE_TYPE (expr))); + expr + = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (TREE_TYPE (expr)), 0); expr = build1 (NOP_EXPR, type, expr); return expr; @@ -2885,8 +2812,7 @@ convert_to_thin_pointer (type, expr) not permitted by the language being compiled. */ tree -convert (type, expr) - tree type, expr; +convert (tree type, tree expr) { enum tree_code code = TREE_CODE (type); tree etype = TREE_TYPE (expr); @@ -2927,7 +2853,7 @@ convert (type, expr) return TREE_VALUE (CONSTRUCTOR_ELTS (expr)); else return convert (type, build_component_ref (expr, NULL_TREE, - TYPE_FIELDS (etype))); + TYPE_FIELDS (etype), 0)); } else if (code == RECORD_TYPE && TYPE_IS_PADDING_P (type)) { @@ -2977,7 +2903,7 @@ convert (type, expr) if (ecode == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (etype) && code != UNCONSTRAINED_ARRAY_TYPE) return convert (type, build_component_ref (expr, NULL_TREE, - TYPE_FIELDS (etype))); + TYPE_FIELDS (etype), 0)); /* If converting to a type that contains a template, convert to the data type and then build the template. */ @@ -3051,7 +2977,7 @@ convert (type, expr) expr = build_unary_op (INDIRECT_REF, NULL_TREE, build_component_ref (TREE_OPERAND (expr, 0), get_identifier ("P_ARRAY"), - NULL_TREE)); + NULL_TREE, 0)); etype = TREE_TYPE (expr); ecode = TREE_CODE (etype); break; @@ -3146,7 +3072,7 @@ convert (type, expr) array and then convert it. */ else if (TYPE_FAT_POINTER_P (etype)) expr = build_component_ref (expr, get_identifier ("P_ARRAY"), - NULL_TREE); + NULL_TREE, 0); return fold (convert_to_pointer (type, expr)); @@ -3228,9 +3154,7 @@ convert (type, expr) the address is not bit-aligned. */ tree -remove_conversions (exp, true_address) - tree exp; - int true_address; +remove_conversions (tree exp, int true_address) { switch (TREE_CODE (exp)) { @@ -3263,8 +3187,7 @@ remove_conversions (exp, true_address) likewise return an expression pointing to the underlying array. */ tree -maybe_unconstrained_array (exp) - tree exp; +maybe_unconstrained_array (tree exp) { enum tree_code code = TREE_CODE (exp); tree new; @@ -3278,7 +3201,7 @@ maybe_unconstrained_array (exp) = build_unary_op (INDIRECT_REF, NULL_TREE, build_component_ref (TREE_OPERAND (exp, 0), get_identifier ("P_ARRAY"), - NULL_TREE)); + NULL_TREE, 0)); TREE_READONLY (new) = TREE_STATIC (new) = TREE_READONLY (exp); return new; } @@ -3306,12 +3229,13 @@ maybe_unconstrained_array (exp) && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new))) return build_component_ref (new, NULL_TREE, - TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new)))); + TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))), + 0); } else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp))) return build_component_ref (exp, NULL_TREE, - TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (exp)))); + TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))), 0); break; default: @@ -3325,10 +3249,7 @@ maybe_unconstrained_array (exp) If NOTRUNC_P is set, truncation operations should be suppressed. */ tree -unchecked_convert (type, expr, notrunc_p) - tree type; - tree expr; - int notrunc_p; +unchecked_convert (tree type, tree expr, int notrunc_p) { tree etype = TREE_TYPE (expr); @@ -3399,7 +3320,7 @@ unchecked_convert (type, expr, notrunc_p) layout_type (rec_type); expr = unchecked_convert (rec_type, expr, notrunc_p); - expr = build_component_ref (expr, NULL_TREE, field); + expr = build_component_ref (expr, NULL_TREE, field, 0); } /* Similarly for integral input type whose precision is not equal to its diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index c2ffdfbc153..a8f228d6eb0 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -44,13 +44,12 @@ #include "ada-tree.h" #include "gigi.h" -static tree find_common_type PARAMS ((tree, tree)); -static int contains_save_expr_p PARAMS ((tree)); -static tree contains_null_expr PARAMS ((tree)); -static tree compare_arrays PARAMS ((tree, tree, tree)); -static tree nonbinary_modular_operation PARAMS ((enum tree_code, tree, - tree, tree)); -static tree build_simple_component_ref PARAMS ((tree, tree, tree)); +static tree find_common_type (tree, tree); +static int contains_save_expr_p (tree); +static tree contains_null_expr (tree); +static tree compare_arrays (tree, tree, tree); +static tree nonbinary_modular_operation (enum tree_code, tree, tree, tree); +static tree build_simple_component_ref (tree, tree, tree, int); /* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical operation. @@ -68,8 +67,7 @@ static tree build_simple_component_ref PARAMS ((tree, tree, tree)); the only possible operands will be things of Boolean type. */ tree -gnat_truthvalue_conversion (expr) - tree expr; +gnat_truthvalue_conversion (tree expr) { tree type = TREE_TYPE (expr); @@ -106,8 +104,7 @@ gnat_truthvalue_conversion (expr) /* Return the base type of TYPE. */ tree -get_base_type (type) - tree type; +get_base_type (tree type) { if (TREE_CODE (type) == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (type)) @@ -123,8 +120,7 @@ get_base_type (type) /* Likewise, but only return types known to the Ada source. */ tree -get_ada_base_type (type) - tree type; +get_ada_base_type (tree type) { while (TREE_TYPE (type) != 0 && (TREE_CODE (type) == INTEGER_TYPE @@ -140,8 +136,7 @@ get_ada_base_type (type) in bits. If we don't know anything about the alignment, return 0. */ unsigned int -known_alignment (exp) - tree exp; +known_alignment (tree exp) { unsigned int this_alignment; unsigned int lhs, rhs; @@ -158,8 +153,8 @@ known_alignment (exp) We always compute a type_alignment value and return the MAX of it compared with what we get from the expression tree. Just set the type_alignment value to 0 when the type information is to be ignored. */ - type_alignment - = ((POINTER_TYPE_P (TREE_TYPE (exp)) + type_alignment + = ((POINTER_TYPE_P (TREE_TYPE (exp)) && ! TYPE_IS_DUMMY_P (TREE_TYPE (TREE_TYPE (exp)))) ? TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))) : 0); @@ -170,7 +165,7 @@ known_alignment (exp) case NON_LVALUE_EXPR: /* Conversions between pointers and integers don't change the alignment of the underlying object. */ - this_alignment = known_alignment (TREE_OPERAND (exp, 0)); + this_alignment = known_alignment (TREE_OPERAND (exp, 0)); break; case PLUS_EXPR: @@ -221,8 +216,7 @@ known_alignment (exp) Otherwise return zero. */ static tree -find_common_type (t1, t2) - tree t1, t2; +find_common_type (tree t1, tree t2) { /* If either type is non-BLKmode, use it. Note that we know that we will not have any alignment problems since if we did the non-BLKmode @@ -251,8 +245,7 @@ find_common_type (t1, t2) of some very general solution. */ static int -contains_save_expr_p (exp) - tree exp; +contains_save_expr_p (tree exp) { switch (TREE_CODE (exp)) { @@ -283,8 +276,7 @@ contains_save_expr_p (exp) that are known to raise Constraint_Error. */ static tree -contains_null_expr (exp) - tree exp; +contains_null_expr (tree exp) { tree tem; @@ -339,9 +331,7 @@ contains_null_expr (exp) length tests in as efficient a manner as possible. */ static tree -compare_arrays (result_type, a1, a2) - tree a1, a2; - tree result_type; +compare_arrays (tree result_type, tree a1, tree a2) { tree t1 = TREE_TYPE (a1); tree t2 = TREE_TYPE (a2); @@ -367,7 +357,7 @@ compare_arrays (result_type, a1, a2) tree comparison, this_a1_is_null, this_a2_is_null; /* If the length of the first array is a constant, swap our operands - unless the length of the second array is the constant zero. + unless the length of the second array is the constant zero. Note that we have set the `length' values to the length - 1. */ if (TREE_CODE (length1) == INTEGER_CST && ! integer_zerop (fold (build (PLUS_EXPR, bt, length2, @@ -416,7 +406,7 @@ compare_arrays (result_type, a1, a2) nbt = get_base_type (TREE_TYPE (ub1)); comparison - = build_binary_op (EQ_EXPR, result_type, + = build_binary_op (EQ_EXPR, result_type, build_binary_op (MINUS_EXPR, nbt, ub1, lb1), build_binary_op (MINUS_EXPR, nbt, ub2, lb2)); @@ -501,10 +491,10 @@ compare_arrays (result_type, a1, a2) modulus. */ static tree -nonbinary_modular_operation (op_code, type, lhs, rhs) - enum tree_code op_code; - tree type; - tree lhs, rhs; +nonbinary_modular_operation (enum tree_code op_code, + tree type, + tree lhs, + tree rhs) { tree modulus = TYPE_MODULUS (type); unsigned int needed_precision = tree_floor_log2 (modulus) + 1; @@ -601,11 +591,10 @@ nonbinary_modular_operation (op_code, type, lhs, rhs) have to do here is validate the work done by SEM and handle subtypes. */ tree -build_binary_op (op_code, result_type, left_operand, right_operand) - enum tree_code op_code; - tree result_type; - tree left_operand; - tree right_operand; +build_binary_op (enum tree_code op_code, + tree result_type, + tree left_operand, + tree right_operand) { tree left_type = TREE_TYPE (left_operand); tree right_type = TREE_TYPE (right_operand); @@ -948,14 +937,15 @@ build_binary_op (op_code, result_type, left_operand, right_operand) gigi_abort (505); } - /* If we are comparing a fat pointer against zero, we need to + /* If we are comparing a fat pointer against zero, we need to just compare the data pointer. */ else if (TYPE_FAT_POINTER_P (left_base_type) && TREE_CODE (right_operand) == CONSTRUCTOR && integer_zerop (TREE_VALUE (CONSTRUCTOR_ELTS (right_operand)))) { right_operand = build_component_ref (left_operand, NULL_TREE, - TYPE_FIELDS (left_base_type)); + TYPE_FIELDS (left_base_type), + 0); left_operand = convert (TREE_TYPE (right_operand), integer_zero_node); } @@ -1093,10 +1083,7 @@ build_binary_op (op_code, result_type, left_operand, right_operand) /* Similar, but for unary operations. */ tree -build_unary_op (op_code, result_type, operand) - enum tree_code op_code; - tree result_type; - tree operand; +build_unary_op (enum tree_code op_code, tree result_type, tree operand) { tree type = TREE_TYPE (operand); tree base_type = get_base_type (type); @@ -1414,11 +1401,10 @@ build_unary_op (op_code, result_type, operand) /* Similar, but for COND_EXPR. */ tree -build_cond_expr (result_type, condition_operand, true_operand, false_operand) - tree result_type; - tree condition_operand; - tree true_operand; - tree false_operand; +build_cond_expr (tree result_type, + tree condition_operand, + tree true_operand, + tree false_operand) { tree result; int addr_p = 0; @@ -1469,9 +1455,7 @@ build_cond_expr (result_type, condition_operand, true_operand, false_operand) the CALL_EXPR. */ tree -build_call_1_expr (fundecl, arg) - tree fundecl; - tree arg; +build_call_1_expr (tree fundecl, tree arg) { tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)), build_unary_op (ADDR_EXPR, NULL_TREE, fundecl), @@ -1487,9 +1471,7 @@ build_call_1_expr (fundecl, arg) the CALL_EXPR. */ tree -build_call_2_expr (fundecl, arg1, arg2) - tree fundecl; - tree arg1, arg2; +build_call_2_expr (tree fundecl, tree arg1, tree arg2) { tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)), build_unary_op (ADDR_EXPR, NULL_TREE, fundecl), @@ -1506,8 +1488,7 @@ build_call_2_expr (fundecl, arg1, arg2) /* Likewise to call FUNDECL with no arguments. */ tree -build_call_0_expr (fundecl) - tree fundecl; +build_call_0_expr (tree fundecl) { tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)), build_unary_op (ADDR_EXPR, NULL_TREE, fundecl), @@ -1522,8 +1503,7 @@ build_call_0_expr (fundecl) name, if requested. MSG says which exception function to call. */ tree -build_call_raise (msg) - int msg; +build_call_raise (int msg) { tree fndecl = gnat_raise_decls[msg]; const char *str = discard_file_names ? "" : ref_filename; @@ -1544,9 +1524,7 @@ build_call_raise (msg) /* Return a CONSTRUCTOR of TYPE whose list is LIST. */ tree -gnat_build_constructor (type, list) - tree type; - tree list; +gnat_build_constructor (tree type, tree list) { tree elmt; int allconstant = (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST); @@ -1609,16 +1587,16 @@ gnat_build_constructor (type, list) /* Return a COMPONENT_REF to access a field that is given by COMPONENT, an IDENTIFIER_NODE giving the name of the field, or FIELD, a FIELD_DECL, - for the field. + for the field. Don't fold the result if NO_FOLD_P is nonzero. We also handle the fact that we might have been passed a pointer to the actual record and know how to look for fields in variant parts. */ static tree -build_simple_component_ref (record_variable, component, field) - tree record_variable; - tree component; - tree field; +build_simple_component_ref (tree record_variable, + tree component, + tree field, + int no_fold_p) { tree record_type = TYPE_MAIN_VARIANT (TREE_TYPE (record_variable)); tree ref; @@ -1673,9 +1651,10 @@ build_simple_component_ref (record_variable, component, field) if (DECL_INTERNAL_P (new_field)) { tree field_ref - = build_simple_component_ref (record_variable, - NULL_TREE, new_field); - ref = build_simple_component_ref (field_ref, NULL_TREE, field); + = build_simple_component_ref (record_variable, + NULL_TREE, new_field, no_fold_p); + ref = build_simple_component_ref (field_ref, NULL_TREE, field, + no_fold_p); if (ref != 0) return ref; @@ -1697,19 +1676,20 @@ build_simple_component_ref (record_variable, component, field) || TYPE_VOLATILE (record_type)) TREE_THIS_VOLATILE (ref) = 1; - return fold (ref); + return no_fold_p ? ref : fold (ref); } /* Like build_simple_component_ref, except that we give an error if the reference could not be found. */ tree -build_component_ref (record_variable, component, field) - tree record_variable; - tree component; - tree field; +build_component_ref (tree record_variable, + tree component, + tree field, + int no_fold_p) { - tree ref = build_simple_component_ref (record_variable, component, field); + tree ref = build_simple_component_ref (record_variable, component, field, + no_fold_p); if (ref != 0) return ref; @@ -1736,14 +1716,12 @@ build_component_ref (record_variable, component, field) object dynamically on the stack frame. */ tree -build_call_alloc_dealloc - (gnu_obj, gnu_size, align, gnat_proc, gnat_pool, gnat_node) - tree gnu_obj; - tree gnu_size; - int align; - Entity_Id gnat_proc; - Entity_Id gnat_pool; - Node_Id gnat_node; +build_call_alloc_dealloc (tree gnu_obj, + tree gnu_size, + int align, + Entity_Id gnat_proc, + Entity_Id gnat_pool, + Node_Id gnat_node) { tree gnu_align = size_int (align / BITS_PER_UNIT); @@ -1753,7 +1731,7 @@ build_call_alloc_dealloc if (Present (gnat_proc)) { - /* The storage pools are obviously always tagged types, but the + /* The storage pools are obviously always tagged types, but the secondary stack uses the same mechanism and is not tagged */ if (Is_Tagged_Type (Etype (gnat_pool))) { @@ -1785,7 +1763,7 @@ build_call_alloc_dealloc convert (gnu_size_type, gnu_size))); gnu_args = chainon (gnu_args, - build_tree_list (NULL_TREE, + build_tree_list (NULL_TREE, convert (gnu_size_type, gnu_align))); gnu_call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (gnu_proc)), @@ -1798,7 +1776,7 @@ build_call_alloc_dealloc else { /* The size is the second parameter */ - Entity_Id gnat_size_type + Entity_Id gnat_size_type = Etype (Next_Formal (First_Formal (gnat_proc))); tree gnu_size_type = gnat_to_gnu_type (gnat_size_type); tree gnu_proc = gnat_to_gnu (gnat_proc); @@ -1860,13 +1838,12 @@ build_call_alloc_dealloc the storage pool to use. */ tree -build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node) - tree type; - tree init; - tree result_type; - Entity_Id gnat_proc; - Entity_Id gnat_pool; - Node_Id gnat_node; +build_allocator (tree type, + tree init, + tree result_type, + Entity_Id gnat_proc, + Entity_Id gnat_pool, + Node_Id gnat_node) { tree size = TYPE_SIZE_UNIT (type); tree result; @@ -1945,7 +1922,7 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node) build_component_ref (build_unary_op (INDIRECT_REF, NULL_TREE, convert (storage_ptr_type, storage)), - NULL_TREE, TYPE_FIELDS (storage_type)), + NULL_TREE, TYPE_FIELDS (storage_type), 0), build_template (template_type, type, NULL_TREE)), convert (result_type, convert (storage_ptr_type, storage))); } @@ -1990,7 +1967,7 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node) result = convert (build_pointer_type (new_type), result); result = build_unary_op (INDIRECT_REF, NULL_TREE, result); result = build_component_ref (result, NULL_TREE, - TYPE_FIELDS (new_type)); + TYPE_FIELDS (new_type), 0); result = convert (result_type, build_unary_op (ADDR_EXPR, NULL_TREE, result)); } @@ -2021,13 +1998,11 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node) return convert (result_type, result); } -/* Fill in a VMS descriptor for EXPR and return a constructor for it. +/* Fill in a VMS descriptor for EXPR and return a constructor for it. GNAT_FORMAL is how we find the descriptor record. */ tree -fill_vms_descriptor (expr, gnat_formal) - tree expr; - Entity_Id gnat_formal; +fill_vms_descriptor (tree expr, Entity_Id gnat_formal) { tree record_type = TREE_TYPE (TREE_TYPE (get_gnu_tree (gnat_formal))); tree field; @@ -2054,8 +2029,7 @@ fill_vms_descriptor (expr, gnat_formal) should not be allocated in a register. Returns true if successful. */ bool -gnat_mark_addressable (expr_node) - tree expr_node; +gnat_mark_addressable (tree expr_node) { while (1) switch (TREE_CODE (expr_node)) diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb index f028b3084a9..479ecde92ee 100644 --- a/gcc/ada/vms_conv.adb +++ b/gcc/ada/vms_conv.adb @@ -25,8 +25,7 @@ ------------------------------------------------------------------------------ with Hostparm; -with Osint; use Osint; -with Sdefault; use Sdefault; +with Osint; use Osint; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Command_Line; use Ada.Command_Line; @@ -141,7 +140,7 @@ package body VMS_Conv is begin Object_Dirs := 0; - Object_Dir_Name := String_Access (Object_Dir_Default_Name); + Object_Dir_Name := new String'(Object_Dir_Default_Prefix); Get_Next_Dir_In_Path_Init (Object_Dir_Name); loop @@ -287,13 +286,13 @@ package body VMS_Conv is Make => (Cname => new S'("MAKE"), - Usage => new S'("GNAT MAKE file /qualifiers (includes " + Usage => new S'("GNAT MAKE file(s) /qualifiers (includes " & "COMPILE /qualifiers)"), VMS_Only => False, Unixcmd => new S'("gnatmake"), Unixsws => null, Switches => Make_Switches'Access, - Params => new Parameter_Array'(1 => File), + Params => new Parameter_Array'(1 => Unlimited_Files), Defext => " "), Name => @@ -340,16 +339,6 @@ package body VMS_Conv is Params => new Parameter_Array'(1 => Unlimited_Files), Defext => " "), - Standard => - (Cname => new S'("STANDARD"), - Usage => new S'("GNAT STANDARD"), - VMS_Only => False, - Unixcmd => new S'("gnatpsta"), - Unixsws => null, - Switches => Standard_Switches'Access, - Params => new Parameter_Array'(1 .. 0 => File), - Defext => " "), - Stub => (Cname => new S'("STUB"), Usage => new S'("GNAT STUB file [directory]/qualifiers"), @@ -1092,231 +1081,270 @@ package body VMS_Conv is Arg_Idx := Argv'First; <> - loop - declare - Next_Arg_Idx : Integer; - Arg : String_Access; - - begin - Next_Arg_Idx := Get_Arg_End (Argv.all, Arg_Idx); - Arg := new String'(Argv (Arg_Idx .. Next_Arg_Idx)); + loop + declare + Next_Arg_Idx : Integer; + Arg : String_Access; - -- The first one must be a command name + begin + Next_Arg_Idx := Get_Arg_End (Argv.all, Arg_Idx); + Arg := new String'(Argv (Arg_Idx .. Next_Arg_Idx)); - if Arg_Num = 1 and then Arg_Idx = Argv'First then + -- The first one must be a command name - Command := Matching_Name (Arg.all, Commands); + if Arg_Num = 1 and then Arg_Idx = Argv'First then - if Command = null then - raise Error_Exit; - end if; + Command := Matching_Name (Arg.all, Commands); - The_Command := Command.Command; + if Command = null then + raise Error_Exit; + end if; - -- Give usage information if only command given + The_Command := Command.Command; - if Argument_Count = 1 and then Next_Arg_Idx = Argv'Last - and then Command.Command /= VMS_Conv.Standard - then - Output_Version; - New_Line; - Put_Line - ("List of available qualifiers and options"); - New_Line; + -- Give usage information if only command given - Put (Command.Usage.all); - Set_Col (53); - Put_Line (Command.Unix_String.all); + if Argument_Count = 1 + and then Next_Arg_Idx = Argv'Last + then + Output_Version; + New_Line; + Put_Line + ("List of available qualifiers and options"); + New_Line; - declare - Sw : Item_Ptr := Command.Switches; + Put (Command.Usage.all); + Set_Col (53); + Put_Line (Command.Unix_String.all); - begin - while Sw /= null loop - Put (" "); - Put (Sw.Name.all); + declare + Sw : Item_Ptr := Command.Switches; - case Sw.Translation is + begin + while Sw /= null loop + Put (" "); + Put (Sw.Name.all); - when T_Other => - Set_Col (53); - Put_Line (Sw.Unix_String.all & - "/"); + case Sw.Translation is - when T_Direct => - Set_Col (53); - Put_Line (Sw.Unix_String.all); + when T_Other => + Set_Col (53); + Put_Line (Sw.Unix_String.all & + "/"); - when T_Directories => - Put ("=(direc,direc,..direc)"); - Set_Col (53); - Put (Sw.Unix_String.all); - Put (" direc "); - Put (Sw.Unix_String.all); - Put_Line (" direc ..."); + when T_Direct => + Set_Col (53); + Put_Line (Sw.Unix_String.all); - when T_Directory => - Put ("=directory"); - Set_Col (53); - Put (Sw.Unix_String.all); + when T_Directories => + Put ("=(direc,direc,..direc)"); + Set_Col (53); + Put (Sw.Unix_String.all); + Put (" direc "); + Put (Sw.Unix_String.all); + Put_Line (" direc ..."); - if Sw.Unix_String (Sw.Unix_String'Last) - /= '=' - then - Put (' '); - end if; + when T_Directory => + Put ("=directory"); + Set_Col (53); + Put (Sw.Unix_String.all); - Put_Line ("directory "); + if Sw.Unix_String (Sw.Unix_String'Last) + /= '=' + then + Put (' '); + end if; - when T_File | T_No_Space_File => - Put ("=file"); - Set_Col (53); - Put (Sw.Unix_String.all); + Put_Line ("directory "); - if Sw.Translation = T_File - and then Sw.Unix_String - (Sw.Unix_String'Last) - /= '=' - then - Put (' '); - end if; + when T_File | T_No_Space_File => + Put ("=file"); + Set_Col (53); + Put (Sw.Unix_String.all); + + if Sw.Translation = T_File + and then Sw.Unix_String + (Sw.Unix_String'Last) + /= '=' + then + Put (' '); + end if; - Put_Line ("file "); + Put_Line ("file "); - when T_Numeric => - Put ("=nnn"); - Set_Col (53); + when T_Numeric => + Put ("=nnn"); + Set_Col (53); - if Sw.Unix_String (Sw.Unix_String'First) - = '`' - then - Put (Sw.Unix_String - (Sw.Unix_String'First + 1 - .. Sw.Unix_String'Last)); - else - Put (Sw.Unix_String.all); - end if; + if Sw.Unix_String (Sw.Unix_String'First) + = '`' + then + Put (Sw.Unix_String + (Sw.Unix_String'First + 1 + .. Sw.Unix_String'Last)); + else + Put (Sw.Unix_String.all); + end if; - Put_Line ("nnn"); + Put_Line ("nnn"); - when T_Alphanumplus => - Put ("=xyz"); - Set_Col (53); + when T_Alphanumplus => + Put ("=xyz"); + Set_Col (53); - if Sw.Unix_String (Sw.Unix_String'First) - = '`' - then - Put (Sw.Unix_String - (Sw.Unix_String'First + 1 - .. Sw.Unix_String'Last)); - else - Put (Sw.Unix_String.all); - end if; + if Sw.Unix_String (Sw.Unix_String'First) + = '`' + then + Put (Sw.Unix_String + (Sw.Unix_String'First + 1 + .. Sw.Unix_String'Last)); + else + Put (Sw.Unix_String.all); + end if; - Put_Line ("xyz"); + Put_Line ("xyz"); - when T_String => - Put ("="); - Put ('"'); - Put (""); - Put ('"'); - Set_Col (53); + when T_String => + Put ("="); + Put ('"'); + Put (""); + Put ('"'); + Set_Col (53); - Put (Sw.Unix_String.all); + Put (Sw.Unix_String.all); - if Sw.Unix_String (Sw.Unix_String'Last) - /= '=' - then - Put (' '); - end if; + if Sw.Unix_String (Sw.Unix_String'Last) + /= '=' + then + Put (' '); + end if; - Put (""); - New_Line; + Put (""); + New_Line; - when T_Commands => - Put (" (switches for "); - Put (Sw.Unix_String - (Sw.Unix_String'First + 7 - .. Sw.Unix_String'Last)); - Put (')'); - Set_Col (53); - Put (Sw.Unix_String - (Sw.Unix_String'First - .. Sw.Unix_String'First + 5)); - Put_Line (" switches"); + when T_Commands => + Put (" (switches for "); + Put (Sw.Unix_String + (Sw.Unix_String'First + 7 + .. Sw.Unix_String'Last)); + Put (')'); + Set_Col (53); + Put (Sw.Unix_String + (Sw.Unix_String'First + .. Sw.Unix_String'First + 5)); + Put_Line (" switches"); - when T_Options => - declare - Opt : Item_Ptr := Sw.Options; + when T_Options => + declare + Opt : Item_Ptr := Sw.Options; - begin - Put_Line ("=(option,option..)"); + begin + Put_Line ("=(option,option..)"); - while Opt /= null loop - Put (" "); - Put (Opt.Name.all); + while Opt /= null loop + Put (" "); + Put (Opt.Name.all); - if Opt = Sw.Options then - Put (" (D)"); - end if; + if Opt = Sw.Options then + Put (" (D)"); + end if; - Set_Col (53); - Put_Line (Opt.Unix_String.all); - Opt := Opt.Next; - end loop; - end; + Set_Col (53); + Put_Line (Opt.Unix_String.all); + Opt := Opt.Next; + end loop; + end; - end case; + end case; - Sw := Sw.Next; - end loop; - end; + Sw := Sw.Next; + end loop; + end; - raise Normal_Exit; - end if; + raise Normal_Exit; + end if; -- Special handling for internal debugging switch /? - elsif Arg.all = "/?" then - Display_Command := True; + elsif Arg.all = "/?" then + Display_Command := True; -- Copy -switch unchanged - elsif Arg (Arg'First) = '-' then - Place (' '); - Place (Arg.all); + elsif Arg (Arg'First) = '-' then + Place (' '); + Place (Arg.all); -- Copy quoted switch with quotes stripped - elsif Arg (Arg'First) = '"' then - if Arg (Arg'Last) /= '"' then - Put (Standard_Error, "misquoted argument: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; + elsif Arg (Arg'First) = '"' then + if Arg (Arg'Last) /= '"' then + Put (Standard_Error, "misquoted argument: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; - else - Place (' '); - Place (Arg (Arg'First + 1 .. Arg'Last - 1)); - end if; + else + Place (' '); + Place (Arg (Arg'First + 1 .. Arg'Last - 1)); + end if; -- Parameter Argument - elsif Arg (Arg'First) /= '/' - and then Make_Commands_Active = null - then - Param_Count := Param_Count + 1; + elsif Arg (Arg'First) /= '/' + and then Make_Commands_Active = null + then + Param_Count := Param_Count + 1; - if Param_Count <= Command.Params'Length then + if Param_Count <= Command.Params'Length then - case Command.Params (Param_Count) is + case Command.Params (Param_Count) is - when File | Optional_File => - declare - Normal_File : constant String_Access := - To_Canonical_File_Spec - (Arg.all); + when File | Optional_File => + declare + Normal_File : constant String_Access := + To_Canonical_File_Spec + (Arg.all); - begin + begin + Place (' '); + Place_Lower (Normal_File.all); + + if Is_Extensionless (Normal_File.all) + and then Command.Defext /= " " + then + Place ('.'); + Place (Command.Defext); + end if; + end; + + when Unlimited_Files => + declare + Normal_File : + constant String_Access := + To_Canonical_File_Spec (Arg.all); + + File_Is_Wild : Boolean := False; + File_List : String_Access_List_Access; + + begin + for J in Arg'Range loop + if Arg (J) = '*' + or else Arg (J) = '%' + then + File_Is_Wild := True; + end if; + end loop; + + if File_Is_Wild then + File_List := To_Canonical_File_List + (Arg.all, False); + + for J in File_List.all'Range loop + Place (' '); + Place_Lower (File_List.all (J).all); + end loop; + + else Place (' '); Place_Lower (Normal_File.all); @@ -1326,36 +1354,92 @@ package body VMS_Conv is Place ('.'); Place (Command.Defext); end if; - end; + end if; - when Unlimited_Files => - declare - Normal_File : - constant String_Access := - To_Canonical_File_Spec (Arg.all); + Param_Count := Param_Count - 1; + end; + + when Other_As_Is => + Place (' '); + Place (Arg.all); + + when Unlimited_As_Is => + Place (' '); + Place (Arg.all); + Param_Count := Param_Count - 1; + + when Files_Or_Wildcard => + + -- Remove spaces from a comma separated list + -- of file names and adjust control variables + -- accordingly. + + while Arg_Num < Argument_Count and then + (Argv (Argv'Last) = ',' xor + Argument (Arg_Num + 1) + (Argument (Arg_Num + 1)'First) = ',') + loop + Argv := new String' + (Argv.all & Argument (Arg_Num + 1)); + Arg_Num := Arg_Num + 1; + Arg_Idx := Argv'First; + Next_Arg_Idx := + Get_Arg_End (Argv.all, Arg_Idx); + Arg := new String' + (Argv (Arg_Idx .. Next_Arg_Idx)); + end loop; + + -- Parse the comma separated list of VMS + -- filenames and place them on the command + -- line as space separated Unix style + -- filenames. Lower case and add default + -- extension as appropriate. - File_Is_Wild : Boolean := False; - File_List : String_Access_List_Access; + declare + Arg1_Idx : Integer := Arg'First; + + function Get_Arg1_End + (Arg : String; Arg_Idx : Integer) + return Integer; + -- Begins looking at Arg_Idx + 1 and + -- returns the index of the last character + -- before a comma or else the index of the + -- last character in the string Arg. + ------------------ + -- Get_Arg1_End -- + ------------------ + + function Get_Arg1_End + (Arg : String; Arg_Idx : Integer) + return Integer + is begin - for J in Arg'Range loop - if Arg (J) = '*' - or else Arg (J) = '%' - then - File_Is_Wild := True; + for J in Arg_Idx + 1 .. Arg'Last loop + if Arg (J) = ',' then + return J - 1; end if; end loop; - if File_Is_Wild then - File_List := To_Canonical_File_List - (Arg.all, False); + return Arg'Last; + end Get_Arg1_End; - for J in File_List.all'Range loop - Place (' '); - Place_Lower (File_List.all (J).all); - end loop; + begin + loop + declare + Next_Arg1_Idx : + constant Integer := + Get_Arg1_End (Arg.all, Arg1_Idx); - else + Arg1 : + constant String := + Arg (Arg1_Idx .. Next_Arg1_Idx); + + Normal_File : + constant String_Access := + To_Canonical_File_Spec (Arg1); + + begin Place (' '); Place_Lower (Normal_File.all); @@ -1365,542 +1449,447 @@ package body VMS_Conv is Place ('.'); Place (Command.Defext); end if; - end if; - - Param_Count := Param_Count - 1; - end; - - when Other_As_Is => - Place (' '); - Place (Arg.all); - - when Unlimited_As_Is => - Place (' '); - Place (Arg.all); - Param_Count := Param_Count - 1; - - when Files_Or_Wildcard => - - -- Remove spaces from a comma separated list - -- of file names and adjust control variables - -- accordingly. - - while Arg_Num < Argument_Count and then - (Argv (Argv'Last) = ',' xor - Argument (Arg_Num + 1) - (Argument (Arg_Num + 1)'First) = ',') - loop - Argv := new String' - (Argv.all & Argument (Arg_Num + 1)); - Arg_Num := Arg_Num + 1; - Arg_Idx := Argv'First; - Next_Arg_Idx := - Get_Arg_End (Argv.all, Arg_Idx); - Arg := new String' - (Argv (Arg_Idx .. Next_Arg_Idx)); - end loop; - - -- Parse the comma separated list of VMS - -- filenames and place them on the command - -- line as space separated Unix style - -- filenames. Lower case and add default - -- extension as appropriate. - - declare - Arg1_Idx : Integer := Arg'First; - - function Get_Arg1_End - (Arg : String; Arg_Idx : Integer) - return Integer; - -- Begins looking at Arg_Idx + 1 and - -- returns the index of the last character - -- before a comma or else the index of the - -- last character in the string Arg. - ------------------ - -- Get_Arg1_End -- - ------------------ + Arg1_Idx := Next_Arg1_Idx + 1; + end; - function Get_Arg1_End - (Arg : String; Arg_Idx : Integer) - return Integer - is - begin - for J in Arg_Idx + 1 .. Arg'Last loop - if Arg (J) = ',' then - return J - 1; - end if; - end loop; + exit when Arg1_Idx > Arg'Last; - return Arg'Last; - end Get_Arg1_End; + -- Don't allow two or more commas in + -- a row - begin - loop - declare - Next_Arg1_Idx : - constant Integer := - Get_Arg1_End (Arg.all, Arg1_Idx); - - Arg1 : - constant String := - Arg (Arg1_Idx .. Next_Arg1_Idx); - - Normal_File : - constant String_Access := - To_Canonical_File_Spec (Arg1); - - begin - Place (' '); - Place_Lower (Normal_File.all); - - if Is_Extensionless (Normal_File.all) - and then Command.Defext /= " " - then - Place ('.'); - Place (Command.Defext); - end if; - - Arg1_Idx := Next_Arg1_Idx + 1; - end; - - exit when Arg1_Idx > Arg'Last; - - -- Don't allow two or more commas in - -- a row - - if Arg (Arg1_Idx) = ',' then - Arg1_Idx := Arg1_Idx + 1; - if Arg1_Idx > Arg'Last or else - Arg (Arg1_Idx) = ',' - then - Put_Line - (Standard_Error, - "Malformed Parameter: " & - Arg.all); - Put (Standard_Error, "usage: "); - Put_Line (Standard_Error, - Command.Usage.all); - raise Error_Exit; - end if; + if Arg (Arg1_Idx) = ',' then + Arg1_Idx := Arg1_Idx + 1; + if Arg1_Idx > Arg'Last or else + Arg (Arg1_Idx) = ',' + then + Put_Line + (Standard_Error, + "Malformed Parameter: " & + Arg.all); + Put (Standard_Error, "usage: "); + Put_Line (Standard_Error, + Command.Usage.all); + raise Error_Exit; end if; + end if; - end loop; - end; - end case; - end if; - - -- Qualifier argument - - else - -- This code is too heavily nested, should be - -- separated out as separate subprogram ??? - - declare - Sw : Item_Ptr; - SwP : Natural; - P2 : Natural; - Endp : Natural := 0; -- avoid warning! - Opt : Item_Ptr; - - begin - SwP := Arg'First; - while SwP < Arg'Last - and then Arg (SwP + 1) /= '=' - loop - SwP := SwP + 1; - end loop; + end loop; + end; + end case; + end if; - -- At this point, the switch name is in - -- Arg (Arg'First..SwP) and if that is not the - -- whole switch, then there is an equal sign at - -- Arg (SwP + 1) and the rest of Arg is what comes - -- after the equal sign. + -- Qualifier argument - -- If make commands are active, see if we have - -- another COMMANDS_TRANSLATION switch belonging - -- to gnatmake. + else + -- This code is too heavily nested, should be + -- separated out as separate subprogram ??? + + declare + Sw : Item_Ptr; + SwP : Natural; + P2 : Natural; + Endp : Natural := 0; -- avoid warning! + Opt : Item_Ptr; + + begin + SwP := Arg'First; + while SwP < Arg'Last + and then Arg (SwP + 1) /= '=' + loop + SwP := SwP + 1; + end loop; + + -- At this point, the switch name is in + -- Arg (Arg'First..SwP) and if that is not the + -- whole switch, then there is an equal sign at + -- Arg (SwP + 1) and the rest of Arg is what comes + -- after the equal sign. + + -- If make commands are active, see if we have + -- another COMMANDS_TRANSLATION switch belonging + -- to gnatmake. + + if Make_Commands_Active /= null then + Sw := + Matching_Name + (Arg (Arg'First .. SwP), + Command.Switches, + Quiet => True); + + if Sw /= null + and then Sw.Translation = T_Commands + then + null; - if Make_Commands_Active /= null then + else Sw := Matching_Name - (Arg (Arg'First .. SwP), - Command.Switches, - Quiet => True); - - if Sw /= null - and then Sw.Translation = T_Commands - then - null; - - else - Sw := - Matching_Name - (Arg (Arg'First .. SwP), - Make_Commands_Active.Switches, - Quiet => False); - end if; + (Arg (Arg'First .. SwP), + Make_Commands_Active.Switches, + Quiet => False); + end if; -- For case of GNAT MAKE or CHOP, if we cannot -- find the switch, then see if it is a -- recognized compiler switch instead, and if -- so process the compiler switch. - elsif Command.Name.all = "MAKE" - or else Command.Name.all = "CHOP" then + elsif Command.Name.all = "MAKE" + or else Command.Name.all = "CHOP" then + Sw := + Matching_Name + (Arg (Arg'First .. SwP), + Command.Switches, + Quiet => True); + + if Sw = null then Sw := Matching_Name - (Arg (Arg'First .. SwP), - Command.Switches, - Quiet => True); - - if Sw = null then - Sw := + (Arg (Arg'First .. SwP), Matching_Name - (Arg (Arg'First .. SwP), - Matching_Name - ("COMPILE", Commands).Switches, - Quiet => False); - end if; + ("COMPILE", Commands).Switches, + Quiet => False); + end if; -- For all other cases, just search the relevant -- command. - else - Sw := - Matching_Name - (Arg (Arg'First .. SwP), - Command.Switches, - Quiet => False); - end if; - - if Sw /= null then - case Sw.Translation is + else + Sw := + Matching_Name + (Arg (Arg'First .. SwP), + Command.Switches, + Quiet => False); + end if; - when T_Direct => - Place_Unix_Switches (Sw.Unix_String); - if SwP < Arg'Last - and then Arg (SwP + 1) = '=' + if Sw /= null then + case Sw.Translation is + + when T_Direct => + Place_Unix_Switches (Sw.Unix_String); + if SwP < Arg'Last + and then Arg (SwP + 1) = '=' + then + Put (Standard_Error, + "qualifier options ignored: "); + Put_Line (Standard_Error, Arg.all); + end if; + + when T_Directories => + if SwP + 1 > Arg'Last then + Put (Standard_Error, + "missing directories for: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; + + elsif Arg (SwP + 2) /= '(' then + SwP := SwP + 2; + Endp := Arg'Last; + + elsif Arg (Arg'Last) /= ')' then + + -- Remove spaces from a comma separated + -- list of file names and adjust + -- control variables accordingly. + + if Arg_Num < Argument_Count and then + (Argv (Argv'Last) = ',' xor + Argument (Arg_Num + 1) + (Argument (Arg_Num + 1)'First) = ',') then - Put (Standard_Error, - "qualifier options ignored: "); - Put_Line (Standard_Error, Arg.all); - end if; - - when T_Directories => - if SwP + 1 > Arg'Last then - Put (Standard_Error, - "missing directories for: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; - - elsif Arg (SwP + 2) /= '(' then - SwP := SwP + 2; - Endp := Arg'Last; - - elsif Arg (Arg'Last) /= ')' then - - -- Remove spaces from a comma separated - -- list of file names and adjust - -- control variables accordingly. - - if Arg_Num < Argument_Count and then - (Argv (Argv'Last) = ',' xor - Argument (Arg_Num + 1) - (Argument (Arg_Num + 1)'First) = ',') - then - Argv := - new String'(Argv.all - & Argument - (Arg_Num + 1)); - Arg_Num := Arg_Num + 1; - Arg_Idx := Argv'First; - Next_Arg_Idx - := Get_Arg_End (Argv.all, Arg_Idx); - Arg := new String' - (Argv (Arg_Idx .. Next_Arg_Idx)); - goto Tryagain_After_Coalesce; - end if; - - Put (Standard_Error, - "incorrectly parenthesized " & - "or malformed argument: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; - - else - SwP := SwP + 3; - Endp := Arg'Last - 1; + Argv := + new String'(Argv.all + & Argument + (Arg_Num + 1)); + Arg_Num := Arg_Num + 1; + Arg_Idx := Argv'First; + Next_Arg_Idx + := Get_Arg_End (Argv.all, Arg_Idx); + Arg := new String' + (Argv (Arg_Idx .. Next_Arg_Idx)); + goto Tryagain_After_Coalesce; end if; - while SwP <= Endp loop - declare - Dir_Is_Wild : Boolean := False; - Dir_Maybe_Is_Wild : Boolean := False; - Dir_List : String_Access_List_Access; - begin - P2 := SwP; - - while P2 < Endp - and then Arg (P2 + 1) /= ',' - loop + Put (Standard_Error, + "incorrectly parenthesized " & + "or malformed argument: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; + + else + SwP := SwP + 3; + Endp := Arg'Last - 1; + end if; + + while SwP <= Endp loop + declare + Dir_Is_Wild : Boolean := False; + Dir_Maybe_Is_Wild : Boolean := False; + Dir_List : String_Access_List_Access; + begin + P2 := SwP; - -- A wildcard directory spec on - -- VMS will contain either * or - -- % or ... + while P2 < Endp + and then Arg (P2 + 1) /= ',' + loop - if Arg (P2) = '*' then - Dir_Is_Wild := True; + -- A wildcard directory spec on + -- VMS will contain either * or + -- % or ... - elsif Arg (P2) = '%' then - Dir_Is_Wild := True; + if Arg (P2) = '*' then + Dir_Is_Wild := True; - elsif Dir_Maybe_Is_Wild - and then Arg (P2) = '.' - and then Arg (P2 + 1) = '.' - then - Dir_Is_Wild := True; - Dir_Maybe_Is_Wild := False; + elsif Arg (P2) = '%' then + Dir_Is_Wild := True; - elsif Dir_Maybe_Is_Wild then - Dir_Maybe_Is_Wild := False; + elsif Dir_Maybe_Is_Wild + and then Arg (P2) = '.' + and then Arg (P2 + 1) = '.' + then + Dir_Is_Wild := True; + Dir_Maybe_Is_Wild := False; - elsif Arg (P2) = '.' - and then Arg (P2 + 1) = '.' - then - Dir_Maybe_Is_Wild := True; + elsif Dir_Maybe_Is_Wild then + Dir_Maybe_Is_Wild := False; - end if; + elsif Arg (P2) = '.' + and then Arg (P2 + 1) = '.' + then + Dir_Maybe_Is_Wild := True; - P2 := P2 + 1; - end loop; + end if; - if Dir_Is_Wild then - Dir_List := To_Canonical_File_List - (Arg (SwP .. P2), True); + P2 := P2 + 1; + end loop; - for J in Dir_List.all'Range loop - Place_Unix_Switches - (Sw.Unix_String); - Place_Lower - (Dir_List.all (J).all); - end loop; + if Dir_Is_Wild then + Dir_List := To_Canonical_File_List + (Arg (SwP .. P2), True); - else + for J in Dir_List.all'Range loop Place_Unix_Switches (Sw.Unix_String); Place_Lower - (To_Canonical_Dir_Spec - (Arg (SwP .. P2), False).all); - end if; + (Dir_List.all (J).all); + end loop; - SwP := P2 + 2; - end; - end loop; + else + Place_Unix_Switches + (Sw.Unix_String); + Place_Lower + (To_Canonical_Dir_Spec + (Arg (SwP .. P2), False).all); + end if; - when T_Directory => - if SwP + 1 > Arg'Last then - Put (Standard_Error, - "missing directory for: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; + SwP := P2 + 2; + end; + end loop; - else - Place_Unix_Switches (Sw.Unix_String); + when T_Directory => + if SwP + 1 > Arg'Last then + Put (Standard_Error, + "missing directory for: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; - -- Some switches end in "=". No space - -- here + else + Place_Unix_Switches (Sw.Unix_String); - if Sw.Unix_String - (Sw.Unix_String'Last) /= '=' - then - Place (' '); - end if; + -- Some switches end in "=". No space + -- here - Place_Lower - (To_Canonical_Dir_Spec - (Arg (SwP + 2 .. Arg'Last), - False).all); + if Sw.Unix_String + (Sw.Unix_String'Last) /= '=' + then + Place (' '); end if; - when T_File | T_No_Space_File => - if SwP + 1 > Arg'Last then - Put (Standard_Error, - "missing file for: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; + Place_Lower + (To_Canonical_Dir_Spec + (Arg (SwP + 2 .. Arg'Last), + False).all); + end if; - else - Place_Unix_Switches (Sw.Unix_String); - - -- Some switches end in "=". No space - -- here. - - if Sw.Translation = T_File - and then Sw.Unix_String - (Sw.Unix_String'Last) /= '=' - then - Place (' '); - end if; + when T_File | T_No_Space_File => + if SwP + 1 > Arg'Last then + Put (Standard_Error, + "missing file for: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; - Place_Lower - (To_Canonical_File_Spec - (Arg (SwP + 2 .. Arg'Last)).all); - end if; - - when T_Numeric => - if - OK_Integer (Arg (SwP + 2 .. Arg'Last)) - then - Place_Unix_Switches (Sw.Unix_String); - Place (Arg (SwP + 2 .. Arg'Last)); + else + Place_Unix_Switches (Sw.Unix_String); - else - Put (Standard_Error, "argument for "); - Put (Standard_Error, Sw.Name.all); - Put_Line - (Standard_Error, " must be numeric"); - Errors := Errors + 1; - end if; + -- Some switches end in "=". No space + -- here. - when T_Alphanumplus => - if - OK_Alphanumerplus - (Arg (SwP + 2 .. Arg'Last)) + if Sw.Translation = T_File + and then Sw.Unix_String + (Sw.Unix_String'Last) /= '=' then - Place_Unix_Switches (Sw.Unix_String); - Place (Arg (SwP + 2 .. Arg'Last)); - - else - Put (Standard_Error, "argument for "); - Put (Standard_Error, Sw.Name.all); - Put_Line (Standard_Error, - " must be alphanumeric"); - Errors := Errors + 1; + Place (' '); end if; - when T_String => - - -- A String value must be extended to the - -- end of the Argv, otherwise strings like - -- "foo/bar" get split at the slash. - -- - -- The begining and ending of the string - -- are flagged with embedded nulls which - -- are removed when building the Spawn - -- call. Nulls are use because they won't - -- show up in a /? output. Quotes aren't - -- used because that would make it - -- difficult to embed them. + Place_Lower + (To_Canonical_File_Spec + (Arg (SwP + 2 .. Arg'Last)).all); + end if; + when T_Numeric => + if + OK_Integer (Arg (SwP + 2 .. Arg'Last)) + then Place_Unix_Switches (Sw.Unix_String); - if Next_Arg_Idx /= Argv'Last then - Next_Arg_Idx := Argv'Last; - Arg := new String' - (Argv (Arg_Idx .. Next_Arg_Idx)); - - SwP := Arg'First; - while SwP < Arg'Last and then - Arg (SwP + 1) /= '=' loop - SwP := SwP + 1; - end loop; - end if; - Place (ASCII.NUL); Place (Arg (SwP + 2 .. Arg'Last)); - Place (ASCII.NUL); - when T_Commands => - - -- Output -largs/-bargs/-cargs - - Place (' '); - Place (Sw.Unix_String - (Sw.Unix_String'First .. - Sw.Unix_String'First + 5)); - - if Sw.Unix_String - (Sw.Unix_String'First + 7 .. - Sw.Unix_String'Last) = - "MAKE" - then - Make_Commands_Active := null; + else + Put (Standard_Error, "argument for "); + Put (Standard_Error, Sw.Name.all); + Put_Line + (Standard_Error, " must be numeric"); + Errors := Errors + 1; + end if; + + when T_Alphanumplus => + if + OK_Alphanumerplus + (Arg (SwP + 2 .. Arg'Last)) + then + Place_Unix_Switches (Sw.Unix_String); + Place (Arg (SwP + 2 .. Arg'Last)); - else - -- Set source of new commands, also - -- setting this non-null indicates that - -- we are in the special commands mode - -- for processing the -xargs case. - - Make_Commands_Active := - Matching_Name - (Sw.Unix_String - (Sw.Unix_String'First + 7 .. - Sw.Unix_String'Last), - Commands); - end if; + else + Put (Standard_Error, "argument for "); + Put (Standard_Error, Sw.Name.all); + Put_Line (Standard_Error, + " must be alphanumeric"); + Errors := Errors + 1; + end if; + + when T_String => + + -- A String value must be extended to the + -- end of the Argv, otherwise strings like + -- "foo/bar" get split at the slash. + -- + -- The begining and ending of the string + -- are flagged with embedded nulls which + -- are removed when building the Spawn + -- call. Nulls are use because they won't + -- show up in a /? output. Quotes aren't + -- used because that would make it + -- difficult to embed them. + + Place_Unix_Switches (Sw.Unix_String); + if Next_Arg_Idx /= Argv'Last then + Next_Arg_Idx := Argv'Last; + Arg := new String' + (Argv (Arg_Idx .. Next_Arg_Idx)); - when T_Options => - if SwP + 1 > Arg'Last then - Place_Unix_Switches - (Sw.Options.Unix_String); - SwP := Endp + 1; - - elsif Arg (SwP + 2) /= '(' then - SwP := SwP + 2; - Endp := Arg'Last; - - elsif Arg (Arg'Last) /= ')' then - Put - (Standard_Error, - "incorrectly parenthesized " & - "argument: "); - Put_Line (Standard_Error, Arg.all); - Errors := Errors + 1; - SwP := Endp + 1; + SwP := Arg'First; + while SwP < Arg'Last and then + Arg (SwP + 1) /= '=' loop + SwP := SwP + 1; + end loop; + end if; + Place (ASCII.NUL); + Place (Arg (SwP + 2 .. Arg'Last)); + Place (ASCII.NUL); - else - SwP := SwP + 3; - Endp := Arg'Last - 1; - end if; + when T_Commands => - while SwP <= Endp loop - P2 := SwP; + -- Output -largs/-bargs/-cargs - while P2 < Endp - and then Arg (P2 + 1) /= ',' - loop - P2 := P2 + 1; - end loop; + Place (' '); + Place (Sw.Unix_String + (Sw.Unix_String'First .. + Sw.Unix_String'First + 5)); + + if Sw.Unix_String + (Sw.Unix_String'First + 7 .. + Sw.Unix_String'Last) = + "MAKE" + then + Make_Commands_Active := null; + + else + -- Set source of new commands, also + -- setting this non-null indicates that + -- we are in the special commands mode + -- for processing the -xargs case. + + Make_Commands_Active := + Matching_Name + (Sw.Unix_String + (Sw.Unix_String'First + 7 .. + Sw.Unix_String'Last), + Commands); + end if; + + when T_Options => + if SwP + 1 > Arg'Last then + Place_Unix_Switches + (Sw.Options.Unix_String); + SwP := Endp + 1; + + elsif Arg (SwP + 2) /= '(' then + SwP := SwP + 2; + Endp := Arg'Last; + + elsif Arg (Arg'Last) /= ')' then + Put + (Standard_Error, + "incorrectly parenthesized " & + "argument: "); + Put_Line (Standard_Error, Arg.all); + Errors := Errors + 1; + SwP := Endp + 1; + + else + SwP := SwP + 3; + Endp := Arg'Last - 1; + end if; + + while SwP <= Endp loop + P2 := SwP; + + while P2 < Endp + and then Arg (P2 + 1) /= ',' + loop + P2 := P2 + 1; + end loop; - -- Option name is in Arg (SwP .. P2) + -- Option name is in Arg (SwP .. P2) - Opt := Matching_Name (Arg (SwP .. P2), - Sw.Options); + Opt := Matching_Name (Arg (SwP .. P2), + Sw.Options); - if Opt /= null then - Place_Unix_Switches - (Opt.Unix_String); - end if; + if Opt /= null then + Place_Unix_Switches + (Opt.Unix_String); + end if; - SwP := P2 + 2; - end loop; + SwP := P2 + 2; + end loop; - when T_Other => - Place_Unix_Switches - (new String'(Sw.Unix_String.all & - Arg.all)); + when T_Other => + Place_Unix_Switches + (new String'(Sw.Unix_String.all & + Arg.all)); - end case; - end if; - end; - end if; + end case; + end if; + end; + end if; - Arg_Idx := Next_Arg_Idx + 1; - end; + Arg_Idx := Next_Arg_Idx + 1; + end; - exit when Arg_Idx > Argv'Last; + exit when Arg_Idx > Argv'Last; - end loop; + end loop; end Process_Argument; Arg_Num := Arg_Num + 1; diff --git a/gcc/ada/vms_conv.ads b/gcc/ada/vms_conv.ads index 3e3216608b4..e945f7fbf98 100644 --- a/gcc/ada/vms_conv.ads +++ b/gcc/ada/vms_conv.ads @@ -25,7 +25,7 @@ ------------------------------------------------------------------------------ -- This package is part of the GNAT driver. It contains a procedure --- VMS_Conversion to convert the command line in VMS form to the wquivalent +-- VMS_Conversion to convert the command line in VMS form to the equivalent -- command line with switches for the GNAT tools that the GNAT driver will -- invoke. -- @@ -97,9 +97,9 @@ package VMS_Conv is type Command_Type is (Bind, Chop, Clean, Compile, Elim, Find, Krunch, Library, Link, List, - Make, Name, Preprocess, Pretty, Shared, Standard, Stub, Xref, Undefined); + Make, Name, Preprocess, Pretty, Shared, Stub, Xref, Undefined); - type Alternate_Command is (Comp, Ls, Kr, Pp, Prep, Psta); + type Alternate_Command is (Comp, Ls, Kr, Pp, Prep); -- Alternate command libel for non VMS system Corresponding_To : constant array (Alternate_Command) of Command_Type := @@ -107,8 +107,7 @@ package VMS_Conv is Ls => List, Kr => Krunch, Prep => Preprocess, - Pp => Pretty, - Psta => Standard); + Pp => Pretty); -- Mapping of alternate commands to commands subtype Real_Command_Type is Command_Type range Bind .. Xref; diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index 72f5942cfae..74da7099f54 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -1526,6 +1526,12 @@ package VMS_Data is -- -- Do not look in the default directory for source files of the runtime. + S_GCC_Nostlib : aliased constant S := "/NOSTD_LIBRARIES " & + "-nostdlib"; + -- /NOSTD_LIBRARIES + -- + -- Do not look for library files in the system default directory. + S_GCC_Opt : aliased constant S := "/OPTIMIZE=" & "ALL " & "-O2,!-O0,!-O1,!-O3 " & @@ -1585,6 +1591,17 @@ package VMS_Data is -- communicated to the compiler through logical names -- ADA_PRJ_INCLUDE_FILE and ADA_PRJ_OBJECTS_FILE. + S_GCC_Psta : aliased constant S := "/PRINT_STANDARD " & + "-gnatS"; + -- /PRINT_STANDARD + -- + -- cause the compiler to output a representation of package Standard + -- in a form very close to standard Ada. It is not quite possible to + -- do this and remain entirely Standard (since new numeric base types + -- cannot be created in standard Ada), but the output is easily + -- readable to any Ada programmer, and is useful to determine the + -- characteristics of target dependent types in package Standard. + S_GCC_Report : aliased constant S := "/REPORT_ERRORS=" & "VERBOSE " & "-gnatv " & @@ -2272,10 +2289,6 @@ package VMS_Data is "-gnatwA " & "ALL_GCC " & "-Wall " & - "BIASED_ROUNDING " & - "-gnatwb " & - "NOBIASED_ROUNDING " & - "-gnatwB " & "CONDITIONALS " & "-gnatwc " & "NOCONDITIONALS " & @@ -2393,30 +2406,6 @@ package VMS_Data is -- backend. Most of these are not relevant -- to Ada. -- - -- BIASED_ROUNDING Activate warnings on biased rounding. - -- If a static floating-point expression has - -- a value that is exactly half way between - -- two adjacent machine numbers, then the - -- rules of Ada (Ada Reference Manual, - -- para 4.9(38)) require that this rounding - -- be done away from zero, even if the normal - -- unbiased rounding rules at run time would - -- require rounding towards zero. - -- - -- This warning message alerts you to such - -- instances where compile-time rounding and - -- run-time rounding are not equivalent. - -- If it is important to get proper run-time - -- rounding, then you can force this by - -- making one of the operands into a - -- variable. The default is that such - -- warnings are not generated. Note that - -- /WARNINGS=ALL does not affect the setting - -- of this warning option. - -- - -- NOBIASED_ROUNDING Suppress warnings on biased rounding. - -- Disable warnings on biased rounding. - -- -- CONDITIONALS Activate warnings for conditional -- Expressions used in tests that are known -- to be True or False at compile time. The @@ -2809,10 +2798,12 @@ package VMS_Data is S_GCC_Noadc 'Access, S_GCC_Noload 'Access, S_GCC_Nostinc 'Access, + S_GCC_Nostlib 'Access, S_GCC_Opt 'Access, S_GCC_OptX 'Access, S_GCC_Polling 'Access, S_GCC_Project 'Access, + S_GCC_Psta 'Access, S_GCC_Report 'Access, S_GCC_ReportX 'Access, S_GCC_Repinfo 'Access, @@ -4636,12 +4627,6 @@ package VMS_Data is S_Shared_Verb 'Access, S_Shared_ZZZZZ 'Access); - -------------------------------- - -- Switches for GNAT STANDARD -- - -------------------------------- - - Standard_Switches : aliased constant Switches := (1 .. 0 => null); - ---------------------------- -- Switches for GNAT STUB -- ---------------------------- diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb index 713a91baf83..cca42856270 100644 --- a/gcc/ada/xref_lib.adb +++ b/gcc/ada/xref_lib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2003 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -359,10 +359,7 @@ package body Xref_Lib is -- Default_Project_File -- -------------------------- - function Default_Project_File - (Dir_Name : String) - return String - is + function Default_Project_File (Dir_Name : String) return String is My_Dir : Dir_Type; Dir_Ent : File_Name_String; Last : Natural; @@ -396,8 +393,7 @@ package body Xref_Lib is function File_Name (File : ALI_File; - Num : Positive) - return File_Reference + Num : Positive) return File_Reference is begin return File.Dep.Table (Num); @@ -876,6 +872,9 @@ package body Xref_Lib is -- unit number is optional. It is specified only if the parent type -- is not defined in the current unit. + -- We also have the format for generic instantiations, as in + -- 7a5*Uid(3|5I8[4|2]) 2|4r74 + -- We could also have something like -- 16I9*I -- that indicates that I derives from the predefined type integer. @@ -918,6 +917,25 @@ package body Xref_Lib is Ptr := Ptr + 1; Parse_Number (Ali, Ptr, P_Column); + -- Skip the information for generics instantiations + + if Ali (Ptr) = '[' then + declare + Num_Brackets : Natural := 1; + begin + while Num_Brackets /= 0 loop + Ptr := Ptr + 1; + if Ali (Ptr) = '[' then + Num_Brackets := Num_Brackets + 1; + elsif Ali (Ptr) = ']' then + Num_Brackets := Num_Brackets - 1; + end if; + end loop; + + Ptr := Ptr + 1; + end; + end if; + -- Skip '>', or ')' or '>' Ptr := Ptr + 1; @@ -928,8 +946,7 @@ package body Xref_Lib is if Der_Info or else Type_Tree then declare Symbol : constant String := - Get_Symbol_Name (P_Eun, P_Line, P_Column); - + Get_Symbol_Name (P_Eun, P_Line, P_Column); begin if Symbol /= "???" then Add_Parent diff --git a/gcc/alias.c b/gcc/alias.c index 797c3f5cd97..e4485375975 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -692,7 +692,7 @@ record_component_aliases (tree type) case RECORD_TYPE: case UNION_TYPE: case QUAL_UNION_TYPE: - /* Recursively record aliases for the base classes, if there are any */ + /* Recursively record aliases for the base classes, if there are any. */ if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL) { int i; diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c index d275cd86cff..c21cfe4c707 100644 --- a/gcc/alloc-pool.c +++ b/gcc/alloc-pool.c @@ -112,7 +112,7 @@ create_alloc_pool (const char *name, size_t size, size_t num) pool->elt_size = size; pool->elts_per_block = num; - /* List header size should be a multiple of 8 */ + /* List header size should be a multiple of 8. */ header_size = align_eight (sizeof (struct alloc_pool_list_def)); pool->block_size = (size * num) + header_size; diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 221b2466985..2e8f5786348 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -193,7 +193,7 @@ struct loops; /* Basic block information indexed by block number. */ typedef struct basic_block_def { /* The first and last insns of the block. */ - rtx head, end; + rtx head_, end_; /* The first and last trees of the block. */ tree head_tree; @@ -234,6 +234,9 @@ typedef struct basic_block_def { /* Outermost loop containing the block. */ struct loop *loop_father; + /* The dominance and postdominance information node. */ + struct et_node *dom[2]; + /* Expected number of executions: calculated in profile.c. */ gcov_type count; @@ -316,11 +319,8 @@ extern struct obstack flow_obstack; /* Stuff for recording basic block info. */ -#define BLOCK_HEAD(B) (BASIC_BLOCK (B)->head) -#define BLOCK_END(B) (BASIC_BLOCK (B)->end) - -#define BLOCK_HEAD_TREE(B) (BASIC_BLOCK (B)->head_tree) -#define BLOCK_END_TREE(B) (BASIC_BLOCK (B)->end_tree) +#define BB_HEAD(B) (B)->head_ +#define BB_END(B) (B)->end_ /* Special block numbers [markers] for entry and exit. */ #define ENTRY_BLOCK (-1) @@ -376,10 +376,6 @@ extern void clear_edges (void); extern void mark_critical_edges (void); extern rtx first_insn_after_basic_block_note (basic_block); -/* Dominator information for basic blocks. */ - -typedef struct dominance_info *dominance_info; - /* Structure to group all of the information to process IF-THEN and IF-THEN-ELSE blocks for the conditional execution support. This needs to be in a public file in case the IFCVT macros call @@ -477,6 +473,8 @@ enum update_life_extent #define PROP_AUTOINC 64 /* Create autoinc mem references. */ #define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */ #define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */ +#define PROP_ASM_SCAN 512 /* Internal flag used within flow.c + to flag analysis of asms. */ #define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \ | PROP_REG_INFO | PROP_KILL_DEAD_CODE \ | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \ @@ -613,22 +611,35 @@ enum cdi_direction CDI_POST_DOMINATORS }; -extern dominance_info calculate_dominance_info (enum cdi_direction); -extern void free_dominance_info (dominance_info); -extern basic_block nearest_common_dominator (dominance_info, +enum dom_state +{ + DOM_NONE, /* Not computed at all. */ + DOM_CONS_OK, /* The data is conservatively OK, i.e. if it says you that A dominates B, + it indeed does. */ + DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */ + DOM_OK /* Everything is ok. */ +}; + +extern enum dom_state dom_computed[2]; + +extern void calculate_dominance_info (enum cdi_direction); +extern void free_dominance_info (enum cdi_direction); +extern basic_block nearest_common_dominator (enum cdi_direction, basic_block, basic_block); -extern void set_immediate_dominator (dominance_info, basic_block, +extern void set_immediate_dominator (enum cdi_direction, basic_block, basic_block); -extern basic_block get_immediate_dominator (dominance_info, basic_block); -extern bool dominated_by_p (dominance_info, basic_block, basic_block); -extern int get_dominated_by (dominance_info, basic_block, basic_block **); -extern void add_to_dominance_info (dominance_info, basic_block); -extern void delete_from_dominance_info (dominance_info, basic_block); -basic_block recount_dominator (dominance_info, basic_block); -extern void redirect_immediate_dominators (dominance_info, basic_block, +extern basic_block get_immediate_dominator (enum cdi_direction, basic_block); +extern bool dominated_by_p (enum cdi_direction, basic_block, basic_block); +extern int get_dominated_by (enum cdi_direction, basic_block, basic_block **); +extern void add_to_dominance_info (enum cdi_direction, basic_block); +extern void delete_from_dominance_info (enum cdi_direction, basic_block); +basic_block recount_dominator (enum cdi_direction, basic_block); +extern void redirect_immediate_dominators (enum cdi_direction, basic_block, basic_block); -void iterate_fix_dominators (dominance_info, basic_block *, int); -extern void verify_dominators (dominance_info); +extern void iterate_fix_dominators (enum cdi_direction, basic_block *, int); +extern void verify_dominators (enum cdi_direction); +extern basic_block first_dom_son (enum cdi_direction, basic_block); +extern basic_block next_dom_son (enum cdi_direction, basic_block); #include "cfghooks.h" diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index e75958e8b74..fc50b6494d3 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -72,6 +72,7 @@ #include "rtl.h" #include "basic-block.h" #include "flags.h" +#include "timevar.h" #include "output.h" #include "cfglayout.h" #include "fibheap.h" @@ -312,7 +313,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) /* Duplicate HEADER if it is a small block containing cond jump in the end. */ - if (any_condjump_p (header->end) && copy_bb_p (header, 0)) + if (any_condjump_p (BB_END (header)) && copy_bb_p (header, 0)) { copy_bb (header, prev_bb->succ, prev_bb, trace_n); } @@ -414,8 +415,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, /* Select the successor that will be placed after BB. */ for (e = bb->succ; e; e = e->succ_next) { +#ifdef ENABLE_CHECKING if (e->flags & EDGE_FAKE) abort (); +#endif if (e->dest == EXIT_BLOCK_PTR) continue; @@ -1000,6 +1003,8 @@ copy_bb_p (basic_block bb, int code_may_grow) int size = 0; int max_size = uncond_jump_length; rtx insn; + int n_succ; + edge e; if (!bb->frequency) return false; @@ -1008,10 +1013,19 @@ copy_bb_p (basic_block bb, int code_may_grow) if (!cfg_layout_can_duplicate_bb_p (bb)) return false; + /* Avoid duplicating blocks which have many successors (PR/13430). */ + n_succ = 0; + for (e = bb->succ; e; e = e->succ_next) + { + n_succ++; + if (n_succ > 8) + return false; + } + if (code_may_grow && maybe_hot_bb_p (bb)) max_size *= 8; - for (insn = bb->head; insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { if (INSN_P (insn)) @@ -1064,6 +1078,8 @@ reorder_basic_blocks (void) if ((* targetm.cannot_modify_jumps_p) ()) return; + timevar_push (TV_REORDER_BLOCKS); + cfg_layout_initialize (); set_edge_can_fallthru_flag (); @@ -1096,4 +1112,6 @@ reorder_basic_blocks (void) dump_flow_info (rtl_dump_file); cfg_layout_finalize (); + + timevar_pop (TV_REORDER_BLOCKS); } diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 84d4be2ec38..bffd9154aee 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -348,7 +348,7 @@ bitmap_clear_bit (bitmap head, int bit) unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; ptr->bits[word_num] &= ~ (((BITMAP_WORD) 1) << bit_num); - /* If we cleared the entire word, free up the element */ + /* If we cleared the entire word, free up the element. */ if (bitmap_element_zerop (ptr)) bitmap_element_free (head, ptr); } diff --git a/gcc/bitmap.h b/gcc/bitmap.h index d7220034880..4191542d3ac 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -305,7 +305,7 @@ do { \ \ for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \ { \ - /* Advance BITMAP2 to the equivalent link */ \ + /* Advance BITMAP2 to the equivalent link. */ \ while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \ ptr2_ = ptr2_->next; \ \ diff --git a/gcc/bt-load.c b/gcc/bt-load.c index b3ba22b83ee..2a68cd76bdb 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -155,9 +155,6 @@ static void note_btr_set (rtx, rtx, void *); migrating branch target load instructions. */ static struct obstack migrate_btrl_obstack; -/* Basic block dominator information used when migrating PT instructions */ -static dominance_info dom; - /* Array indexed by basic block number, giving the set of registers live in that block. */ static HARD_REG_SET *btrs_live; @@ -477,7 +474,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, && REGNO_REG_SET_P (bb->global_live_at_start, reg)) SET_HARD_REG_BIT (info.btrs_live_in_block, reg); - for (insn = bb->head, last = NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last; insn = NEXT_INSN (insn), insn_luid++) { @@ -629,7 +626,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, rtx last; sbitmap_union_of_preds (reaching_defs, bb_out, i); - for (insn = bb->head, last = NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last; insn = NEXT_INSN (insn)) { @@ -840,9 +837,9 @@ augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range, tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1)); - if (dominated_by_p (dom, new_bb, head_bb)) + if (dominated_by_p (CDI_DOMINATORS, new_bb, head_bb)) *tos++ = new_bb; - else if (dominated_by_p (dom, head_bb, new_bb)) + else if (dominated_by_p (CDI_DOMINATORS, head_bb, new_bb)) { edge e; int new_block = new_bb->index; @@ -974,7 +971,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) if (other_def != def && other_def->uses != NULL && ! other_def->has_ambiguous_use - && dominated_by_p (dom, other_def->bb, def->bb)) + && dominated_by_p (CDI_DOMINATORS, other_def->bb, def->bb)) { /* def->bb dominates the other def, so def and other_def could be combined. */ @@ -1058,7 +1055,7 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, Replace all uses of the old target register definition by uses of the new definition. Delete the old definition. */ basic_block b = new_def_bb; - rtx insp = b->head; + rtx insp = BB_HEAD (b); rtx old_insn = def->insn; rtx src; rtx btr_rtx; @@ -1131,7 +1128,7 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, static int can_move_up (basic_block bb, rtx insn, int n_insns) { - while (insn != bb->head && n_insns > 0) + while (insn != BB_HEAD (bb) && n_insns > 0) { insn = PREV_INSN (insn); /* ??? What if we have an anti-dependency that actually prevents the @@ -1226,9 +1223,9 @@ migrate_btr_def (btr_def def, int min_cost) def_basic_block_freq = basic_block_freq (def->bb); - for (try = get_immediate_dominator (dom, def->bb); + for (try = get_immediate_dominator (CDI_DOMINATORS, def->bb); !give_up && try && try != ENTRY_BLOCK_PTR && def->cost >= min_cost; - try = get_immediate_dominator (dom, try)) + try = get_immediate_dominator (CDI_DOMINATORS, try)) { /* Try to move the instruction that sets the target register into basic block TRY. */ @@ -1299,7 +1296,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save) "Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC " loop-depth = %d idom = %d\n", i, (HOST_WIDEST_INT) bb->count, bb->loop_depth, - get_immediate_dominator (dom, bb)->index); + get_immediate_dominator (CDI_DOMINATORS, bb)->index); } } @@ -1367,12 +1364,12 @@ branch_target_load_optimize (rtx insns, bool after_prologue_epilogue_gen) life_analysis (insns, NULL, 0); /* Dominator info is also needed for migrate_btr_def. */ - dom = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); migrate_btr_defs (class, ((*targetm.branch_target_register_callee_saved) (after_prologue_epilogue_gen))); - free_dominance_info (dom); + free_dominance_info (CDI_DOMINATORS); update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES | PROP_REG_INFO); diff --git a/gcc/builtins.c b/gcc/builtins.c index 39156ebb62e..c5af18d7182 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -710,6 +710,13 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) { lab = copy_to_reg (lab); + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + gen_rtx_SCRATCH (VOIDmode)))); + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + hard_frame_pointer_rtx))); + emit_move_insn (hard_frame_pointer_rtx, fp); emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); @@ -1089,7 +1096,7 @@ result_vector (int savep, rtx result) static rtx expand_builtin_apply_args_1 (void) { - rtx registers; + rtx registers, tem; int size, align, regno; enum machine_mode mode; rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1); @@ -1107,8 +1114,6 @@ expand_builtin_apply_args_1 (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if ((mode = apply_args_mode[regno]) != VOIDmode) { - rtx tem; - align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT; if (size % align != 0) size = CEIL (size, align) * align; @@ -1120,8 +1125,14 @@ expand_builtin_apply_args_1 (void) } /* Save the arg pointer to the block. */ - emit_move_insn (adjust_address (registers, Pmode, 0), - copy_to_reg (virtual_incoming_args_rtx)); + tem = copy_to_reg (virtual_incoming_args_rtx); +#ifdef STACK_GROWS_DOWNWARD + /* We need the pointer as the caller actually passed them to us, not + as we might have pretended they were passed. */ + tem = plus_constant (tem, current_function_pretend_args_size); +#endif + emit_move_insn (adjust_address (registers, Pmode, 0), tem); + size = GET_MODE_SIZE (Pmode); /* Save the structure value address unless this is passed as an @@ -1219,12 +1230,16 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) #endif emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX); - /* Push a block of memory onto the stack to store the memory arguments. - Save the address in a register, and copy the memory arguments. ??? I - haven't figured out how the calling convention macros effect this, - but it's likely that the source and/or destination addresses in - the block copy will need updating in machine specific ways. */ - dest = allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT); + /* 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); + dest = virtual_outgoing_args_rtx; +#ifndef STACK_GROWS_DOWNWARD + if (GET_CODE (argsize) == CONST_INT) + dest = plus_constant (dest, -INTVAL (argsize)); + else + dest = gen_rtx_PLUS (Pmode, dest, negate_rtx (Pmode, argsize)); +#endif dest = gen_rtx_MEM (BLKmode, dest); set_mem_align (dest, PARM_BOUNDARY); src = gen_rtx_MEM (BLKmode, incoming_args); @@ -1378,7 +1393,7 @@ expand_builtin_return (rtx result) /* Return whatever values was restored by jumping directly to the end of the function. */ - expand_null_return (); + expand_naked_return (); } /* Used by expand_builtin_classify_type and fold_builtin_classify_type. */ @@ -2261,7 +2276,8 @@ expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode) /* Return an offset into the constant string argument. */ return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, ssize_int (r - p1))), + s1, convert (TREE_TYPE (s1), + ssize_int (r - p1)))), target, mode, EXPAND_NORMAL); } @@ -2318,7 +2334,8 @@ expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode) /* Return an offset into the constant string argument. */ return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, ssize_int (r - p1))), + s1, convert (TREE_TYPE (s1), + ssize_int (r - p1)))), target, mode, EXPAND_NORMAL); } @@ -2362,7 +2379,8 @@ expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode) /* Return an offset into the constant string argument. */ return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, ssize_int (r - p1))), + s1, convert (TREE_TYPE (s1), + ssize_int (r - p1)))), target, mode, EXPAND_NORMAL); } @@ -2408,7 +2426,8 @@ expand_builtin_strpbrk (tree arglist, rtx target, enum machine_mode mode) /* Return an offset into the constant string argument. */ return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, ssize_int (r - p1))), + s1, convert (TREE_TYPE (s1), + ssize_int (r - p1)))), target, mode, EXPAND_NORMAL); } @@ -3910,6 +3929,14 @@ stabilize_va_list (tree valist, int needs_lvalue) return valist; } +/* The "standard" definition of va_list is void*. */ + +tree +std_build_builtin_va_list (void) +{ + return ptr_type_node; +} + /* The "standard" implementation of va_start: just assign `nextarg' to the variable. */ @@ -4437,6 +4464,14 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) ret = get_insns (); end_sequence (); + /* For mildly unsafe builtin jump's, if unsave_expr_now + creates a new tree instead of changing the old one + TREE_VALUE (arglist) needs to be updated. */ + if (arg0 != TREE_VALUE (arglist) + && TREE_CODE (arg0) == UNSAVE_EXPR + && TREE_OPERAND (arg0, 0) != TREE_VALUE (arglist)) + TREE_VALUE (arglist) = TREE_OPERAND (arg0, 0); + /* Now that the __builtin_expect has been validated, go through and add the expect's to each of the conditional jumps. If we run into an error, just give up and generate the 'safe' code of doing a SCC diff --git a/gcc/c-common.c b/gcc/c-common.c index 1d32d963a51..3ba73dd2722 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -386,7 +386,7 @@ int flag_isoc94; int flag_isoc99; -/* Nonzero means that we have builtin functions, and main is an int */ +/* Nonzero means that we have builtin functions, and main is an int. */ int flag_hosted = 1; @@ -510,17 +510,6 @@ int flag_no_gnu_keywords; int flag_implement_inlines = 1; -/* Nonzero means do emit exported implementations of templates, instead of - multiple static copies in each file that needs a definition. */ - -int flag_external_templates; - -/* Nonzero means that the decision to emit or not emit the implementation of a - template depends on where the template is instantiated, rather than where - it is defined. */ - -int flag_alt_external_templates; - /* Nonzero means that implicit instantiations will be emitted if needed. */ int flag_implicit_templates = 1; @@ -620,10 +609,12 @@ int flag_enforce_eh_specs = 1; 1: The version of the ABI first used in G++ 3.2. + 2: The version of the ABI first used in G++ 3.4. + Additional positive integers will be assigned as new versions of the ABI become the default version of the ABI. */ -int flag_abi_version = 1; +int flag_abi_version = 2; /* Nonzero means warn about things that will change when compiling with an ABI-compliant compiler. */ @@ -2793,6 +2784,9 @@ static tree builtin_function_2 (const char *, const char *, tree, tree, tree c_build_qualified_type (tree type, int type_quals) { + if (type == error_mark_node) + return type; + if (TREE_CODE (type) == ARRAY_TYPE) return build_array_type (c_build_qualified_type (TREE_TYPE (type), type_quals), @@ -2818,6 +2812,9 @@ void c_apply_type_quals_to_decl (int type_quals, tree decl) { tree type = TREE_TYPE (decl); + + if (type == error_mark_node) + return; if (((type_quals & TYPE_QUAL_CONST) || (type && TREE_CODE (type) == REFERENCE_TYPE)) @@ -4929,34 +4926,33 @@ handle_visibility_attribute (tree *node, tree name, tree args, bool *no_add_attrs) { tree decl = *node; + tree id = TREE_VALUE (args); + + *no_add_attrs = true; if (decl_function_context (decl) != 0 || ! TREE_PUBLIC (decl)) { warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - *no_add_attrs = true; + return NULL_TREE; } - else - { - tree id; - id = TREE_VALUE (args); - if (TREE_CODE (id) != STRING_CST) - { - error ("visibility arg not a string"); - *no_add_attrs = true; - return NULL_TREE; - } - if (strcmp (TREE_STRING_POINTER (id), "hidden") - && strcmp (TREE_STRING_POINTER (id), "protected") - && strcmp (TREE_STRING_POINTER (id), "internal") - && strcmp (TREE_STRING_POINTER (id), "default")) - { - error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); - *no_add_attrs = true; - return NULL_TREE; - } + if (TREE_CODE (id) != STRING_CST) + { + error ("visibility arg not a string"); + return NULL_TREE; } + if (strcmp (TREE_STRING_POINTER (id), "default") == 0) + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + else if (strcmp (TREE_STRING_POINTER (id), "internal") == 0) + DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL; + else if (strcmp (TREE_STRING_POINTER (id), "hidden") == 0) + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0) + DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED; + else + error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); + return NULL_TREE; } @@ -5775,7 +5771,7 @@ c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) return NULL; switch (TREE_CODE (x)) { - /* Reconginze assignments of large structures and constructors of + /* Recognize assignments of large structures and constructors of big arrays. */ case MODIFY_EXPR: case CONSTRUCTOR: @@ -5894,4 +5890,36 @@ c_decl_uninit (tree t) return false; } +/* Issue the error given by MSGID, indicating that it occurred before + TOKEN, which had the associated VALUE. */ + +void +c_parse_error (const char *msgid, enum cpp_ttype token, tree value) +{ + const char *string = _(msgid); + + if (token == CPP_EOF) + error ("%s at end of input", string); + else if (token == CPP_CHAR || token == CPP_WCHAR) + { + unsigned int val = TREE_INT_CST_LOW (value); + const char *const ell = (token == CPP_CHAR) ? "" : "L"; + if (val <= UCHAR_MAX && ISGRAPH (val)) + error ("%s before %s'%c'", string, ell, val); + else + error ("%s before %s'\\x%x'", string, ell, val); + } + else if (token == CPP_STRING + || token == CPP_WSTRING) + error ("%s before string constant", string); + else if (token == CPP_NUMBER) + error ("%s before numeric constant", string); + else if (token == CPP_NAME) + error ("%s before \"%s\"", string, IDENTIFIER_POINTER (value)); + else if (token < N_TTYPES) + error ("%s before '%s' token", string, cpp_type2name (token)); + else + error ("%s", string); +} + #include "gt-c-common.h" diff --git a/gcc/c-common.h b/gcc/c-common.h index ccfc779bee0..e3ae91fb311 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -88,9 +88,10 @@ enum rid RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_TEMPLATE, RID_NULL, RID_CATCH, RID_DELETE, RID_FALSE, RID_NAMESPACE, - RID_NEW, RID_OPERATOR, RID_THIS, - RID_THROW, RID_TRUE, RID_TRY, - RID_TYPENAME, RID_TYPEID, RID_USING, + RID_NEW, RID_OFFSETOF, RID_OPERATOR, + RID_THIS, RID_THROW, RID_TRUE, + RID_TRY, RID_TYPENAME, RID_TYPEID, + RID_USING, /* casts */ RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST, @@ -552,7 +553,7 @@ extern int flag_isoc94; extern int flag_isoc99; -/* Nonzero means that we have builtin functions, and main is an int */ +/* Nonzero means that we have builtin functions, and main is an int. */ extern int flag_hosted; @@ -673,17 +674,6 @@ extern int flag_no_gnu_keywords; extern int flag_implement_inlines; -/* Nonzero means do emit exported implementations of templates, instead of - multiple static copies in each file that needs a definition. */ - -extern int flag_external_templates; - -/* Nonzero means that the decision to emit or not emit the implementation of a - template depends on where the template is instantiated, rather than where - it is defined. */ - -extern int flag_alt_external_templates; - /* Nonzero means that implicit instantiations will be emitted if needed. */ extern int flag_implicit_templates; @@ -1330,6 +1320,7 @@ extern void c_stddef_cpp_builtins (void); extern void fe_file_change (const struct line_map *); extern int c_estimate_num_insns (tree decl); extern bool c_decl_uninit (tree t); +extern void c_parse_error (const char *, enum cpp_ttype, tree); /* The following have been moved here from c-tree.h, since they're needed in the ObjC++ world, too. What is more, stub-objc.c could use a few diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index 19a9cf48106..739a34224b1 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -310,7 +310,23 @@ c_cpp_builtins (cpp_reader *pfile) /* represents the C++ ABI version, always defined so it can be used while preprocessing C and assembler. */ - cpp_define (pfile, "__GXX_ABI_VERSION=102"); + if (flag_abi_version == 0) + /* Use a very large value so that: + + #if __GXX_ABI_VERSION >= + + will work whether the user explicitly says "-fabi-version=x" or + "-fabi-version=0". Do not use INT_MAX because that will be + different from system to system. */ + builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999); + else if (flag_abi_version == 1) + /* Due to an historical accident, this version had the value + "102". */ + builtin_define_with_int_value ("__GXX_ABI_VERSION", 102); + else + /* Newer versions have values 1002, 1003, ... */ + builtin_define_with_int_value ("__GXX_ABI_VERSION", + 1000 + flag_abi_version); /* libgcc needs to know this. */ if (USING_SJLJ_EXCEPTIONS) diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 93ce347784d..db04a877f1a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -61,7 +61,6 @@ enum decl_context FUNCDEF, /* Function definition */ PARM, /* Declaration of parm before function body */ FIELD, /* Declaration inside struct or union */ - BITFIELD, /* Likewise but with specified width */ TYPENAME}; /* Typename (inside cast or sizeof) */ @@ -126,6 +125,10 @@ static GTY(()) struct stmt_tree_s c_stmt_tree; static GTY(()) tree c_scope_stmt_stack; +/* State saving variables. */ +int c_in_iteration_stmt; +int c_in_case_stmt; + /* A list of external DECLs that appeared at block scope when there was some other global meaning for that identifier. */ static GTY(()) tree truly_local_externals; @@ -311,7 +314,7 @@ static void bind_label (tree, tree, struct c_scope *); static void implicit_decl_warning (tree); static tree lookup_tag (enum tree_code, tree, int); static tree lookup_name_current_level (tree); -static tree grokdeclarator (tree, tree, enum decl_context, int); +static tree grokdeclarator (tree, tree, enum decl_context, int, tree *); static tree grokparms (tree, int); static void layout_array_type (tree); static void store_parm_decls_newstyle (void); @@ -321,6 +324,7 @@ static void c_expand_body_1 (tree, int); static tree any_external_decl (tree); static void record_external_decl (tree); static void warn_if_shadowing (tree, tree); +static void check_bitfield_type_and_width (tree *, tree *, const char *); static void clone_underlying_type (tree); static bool flexible_array_type_p (tree); static hashval_t link_hash_hash (const void *); @@ -425,13 +429,13 @@ void objc_mark_locals_volatile (void *enclosing_blk) { struct c_scope *scope; - - for (scope = current_scope; + + for (scope = current_scope; scope && scope != enclosing_blk; scope = scope->outer) { tree decl; - + for (decl = scope->names; decl; decl = TREE_CHAIN (decl)) { DECL_REGISTER (decl) = 0; @@ -440,9 +444,9 @@ objc_mark_locals_volatile (void *enclosing_blk) /* Do not climb up past the current function. */ if (scope->function_body) break; - } -} - + } +} + /* Nonzero if we are currently in the global scope. */ int @@ -537,7 +541,7 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) tree decl; tree p; - /* The following line does not use |= due to a bug in HP's C compiler */ + /* The following line does not use |= due to a bug in HP's C compiler. */ scope->function_body = scope->function_body | functionbody; if (keep == KEEP_MAYBE) @@ -672,7 +676,7 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p); /* Dispose of the block that we just made inside some higher level. */ - if (scope->function_body) + if (scope->function_body && current_function_decl) DECL_INITIAL (current_function_decl) = block; else if (scope->outer) { @@ -1331,6 +1335,19 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, Currently, it can only be defined in the prototype. */ COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); + /* If either declaration has a nondefault visibility, use it. */ + if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) + { + if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT + && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) + { + warning ("%J'%D': visibility attribute ignored because it", + newdecl, newdecl); + warning ("%Jconflicts with previous declaration here", olddecl); + } + DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); + } + if (TREE_CODE (newdecl) == FUNCTION_DECL) { DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl); @@ -1408,7 +1425,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, { if (TREE_USED (olddecl) /* In unit-at-a-time mode we never inline re-defined extern - inline functions. */ + inline functions. */ && !flag_unit_at_a_time) (*debug_hooks->outlining_inline_function) (olddecl); @@ -1677,7 +1694,7 @@ pushdecl (tree x) DECL_CONTEXT (x) = current_file_decl; else DECL_CONTEXT (x) = current_function_decl; - + if (name) { tree old; @@ -1712,13 +1729,13 @@ pushdecl (tree x) if (DECL_EXTERNAL (x) || scope == global_scope) { /* Find and check against a previous, not-in-scope, external - decl for this identifier. (C99 s???: If two declarations - with external linkage, referring to the same object, have - incompatible types, the behavior is undefined). */ - tree ext = any_external_decl (name); + decl for this identifier. (C99 6.2.7p2: All declarations + that refer to the same object or function shall have + compatible type; otherwise, the behavior is undefined.) */ + tree ext = any_external_decl (name); if (ext) { - if (duplicate_decls (x, ext, scope != global_scope, + if (duplicate_decls (x, ext, scope != global_scope, false)) x = copy_node (ext); } @@ -2250,7 +2267,7 @@ c_init_decl_processing (void) tree endlink; tree ptr_ftype_void, ptr_ftype_ptr; location_t save_loc = input_location; - + /* Adds some ggc roots, and reserved words for c-parse.in. */ c_parse_init (); @@ -2523,7 +2540,8 @@ groktypename (tree typename) split_specs_attrs (TREE_PURPOSE (typename), &specs, &attrs); - typename = grokdeclarator (TREE_VALUE (typename), specs, TYPENAME, 0); + typename = grokdeclarator (TREE_VALUE (typename), specs, TYPENAME, 0, + NULL); /* Apply attributes. */ decl_attributes (&typename, attrs, 0); @@ -2540,7 +2558,7 @@ groktypename_in_parm_context (tree typename) return typename; return grokdeclarator (TREE_VALUE (typename), TREE_PURPOSE (typename), - PARM, 0); + PARM, 0, NULL); } /* Decode a declarator in an ordinary declaration or data definition. @@ -2570,7 +2588,7 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) deprecated_state = DEPRECATED_SUPPRESS; decl = grokdeclarator (declarator, declspecs, - NORMAL, initialized); + NORMAL, initialized, NULL); deprecated_state = DEPRECATED_NORMAL; @@ -2757,7 +2775,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) || TREE_CODE (decl) == FIELD_DECL)) objc_check_decl (decl); - /* Deduce size of array from initialization, if not already known */ + /* Deduce size of array from initialization, if not already known. */ if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == 0 && TREE_CODE (decl) != TYPE_DECL) @@ -2870,7 +2888,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) #endif } SET_DECL_RTL (decl, NULL_RTX); - SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred)); + change_decl_assembler_name (decl, get_identifier (starred)); } /* If #pragma weak was used, mark the decl weak now. */ @@ -2920,7 +2938,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) warning ("%Jignoring asm-specifier for non-static local " "variable '%D'", decl, decl); else - SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec)); + change_decl_assembler_name (decl, get_identifier (asmspec)); } if (TREE_CODE (decl) != FUNCTION_DECL) @@ -3006,7 +3024,8 @@ push_parm_decl (tree parm) immediate_size_expand = 0; decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)), - TREE_PURPOSE (TREE_PURPOSE (parm)), PARM, 0); + TREE_PURPOSE (TREE_PURPOSE (parm)), + PARM, 0, NULL); decl_attributes (&decl, TREE_VALUE (parm), 0); decl = pushdecl (decl); @@ -3201,6 +3220,77 @@ flexible_array_type_p (tree type) } } +/* Performs sanity checks on the TYPE and WIDTH of the bit-field NAME, + replacing with appropriate values if they are invalid. */ +static void +check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) +{ + tree type_mv; + unsigned int max_width; + unsigned HOST_WIDE_INT w; + const char *name = orig_name ? orig_name: _(""); + + /* Necessary? */ + STRIP_NOPS (*width); + + /* Detect and ignore out of range field width and process valid + field widths. */ + if (TREE_CODE (*width) != INTEGER_CST) + { + error ("bit-field `%s' width not an integer constant", name); + *width = integer_one_node; + } + else + { + constant_expression_warning (*width); + if (tree_int_cst_sgn (*width) < 0) + { + error ("negative width in bit-field `%s'", name); + *width = integer_one_node; + } + else if (integer_zerop (*width) && orig_name) + { + error ("zero width for bit-field `%s'", name); + *width = integer_one_node; + } + } + + /* Detect invalid bit-field type. */ + if (TREE_CODE (*type) != INTEGER_TYPE + && TREE_CODE (*type) != BOOLEAN_TYPE + && TREE_CODE (*type) != ENUMERAL_TYPE) + { + error ("bit-field `%s' has invalid type", name); + *type = unsigned_type_node; + } + + type_mv = TYPE_MAIN_VARIANT (*type); + if (pedantic + && type_mv != integer_type_node + && type_mv != unsigned_type_node + && type_mv != boolean_type_node) + pedwarn ("type of bit-field `%s' is a GCC extension", name); + + if (type_mv == boolean_type_node) + max_width = CHAR_TYPE_SIZE; + else + max_width = TYPE_PRECISION (*type); + + if (0 < compare_tree_int (*width, max_width)) + { + error ("width of `%s' exceeds its type", name); + w = max_width; + *width = build_int_2 (w, 0); + } + else + w = tree_low_cst (*width, 1); + + if (TREE_CODE (*type) == ENUMERAL_TYPE + && (w < min_precision (TYPE_MIN_VALUE (*type), TREE_UNSIGNED (*type)) + || w < min_precision (TYPE_MAX_VALUE (*type), TREE_UNSIGNED (*type)))) + warning ("`%s' is narrower than values of its type", name); +} + /* Given declspecs and a declarator, determine the name and type of the object declared and construct a ..._DECL node for it. @@ -3220,8 +3310,9 @@ flexible_array_type_p (tree type) TYPENAME if for a typename (in a cast or sizeof). Don't make a DECL node; just return the ..._TYPE node. FIELD for a struct or union field; make a FIELD_DECL. - BITFIELD for a field with specified width. INITIALIZED is 1 if the decl has an initializer. + WIDTH is non-NULL for bit-fields, and is a pointer to an INTEGER_CST node + representing the width of the bit-field. In the TYPENAME case, DECLARATOR is really an absolute declarator. It may also be so in the PARM case, for a prototype where the @@ -3232,7 +3323,7 @@ flexible_array_type_p (tree type) static tree grokdeclarator (tree declarator, tree declspecs, - enum decl_context decl_context, int initialized) + enum decl_context decl_context, int initialized, tree *width) { int specbits = 0; tree spec; @@ -3247,19 +3338,16 @@ grokdeclarator (tree declarator, tree declspecs, int explicit_char = 0; int defaulted_int = 0; tree typedef_decl = 0; - const char *name; + const char *name, *orig_name; tree typedef_type = 0; int funcdef_flag = 0; enum tree_code innermost_code = ERROR_MARK; - int bitfield = 0; int size_varies = 0; tree decl_attr = NULL_TREE; tree array_ptr_quals = NULL_TREE; int array_parm_static = 0; tree returned_attrs = NULL_TREE; - - if (decl_context == BITFIELD) - bitfield = 1, decl_context = FIELD; + bool bitfield = width != NULL; if (decl_context == FUNCDEF) funcdef_flag = 1, decl_context = NORMAL; @@ -3292,6 +3380,7 @@ grokdeclarator (tree declarator, tree declspecs, default: abort (); } + orig_name = name; if (name == 0) name = "type name"; } @@ -3524,7 +3613,7 @@ grokdeclarator (tree declarator, tree declspecs, } /* Decide whether an integer type is signed or not. - Optionally treat bitfields as signed by default. */ + Optionally treat bit-fields as signed by default. */ if (specbits & 1 << (int) RID_UNSIGNED || (bitfield && ! flag_signed_bitfields && (explicit_int || defaulted_int || explicit_char @@ -3596,6 +3685,10 @@ grokdeclarator (tree declarator, tree declspecs, } } + /* Check the type and width of a bit-field. */ + if (bitfield) + check_bitfield_type_and_width (&type, width, orig_name); + /* Figure out the type qualifiers for the declaration. There are two ways a declaration can become qualified. One is something like `const int i' where the `const' is explicit. Another is @@ -4637,7 +4730,7 @@ get_parm_info (int void_at_end) default: abort (); } - if (TREE_PURPOSE (decl)) + if (TREE_PURPOSE (decl)) /* The first %s will be one of 'struct', 'union', or 'enum'. */ warning ("\"%s %s\" declared inside parameter list", keyword, IDENTIFIER_POINTER (TREE_PURPOSE (decl))); @@ -4752,7 +4845,7 @@ start_struct (enum tree_code code, tree name) /* Process the specs, declarator (NULL if omitted) and width (NULL if omitted) of a structure component, returning a FIELD_DECL node. - WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. + WIDTH is non-NULL for bit-fields only, and is an INTEGER_CST node. This is done during the parsing of the struct declaration. The FIELD_DECL nodes are chained together and the lot of them @@ -4807,7 +4900,8 @@ grokfield (tree declarator, tree declspecs, tree width) } } - value = grokdeclarator (declarator, declspecs, width ? BITFIELD : FIELD, 0); + value = grokdeclarator (declarator, declspecs, FIELD, 0, + width ? &width : NULL); finish_decl (value, NULL_TREE, NULL_TREE); DECL_INITIAL (value) = width; @@ -4954,72 +5048,12 @@ finish_struct (tree t, tree fieldlist, tree attributes) error ("nested redefinition of `%s'", IDENTIFIER_POINTER (TYPE_NAME (t))); - /* Detect invalid bit-field size. */ - if (DECL_INITIAL (x)) - STRIP_NOPS (DECL_INITIAL (x)); - if (DECL_INITIAL (x)) - { - if (TREE_CODE (DECL_INITIAL (x)) == INTEGER_CST) - constant_expression_warning (DECL_INITIAL (x)); - else - { - error ("%Jbit-field '%D' width not an integer constant", x, x); - DECL_INITIAL (x) = NULL; - } - } - - /* Detect invalid bit-field type. */ - if (DECL_INITIAL (x) - && TREE_CODE (TREE_TYPE (x)) != INTEGER_TYPE - && TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE - && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE) - { - error ("%Jbit-field '%D' has invalid type", x, x); - DECL_INITIAL (x) = NULL; - } - - if (DECL_INITIAL (x) && pedantic - && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != integer_type_node - && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != unsigned_type_node - && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != boolean_type_node - /* Accept an enum that's equivalent to int or unsigned int. */ - && !(TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE - && (TYPE_PRECISION (TREE_TYPE (x)) - == TYPE_PRECISION (integer_type_node)))) - pedwarn ("%Jbit-field '%D' type invalid in ISO C", x, x); - - /* Detect and ignore out of range field width and process valid - field widths. */ if (DECL_INITIAL (x)) { - int max_width - = (TYPE_MAIN_VARIANT (TREE_TYPE (x)) == boolean_type_node - ? CHAR_TYPE_SIZE : TYPE_PRECISION (TREE_TYPE (x))); - - if (tree_int_cst_sgn (DECL_INITIAL (x)) < 0) - error ("%Jnegative width in bit-field '%D'", x, x); - else if (0 < compare_tree_int (DECL_INITIAL (x), max_width)) - pedwarn ("%Jwidth of '%D' exceeds its type", x, x); - else if (integer_zerop (DECL_INITIAL (x)) && DECL_NAME (x) != 0) - error ("%Jzero width for bit-field '%D'", x, x); - else - { - /* The test above has assured us that TREE_INT_CST_HIGH is 0. */ - unsigned HOST_WIDE_INT width - = tree_low_cst (DECL_INITIAL (x), 1); - - if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE - && (width < min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)), - TREE_UNSIGNED (TREE_TYPE (x))) - || (width - < min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)), - TREE_UNSIGNED (TREE_TYPE (x)))))) - warning ("%J'%D' is narrower than values of its type", x, x); - - DECL_SIZE (x) = bitsize_int (width); - DECL_BIT_FIELD (x) = 1; - SET_DECL_C_BIT_FIELD (x); - } + unsigned HOST_WIDE_INT width = tree_low_cst (DECL_INITIAL (x), 1); + DECL_SIZE (x) = bitsize_int (width); + DECL_BIT_FIELD (x) = 1; + SET_DECL_C_BIT_FIELD (x); } DECL_INITIAL (x) = 0; @@ -5055,7 +5089,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) layout_type (t); - /* Delete all zero-width bit-fields from the fieldlist */ + /* Delete all zero-width bit-fields from the fieldlist. */ { tree *fieldlistp = &fieldlist; while (*fieldlistp) @@ -5071,7 +5105,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) TYPE_FIELDS (t) = fieldlist; /* If there are lots of fields, sort so we can look through them fast. - We arbitrarily consider 16 or more elts to be "a lot". */ + We arbitrarily consider 16 or more elts to be "a lot". */ { int len = 0; @@ -5088,23 +5122,23 @@ finish_struct (tree t, tree fieldlist, tree attributes) tree *field_array; struct lang_type *space; struct sorted_fields_type *space2; - + len += list_length (x); - + /* Use the same allocation policy here that make_node uses, to ensure that this lives as long as the rest of the struct decl. All decls in an inline function need to be saved. */ - + space = ggc_alloc (sizeof (struct lang_type)); space2 = ggc_alloc (sizeof (struct sorted_fields_type) + len * sizeof (tree)); - + len = 0; space->s = space2; field_array = &space2->elts[0]; for (x = fieldlist; x; x = TREE_CHAIN (x)) { field_array[len++] = x; - + /* If there is anonymous struct or union, break out of the loop. */ if (DECL_NAME (x) == NULL) break; @@ -5119,7 +5153,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) } } } - + for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x)) { TYPE_FIELDS (x) = TYPE_FIELDS (t); @@ -5438,11 +5472,13 @@ start_function (tree declspecs, tree declarator, tree attributes) current_function_returns_abnormally = 0; warn_about_return_type = 0; current_extern_inline = 0; + c_in_iteration_stmt = 0; + c_in_case_stmt = 0; /* Don't expand any sizes in the return type of the function. */ immediate_size_expand = 0; - decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1); + decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, NULL); /* If the declarator is not suitable for a function definition, cause a syntax error. */ @@ -6052,11 +6088,13 @@ finish_function (void) } } - BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; + if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node) + BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; /* Must mark the RESULT_DECL as being in this function. */ - DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; + if (DECL_RESULT (fndecl) && DECL_RESULT (fndecl) != error_mark_node) + DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted) { @@ -6156,7 +6194,7 @@ c_expand_body_1 (tree fndecl, int nested_p) /* Squirrel away our current state. */ push_function_context (); } - + tree_rest_of_compilation (fndecl, nested_p); if (nested_p) @@ -6187,7 +6225,9 @@ c_expand_body_1 (tree fndecl, int nested_p) void c_expand_body (tree fndecl) { - c_expand_body_1 (fndecl, 0); + + if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node) + c_expand_body_1 (fndecl, 0); } /* Check the declarations given in a for-loop for satisfying the C99 @@ -6251,20 +6291,6 @@ check_for_loop_decls (void) } } -/* Save and restore the variables in this file and elsewhere - that keep track of the progress of compilation of the current function. - Used for nested functions. */ - -struct language_function GTY(()) -{ - struct c_language_function base; - int returns_value; - int returns_null; - int returns_abnormally; - int warn_about_return_type; - int extern_inline; -}; - /* Save and reinitialize the variables used during compilation of a C function. */ @@ -6277,6 +6303,8 @@ c_push_function_context (struct function *f) p->base.x_stmt_tree = c_stmt_tree; p->base.x_scope_stmt_stack = c_scope_stmt_stack; + p->x_in_iteration_stmt = c_in_iteration_stmt; + p->x_in_case_stmt = c_in_case_stmt; p->returns_value = current_function_returns_value; p->returns_null = current_function_returns_null; p->returns_abnormally = current_function_returns_abnormally; @@ -6303,6 +6331,8 @@ c_pop_function_context (struct function *f) c_stmt_tree = p->base.x_stmt_tree; c_scope_stmt_stack = p->base.x_scope_stmt_stack; + c_in_iteration_stmt = p->x_in_iteration_stmt; + c_in_case_stmt = p->x_in_case_stmt; current_function_returns_value = p->returns_value; current_function_returns_null = p->returns_null; current_function_returns_abnormally = p->returns_abnormally; @@ -6510,7 +6540,7 @@ merge_translation_unit_decls (void) tree decl; htab_t link_hash_table; tree block; - + /* Create the BLOCK that poplevel would have created, but don't actually call poplevel since that's expensive. */ block = make_node (BLOCK); @@ -6551,7 +6581,7 @@ merge_translation_unit_decls (void) DECL_EXTERNAL (decl) = 1; else if (DECL_COMMON (old_decl) || DECL_ONE_ONLY (old_decl)) DECL_EXTERNAL (old_decl) = 1; - + if (DECL_EXTERNAL (decl)) { DECL_INITIAL (decl) = NULL_TREE; @@ -6585,10 +6615,10 @@ merge_translation_unit_decls (void) { tree global_decl; global_decl = htab_find (link_hash_table, decl); - + if (! global_decl) continue; - + /* Print any appropriate error messages, and partially merge the decls. */ (void) duplicate_decls (decl, global_decl, true, true); @@ -6603,7 +6633,7 @@ void c_write_global_declarations(void) { tree link; - + for (link = current_file_decl; link; link = TREE_CHAIN (link)) { tree globals = BLOCK_VARS (DECL_INITIAL (link)); @@ -6611,16 +6641,16 @@ c_write_global_declarations(void) tree *vec = xmalloc (sizeof (tree) * len); int i; tree decl; - + /* Process the decls in the order they were written. */ for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl)) vec[i] = decl; - + wrapup_global_declarations (vec, len); - + check_global_declarations (vec, len); - + /* Clean up. */ free (vec); } @@ -6633,7 +6663,7 @@ c_reset_state (void) { tree link; tree file_scope_decl; - + /* Pop the global scope. */ if (current_scope != global_scope) current_scope = global_scope; diff --git a/gcc/c-format.c b/gcc/c-format.c index 82fb593f440..a532259750c 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -37,13 +37,13 @@ void set_Wformat (int setting) { warn_format = setting; - warn_format_y2k = setting; warn_format_extra_args = setting; warn_format_zero_length = setting; if (setting != 1) { warn_format_nonliteral = setting; warn_format_security = setting; + warn_format_y2k = setting; } /* Make sure not to disable -Wnonnull if -Wformat=0 is specified. */ if (setting) @@ -755,23 +755,23 @@ static const format_flag_pair strfmon_flag_pairs[] = static const format_char_info print_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" }, - { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" }, - { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" }, - { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" }, - { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" }, - { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" }, - { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" }, + { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" }, + { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" }, + { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" }, + { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" }, + { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#I", "" }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" }, + { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" }, /* C99 conversion specifiers. */ - { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" }, - { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" }, + { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" }, + { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" }, /* X/Open conversion specifiers. */ - { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, - { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" }, + { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, + { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" }, /* GNU conversion specifiers. */ - { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" }, + { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" }, { NULL, 0, 0, NOLENGTHS, NULL, NULL } }; diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index e28114652a3..7b08c1a12a3 100644 --- a/gcc/c-incpath.c +++ b/gcc/c-incpath.c @@ -187,12 +187,12 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, { /* Dirs that don't exist are silently ignored, unless verbose. */ if (errno != ENOENT) - cpp_errno (pfile, DL_ERROR, cur->name); + cpp_errno (pfile, CPP_DL_ERROR, cur->name); else reason = REASON_NOENT; } else if (!S_ISDIR (st.st_mode)) - cpp_error_with_line (pfile, DL_ERROR, 0, 0, + cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0, "%s: not a directory", cur->name); else { diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index 287cf300232..e9a4a09ed8d 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -293,29 +293,41 @@ static bool c_tree_printer (pretty_printer *pp, text_info *text) { tree t = va_arg (*text->args_ptr, tree); + const char *n = "({anonymous})"; switch (*text->format_spec) { case 'D': case 'F': + if (DECL_NAME (t)) + n = (*lang_hooks.decl_printable_name) (t, 2); + break; + case 'T': - { - const char *n = DECL_NAME (t) - ? (*lang_hooks.decl_printable_name) (t, 2) - : "({anonymous})"; - pp_string (pp, n); - } - return true; + if (TREE_CODE (t) == TYPE_DECL) + { + if (DECL_NAME (t)) + n = (*lang_hooks.decl_printable_name) (t, 2); + } + else + { + t = TYPE_NAME (t); + if (t) + n = IDENTIFIER_POINTER (t); + } + break; case 'E': - if (TREE_CODE (t) == IDENTIFIER_NODE) - { - pp_string (pp, IDENTIFIER_POINTER (t)); - return true; - } - return false; + if (TREE_CODE (t) == IDENTIFIER_NODE) + n = IDENTIFIER_POINTER (t); + else + return false; + break; default: return false; } + + pp_string (pp, n); + return true; } diff --git a/gcc/c-opts.c b/gcc/c-opts.c index b15f31ce78e..59bce76607b 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -108,7 +108,7 @@ static void sanitize_cpp_opts (void); static void add_prefixed_path (const char *, size_t); static void push_command_line_include (void); static void cb_file_change (cpp_reader *, const struct line_map *); -static void finish_options (const char *); +static bool finish_options (const char *); #ifndef STDC_0_IN_SYSTEM_HEADERS #define STDC_0_IN_SYSTEM_HEADERS 0 @@ -672,7 +672,9 @@ c_common_handle_option (size_t scode, const char *arg, int value) /* 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: @@ -697,15 +699,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_access_control = value; break; - case OPT_falt_external_templates: - flag_alt_external_templates = value; - if (value) - flag_external_templates = true; - cp_deprecated: - warning ("switch \"%s\" is deprecated, please see documentation " - "for details", option->opt_text); - break; - case OPT_fasm: flag_no_asm = !value; break; @@ -799,10 +792,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_enforce_eh_specs = value; break; - case OPT_fexternal_templates: - flag_external_templates = value; - goto cp_deprecated; - case OPT_ffixed_form: case OPT_ffixed_line_length_: /* Fortran front end options ignored when preprocessing only. */ @@ -1183,8 +1172,8 @@ c_common_init (void) if (flag_preprocess_only) { - finish_options (in_fnames[0]); - preprocess_file (parse_in); + if (finish_options (in_fnames[0])) + preprocess_file (parse_in); return false; } @@ -1220,7 +1209,8 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED) cpp_undef_all (parse_in); } - finish_options(in_fnames[file_index]); + if (! finish_options(in_fnames[file_index])) + break; if (file_index == 0) pch_init(); c_parse_file (); @@ -1387,10 +1377,14 @@ add_prefixed_path (const char *suffix, size_t chain) /* Handle -D, -U, -A, -imacros, and the first -include. TIF is the input file to which we will return after processing all - the includes. */ -static void + the includes. Returns true on success. */ +static bool finish_options (const char *tif) { + this_input_filename = tif; + if (! cpp_find_main_file (parse_in, this_input_filename)) + return false; + if (!cpp_opts->preprocessed) { size_t i; @@ -1435,14 +1429,17 @@ finish_options (const char *tif) if (opt->code == OPT_imacros && cpp_push_include (parse_in, opt->arg)) - cpp_scan_nooutput (parse_in); + { + /* Disable push_command_line_include callback for now. */ + include_cursor = deferred_count + 1; + cpp_scan_nooutput (parse_in); + } } } include_cursor = 0; - this_input_filename = tif; - cpp_find_main_file (parse_in, this_input_filename); push_command_line_include (); + return true; } /* Give CPP the next file given by -include, if any. */ diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 22bab99077a..954c37067ff 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -1372,7 +1372,11 @@ typespec_nonreserved_nonattr: { $$ = get_object_reference ($1); } @@end_ifobjc | typeof '(' expr ')' - { skip_evaluation--; $$ = TREE_TYPE ($3); } + { skip_evaluation--; + if (TREE_CODE ($3) == COMPONENT_REF + && DECL_C_BIT_FIELD (TREE_OPERAND ($3, 1))) + error ("`typeof' applied to a bit-field"); + $$ = TREE_TYPE ($3); } | typeof '(' typename ')' { skip_evaluation--; $$ = groktypename ($3); } ; @@ -2053,12 +2057,12 @@ pushlevel: /* empty */ ; poplevel: /* empty */ - { + { @@ifobjc if (c_dialect_objc ()) objc_clear_super_receiver (); @@end_ifobjc - $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); + $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); } ; @@ -2202,6 +2206,7 @@ do_stmt_start: DO { stmt_count++; compstmt_count++; + c_in_iteration_stmt++; $$ = add_stmt (build_stmt (DO_STMT, NULL_TREE, NULL_TREE)); @@ -2212,7 +2217,8 @@ do_stmt_start: DO_COND ($$) = error_mark_node; } c99_block_lineno_labeled_stmt WHILE { $$ = $2; - RECHAIN_STMTS ($$, DO_BODY ($$)); } + RECHAIN_STMTS ($$, DO_BODY ($$)); + c_in_iteration_stmt--; } ; /* The forced readahead in here is because we might be at the end of a @@ -2295,12 +2301,14 @@ select_or_iter_stmt: { stmt_count++; $$ = c_begin_while_stmt (); } '(' expr ')' - { $4 = c_common_truthvalue_conversion ($4); + { c_in_iteration_stmt++; + $4 = c_common_truthvalue_conversion ($4); c_finish_while_stmt_cond (c_common_truthvalue_conversion ($4), $2); $$ = add_stmt ($2); } c99_block_lineno_labeled_stmt - { RECHAIN_STMTS ($6, WHILE_BODY ($6)); } + { c_in_iteration_stmt--; + RECHAIN_STMTS ($6, WHILE_BODY ($6)); } | do_stmt_start '(' expr ')' ';' { DO_COND ($1) = c_common_truthvalue_conversion ($3); } @@ -2318,14 +2326,18 @@ select_or_iter_stmt: FOR_COND ($2) = c_common_truthvalue_conversion ($6); } xexpr ')' - { FOR_EXPR ($2) = $9; } + { c_in_iteration_stmt++; + FOR_EXPR ($2) = $9; } c99_block_lineno_labeled_stmt - { RECHAIN_STMTS ($2, FOR_BODY ($2)); } + { RECHAIN_STMTS ($2, FOR_BODY ($2)); + c_in_iteration_stmt--;} | SWITCH '(' expr ')' { stmt_count++; - $$ = c_start_case ($3); } + $$ = c_start_case ($3); + c_in_case_stmt++; } c99_block_lineno_labeled_stmt - { c_finish_case (); } + { c_finish_case (); + c_in_case_stmt--; } ; for_init_stmt: @@ -2348,9 +2360,21 @@ stmt: $$ = NULL_TREE; } | BREAK ';' { stmt_count++; + if (!(c_in_iteration_stmt || c_in_case_stmt)) + { + error ("break statement not within loop or switch"); + $$ = NULL_TREE; + } + else $$ = add_stmt (build_break_stmt ()); } | CONTINUE ';' { stmt_count++; + if (!c_in_iteration_stmt) + { + error ("continue statement not within a loop"); + $$ = NULL_TREE; + } + else $$ = add_stmt (build_continue_stmt ()); } | RETURN ';' { stmt_count++; @@ -2397,18 +2421,18 @@ stmt: { $$ = NULL_TREE; } @@ifobjc | AT_THROW expr ';' - { stmt_count++; - $$ = objc_build_throw_stmt ($2); + { stmt_count++; + $$ = objc_build_throw_stmt ($2); } | AT_THROW ';' - { stmt_count++; - $$ = objc_build_throw_stmt (NULL_TREE); + { stmt_count++; + $$ = objc_build_throw_stmt (NULL_TREE); } - | objc_try_catch_stmt + | objc_try_catch_stmt { objc_build_finally_prologue (); } objc_finally_block { $$ = objc_build_try_catch_finally_stmt ($1, $3); } - | AT_SYNCHRONIZED '(' expr ')' + | AT_SYNCHRONIZED '(' expr ')' { objc_build_synchronized_prologue ($3); } compstmt { $$ = objc_build_synchronized_epilogue (); } @@ -2425,18 +2449,18 @@ objc_try_catch_stmt: objc_try_stmt: - AT_TRY + AT_TRY { objc_build_try_prologue (); } - compstmt + compstmt ; - + objc_catch_list: objc_catch_list objc_catch_block | objc_catch_block ; objc_catch_block: - AT_CATCH '(' parm ')' + AT_CATCH '(' parm ')' { objc_build_catch_stmt ($3); } compstmt { stmt_count++; } @@ -3460,6 +3484,7 @@ static const short rid_to_yy[RID_MAX] = /* RID_FALSE */ 0, /* RID_NAMESPACE */ 0, /* RID_NEW */ 0, + /* RID_OFFSETOF */ 0, /* RID_OPERATOR */ 0, /* RID_THIS */ 0, /* RID_THROW */ 0, @@ -3527,28 +3552,7 @@ init_reswords (void) static void yyerror (const char *msgid) { - const char *string = _(msgid); - - if (last_token == CPP_EOF) - error ("%s at end of input", string); - else if (last_token == CPP_CHAR || last_token == CPP_WCHAR) - { - unsigned int val = TREE_INT_CST_LOW (yylval.ttype); - const char *const ell = (last_token == CPP_CHAR) ? "" : "L"; - if (val <= UCHAR_MAX && ISGRAPH (val)) - error ("%s before %s'%c'", string, ell, val); - else - error ("%s before %s'\\x%x'", string, ell, val); - } - else if (last_token == CPP_STRING - || last_token == CPP_WSTRING) - error ("%s before string constant", string); - else if (last_token == CPP_NUMBER) - error ("%s before numeric constant", string); - else if (last_token == CPP_NAME) - error ("%s before \"%s\"", string, IDENTIFIER_POINTER (yylval.ttype)); - else - error ("%s before '%s' token", string, NAME(last_token)); + c_parse_error (msgid, last_token, yylval.ttype); } static int @@ -3689,7 +3693,7 @@ _yylex (void) case CPP_STRING: case CPP_WSTRING: return STRING; - + case CPP_OBJC_STRING: return OBJC_STRING; diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 2a29075d5a3..157061f9177 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -102,13 +102,14 @@ pch_init (void) FILE *f; struct c_pch_validity v; void *target_validity; + static const char partial_pch[IDENT_LENGTH] = "gpcWrite"; if (! pch_file) return; f = fopen (pch_file, "w+b"); if (f == NULL) - fatal_error ("can't open %s: %m", pch_file); + fatal_error ("can't create precompiled header %s: %m", pch_file); pch_outfile = f; if (strlen (host_machine) > 255 || strlen (target_machine) > 255 @@ -122,7 +123,7 @@ pch_init (void) v.pch_init = &pch_init; target_validity = targetm.get_pch_validity (&v.target_data_length); - if (fwrite (get_ident(), IDENT_LENGTH, 1, f) != 1 + if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 || fwrite (host_machine, v.host_machine_length, 1, f) != 1 || fwrite (target_machine, v.target_machine_length, 1, f) != 1 @@ -189,6 +190,10 @@ c_common_write_pch (void) gt_pch_save (pch_outfile); cpp_write_pch_state (parse_in, pch_outfile); + if (fseek (pch_outfile, 0, SEEK_SET) != 0 + || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1) + fatal_error ("can't write %s: %m", pch_file); + fclose (pch_outfile); } @@ -225,15 +230,15 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if (memcmp (ident, pch_ident, 5) == 0) /* It's a PCH, for the right language, but has the wrong version. */ - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: not compatible with this GCC version", name); else if (memcmp (ident, pch_ident, 4) == 0) /* It's a PCH for the wrong language. */ - cpp_error (pfile, DL_WARNING, "%s: not for %s", name, + cpp_error (pfile, CPP_DL_WARNING, "%s: not for %s", name, lang_hooks.name); else /* Not any kind of PCH. */ - cpp_error (pfile, DL_WARNING, "%s: not a PCH file", name); + cpp_error (pfile, CPP_DL_WARNING, "%s: not a PCH file", name); } return 2; } @@ -251,7 +256,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) || memcmp (host_machine, short_strings, strlen (host_machine)) != 0) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: created on host `%.*s', but used on host `%s'", name, v.host_machine_length, short_strings, host_machine); return 2; @@ -261,7 +266,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) strlen (target_machine)) != 0) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: created for target `%.*s', but used for target `%s'", name, v.target_machine_length, short_strings + v.host_machine_length, target_machine); @@ -274,7 +279,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) v.version_length) != 0) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: created by version `%.*s', but this is version `%s'", name, v.version_length, (short_strings + v.host_machine_length @@ -290,7 +295,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) && write_symbols != NO_DEBUG) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: created with -g%s, but used with -g%s", name, debug_type_names[v.debug_info_type], debug_type_names[write_symbols]); @@ -304,7 +309,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if (v.pch_init != &pch_init) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: had text segment at different address", name); return 2; } @@ -322,7 +327,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if (msg != NULL) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, DL_WARNING, "%s: %s", name, msg); + cpp_error (pfile, CPP_DL_WARNING, "%s: %s", name, msg); return 2; } } @@ -353,7 +358,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, f = fdopen (fd, "rb"); if (f == NULL) { - cpp_errno (pfile, DL_ERROR, "calling fdopen"); + cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen"); return; } @@ -361,7 +366,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, if (fread (&h, sizeof (h), 1, f) != 1) { - cpp_errno (pfile, DL_ERROR, "reading"); + cpp_errno (pfile, CPP_DL_ERROR, "reading"); return; } @@ -373,7 +378,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, size = 16384; if (fread (buf, size, 1, f) != 1 || fwrite (buf, size, 1, asm_out_file) != 1) - cpp_errno (pfile, DL_ERROR, "reading"); + cpp_errno (pfile, CPP_DL_ERROR, "reading"); written += size; } free (buf); diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index 141b9061cef..e233a5e35fd 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -382,7 +382,7 @@ handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED) if (DECL_ASSEMBLER_NAME_SET_P (decl) && DECL_ASSEMBLER_NAME (decl) != newname) warning ("#pragma redefine_extname conflicts with declaration"); - SET_DECL_ASSEMBLER_NAME (decl, newname); + change_decl_assembler_name (decl, newname); } else add_to_renaming_pragma_list(oldname, newname); diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index b2161b0b6a3..1c1f77bcd74 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -1106,7 +1106,7 @@ pp_c_initializer_list (c_pretty_printer *pp, tree e) } } -/* Pretty-print a brace-enclosed initializer-list. */ +/* Pretty-print a brace-enclosed initializer-list. */ static void pp_c_brace_enclosed_initializer_list (c_pretty_printer *pp, tree l) @@ -1246,7 +1246,7 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) } } -/* Print out an expression-list; E is expected to be a TREE_LIST */ +/* Print out an expression-list; E is expected to be a TREE_LIST. */ void pp_c_expression_list (c_pretty_printer *pp, tree e) @@ -1259,7 +1259,7 @@ pp_c_expression_list (c_pretty_printer *pp, tree e) } } -/* Print out an expression-list in parens, as in a function call. */ +/* Print out an expression-list in parens, as in a function call. */ void pp_c_call_argument_list (c_pretty_printer *pp, tree t) @@ -1820,7 +1820,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) /* statement: labeled-statement - coumpound-statement + compound-statement expression-statement selection-statement iteration-statement @@ -1870,7 +1870,7 @@ pp_c_statement (c_pretty_printer *pp, tree stmt) pp_needs_newline (pp) = true; break; - /* coumpound-statement: + /* compound-statement: { block-item-list(opt) } block-item-list: diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index a3e1b45343c..f3c61b42c35 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -592,7 +592,7 @@ genrtl_break_stmt (void) { emit_line_note (input_location); if ( ! expand_exit_something ()) - error ("break statement not within loop or switch"); + abort (); } /* Build a continue statement node and return it. */ @@ -610,7 +610,7 @@ genrtl_continue_stmt (void) { emit_line_note (input_location); if (! expand_continue_loop (0)) - error ("continue statement not within a loop"); + abort (); } /* Generate the RTL for T, which is a SCOPE_STMT. */ diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 96faf84ac9b..4849ab2dd55 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -44,12 +44,12 @@ struct lang_identifier GTY(()) /* The resulting tree type. */ -union lang_tree_node +union lang_tree_node GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *)TYPE_NEXT_VARIANT (&%h.generic) : (union lang_tree_node *)TREE_CHAIN (&%h.generic)"))) { - union tree_node GTY ((tag ("0"), - desc ("tree_node_structure (&%h)"))) + union tree_node GTY ((tag ("0"), + desc ("tree_node_structure (&%h)"))) generic; struct lang_identifier GTY ((tag ("1"))) identifier; }; @@ -106,7 +106,7 @@ struct lang_decl GTY(()) /* In a RECORD_TYPE, a sorted array of the fields of the type. */ struct lang_type GTY(()) { - struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s; + struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s; }; /* Record whether a type or decl was written with nonconstant size. @@ -152,6 +152,22 @@ struct lang_type GTY(()) #define KEEP_YES 1 #define KEEP_MAYBE 2 +/* Save and restore the variables in this file and elsewhere + that keep track of the progress of compilation of the current function. + Used for nested functions. */ + +struct language_function GTY(()) +{ + struct c_language_function base; + int returns_value; + int returns_null; + int returns_abnormally; + int warn_about_return_type; + int extern_inline; + int x_in_iteration_stmt; + int x_in_case_stmt; +}; + /* in c-parse.in */ extern void c_parse_init (void); @@ -160,6 +176,9 @@ extern void c_parse_init (void); extern void gen_aux_info_record (tree, int, int, int); /* in c-decl.c */ +extern int c_in_iteration_stmt; +extern int c_in_case_stmt; + extern int global_bindings_p (void); extern tree getdecls (void); extern void pushlevel (int); @@ -273,7 +292,7 @@ extern tree c_start_case (tree); extern void c_finish_case (void); extern tree simple_asm_stmt (tree); extern tree build_asm_stmt (tree, tree, tree, tree, tree); -extern tree c_convert_parm_for_inlining (tree, tree, tree); +extern tree c_convert_parm_for_inlining (tree, tree, tree, int); /* Set to 0 at beginning of a function definition, set to 1 if a return statement that specifies a return value is seen. */ diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 598e249d947..682cbc0585f 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1645,6 +1645,7 @@ build_function_call (tree function, tree params) tree fntype, fundecl = 0; tree coerced_params; tree name = NULL_TREE, result; + tree tem; /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */ STRIP_TYPE_NOPS (function); @@ -1684,6 +1685,47 @@ build_function_call (tree function, tree params) /* fntype now gets the type of function pointed to. */ fntype = TREE_TYPE (fntype); + /* Check that the function is called through a compatible prototype. + If it is not, replace the call by a trap, wrapped up in a compound + expression if necessary. This has the nice side-effect to prevent + the tree-inliner from generating invalid assignment trees which may + blow up in the RTL expander later. + + ??? This doesn't work for Objective-C because objc_comptypes + refuses to compare function prototypes, yet the compiler appears + to build calls that are flagged as invalid by C's comptypes. */ + if (! c_dialect_objc () + && TREE_CODE (function) == NOP_EXPR + && TREE_CODE (tem = TREE_OPERAND (function, 0)) == ADDR_EXPR + && TREE_CODE (tem = TREE_OPERAND (tem, 0)) == FUNCTION_DECL + && ! comptypes (fntype, TREE_TYPE (tem), COMPARE_STRICT)) + { + tree return_type = TREE_TYPE (fntype); + tree trap = build_function_call (built_in_decls[BUILT_IN_TRAP], + NULL_TREE); + + /* This situation leads to run-time undefined behavior. We can't, + therefore, simply error unless we can prove that all possible + executions of the program must execute the code. */ + warning ("function called through a non-compatible type"); + + if (VOID_TYPE_P (return_type)) + return trap; + else + { + tree rhs; + + if (AGGREGATE_TYPE_P (return_type)) + rhs = build_compound_literal (return_type, + build_constructor (return_type, + NULL_TREE)); + else + rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node)); + + return build (COMPOUND_EXPR, return_type, trap, rhs); + } + } + /* Convert the parameters to the types declared in the function prototype, or apply default promotions. */ @@ -2588,12 +2630,10 @@ pedantic_lvalue_warning (enum tree_code code) switch (code) { case COND_EXPR: - if (pedantic) - pedwarn ("ISO C forbids use of conditional expressions as lvalues"); + pedwarn ("use of conditional expressions as lvalues is deprecated"); break; case COMPOUND_EXPR: - if (pedantic) - pedwarn ("ISO C forbids use of compound expressions as lvalues"); + pedwarn ("use of compound expressions as lvalues is deprecated"); break; default: pedwarn ("use of cast expressions as lvalues is deprecated"); @@ -2904,11 +2944,6 @@ internal_build_compound_expr (tree list, int first_p) && ! (TREE_CODE (TREE_VALUE (list)) == CONVERT_EXPR && VOID_TYPE_P (TREE_TYPE (TREE_VALUE (list))))) warning ("left-hand operand of comma expression has no effect"); - - /* When pedantic, a compound expression can be neither an lvalue - nor an integer constant expression. */ - if (! pedantic) - return rest; } /* With -Wunused, we should also warn if the left-hand operand does have @@ -3573,12 +3608,10 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, && TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE && TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST && integer_zerop (TREE_OPERAND (rhs, 0)))) - { warn_for_assignment ("%s makes pointer from integer without a cast", errtype, funname, parmnum); - return convert (type, rhs); - } - return null_pointer_node; + + return convert (type, rhs); } else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) { @@ -3612,10 +3645,12 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, return error_mark_node; } -/* Convert VALUE for assignment into inlined parameter PARM. */ +/* Convert VALUE for assignment into inlined parameter PARM. ARGNUM + is used for error and waring reporting and indicates which argument + is being processed. */ tree -c_convert_parm_for_inlining (tree parm, tree value, tree fn) +c_convert_parm_for_inlining (tree parm, tree value, tree fn, int argnum) { tree ret, type; @@ -3627,7 +3662,7 @@ c_convert_parm_for_inlining (tree parm, tree value, tree fn) type = TREE_TYPE (parm); ret = convert_for_assignment (type, value, (char *) 0 /* arg passing */, fn, - DECL_NAME (fn), 0); + DECL_NAME (fn), argnum); if (targetm.calls.promote_prototypes (TREE_TYPE (fn)) && INTEGRAL_TYPE_P (type) && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))) @@ -5647,7 +5682,7 @@ output_pending_init_elements (int all) retry: - /* Look thru the whole pending tree. + /* Look through the whole pending tree. If we find an element that should be output now, output it. Otherwise, set NEXT to the element that comes first among those still pending. */ diff --git a/gcc/caller-save.c b/gcc/caller-save.c index d40c8d99be1..7133fe393ab 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -408,7 +408,7 @@ save_call_clobbered_regs (void) regno += insert_restore (chain, 1, regno, MOVE_MAX_WORDS, save_mode); } - if (code == CALL_INSN) + if (code == CALL_INSN && ! find_reg_note (insn, REG_NORETURN, NULL)) { int regno; HARD_REG_SET hard_regs_to_save; @@ -568,8 +568,10 @@ mark_referenced_regs (rtx x) { x = SET_DEST (x); code = GET_CODE (x); - if (code == REG || code == PC || code == CC0 + if ((code == REG && REGNO (x) < FIRST_PSEUDO_REGISTER) + || code == PC || code == CC0 || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG + && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER /* If we're setting only part of a multi-word register, we shall mark it as referenced, because the words that are not being set should be restored. */ @@ -697,7 +699,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, n_regs_saved--; } - /* Tell our callers how many extra registers we saved/restored */ + /* Tell our callers how many extra registers we saved/restored. */ return numregs - 1; } @@ -769,7 +771,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno, n_regs_saved++; } - /* Tell our callers how many extra registers we saved/restored */ + /* Tell our callers how many extra registers we saved/restored. */ return numregs - 1; } @@ -832,8 +834,8 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) } } CLEAR_REG_SET (&new->dead_or_set); - if (chain->insn == BLOCK_HEAD (chain->block)) - BLOCK_HEAD (chain->block) = new->insn; + if (chain->insn == BB_HEAD (BASIC_BLOCK (chain->block))) + BB_HEAD (BASIC_BLOCK (chain->block)) = new->insn; } else { @@ -852,8 +854,8 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) note_stores (PATTERN (chain->insn), add_stored_regs, &new->live_throughout); CLEAR_REG_SET (&new->dead_or_set); - if (chain->insn == BLOCK_END (chain->block)) - BLOCK_END (chain->block) = new->insn; + if (chain->insn == BB_END (BASIC_BLOCK (chain->block))) + BB_END (BASIC_BLOCK (chain->block)) = new->insn; } new->block = chain->block; new->is_caller_save_insn = 1; diff --git a/gcc/calls.c b/gcc/calls.c index 18df59a92c2..244aa4cb73e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -133,7 +133,8 @@ static int compute_argument_block_size (int, struct args_size *, int); static void initialize_argument_information (int, struct arg_data *, struct args_size *, int, tree, tree, CUMULATIVE_ARGS *, int, - rtx *, int *, int *, int *); + rtx *, int *, int *, int *, + bool); static void compute_argument_addresses (struct arg_data *, rtx, int); static rtx rtx_for_function_call (tree, tree); static void load_register_parameters (struct arg_data *, int, rtx *, int, @@ -148,6 +149,7 @@ static int check_sibcall_argument_overlap (rtx, struct arg_data *, int); static int combine_pending_stack_adjustment_and_call (int, struct args_size *, int); static tree fix_unsafe_tree (tree); +static bool shift_returned_value (tree, rtx *); #ifdef REG_PARM_STACK_SPACE static rtx save_fixed_argument_area (int, rtx, int *, int *); @@ -289,7 +291,7 @@ prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage, /* Get possible static chain value for nested function in C. */ static_chain_value = lookup_static_chain (fndecl); - /* Make a valid memory address and copy constants thru pseudo-regs, + /* Make a valid memory address and copy constants through pseudo-regs, but not for a constant address if -fno-function-cse. */ if (GET_CODE (funexp) != SYMBOL_REF) /* If we are using registers for parameters, force the @@ -744,6 +746,28 @@ flags_from_decl_or_type (tree exp) return flags; } +/* Detect flags from a CALL_EXPR. */ + +int +call_expr_flags (tree t) +{ + int flags; + tree decl = get_callee_fndecl (t); + + if (decl) + flags = flags_from_decl_or_type (decl); + else + { + t = TREE_TYPE (TREE_OPERAND (t, 0)); + if (t && TREE_CODE (t) == POINTER_TYPE) + flags = flags_from_decl_or_type (TREE_TYPE (t)); + else + flags = 0; + } + + return flags; +} + /* Precompute all register parameters as described by ARGS, storing values into fields within the ARGS array. @@ -1000,7 +1024,10 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) and may be modified by this routine. OLD_PENDING_ADJ, MUST_PREALLOCATE and FLAGS are pointers to integer - flags which may may be modified by this routine. */ + flags which may may be modified by this routine. + + CALL_FROM_THUNK_P is true if this call is the jump from a thunk to + the thunked-to function. */ static void initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, @@ -1011,7 +1038,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, CUMULATIVE_ARGS *args_so_far, int reg_parm_stack_space, rtx *old_stack_level, int *old_pending_adj, - int *must_preallocate, int *ecf_flags) + int *must_preallocate, int *ecf_flags, + bool call_from_thunk_p) { /* 1 if scanning parms front to back, -1 if scanning back to front. */ int inc; @@ -1084,7 +1112,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, { /* If we're compiling a thunk, pass through invisible references instead of making a copy. */ - if (current_function_is_thunk + if (call_from_thunk_p #ifdef FUNCTION_ARG_CALLEE_COPIES || (FUNCTION_ARG_CALLEE_COPIES (*args_so_far, TYPE_MODE (type), type, argpos < n_named_args) @@ -1578,11 +1606,7 @@ load_register_parameters (struct arg_data *args, int num_actuals, { int i, j; -#ifdef LOAD_ARGS_REVERSED - for (i = num_actuals - 1; i >= 0; i--) -#else for (i = 0; i < num_actuals; i++) -#endif { rtx reg = ((flags & ECF_SIBCALL) ? args[i].tail_call_reg : args[i].reg); @@ -2000,6 +2024,34 @@ fix_unsafe_tree (tree t) return t; } + +/* If function value *VALUE was returned at the most significant end of a + register, shift it towards the least significant end and convert it to + TYPE's mode. Return true and update *VALUE if some action was needed. + + TYPE is the type of the function's return value, which is known not + to have mode BLKmode. */ + +static bool +shift_returned_value (tree type, rtx *value) +{ + if (targetm.calls.return_in_msb (type)) + { + HOST_WIDE_INT shift; + + shift = (GET_MODE_BITSIZE (GET_MODE (*value)) + - BITS_PER_UNIT * int_size_in_bytes (type)); + if (shift > 0) + { + *value = expand_binop (GET_MODE (*value), lshr_optab, *value, + GEN_INT (shift), 0, 1, OPTAB_WIDEN); + *value = convert_to_mode (TYPE_MODE (type), *value, 0); + return true; + } + } + return false; +} + /* Generate all the code for a function call and return an rtx for its value. Store the value in TARGET (specified as an rtx) if convenient. @@ -2101,6 +2153,7 @@ expand_call (tree exp, rtx target, int ignore) #endif int initial_highest_arg_in_use = highest_outgoing_arg_in_use; + rtx temp_target = 0; char *initial_stack_usage_map = stack_usage_map; int old_stack_allocated; @@ -2361,15 +2414,16 @@ expand_call (tree exp, rtx target, int ignore) (If no anonymous args follow, the result of list_length is actually one too large. This is harmless.) - If PRETEND_OUTGOING_VARARGS_NAMED is set and STRICT_ARGUMENT_NAMING is - zero, this machine will be able to place unnamed args that were - passed in registers into the stack. So treat all args as named. - This allows the insns emitting for a specific argument list to be - independent of the function declaration. + If targetm.calls.pretend_outgoing_varargs_named() returns + nonzero, and STRICT_ARGUMENT_NAMING is zero, this machine will be + able to place unnamed args that were passed in registers into the + stack. So treat all args as named. This allows the insns + emitting for a specific argument list to be independent of the + function declaration. - If PRETEND_OUTGOING_VARARGS_NAMED is not set, we do not have any - reliable way to pass unnamed args in registers, so we must force - them into memory. */ + If targetm.calls.pretend_outgoing_varargs_named() returns zero, + we do not have any reliable way to pass unnamed args in + registers, so we must force them into memory. */ if ((targetm.calls.strict_argument_naming (&args_so_far) || ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far)) @@ -2394,7 +2448,8 @@ expand_call (tree exp, rtx target, int ignore) n_named_args, actparms, fndecl, &args_so_far, reg_parm_stack_space, &old_stack_level, &old_pending_adj, - &must_preallocate, &flags); + &must_preallocate, &flags, + CALL_FROM_THUNK_P (exp)); if (args_size.var) { @@ -2433,11 +2488,15 @@ expand_call (tree exp, rtx target, int ignore) finished with regular parsing. Which means that some of the machinery we use to generate tail-calls is no longer in place. This is most often true of sjlj-exceptions, which we couldn't - tail-call to anyway. */ + tail-call to anyway. + If current_nesting_level () == 0, we're being called after + the function body has been expanded. This can happen when + setting up trampolines in expand_function_end. */ if (currently_expanding_call++ != 0 || !flag_optimize_sibling_calls || !rtx_equal_function_value_matters + || current_nesting_level () == 0 || any_pending_cleanups () || args_size.var) try_tail_call = try_tail_recursion = 0; @@ -3097,22 +3156,33 @@ expand_call (tree exp, rtx target, int ignore) mark_reg_pointer (temp, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp)))); - /* Construct an "equal form" for the value which mentions all the - arguments in order as well as the function name. */ - for (i = 0; i < num_actuals; i++) - note = gen_rtx_EXPR_LIST (VOIDmode, - args[i].initial_value, note); - note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note); - end_sequence (); - - if (flags & ECF_PURE) - note = gen_rtx_EXPR_LIST (VOIDmode, + if (flag_unsafe_math_optimizations + && fndecl + && DECL_BUILT_IN (fndecl) + && (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRT + || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTF + || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTL)) + note = gen_rtx_fmt_e (SQRT, + GET_MODE (temp), + args[0].initial_value); + else + { + /* Construct an "equal form" for the value which + mentions all the arguments in order as well as + the function name. */ + for (i = 0; i < num_actuals; i++) + note = gen_rtx_EXPR_LIST (VOIDmode, + args[i].initial_value, note); + note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note); + + if (flags & ECF_PURE) + note = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode))), note); - + } emit_libcall_block (insns, temp, valreg, note); valreg = temp; @@ -3215,7 +3285,11 @@ expand_call (tree exp, rtx target, int ignore) The Irix 6 ABI has examples of this. */ else if (GET_CODE (valreg) == PARALLEL) { - if (target == 0) + /* Second condition is added because "target" is freed at the + the end of "pass0" for -O2 when call is made to + expand_end_target_temps (). Its "in_use" flag has been set + to false, so allocate a new temp. */ + if (target == 0 || (pass == 1 && target == temp_target)) { /* This will only be assigned once, so it can be readonly. */ tree nt = build_qualified_type (TREE_TYPE (exp), @@ -3223,6 +3297,7 @@ expand_call (tree exp, rtx target, int ignore) | TYPE_QUAL_CONST)); target = assign_temp (nt, 0, 1, 1); + temp_target = target; preserve_temp_slots (target); } @@ -3259,7 +3334,12 @@ expand_call (tree exp, rtx target, int ignore) sibcall_failure = 1; } else - target = copy_to_reg (valreg); + { + if (shift_returned_value (TREE_TYPE (exp), &valreg)) + sibcall_failure = 1; + + target = copy_to_reg (valreg); + } if (targetm.calls.promote_function_return(funtype)) { @@ -4559,9 +4639,18 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, { /* PUSH_ROUNDING has no effect on us, because emit_push_insn for BLKmode is careful to avoid it. */ - excess = (arg->locate.size.constant - - int_size_in_bytes (TREE_TYPE (pval)) - + partial * UNITS_PER_WORD); + if (reg && GET_CODE (reg) == PARALLEL) + { + /* Use the size of the elt to compute excess. */ + rtx elt = XEXP (XVECEXP (reg, 0, 0), 0); + excess = (arg->locate.size.constant + - int_size_in_bytes (TREE_TYPE (pval)) + + partial * GET_MODE_SIZE (GET_MODE (elt))); + } + else + excess = (arg->locate.size.constant + - int_size_in_bytes (TREE_TYPE (pval)) + + partial * UNITS_PER_WORD); size_rtx = expand_expr (size_in_bytes (TREE_TYPE (pval)), NULL_RTX, TYPE_MODE (sizetype), 0); } diff --git a/gcc/cfg.c b/gcc/cfg.c index ded0e3263fb..96dac25d0ac 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -111,6 +111,7 @@ struct basic_block_def entry_exit_blocks[2] EXIT_BLOCK_PTR, /* next_bb */ 0, /* loop_depth */ NULL, /* loop_father */ + { NULL, NULL }, /* dom */ 0, /* count */ 0, /* frequency */ 0, /* flags */ @@ -133,6 +134,7 @@ struct basic_block_def entry_exit_blocks[2] NULL, /* next_bb */ 0, /* loop_depth */ NULL, /* loop_father */ + { NULL, NULL }, /* dom */ 0, /* count */ 0, /* frequency */ 0, /* flags */ @@ -543,7 +545,7 @@ dump_flow_info (FILE *file) gcov_type lsum; fprintf (file, "\nBasic block %d: first insn %d, last %d, ", - bb->index, INSN_UID (bb->head), INSN_UID (bb->end)); + bb->index, INSN_UID (BB_HEAD (bb)), INSN_UID (BB_END (bb))); fprintf (file, "prev %d, next %d, ", bb->prev_bb->index, bb->next_bb->index); fprintf (file, "loop_depth %d, count ", bb->loop_depth); diff --git a/gcc/cfganal.c b/gcc/cfganal.c index e45b48465e2..91297e53daa 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -89,7 +89,7 @@ forwarder_block_p (basic_block bb) || !bb->succ || bb->succ->succ_next) return false; - for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) if (INSN_P (insn) && flow_active_insn_p (insn)) return false; @@ -103,8 +103,8 @@ forwarder_block_p (basic_block bb) bool can_fallthru (basic_block src, basic_block target) { - rtx insn = src->end; - rtx insn2 = target == EXIT_BLOCK_PTR ? NULL : target->head; + rtx insn = BB_END (src); + rtx insn2 = target == EXIT_BLOCK_PTR ? NULL : BB_HEAD (target); if (src->next_bb != target) return 0; @@ -232,11 +232,11 @@ set_edge_can_fallthru_flag (void) CAN_FALLTHRU edges. */ if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next) continue; - if (!any_condjump_p (bb->end)) + if (!any_condjump_p (BB_END (bb))) continue; - if (!invert_jump (bb->end, JUMP_LABEL (bb->end), 0)) + if (!invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0)) continue; - invert_jump (bb->end, JUMP_LABEL (bb->end), 0); + invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0); bb->succ->flags |= EDGE_CAN_FALLTHRU; bb->succ->succ_next->flags |= EDGE_CAN_FALLTHRU; } @@ -305,10 +305,10 @@ flow_call_edges_add (sbitmap blocks) if (check_last_block) { basic_block bb = EXIT_BLOCK_PTR->prev_bb; - rtx insn = bb->end; + rtx insn = BB_END (bb); /* Back up past insns that must be kept in the same block as a call. */ - while (insn != bb->head + while (insn != BB_HEAD (bb) && keep_with_call_p (insn)) insn = PREV_INSN (insn); @@ -342,7 +342,7 @@ flow_call_edges_add (sbitmap blocks) if (blocks && !TEST_BIT (blocks, i)) continue; - for (insn = bb->end; ; insn = prev_insn) + for (insn = BB_END (bb); ; insn = prev_insn) { prev_insn = PREV_INSN (insn); if (need_fake_edge_p (insn)) @@ -353,7 +353,7 @@ flow_call_edges_add (sbitmap blocks) /* Don't split the block between a call and an insn that should remain in the same block as the call. */ if (GET_CODE (insn) == CALL_INSN) - while (split_at_insn != bb->end + while (split_at_insn != BB_END (bb) && keep_with_call_p (NEXT_INSN (split_at_insn))) split_at_insn = NEXT_INSN (split_at_insn); @@ -363,7 +363,7 @@ flow_call_edges_add (sbitmap blocks) cause us to mark that edge as fake and remove it later. */ #ifdef ENABLE_CHECKING - if (split_at_insn == bb->end) + if (split_at_insn == BB_END (bb)) for (e = bb->succ; e; e = e->succ_next) if (e->dest == EXIT_BLOCK_PTR) abort (); @@ -371,7 +371,7 @@ flow_call_edges_add (sbitmap blocks) /* Note that the following may create a new basic block and renumber the existing basic blocks. */ - if (split_at_insn != bb->end) + if (split_at_insn != BB_END (bb)) { e = split_block (bb, split_at_insn); if (e) @@ -381,7 +381,7 @@ flow_call_edges_add (sbitmap blocks) make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE); } - if (insn == bb->head) + if (insn == BB_HEAD (bb)) break; } } diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index 1fb43605972..5805e587ec8 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -303,13 +303,14 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p enum rtx_code code; int force_fallthru = 0; - if (GET_CODE (bb->head) == CODE_LABEL && LABEL_ALT_ENTRY_P (bb->head)) + if (GET_CODE (BB_HEAD (bb)) == CODE_LABEL + && LABEL_ALT_ENTRY_P (BB_HEAD (bb))) cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0); /* Examine the last instruction of the block, and discover the ways we can leave the block. */ - insn = bb->end; + insn = BB_END (bb); code = GET_CODE (insn); /* A branch. */ @@ -432,7 +433,7 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU); else if (bb->next_bb != EXIT_BLOCK_PTR) { - if (force_fallthru || insn == bb->next_bb->head) + if (force_fallthru || insn == BB_HEAD (bb->next_bb)) cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU); } } @@ -649,12 +650,12 @@ enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT}; static void find_bb_boundaries (basic_block bb) { - rtx insn = bb->head; - rtx end = bb->end; + rtx insn = BB_HEAD (bb); + rtx end = BB_END (bb); rtx flow_transfer_insn = NULL_RTX; edge fallthru = NULL; - if (insn == bb->end) + if (insn == BB_END (bb)) return; if (GET_CODE (insn) == CODE_LABEL) @@ -670,7 +671,7 @@ find_bb_boundaries (basic_block bb) { fallthru = split_block (bb, PREV_INSN (insn)); if (flow_transfer_insn) - bb->end = flow_transfer_insn; + BB_END (bb) = flow_transfer_insn; bb = fallthru->dest; remove_edge (fallthru); @@ -684,7 +685,7 @@ find_bb_boundaries (basic_block bb) if (flow_transfer_insn && inside_basic_block_p (insn)) { fallthru = split_block (bb, PREV_INSN (insn)); - bb->end = flow_transfer_insn; + BB_END (bb) = flow_transfer_insn; bb = fallthru->dest; remove_edge (fallthru); flow_transfer_insn = NULL_RTX; @@ -701,7 +702,7 @@ find_bb_boundaries (basic_block bb) return and barrier, or possibly other sequence not behaving like ordinary jump, we need to take care and move basic block boundary. */ if (flow_transfer_insn) - bb->end = flow_transfer_insn; + BB_END (bb) = flow_transfer_insn; /* We've possibly replaced the conditional jump by conditional jump followed by cleanup at fallthru edge, so the outgoing edges may @@ -719,7 +720,7 @@ compute_outgoing_frequencies (basic_block b) if (b->succ && b->succ->succ_next && !b->succ->succ_next->succ_next) { - rtx note = find_reg_note (b->end, REG_BR_PROB, NULL); + rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL); int probability; if (!note) diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 32a9e653228..056a32f4faa 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -129,7 +129,7 @@ try_simplify_condjump (basic_block cbranch_block) /* Verify that we've got a normal conditional branch at the end of the block. */ - cbranch_insn = cbranch_block->end; + cbranch_insn = BB_END (cbranch_block); if (!any_condjump_p (cbranch_insn)) return false; @@ -159,7 +159,7 @@ try_simplify_condjump (basic_block cbranch_block) if (rtl_dump_file) fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n", - INSN_UID (cbranch_insn), INSN_UID (jump_block->end)); + INSN_UID (cbranch_insn), INSN_UID (BB_END (jump_block))); /* Success. Update the CFG to match. Note that after this point the edge variable names appear backwards; the redirection is done @@ -172,19 +172,19 @@ try_simplify_condjump (basic_block cbranch_block) cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU; update_br_prob_note (cbranch_block); - end = jump_block->end; + end = BB_END (jump_block); /* Deleting a block may produce unreachable code warning even when we are - not deleting anything live. Supress it by moving all the line number + not deleting anything live. Suppress it by moving all the line number notes out of the block. */ - for (insn = jump_block->head; insn != NEXT_INSN (jump_block->end); + for (insn = BB_HEAD (jump_block); insn != NEXT_INSN (BB_END (jump_block)); insn = next) { next = NEXT_INSN (insn); if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) { - if (insn == jump_block->end) + if (insn == BB_END (jump_block)) { - jump_block->end = PREV_INSN (insn); + BB_END (jump_block) = PREV_INSN (insn); if (insn == end) break; } @@ -300,17 +300,17 @@ thread_jump (int mode, edge e, basic_block b) } /* Second branch must end with onlyjump, as we will eliminate the jump. */ - if (!any_condjump_p (e->src->end)) + if (!any_condjump_p (BB_END (e->src))) return NULL; - if (!any_condjump_p (b->end) || !onlyjump_p (b->end)) + if (!any_condjump_p (BB_END (b)) || !onlyjump_p (BB_END (b))) { BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); return NULL; } - set1 = pc_set (e->src->end); - set2 = pc_set (b->end); + set1 = pc_set (BB_END (e->src)); + set2 = pc_set (BB_END (b)); if (((e->flags & EDGE_FALLTHRU) != 0) != (XEXP (SET_SRC (set1), 1) == pc_rtx)) reverse1 = true; @@ -318,12 +318,12 @@ thread_jump (int mode, edge e, basic_block b) cond1 = XEXP (SET_SRC (set1), 0); cond2 = XEXP (SET_SRC (set2), 0); if (reverse1) - code1 = reversed_comparison_code (cond1, e->src->end); + code1 = reversed_comparison_code (cond1, BB_END (e->src)); else code1 = GET_CODE (cond1); code2 = GET_CODE (cond2); - reversed_code2 = reversed_comparison_code (cond2, b->end); + reversed_code2 = reversed_comparison_code (cond2, BB_END (b)); if (!comparison_dominates_p (code1, code2) && !comparison_dominates_p (code1, reversed_code2)) @@ -339,7 +339,7 @@ thread_jump (int mode, edge e, basic_block b) /* Short circuit cases where block B contains some side effects, as we can't safely bypass it. */ - for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end); + for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b)); insn = NEXT_INSN (insn)) if (INSN_P (insn) && side_effects_p (PATTERN (insn))) { @@ -350,7 +350,7 @@ thread_jump (int mode, edge e, basic_block b) cselib_init (); /* First process all values computed in the source basic block. */ - for (insn = NEXT_INSN (e->src->head); insn != NEXT_INSN (e->src->end); + for (insn = NEXT_INSN (BB_HEAD (e->src)); insn != NEXT_INSN (BB_END (e->src)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) cselib_process_insn (insn); @@ -362,7 +362,7 @@ thread_jump (int mode, edge e, basic_block b) processing as if it were same basic block. Our goal is to prove that whole block is an NOOP. */ - for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end) && !failed; + for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b)) && !failed; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) @@ -509,7 +509,7 @@ try_forward_edges (int mode, basic_block b) if ((mode & CLEANUP_PRE_LOOP) && optimize) { rtx insn = (target->succ->flags & EDGE_FALLTHRU - ? target->head : prev_nonnote_insn (target->end)); + ? BB_HEAD (target) : prev_nonnote_insn (BB_END (target))); if (GET_CODE (insn) != NOTE) insn = NEXT_INSN (insn); @@ -527,7 +527,7 @@ try_forward_edges (int mode, basic_block b) at this time; it can mess up the loop optimizer's recognition of some patterns. */ - insn = PREV_INSN (target->head); + insn = PREV_INSN (BB_HEAD (target)); if (insn && GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END) break; @@ -696,7 +696,7 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b) { rtx barrier; - barrier = next_nonnote_insn (a->end); + barrier = next_nonnote_insn (BB_END (a)); if (GET_CODE (barrier) != BARRIER) abort (); delete_insn (barrier); @@ -708,12 +708,12 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b) and adjust the block trees appropriately. Even better would be to have a tighter connection between block trees and rtl so that this is not necessary. */ - if (squeeze_notes (&a->head, &a->end)) + if (squeeze_notes (&BB_HEAD (a), &BB_END (a))) abort (); /* Scramble the insn chain. */ - if (a->end != PREV_INSN (b->head)) - reorder_insns_nobb (a->head, a->end, PREV_INSN (b->head)); + if (BB_END (a) != PREV_INSN (BB_HEAD (b))) + reorder_insns_nobb (BB_HEAD (a), BB_END (a), PREV_INSN (BB_HEAD (b))); a->flags |= BB_DIRTY; if (rtl_dump_file) @@ -739,18 +739,18 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) rtx barrier, real_b_end; rtx label, table; - real_b_end = b->end; + real_b_end = BB_END (b); /* If there is a jump table following block B temporarily add the jump table to block B so that it will also be moved to the correct location. */ - if (tablejump_p (b->end, &label, &table) - && prev_active_insn (label) == b->end) + if (tablejump_p (BB_END (b), &label, &table) + && prev_active_insn (label) == BB_END (b)) { - b->end = table; + BB_END (b) = table; } /* There had better have been a barrier there. Delete it. */ - barrier = NEXT_INSN (b->end); + barrier = NEXT_INSN (BB_END (b)); if (barrier && GET_CODE (barrier) == BARRIER) delete_insn (barrier); @@ -761,14 +761,14 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) and adjust the block trees appropriately. Even better would be to have a tighter connection between block trees and rtl so that this is not necessary. */ - if (squeeze_notes (&b->head, &b->end)) + if (squeeze_notes (&BB_HEAD (b), &BB_END (b))) abort (); /* Scramble the insn chain. */ - reorder_insns_nobb (b->head, b->end, a->end); + reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a)); /* Restore the real end of b. */ - b->end = real_b_end; + BB_END (b) = real_b_end; if (rtl_dump_file) fprintf (rtl_dump_file, "Moved block %d after %d and merged.\n", @@ -799,8 +799,8 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) that would make optimize_sibling_and_tail_recursive_calls more complex for no gain. */ if ((mode & CLEANUP_PRE_SIBCALL) - && GET_CODE (c->head) == CODE_LABEL - && tail_recursion_label_p (c->head)) + && GET_CODE (BB_HEAD (c)) == CODE_LABEL + && tail_recursion_label_p (BB_HEAD (c))) return NULL; /* If B has a fallthru edge to C, no need to move anything. */ @@ -1010,7 +1010,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, /* Skip simple jumps at the end of the blocks. Complex jumps still need to be compared for equivalence, which we'll do below. */ - i1 = bb1->end; + i1 = BB_END (bb1); last1 = afterlast1 = last2 = afterlast2 = NULL_RTX; if (onlyjump_p (i1) || (returnjump_p (i1) && !side_effects_p (PATTERN (i1)))) @@ -1019,7 +1019,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, i1 = PREV_INSN (i1); } - i2 = bb2->end; + i2 = BB_END (bb2); if (onlyjump_p (i2) || (returnjump_p (i2) && !side_effects_p (PATTERN (i2)))) { @@ -1033,13 +1033,13 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, while (true) { /* Ignore notes. */ - while (!INSN_P (i1) && i1 != bb1->head) + while (!INSN_P (i1) && i1 != BB_HEAD (bb1)) i1 = PREV_INSN (i1); - while (!INSN_P (i2) && i2 != bb2->head) + while (!INSN_P (i2) && i2 != BB_HEAD (bb2)) i2 = PREV_INSN (i2); - if (i1 == bb1->head || i2 == bb2->head) + if (i1 == BB_HEAD (bb1) || i2 == BB_HEAD (bb2)) break; if (!insns_match_p (mode, i1, i2)) @@ -1085,16 +1085,16 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, Two, it keeps line number notes as matched as may be. */ if (ninsns) { - while (last1 != bb1->head && !INSN_P (PREV_INSN (last1))) + while (last1 != BB_HEAD (bb1) && !INSN_P (PREV_INSN (last1))) last1 = PREV_INSN (last1); - if (last1 != bb1->head && GET_CODE (PREV_INSN (last1)) == CODE_LABEL) + if (last1 != BB_HEAD (bb1) && GET_CODE (PREV_INSN (last1)) == CODE_LABEL) last1 = PREV_INSN (last1); - while (last2 != bb2->head && !INSN_P (PREV_INSN (last2))) + while (last2 != BB_HEAD (bb2) && !INSN_P (PREV_INSN (last2))) last2 = PREV_INSN (last2); - if (last2 != bb2->head && GET_CODE (PREV_INSN (last2)) == CODE_LABEL) + if (last2 != BB_HEAD (bb2) && GET_CODE (PREV_INSN (last2)) == CODE_LABEL) last2 = PREV_INSN (last2); *f1 = last1; @@ -1121,18 +1121,18 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) unconditional jump, or a fake edge to exit. */ if (bb1->succ && !bb1->succ->succ_next && (bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0 - && (GET_CODE (bb1->end) != JUMP_INSN || simplejump_p (bb1->end))) + && (GET_CODE (BB_END (bb1)) != JUMP_INSN || simplejump_p (BB_END (bb1)))) return (bb2->succ && !bb2->succ->succ_next && (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0 - && (GET_CODE (bb2->end) != JUMP_INSN || simplejump_p (bb2->end))); + && (GET_CODE (BB_END (bb2)) != JUMP_INSN || simplejump_p (BB_END (bb2)))); /* Match conditional jumps - this may get tricky when fallthru and branch edges are crossed. */ if (bb1->succ && bb1->succ->succ_next && !bb1->succ->succ_next->succ_next - && any_condjump_p (bb1->end) - && onlyjump_p (bb1->end)) + && any_condjump_p (BB_END (bb1)) + && onlyjump_p (BB_END (bb1))) { edge b1, f1, b2, f2; bool reverse, match; @@ -1142,8 +1142,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) if (!bb2->succ || !bb2->succ->succ_next || bb2->succ->succ_next->succ_next - || !any_condjump_p (bb2->end) - || !onlyjump_p (bb2->end)) + || !any_condjump_p (BB_END (bb2)) + || !onlyjump_p (BB_END (bb2))) return false; b1 = BRANCH_EDGE (bb1); @@ -1175,8 +1175,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) else return false; - set1 = pc_set (bb1->end); - set2 = pc_set (bb2->end); + set1 = pc_set (BB_END (bb1)); + set2 = pc_set (BB_END (bb2)); if ((XEXP (SET_SRC (set1), 1) == pc_rtx) != (XEXP (SET_SRC (set2), 1) == pc_rtx)) reverse = !reverse; @@ -1185,7 +1185,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) cond2 = XEXP (SET_SRC (set2), 0); code1 = GET_CODE (cond1); if (reverse) - code2 = reversed_comparison_code (cond2, bb2->end); + code2 = reversed_comparison_code (cond2, BB_END (bb2)); else code2 = GET_CODE (cond2); @@ -1250,8 +1250,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) rtx label1, label2; rtx table1, table2; - if (tablejump_p (bb1->end, &label1, &table1) - && tablejump_p (bb2->end, &label2, &table2) + if (tablejump_p (BB_END (bb1), &label1, &table1) + && tablejump_p (BB_END (bb2), &label2, &table2) && GET_CODE (PATTERN (table1)) == GET_CODE (PATTERN (table2))) { /* The labels should never be the same rtx. If they really are same @@ -1261,7 +1261,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* If LABEL2 is referenced in BB1->END do not do anything because we would loose information when replacing LABEL1 by LABEL2 and then LABEL2 by LABEL1 in BB1->END. */ - if (label1 != label2 && !rtx_referenced_p (label2, bb1->end)) + if (label1 != label2 && !rtx_referenced_p (label2, BB_END (bb1))) { /* Set IDENTICAL to true when the tables are identical. */ bool identical = false; @@ -1296,9 +1296,9 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) rr.r1 = label1; rr.r2 = label2; rr.update_label_nuses = false; - for_each_rtx (&bb1->end, replace_label, &rr); + for_each_rtx (&BB_END (bb1), replace_label, &rr); - match = insns_match_p (mode, bb1->end, bb2->end); + match = insns_match_p (mode, BB_END (bb1), BB_END (bb2)); if (rtl_dump_file && match) fprintf (rtl_dump_file, "Tablejumps in bb %i and %i match.\n", @@ -1309,7 +1309,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) from the instruction is deleted too. */ rr.r1 = label2; rr.r2 = label1; - for_each_rtx (&bb1->end, replace_label, &rr); + for_each_rtx (&BB_END (bb1), replace_label, &rr); return match; } @@ -1321,7 +1321,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* First ensure that the instructions match. There may be many outgoing edges so this test is generally cheaper. */ - if (!insns_match_p (mode, bb1->end, bb2->end)) + if (!insns_match_p (mode, BB_END (bb1), BB_END (bb2))) return false; /* Search the outgoing edges, ensure that the counts do match, find possible @@ -1362,8 +1362,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* Ensure the same EH region. */ { - rtx n1 = find_reg_note (bb1->end, REG_EH_REGION, 0); - rtx n2 = find_reg_note (bb2->end, REG_EH_REGION, 0); + rtx n1 = find_reg_note (BB_END (bb1), REG_EH_REGION, 0); + rtx n2 = find_reg_note (BB_END (bb2), REG_EH_REGION, 0); if (!n1 && n2) return false; @@ -1443,8 +1443,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) rtx label1, label2; rtx table1, table2; - if (tablejump_p (src1->end, &label1, &table1) - && tablejump_p (src2->end, &label2, &table2) + if (tablejump_p (BB_END (src1), &label1, &table1) + && tablejump_p (BB_END (src2), &label2, &table2) && label1 != label2) { replace_label_data rr; @@ -1459,7 +1459,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) /* Do not replace the label in SRC1->END because when deleting a block whose end is a tablejump, the tablejump referenced from the instruction is deleted too. */ - if (insn != src1->end) + if (insn != BB_END (src1)) for_each_rtx (&insn, replace_label, &rr); } } @@ -1467,7 +1467,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) #endif /* Avoid splitting if possible. */ - if (newpos2 == src2->head) + if (newpos2 == BB_HEAD (src2)) redirect_to = src2; else { @@ -1716,9 +1716,9 @@ try_optimize_cfg (int mode) if (b->pred->pred_next == NULL && (b->pred->flags & EDGE_FALLTHRU) && !(b->pred->flags & EDGE_COMPLEX) - && GET_CODE (b->head) == CODE_LABEL + && GET_CODE (BB_HEAD (b)) == CODE_LABEL && (!(mode & CLEANUP_PRE_SIBCALL) - || !tail_recursion_label_p (b->head)) + || !tail_recursion_label_p (BB_HEAD (b))) /* If the previous block ends with a branch to this block, we can't delete the label. Normally this is a condjump that is yet to be simplified, but @@ -1726,21 +1726,21 @@ try_optimize_cfg (int mode) some element going to the same place as the default (fallthru). */ && (b->pred->src == ENTRY_BLOCK_PTR - || GET_CODE (b->pred->src->end) != JUMP_INSN - || ! label_is_jump_target_p (b->head, - b->pred->src->end))) + || GET_CODE (BB_END (b->pred->src)) != JUMP_INSN + || ! label_is_jump_target_p (BB_HEAD (b), + BB_END (b->pred->src)))) { - rtx label = b->head; + rtx label = BB_HEAD (b); delete_insn_chain (label, label); /* In the case label is undeletable, move it after the BASIC_BLOCK note. */ - if (NOTE_LINE_NUMBER (b->head) == NOTE_INSN_DELETED_LABEL) + if (NOTE_LINE_NUMBER (BB_HEAD (b)) == NOTE_INSN_DELETED_LABEL) { - rtx bb_note = NEXT_INSN (b->head); + rtx bb_note = NEXT_INSN (BB_HEAD (b)); reorder_insns_nobb (label, label, bb_note); - b->head = bb_note; + BB_HEAD (b) = bb_note; } if (rtl_dump_file) fprintf (rtl_dump_file, "Deleted label in block %i.\n", @@ -1751,7 +1751,7 @@ try_optimize_cfg (int mode) if (!(mode & CLEANUP_CFGLAYOUT) && b->pred->pred_next == NULL && (b->pred->flags & EDGE_FALLTHRU) - && GET_CODE (b->head) != CODE_LABEL + && GET_CODE (BB_HEAD (b)) != CODE_LABEL && FORWARDER_BLOCK_P (b) /* Note that forwarder_block_p true ensures that there is a successor for this block. */ @@ -1793,10 +1793,10 @@ try_optimize_cfg (int mode) else if (!(mode & CLEANUP_CFGLAYOUT) /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (b->end) != JUMP_INSN + && (GET_CODE (BB_END (b)) != JUMP_INSN || (flow2_completed - ? simplejump_p (b->end) - : onlyjump_p (b->end))) + ? simplejump_p (BB_END (b)) + : onlyjump_p (BB_END (b)))) && (next = merge_blocks_move (s, b, c, mode))) { b = next; @@ -1818,7 +1818,7 @@ try_optimize_cfg (int mode) if (b->succ && ! b->succ->succ_next && b->succ->dest != EXIT_BLOCK_PTR - && onlyjump_p (b->end) + && onlyjump_p (BB_END (b)) && redirect_edge_and_branch (b->succ, b->succ->dest)) { update_forwarder_flag (b); diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h index 37457deff8b..5ef3b1f5480 100644 --- a/gcc/cfghooks.h +++ b/gcc/cfghooks.h @@ -31,7 +31,7 @@ struct cfg_hooks /* Basic CFG manipulation. */ - /* Return new basic block */ + /* Return new basic block. */ basic_block (*create_basic_block) (void *head, void *end, basic_block after); /* Redirect edge E to the given basic block B and update underlying program diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 7c7600af9ae..15ec0547451 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -89,9 +89,9 @@ skip_insns_after_block (basic_block bb) next_head = NULL_RTX; if (bb->next_bb != EXIT_BLOCK_PTR) - next_head = bb->next_bb->head; + next_head = BB_HEAD (bb->next_bb); - for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)) != 0; ) + for (last_insn = insn = BB_END (bb); (insn = NEXT_INSN (insn)) != 0; ) { if (insn == next_head) break; @@ -148,7 +148,7 @@ skip_insns_after_block (basic_block bb) created by removing the basic block originally following NOTE_INSN_LOOP_BEG. In such case reorder the notes. */ - for (insn = last_insn; insn != bb->end; insn = prev) + for (insn = last_insn; insn != BB_END (bb); insn = prev) { prev = PREV_INSN (insn); if (GET_CODE (insn) == NOTE) @@ -172,7 +172,7 @@ skip_insns_after_block (basic_block bb) static rtx label_for_bb (basic_block bb) { - rtx label = bb->head; + rtx label = BB_HEAD (bb); if (GET_CODE (label) != CODE_LABEL) { @@ -214,13 +214,13 @@ record_effective_endpoints (void) { rtx end; - if (PREV_INSN (bb->head) && next_insn != bb->head) + if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb)) bb->rbi->header = unlink_insn_chain (next_insn, - PREV_INSN (bb->head)); + PREV_INSN (BB_HEAD (bb))); end = skip_insns_after_block (bb); - if (NEXT_INSN (bb->end) && bb->end != end) - bb->rbi->footer = unlink_insn_chain (NEXT_INSN (bb->end), end); - next_insn = NEXT_INSN (bb->end); + if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end) + bb->rbi->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end); + next_insn = NEXT_INSN (BB_END (bb)); } cfg_layout_function_footer = next_insn; @@ -598,11 +598,11 @@ fixup_reorder_chain (void) insn = NEXT_INSN (insn); } if (insn) - NEXT_INSN (insn) = bb->head; + NEXT_INSN (insn) = BB_HEAD (bb); else - set_first_insn (bb->head); - PREV_INSN (bb->head) = insn; - insn = bb->end; + set_first_insn (BB_HEAD (bb)); + PREV_INSN (BB_HEAD (bb)) = insn; + insn = BB_END (bb); if (bb->rbi->footer) { NEXT_INSN (insn) = bb->rbi->footer; @@ -649,7 +649,7 @@ fixup_reorder_chain (void) else if (! (e->flags & EDGE_EH)) e_taken = e; - bb_end_insn = bb->end; + bb_end_insn = BB_END (bb); if (GET_CODE (bb_end_insn) == JUMP_INSN) { if (any_condjump_p (bb_end_insn)) @@ -675,9 +675,9 @@ fixup_reorder_chain (void) e_fake = unchecked_make_edge (bb, e_fall->dest, 0); - if (!redirect_jump (bb->end, block_label (bb), 0)) + if (!redirect_jump (BB_END (bb), block_label (bb), 0)) abort (); - note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX); + note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX); if (note) { int prob = INTVAL (XEXP (note, 0)); @@ -784,7 +784,7 @@ fixup_reorder_chain (void) if (bb->rbi->original) fprintf (rtl_dump_file, "duplicate of %i ", bb->rbi->original->index); - else if (forwarder_block_p (bb) && GET_CODE (bb->head) != CODE_LABEL) + else if (forwarder_block_p (bb) && GET_CODE (BB_HEAD (bb)) != CODE_LABEL) fprintf (rtl_dump_file, "compensation "); else fprintf (rtl_dump_file, "bb %i ", bb->index); @@ -896,18 +896,18 @@ cfg_layout_can_duplicate_bb_p (basic_block bb) /* Do not attempt to duplicate tablejumps, as we need to unshare the dispatch table. This is difficult to do, as the instructions computing jump destination may be hoisted outside the basic block. */ - if (tablejump_p (bb->end, NULL, NULL)) + if (tablejump_p (BB_END (bb), NULL, NULL)) return false; /* Do not duplicate blocks containing insns that can't be copied. */ if (targetm.cannot_copy_insn_p) { - rtx insn = bb->head; + rtx insn = BB_HEAD (bb); while (1) { if (INSN_P (insn) && (*targetm.cannot_copy_insn_p) (insn)) return false; - if (insn == bb->end) + if (insn == BB_END (bb)) break; insn = NEXT_INSN (insn); } @@ -1028,7 +1028,7 @@ cfg_layout_duplicate_bb (basic_block bb, edge e) abort (); #endif - insn = duplicate_insn_chain (bb->head, bb->end); + insn = duplicate_insn_chain (BB_HEAD (bb), BB_END (bb)); new_bb = create_basic_block (insn, insn ? get_last_insn () : NULL, EXIT_BLOCK_PTR->prev_bb); @@ -1253,7 +1253,7 @@ end: void copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, edge *edges, unsigned n_edges, edge *new_edges, - struct loop *base, struct loops *loops) + struct loop *base) { unsigned i, j; basic_block bb, new_bb, dom_bb; @@ -1268,7 +1268,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, bb->rbi->duplicated = 1; /* Add to loop. */ add_bb_to_loop (new_bb, bb->loop_father->copy); - add_to_dominance_info (loops->cfg.dom, new_bb); + add_to_dominance_info (CDI_DOMINATORS, new_bb); /* Possibly set header. */ if (bb->loop_father->header == bb && bb->loop_father != base) new_bb->loop_father->header = new_bb; @@ -1283,11 +1283,11 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, bb = bbs[i]; new_bb = new_bbs[i]; - dom_bb = get_immediate_dominator (loops->cfg.dom, bb); + dom_bb = get_immediate_dominator (CDI_DOMINATORS, bb); if (dom_bb->rbi->duplicated) { dom_bb = dom_bb->rbi->copy; - set_immediate_dominator (loops->cfg.dom, new_bb, dom_bb); + set_immediate_dominator (CDI_DOMINATORS, new_bb, dom_bb); } } diff --git a/gcc/cfglayout.h b/gcc/cfglayout.h index 3258fe8fba5..ca79e26c433 100644 --- a/gcc/cfglayout.h +++ b/gcc/cfglayout.h @@ -43,5 +43,5 @@ extern void insn_locators_initialize (void); extern void reemit_insn_block_notes (void); extern bool can_copy_bbs_p (basic_block *, unsigned); extern void copy_bbs (basic_block *, unsigned, basic_block *, - edge *, unsigned, edge *, struct loop *, struct loops *); -extern void cfg_layout_initialize_rbi (basic_block); + edge *, unsigned, edge *, struct loop *); +extern void cfg_layout_initialize_rbi (basic_block); diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 2f3ff3e4513..43c52f23ddb 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -38,7 +38,7 @@ static void flow_loop_entry_edges_find (struct loop *); static void flow_loop_exit_edges_find (struct loop *); static int flow_loop_nodes_find (basic_block, struct loop *); static void flow_loop_pre_header_scan (struct loop *); -static basic_block flow_loop_pre_header_find (basic_block, dominance_info); +static basic_block flow_loop_pre_header_find (basic_block); static int flow_loop_level_compute (struct loop *); static int flow_loops_level_compute (struct loops *); static void establish_preds (struct loop *); @@ -55,7 +55,7 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file) int i; basic_block bb; - if (! loops->num || ! file || ! loops->cfg.dom) + if (! loops->num || ! file) return; FOR_EACH_BB (bb) @@ -212,9 +212,6 @@ flow_loops_free (struct loops *loops) free (loops->parray); loops->parray = NULL; - if (loops->cfg.dom) - free_dominance_info (loops->cfg.dom); - if (loops->cfg.dfs_order) free (loops->cfg.dfs_order); if (loops->cfg.rc_order) @@ -391,11 +388,10 @@ flow_loop_pre_header_scan (struct loop *loop) } /* Return the block for the pre-header of the loop with header - HEADER where DOM specifies the dominator information. Return NULL if - there is no pre-header. */ + HEADER. Return NULL if there is no pre-header. */ static basic_block -flow_loop_pre_header_find (basic_block header, dominance_info dom) +flow_loop_pre_header_find (basic_block header) { basic_block pre_header; edge e; @@ -408,7 +404,7 @@ flow_loop_pre_header_find (basic_block header, dominance_info dom) basic_block node = e->src; if (node != ENTRY_BLOCK_PTR - && ! dominated_by_p (dom, node, header)) + && ! dominated_by_p (CDI_DOMINATORS, node, header)) { if (pre_header == NULL) pre_header = node; @@ -522,7 +518,7 @@ flow_loops_level_compute (struct loops *loops) about it specified by FLAGS. */ int -flow_loop_scan (struct loops *loops, struct loop *loop, int flags) +flow_loop_scan (struct loop *loop, int flags) { if (flags & LOOP_ENTRY_EDGES) { @@ -541,8 +537,7 @@ flow_loop_scan (struct loops *loops, struct loop *loop, int flags) if (flags & LOOP_PRE_HEADER) { /* Look to see if the loop has a pre-header node. */ - loop->pre_header - = flow_loop_pre_header_find (loop->header, loops->cfg.dom); + loop->pre_header = flow_loop_pre_header_find (loop->header); /* Find the blocks within the extended basic block of the loop pre-header. */ @@ -588,7 +583,7 @@ make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch, insn = PREV_INSN (first_insn_after_basic_block_note (bb)); /* For empty block split_block will return NULL. */ - if (bb->end == insn) + if (BB_END (bb) == insn) emit_note_after (NOTE_INSN_DELETED, insn); fallthru = split_block (bb, insn); @@ -627,12 +622,11 @@ make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch, static void canonicalize_loop_headers (void) { - dominance_info dom; basic_block header; edge e; /* Compute the dominators. */ - dom = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); alloc_aux_for_blocks (sizeof (int)); alloc_aux_for_edges (sizeof (int)); @@ -651,7 +645,7 @@ canonicalize_loop_headers (void) have_abnormal_edge = 1; if (latch != ENTRY_BLOCK_PTR - && dominated_by_p (dom, latch, header)) + && dominated_by_p (CDI_DOMINATORS, latch, header)) { num_latches++; LATCH_EDGE (e) = 1; @@ -663,6 +657,8 @@ canonicalize_loop_headers (void) HEADER_BLOCK (header) = num_latches; } + free_dominance_info (CDI_DOMINATORS); + if (HEADER_BLOCK (ENTRY_BLOCK_PTR->succ->dest)) { basic_block bb; @@ -728,7 +724,6 @@ canonicalize_loop_headers (void) free_aux_for_blocks (); free_aux_for_edges (); - free_dominance_info (dom); } /* Find all the natural loops in the function and save in LOOPS structure and @@ -744,7 +739,6 @@ flow_loops_find (struct loops *loops, int flags) int num_loops; edge e; sbitmap headers; - dominance_info dom; int *dfs_order; int *rc_order; basic_block header; @@ -770,7 +764,7 @@ flow_loops_find (struct loops *loops, int flags) canonicalize_loop_headers (); /* Compute the dominators. */ - dom = loops->cfg.dom = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); /* Count the number of loop headers. This should be the same as the number of natural loops. */ @@ -804,7 +798,8 @@ flow_loops_find (struct loops *loops, int flags) node (header) that dominates all the nodes in the loop. It also has single back edge to the header from a latch node. */ - if (latch != ENTRY_BLOCK_PTR && dominated_by_p (dom, latch, header)) + if (latch != ENTRY_BLOCK_PTR + && dominated_by_p (CDI_DOMINATORS, latch, header)) { /* Shared headers should be eliminated by now. */ if (more_latches) @@ -849,7 +844,6 @@ flow_loops_find (struct loops *loops, int flags) flow_depth_first_order_compute (dfs_order, rc_order); /* Save CFG derived information to avoid recomputing it. */ - loops->cfg.dom = dom; loops->cfg.dfs_order = dfs_order; loops->cfg.rc_order = rc_order; @@ -878,7 +872,7 @@ flow_loops_find (struct loops *loops, int flags) basic_block latch = e->src; if (latch != ENTRY_BLOCK_PTR - && dominated_by_p (dom, latch, header)) + && dominated_by_p (CDI_DOMINATORS, latch, header)) { loop->latch = latch; break; @@ -897,14 +891,13 @@ flow_loops_find (struct loops *loops, int flags) /* Scan the loops. */ for (i = 1; i < num_loops; i++) - flow_loop_scan (loops, loops->parray[i], flags); + flow_loop_scan (loops->parray[i], flags); loops->num = num_loops; } else { - loops->cfg.dom = NULL; - free_dominance_info (dom); + free_dominance_info (CDI_DOMINATORS); } loops->state = 0; diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index e879e522031..4d8c67dd35d 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -42,6 +42,9 @@ struct loop_desc int postincr; /* 1 if increment/decrement is done after loop exit condition. */ rtx stride; /* Value added to VAR in each iteration. */ rtx var; /* Loop control variable. */ + enum machine_mode inner_mode; + /* The mode from that it is extended. */ + enum rtx_code extend; /* With this extend. */ rtx var_alts; /* List of definitions of its initial value. */ rtx lim; /* Expression var is compared with. */ rtx lim_alts; /* List of definitions of its initial value. */ @@ -227,9 +230,6 @@ struct loops /* Information derived from the CFG. */ struct cfg { - /* The bitmap vector of dominators or NULL if not computed. */ - dominance_info dom; - /* The ordering of the basic blocks in a depth first search. */ int *dfs_order; @@ -262,7 +262,7 @@ extern void flow_loops_dump (const struct loops *, FILE *, void (*)(const struct loop *, FILE *, int), int); extern void flow_loop_dump (const struct loop *, FILE *, void (*)(const struct loop *, FILE *, int), int); -extern int flow_loop_scan (struct loops *, struct loop *, int); +extern int flow_loop_scan (struct loop *, int); extern void flow_loop_free (struct loop *); void mark_irreducible_loops (struct loops *); @@ -289,7 +289,7 @@ extern void remove_bb_from_loops (basic_block); extern void cancel_loop (struct loops *, struct loop *); extern void cancel_loop_tree (struct loops *, struct loop *); -extern basic_block loop_split_edge_with (edge, rtx, struct loops *); +extern basic_block loop_split_edge_with (edge, rtx); extern int fix_loop_placement (struct loop *); enum @@ -303,10 +303,9 @@ extern void force_single_succ_latches (struct loops *); extern void verify_loop_structure (struct loops *); /* Loop analysis. */ -extern bool simple_loop_p (struct loops *, struct loop *, struct loop_desc *); +extern bool simple_loop_p (struct loop *, struct loop_desc *); extern rtx count_loop_iterations (struct loop_desc *, rtx, rtx); -extern bool just_once_each_iteration_p (struct loops *,struct loop *, - basic_block); +extern bool just_once_each_iteration_p (struct loop *, basic_block); extern unsigned expected_loop_iterations (const struct loop *); /* Loop manipulation. */ @@ -321,7 +320,7 @@ extern int duplicate_loop_to_header_edge (struct loop *, edge, struct loops *, extern struct loop *loopify (struct loops *, edge, edge, basic_block); extern void unloop (struct loops *, struct loop *); extern bool remove_path (struct loops *, edge); -extern edge split_loop_bb (struct loops *, basic_block, rtx); +extern edge split_loop_bb (basic_block, rtx); /* Loop optimizer initialization. */ extern struct loops *loop_optimizer_init (FILE *); diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index 60c78eaa77a..fb5f8ae6c6b 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -39,23 +39,43 @@ static bool invariant_rtx_wrto_regs_p (rtx, regset); static rtx test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT); static bool constant_iterations (struct loop_desc *, unsigned HOST_WIDE_INT *, bool *); -static bool simple_loop_exit_p (struct loops *, struct loop *, edge, regset, +static bool simple_loop_exit_p (struct loop *, edge, regset, rtx *, struct loop_desc *); -static rtx variable_initial_value (rtx, regset, rtx, rtx *); -static rtx variable_initial_values (edge, rtx); +static rtx variable_initial_value (rtx, regset, rtx, rtx *, enum machine_mode); +static rtx variable_initial_values (edge, rtx, enum machine_mode); static bool simple_condition_p (struct loop *, rtx, regset, struct loop_desc *); -static basic_block simple_increment (struct loops *, struct loop *, rtx *, - struct loop_desc *); +static basic_block simple_increment (struct loop *, rtx *, struct loop_desc *); static rtx count_strange_loop_iterations (rtx, rtx, enum rtx_code, - int, rtx, enum machine_mode); + int, rtx, enum machine_mode, + enum machine_mode); +static unsigned HOST_WIDEST_INT inverse (unsigned HOST_WIDEST_INT, int); +static bool fits_in_mode_p (enum machine_mode mode, rtx expr); + +/* Computes inverse to X modulo (1 << MOD). */ +static unsigned HOST_WIDEST_INT +inverse (unsigned HOST_WIDEST_INT x, int mod) +{ + unsigned HOST_WIDEST_INT mask = + ((unsigned HOST_WIDEST_INT) 1 << (mod - 1) << 1) - 1; + unsigned HOST_WIDEST_INT rslt = 1; + int i; + + for (i = 0; i < mod - 1; i++) + { + rslt = (rslt * x) & mask; + x = (x * x) & mask; + } + + return rslt; +} /* Checks whether BB is executed exactly once in each LOOP iteration. */ bool -just_once_each_iteration_p (struct loops *loops, struct loop *loop, basic_block bb) +just_once_each_iteration_p (struct loop *loop, basic_block bb) { /* It must be executed at least once each iteration. */ - if (!dominated_by_p (loops->cfg.dom, loop->latch, bb)) + if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb)) return false; /* And just once. */ @@ -91,8 +111,8 @@ blocks_invariant_registers (basic_block *bbs, int nbbs, regset regs) for (i = 0; i < max_reg_num (); i++) SET_REGNO_REG_SET (regs, i); for (i = 0; i < nbbs; i++) - for (insn = bbs[i]->head; - insn != NEXT_INSN (bbs[i]->end); + for (insn = BB_HEAD (bbs[i]); + insn != NEXT_INSN (BB_END (bbs[i])); insn = NEXT_INSN (insn)) if (INSN_P (insn)) note_stores (PATTERN (insn), @@ -136,8 +156,8 @@ blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs) regs[i] = NULL; for (i = 0; i < nbbs; i++) - for (insn = bbs[i]->head; - insn != NEXT_INSN (bbs[i]->end); + for (insn = BB_HEAD (bbs[i]); + insn != NEXT_INSN (BB_END (bbs[i])); insn = NEXT_INSN (insn)) { rtx set = single_set (insn); @@ -150,8 +170,8 @@ blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs) data.regs = regs; for (i = 0; i < nbbs; i++) - for (insn = bbs[i]->head; - insn != NEXT_INSN (bbs[i]->end); + for (insn = BB_HEAD (bbs[i]); + insn != NEXT_INSN (BB_END (bbs[i])); insn = NEXT_INSN (insn)) { if (!INSN_P (insn)) @@ -274,11 +294,11 @@ simple_condition_p (struct loop *loop ATTRIBUTE_UNUSED, rtx condition, iteration. Fills in DESC->stride and returns block in that DESC->var is modified. */ static basic_block -simple_increment (struct loops *loops, struct loop *loop, - rtx *simple_increment_regs, struct loop_desc *desc) +simple_increment (struct loop *loop, rtx *simple_increment_regs, + struct loop_desc *desc) { - rtx mod_insn, set, set_src, set_add; - basic_block mod_bb; + rtx mod_insn, mod_insn1, set, set_src, set_add; + basic_block mod_bb, mod_bb1; /* Find insn that modifies var. */ mod_insn = simple_increment_regs[REGNO (desc->var)]; @@ -287,7 +307,7 @@ simple_increment (struct loops *loops, struct loop *loop, mod_bb = BLOCK_FOR_INSN (mod_insn); /* Check that it is executed exactly once each iteration. */ - if (!just_once_each_iteration_p (loops, loop, mod_bb)) + if (!just_once_each_iteration_p (loop, mod_bb)) return NULL; /* mod_insn must be a simple increment/decrement. */ @@ -300,6 +320,71 @@ simple_increment (struct loops *loops, struct loop *loop, set_src = find_reg_equal_equiv_note (mod_insn); if (!set_src) set_src = SET_SRC (set); + + /* Check for variables that iterate in narrower mode. */ + if (GET_CODE (set_src) == SIGN_EXTEND + || GET_CODE (set_src) == ZERO_EXTEND) + { + /* If we are sign extending variable that is then compared unsigned + or vice versa, there is something weird happening. */ + if (desc->cond != EQ + && desc->cond != NE + && ((desc->cond == LEU + || desc->cond == LTU + || desc->cond == GEU + || desc->cond == GTU) + ^ (GET_CODE (set_src) == ZERO_EXTEND))) + return NULL; + + if (GET_CODE (XEXP (set_src, 0)) != SUBREG + || SUBREG_BYTE (XEXP (set_src, 0)) != 0 + || GET_MODE (SUBREG_REG (XEXP (set_src, 0))) != GET_MODE (desc->var)) + return NULL; + + desc->inner_mode = GET_MODE (XEXP (set_src, 0)); + desc->extend = GET_CODE (set_src); + set_src = SUBREG_REG (XEXP (set_src, 0)); + + if (GET_CODE (set_src) != REG) + return NULL; + + /* Find where the reg is set. */ + mod_insn1 = simple_increment_regs[REGNO (set_src)]; + if (!mod_insn1) + return NULL; + + mod_bb1 = BLOCK_FOR_INSN (mod_insn1); + if (!dominated_by_p (CDI_DOMINATORS, mod_bb, mod_bb1)) + return NULL; + if (mod_bb1 == mod_bb) + { + for (; + mod_insn != PREV_INSN (BB_HEAD (mod_bb)); + mod_insn = PREV_INSN (mod_insn)) + if (mod_insn == mod_insn1) + break; + + if (mod_insn == PREV_INSN (BB_HEAD (mod_bb))) + return NULL; + } + + /* Replace the source with the possible place of increment. */ + set = single_set (mod_insn1); + if (!set) + abort (); + if (!rtx_equal_p (SET_DEST (set), set_src)) + abort (); + + set_src = find_reg_equal_equiv_note (mod_insn1); + if (!set_src) + set_src = SET_SRC (set); + } + else + { + desc->inner_mode = GET_MODE (desc->var); + desc->extend = NIL; + } + if (GET_CODE (set_src) != PLUS) return NULL; if (!rtx_equal_p (XEXP (set_src, 0), desc->var)) @@ -317,18 +402,20 @@ simple_increment (struct loops *loops, struct loop *loop, /* Tries to find initial value of VAR in INSN. This value must be invariant wrto INVARIANT_REGS. If SET_INSN is not NULL, insn in that var is set is - placed here. */ + placed here. INNER_MODE is mode in that induction variable VAR iterates. */ static rtx -variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn) +variable_initial_value (rtx insn, regset invariant_regs, + rtx var, rtx *set_insn, enum machine_mode inner_mode) { basic_block bb; rtx set; + rtx ret = NULL; /* Go back through cfg. */ bb = BLOCK_FOR_INSN (insn); while (1) { - for (; insn != bb->head; insn = PREV_INSN (insn)) + for (; insn != BB_HEAD (bb); insn = PREV_INSN (insn)) { if (INSN_P (insn)) note_stores (PATTERN (insn), @@ -338,7 +425,7 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn) break; } - if (insn != bb->head) + if (insn != BB_HEAD (bb)) { /* We found place where var is set. */ rtx set_dest; @@ -357,8 +444,21 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn) val = XEXP (note, 0); else val = SET_SRC (set); + + /* If we know that the initial value is indeed in range of + the inner mode, record the fact even in case the value itself + is useless. */ + if ((GET_CODE (val) == SIGN_EXTEND + || GET_CODE (val) == ZERO_EXTEND) + && GET_MODE (XEXP (val, 0)) == inner_mode) + ret = gen_rtx_fmt_e (GET_CODE (val), + GET_MODE (var), + gen_rtx_fmt_ei (SUBREG, + inner_mode, + var, 0)); + if (!invariant_rtx_wrto_regs_p (val, invariant_regs)) - return NULL; + return ret; if (set_insn) *set_insn = insn; @@ -370,15 +470,16 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn) return NULL; bb = bb->pred->src; - insn = bb->end; + insn = BB_END (bb); } return NULL; } -/* Returns list of definitions of initial value of VAR at Edge. */ +/* Returns list of definitions of initial value of VAR at edge E. INNER_MODE + is mode in that induction variable VAR really iterates. */ static rtx -variable_initial_values (edge e, rtx var) +variable_initial_values (edge e, rtx var, enum machine_mode inner_mode) { rtx set_insn, list; regset invariant_regs; @@ -394,9 +495,10 @@ variable_initial_values (edge e, rtx var) if (e->src == ENTRY_BLOCK_PTR) return list; - set_insn = e->src->end; + set_insn = BB_END (e->src); while (REG_P (var) - && (var = variable_initial_value (set_insn, invariant_regs, var, &set_insn))) + && (var = variable_initial_value (set_insn, invariant_regs, var, + &set_insn, inner_mode))) list = alloc_EXPR_LIST (0, copy_rtx (var), list); FREE_REG_SET (invariant_regs); @@ -453,18 +555,24 @@ constant_iterations (struct loop_desc *desc, unsigned HOST_WIDE_INT *niter, /* Attempts to determine a number of iterations of a "strange" loop. Its induction variable starts with value INIT, is compared by COND with LIM. If POSTINCR, it is incremented after the test. It is incremented - by STRIDE each iteration and iterates in MODE. + by STRIDE each iteration, has mode MODE but iterates in INNER_MODE. By "strange" we mean loops where induction variable increases in the wrong direction wrto comparison, i.e. for (i = 6; i > 5; i++). */ static rtx count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond, - int postincr, rtx stride, enum machine_mode mode) + int postincr, rtx stride, enum machine_mode mode, + enum machine_mode inner_mode) { rtx rqmt, n_to_wrap, before_wrap, after_wrap; rtx mode_min, mode_max; int size; + /* This could be handled, but it is not important enough to lose time with + it just now. */ + if (mode != inner_mode) + return NULL_RTX; + if (!postincr) init = simplify_gen_binary (PLUS, mode, init, stride); @@ -567,6 +675,28 @@ count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond, return simplify_gen_binary (PLUS, mode, n_to_wrap, const1_rtx); } +/* Checks whether value of EXPR fits into range of MODE. */ +static bool +fits_in_mode_p (enum machine_mode mode, rtx expr) +{ + unsigned HOST_WIDEST_INT val; + int n_bits = 0; + + if (GET_CODE (expr) == CONST_INT) + { + for (val = INTVAL (expr); val; val >>= 1) + n_bits++; + + return n_bits <= GET_MODE_BITSIZE (mode); + } + + if (GET_CODE (expr) == SIGN_EXTEND + || GET_CODE (expr) == ZERO_EXTEND) + return GET_MODE (XEXP (expr, 0)) == mode; + + return false; +} + /* Return RTX expression representing number of iterations of loop as bounded by test described by DESC (in the case loop really has multiple exit edges, fewer iterations may happen in the practice). @@ -584,11 +714,14 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) { enum rtx_code cond = desc->cond; rtx stride = desc->stride; - rtx mod, exp; + rtx mod, exp, ainit, bound; + rtx overflow_check, mx, mxp; + enum machine_mode mode = GET_MODE (desc->var); + unsigned HOST_WIDEST_INT s, size, d; /* Give up on floating point modes and friends. It can be possible to do the job for constant loop bounds, but it is probably not worthwhile. */ - if (!INTEGRAL_MODE_P (GET_MODE (desc->var))) + if (!INTEGRAL_MODE_P (mode)) return NULL; init = copy_rtx (init ? init : desc->var); @@ -598,6 +731,82 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) if (desc->neg) cond = reverse_condition (cond); + if (desc->inner_mode != mode) + { + /* We have a case when the variable in fact iterates in the narrower + mode. This has following consequences: + + For induction variable itself, if !desc->postincr, it does not mean + anything too special, since we know the variable is already in range + of the inner mode when we compare it (so it is just needed to shorten + it into the mode before calculations are done, so that we don't risk + wrong results). More complicated case is when desc->postincr; then + the first two iterations are special (the first one because the value + may be out of range, the second one because after shortening it to the + range it may have absolutely any value), and we do not handle this in + unrolling. So if we aren't able to prove that the initial value is in + the range, we fail in this case. + + Step is just moduled to fit into inner mode. + + If lim is out of range, then either the loop is infinite (and then + we may unroll however we like to), or exits in the first iteration + (this is also ok, since we handle it specially for this case anyway). + So we may safely assume that it fits into the inner mode. */ + + for (ainit = desc->var_alts; ainit; ainit = XEXP (ainit, 1)) + if (fits_in_mode_p (desc->inner_mode, XEXP (ainit, 0))) + break; + + if (!ainit) + { + if (desc->postincr) + return NULL_RTX; + + init = simplify_gen_unary (desc->extend, + mode, + simplify_gen_subreg (desc->inner_mode, + init, + mode, + 0), + desc->inner_mode); + } + + stride = simplify_gen_subreg (desc->inner_mode, stride, mode, 0); + if (stride == const0_rtx) + return NULL_RTX; + } + + /* Prepare condition to verify that we do not risk overflow. */ + if (stride == const1_rtx + || stride == constm1_rtx + || cond == NE + || cond == EQ) + { + /* Overflow at NE conditions does not occur. EQ condition + is weird and is handled in count_strange_loop_iterations. + If stride is 1, overflow may occur only for <= and >= conditions, + and then they are infinite, so it does not bother us. */ + overflow_check = const0_rtx; + } + else + { + if (cond == LT || cond == LTU) + mx = simplify_gen_binary (MINUS, mode, lim, const1_rtx); + else if (cond == GT || cond == GTU) + mx = simplify_gen_binary (PLUS, mode, lim, const1_rtx); + else + mx = lim; + if (mode != desc->inner_mode) + mxp = simplify_gen_subreg (desc->inner_mode, mx, mode, 0); + else + mxp = mx; + mxp = simplify_gen_binary (PLUS, desc->inner_mode, mxp, stride); + if (mode != desc->inner_mode) + mxp = simplify_gen_unary (desc->extend, mode, mxp, desc->inner_mode); + overflow_check = simplify_gen_relational (cond, SImode, mode, mx, mxp); + } + /* Compute absolute value of the difference of initial and final value. */ if (INTVAL (stride) > 0) { @@ -605,43 +814,57 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) if (cond == EQ || cond == GE || cond == GT || cond == GEU || cond == GTU) return count_strange_loop_iterations (init, lim, cond, desc->postincr, - stride, GET_MODE (desc->var)); - exp = simplify_gen_binary (MINUS, GET_MODE (desc->var), - lim, init); + stride, mode, desc->inner_mode); + exp = simplify_gen_binary (MINUS, mode, lim, init); } else { - /* Bypass nonsensical tests. */ if (cond == EQ || cond == LE || cond == LT || cond == LEU || cond == LTU) return count_strange_loop_iterations (init, lim, cond, desc->postincr, - stride, GET_MODE (desc->var)); - exp = simplify_gen_binary (MINUS, GET_MODE (desc->var), - init, lim); - stride = simplify_gen_unary (NEG, GET_MODE (desc->var), - stride, GET_MODE (desc->var)); + stride, mode, desc->inner_mode); + exp = simplify_gen_binary (MINUS, mode, init, lim); + stride = simplify_gen_unary (NEG, mode, stride, mode); } + /* If there is a risk of overflow (i.e. when we increment value satisfying + a condition, we may again obtain a value satisfying the condition), + fail. */ + if (overflow_check != const0_rtx) + return NULL_RTX; + /* Normalize difference so the value is always first examined and later incremented. */ - if (!desc->postincr) - exp = simplify_gen_binary (MINUS, GET_MODE (desc->var), - exp, stride); + exp = simplify_gen_binary (MINUS, mode, exp, stride); /* Determine delta caused by exit condition. */ switch (cond) { case NE: - /* For NE tests, make sure that the iteration variable won't miss - the final value. If EXP mod STRIDE is not zero, then the - iteration variable will overflow before the loop exits, and we - can not calculate the number of iterations easily. */ - if (stride != const1_rtx - && (simplify_gen_binary (UMOD, GET_MODE (desc->var), exp, stride) - != const0_rtx)) - return NULL; + /* NE tests are easy to handle, because we just perform simple + arithmetics modulo power of 2. Let's use the fact to compute the + number of iterations exactly. We are now in situation when we want to + solve an equation stride * i = c (mod size of inner_mode). + Let nsd (stride, size of mode) = d. If d does not divide c, the + loop is infinite. Otherwise, the number of iterations is + (inverse(s/d) * (c/d)) mod (size of mode/d). */ + size = GET_MODE_BITSIZE (desc->inner_mode); + s = INTVAL (stride); + d = 1; + while (s % 2 != 1) + { + s /= 2; + d *= 2; + size--; + } + bound = GEN_INT (((unsigned HOST_WIDEST_INT) 1 << (size - 1 ) << 1) - 1); + exp = simplify_gen_binary (UDIV, mode, exp, GEN_INT (d)); + exp = simplify_gen_binary (MULT, mode, + exp, GEN_INT (inverse (s, size))); + exp = simplify_gen_binary (AND, mode, exp, bound); break; + case LT: case GT: case LTU: @@ -651,19 +874,18 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) case GE: case LEU: case GEU: - exp = simplify_gen_binary (PLUS, GET_MODE (desc->var), - exp, const1_rtx); + exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx); break; default: abort (); } - if (stride != const1_rtx) + if (cond != NE && stride != const1_rtx) { /* Number of iterations is now (EXP + STRIDE - 1 / STRIDE), but we need to take care for overflows. */ - mod = simplify_gen_binary (UMOD, GET_MODE (desc->var), exp, stride); + mod = simplify_gen_binary (UMOD, mode, exp, stride); /* This is dirty trick. When we can't compute number of iterations to be constant, we simply ignore the possible overflow, as @@ -672,18 +894,15 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) if (GET_CODE (mod) != CONST_INT) { - rtx stridem1 = simplify_gen_binary (PLUS, GET_MODE (desc->var), - stride, constm1_rtx); - exp = simplify_gen_binary (PLUS, GET_MODE (desc->var), - exp, stridem1); - exp = simplify_gen_binary (UDIV, GET_MODE (desc->var), exp, stride); + rtx stridem1 = simplify_gen_binary (PLUS, mode, stride, constm1_rtx); + exp = simplify_gen_binary (PLUS, mode, exp, stridem1); + exp = simplify_gen_binary (UDIV, mode, exp, stride); } else { - exp = simplify_gen_binary (UDIV, GET_MODE (desc->var), exp, stride); + exp = simplify_gen_binary (UDIV, mode, exp, stride); if (mod != const0_rtx) - exp = simplify_gen_binary (PLUS, GET_MODE (desc->var), - exp, const1_rtx); + exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx); } } @@ -742,7 +961,7 @@ test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT iter) description joined to it in in DESC. INVARIANT_REGS and SINGLE_SET_REGS are results of blocks_{invariant,single_set}_regs over BODY. */ static bool -simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge, +simple_loop_exit_p (struct loop *loop, edge exit_edge, regset invariant_regs, rtx *single_set_regs, struct loop_desc *desc) { @@ -759,11 +978,11 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge, return false; /* It must be tested (at least) once during any iteration. */ - if (!dominated_by_p (loops->cfg.dom, loop->latch, exit_bb)) + if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit_bb)) return false; /* It must end in a simple conditional jump. */ - if (!any_condjump_p (exit_bb->end)) + if (!any_condjump_p (BB_END (exit_bb))) return false; ei = exit_bb->succ; @@ -775,7 +994,7 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge, /* Condition must be a simple comparison in that one of operands is register and the other one is invariant. */ - if (!(condition = get_condition (exit_bb->end, NULL, false))) + if (!(condition = get_condition (BB_END (exit_bb), NULL, false))) return false; if (!simple_condition_p (loop, condition, invariant_regs, desc)) @@ -783,17 +1002,17 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge, /* Var must be simply incremented or decremented in exactly one insn that is executed just once every iteration. */ - if (!(mod_bb = simple_increment (loops, loop, single_set_regs, desc))) + if (!(mod_bb = simple_increment (loop, single_set_regs, desc))) return false; /* OK, it is simple loop. Now just fill in remaining info. */ - desc->postincr = !dominated_by_p (loops->cfg.dom, exit_bb, mod_bb); + desc->postincr = !dominated_by_p (CDI_DOMINATORS, exit_bb, mod_bb); desc->neg = !fallthru_out; /* Find initial value of var and alternative values for lim. */ e = loop_preheader_edge (loop); - desc->var_alts = variable_initial_values (e, desc->var); - desc->lim_alts = variable_initial_values (e, desc->lim); + desc->var_alts = variable_initial_values (e, desc->var, desc->inner_mode); + desc->lim_alts = variable_initial_values (e, desc->lim, desc->inner_mode); /* Number of iterations. */ desc->const_iter = @@ -806,7 +1025,7 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge, /* Tests whether LOOP is simple for loop. Returns simple loop description in DESC. */ bool -simple_loop_p (struct loops *loops, struct loop *loop, struct loop_desc *desc) +simple_loop_p (struct loop *loop, struct loop_desc *desc) { unsigned i; basic_block *body; @@ -831,7 +1050,7 @@ simple_loop_p (struct loops *loops, struct loop *loop, struct loop_desc *desc) { for (e = body[i]->succ; e; e = e->succ_next) if (!flow_bb_inside_loop_p (loop, e->dest) - && simple_loop_exit_p (loops, loop, e, + && simple_loop_exit_p (loop, e, invariant_regs, single_set_regs, &act)) { /* Prefer constant iterations; the less the better. */ @@ -1027,7 +1246,7 @@ mark_irreducible_loops (struct loops *loops) : e->dest->index + 1; if (closed[sidx]) { - if (!closed[mri[sidx]]) + if (mri[sidx] != -1 && !closed[mri[sidx]]) { if (mr[sidx] < mr[idx]) { @@ -1103,7 +1322,7 @@ num_loop_insns (struct loop *loop) { bb = bbs[i]; ninsns++; - for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) if (INSN_P (insn)) ninsns++; } @@ -1127,7 +1346,7 @@ average_num_loop_insns (struct loop *loop) bb = bbs[i]; binsns = 1; - for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) if (INSN_P (insn)) binsns++; diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index ca50760f384..86af4a2536b 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -36,9 +36,9 @@ static void copy_loops_to (struct loops *, struct loop **, int, struct loop *); static void loop_redirect_edge (edge, basic_block); static bool loop_delete_branch_edge (edge, int); -static void remove_bbs (dominance_info, basic_block *, int); +static void remove_bbs (basic_block *, int); static bool rpe_enum_p (basic_block, void *); -static int find_path (edge, dominance_info, basic_block **); +static int find_path (edge, basic_block **); static bool alp_enum_p (basic_block, void *); static void add_loop (struct loops *, struct loop *); static void fix_loop_placements (struct loop *); @@ -47,17 +47,15 @@ static void fix_bb_placements (struct loops *, basic_block); static void place_new_loop (struct loops *, struct loop *); static void scale_loop_frequencies (struct loop *, int, int); static void scale_bbs_frequencies (basic_block *, int, int, int); -static basic_block create_preheader (struct loop *, dominance_info, int); +static basic_block create_preheader (struct loop *, int); static void fix_irreducible_loops (basic_block); /* Splits basic block BB after INSN, returns created edge. Updates loops and dominators. */ edge -split_loop_bb (struct loops *loops, basic_block bb, rtx insn) +split_loop_bb (basic_block bb, rtx insn) { edge e; - basic_block *dom_bbs; - int n_dom_bbs, i; /* Split the block. */ e = split_block (bb, insn); @@ -66,42 +64,31 @@ split_loop_bb (struct loops *loops, basic_block bb, rtx insn) add_bb_to_loop (e->dest, e->src->loop_father); /* Fix dominators. */ - add_to_dominance_info (loops->cfg.dom, e->dest); - n_dom_bbs = get_dominated_by (loops->cfg.dom, e->src, &dom_bbs); - for (i = 0; i < n_dom_bbs; i++) - set_immediate_dominator (loops->cfg.dom, dom_bbs[i], e->dest); - free (dom_bbs); - set_immediate_dominator (loops->cfg.dom, e->dest, e->src); + add_to_dominance_info (CDI_DOMINATORS, e->dest); + redirect_immediate_dominators (CDI_DOMINATORS, e->src, e->dest); + set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); return e; } -/* Checks whether basic block BB is dominated by RPE->DOM, where - RPE is passed through DATA. */ -struct rpe_data - { - basic_block dom; - dominance_info doms; - }; - +/* Checks whether basic block BB is dominated by DATA. */ static bool rpe_enum_p (basic_block bb, void *data) { - struct rpe_data *rpe = data; - return dominated_by_p (rpe->doms, bb, rpe->dom); + return dominated_by_p (CDI_DOMINATORS, bb, data); } /* Remove basic blocks BBS from loop structure and dominance info, and delete them afterwards. */ static void -remove_bbs (dominance_info dom, basic_block *bbs, int nbbs) +remove_bbs (basic_block *bbs, int nbbs) { int i; for (i = 0; i < nbbs; i++) { remove_bb_from_loops (bbs[i]); - delete_from_dominance_info (dom, bbs[i]); + delete_from_dominance_info (CDI_DOMINATORS, bbs[i]); delete_block (bbs[i]); } } @@ -113,19 +100,15 @@ remove_bbs (dominance_info dom, basic_block *bbs, int nbbs) alter anything by this function). The number of basic blocks in the path is returned. */ static int -find_path (edge e, dominance_info doms, basic_block **bbs) +find_path (edge e, basic_block **bbs) { - struct rpe_data rpe; - if (e->dest->pred->pred_next) abort (); /* Find bbs in the path. */ - rpe.dom = e->dest; - rpe.doms = doms; *bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); return dfs_enumerate_from (e->dest, 0, rpe_enum_p, *bbs, - n_basic_blocks, &rpe); + n_basic_blocks, e->dest); } /* Fix placement of basic block BB inside loop hierarchy stored in LOOPS -- @@ -353,19 +336,19 @@ remove_path (struct loops *loops, edge e) fix -- when e->dest has exactly one predecessor, this corresponds to blocks dominated by e->dest, if not, split the edge. */ if (e->dest->pred->pred_next) - e = loop_split_edge_with (e, NULL_RTX, loops)->pred; + e = loop_split_edge_with (e, NULL_RTX)->pred; /* It may happen that by removing path we remove one or more loops we belong to. In this case first unloop the loops, then proceed normally. We may assume that e->dest is not a header of any loop, as it now has exactly one predecessor. */ while (e->src->loop_father->outer - && dominated_by_p (loops->cfg.dom, + && dominated_by_p (CDI_DOMINATORS, e->src->loop_father->latch, e->dest)) unloop (loops, e->src->loop_father); /* Identify the path. */ - nrem = find_path (e, loops->cfg.dom, &rem_bbs); + nrem = find_path (e, &rem_bbs); n_bord_bbs = 0; bord_bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); @@ -397,7 +380,7 @@ remove_path (struct loops *loops, edge e) if (rem_bbs[i]->loop_father->header == rem_bbs[i]) cancel_loop_tree (loops, rem_bbs[i]->loop_father); - remove_bbs (loops->cfg.dom, rem_bbs, nrem); + remove_bbs (rem_bbs, nrem); free (rem_bbs); /* Find blocks whose dominators may be affected. */ @@ -405,25 +388,24 @@ remove_path (struct loops *loops, edge e) sbitmap_zero (seen); for (i = 0; i < n_bord_bbs; i++) { - int j, nldom; - basic_block *ldom; + basic_block ldom; - bb = get_immediate_dominator (loops->cfg.dom, bord_bbs[i]); + bb = get_immediate_dominator (CDI_DOMINATORS, bord_bbs[i]); if (TEST_BIT (seen, bb->index)) continue; SET_BIT (seen, bb->index); - nldom = get_dominated_by (loops->cfg.dom, bb, &ldom); - for (j = 0; j < nldom; j++) - if (!dominated_by_p (loops->cfg.dom, from, ldom[j])) - dom_bbs[n_dom_bbs++] = ldom[j]; - free(ldom); + for (ldom = first_dom_son (CDI_DOMINATORS, bb); + ldom; + ldom = next_dom_son (CDI_DOMINATORS, ldom)) + if (!dominated_by_p (CDI_DOMINATORS, from, ldom)) + dom_bbs[n_dom_bbs++] = ldom; } free (seen); /* Recount dominators. */ - iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); free (dom_bbs); /* These blocks have lost some predecessor(s), thus their irreducible @@ -513,7 +495,7 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi basic_block succ_bb = latch_edge->dest; basic_block pred_bb = header_edge->src; basic_block *dom_bbs, *body; - unsigned n_dom_bbs, i, j; + unsigned n_dom_bbs, i; sbitmap seen; struct loop *loop = xcalloc (1, sizeof (struct loop)); struct loop *outer = succ_bb->loop_father->outer; @@ -538,9 +520,9 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi loop_redirect_edge (switch_bb->succ, succ_bb); /* Update dominators. */ - set_immediate_dominator (loops->cfg.dom, switch_bb, pred_bb); - set_immediate_dominator (loops->cfg.dom, loop->header, switch_bb); - set_immediate_dominator (loops->cfg.dom, succ_bb, switch_bb); + set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb); + set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb); + set_immediate_dominator (CDI_DOMINATORS, succ_bb, switch_bb); /* Compute new loop. */ add_loop (loops, loop); @@ -569,20 +551,19 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi for (i = 0; i < loop->num_nodes; i++) { - unsigned nldom; - basic_block *ldom; + basic_block ldom; - nldom = get_dominated_by (loops->cfg.dom, body[i], &ldom); - for (j = 0; j < nldom; j++) - if (!TEST_BIT (seen, ldom[j]->index)) + for (ldom = first_dom_son (CDI_DOMINATORS, body[i]); + ldom; + ldom = next_dom_son (CDI_DOMINATORS, ldom)) + if (!TEST_BIT (seen, ldom->index)) { - SET_BIT (seen, ldom[j]->index); - dom_bbs[n_dom_bbs++] = ldom[j]; + SET_BIT (seen, ldom->index); + dom_bbs[n_dom_bbs++] = ldom; } - free (ldom); } - iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); free (body); free (seen); @@ -788,7 +769,7 @@ loop_delete_branch_edge (edge e, int really_delete) if (src->succ->succ_next->succ_next) return false; /* And it must be just a simple branch. */ - if (!any_condjump_p (src->end)) + if (!any_condjump_p (BB_END (src))) return false; snd = e == src->succ ? src->succ->succ_next : src->succ; @@ -990,7 +971,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, copy_loops_to (loops, orig_loops, n_orig_loops, target); /* Copy bbs. */ - copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop, loops); + copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop); /* Note whether the blocks and edges belong to an irreducible loop. */ if (add_irreducible_flag) @@ -1019,7 +1000,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, redirect_edge_and_branch_force (latch_edge, new_bbs[0]); redirect_edge_and_branch_force (new_spec_edges[SE_LATCH], loop->header); - set_immediate_dominator (loops->cfg.dom, new_bbs[0], latch); + set_immediate_dominator (CDI_DOMINATORS, new_bbs[0], latch); latch = loop->latch = new_bbs[1]; e = latch_edge = new_spec_edges[SE_LATCH]; } @@ -1028,7 +1009,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, redirect_edge_and_branch_force (new_spec_edges[SE_LATCH], loop->header); redirect_edge_and_branch_force (e, new_bbs[0]); - set_immediate_dominator (loops->cfg.dom, new_bbs[0], e->src); + set_immediate_dominator (CDI_DOMINATORS, new_bbs[0], e->src); e = new_spec_edges[SE_LATCH]; } @@ -1056,7 +1037,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, /* Update the original loop. */ if (!is_latch) - set_immediate_dominator (loops->cfg.dom, e->dest, e->src); + set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); if (flags & DLTHE_FLAG_UPDATE_FREQ) { scale_bbs_frequencies (bbs, n, scale_main, REG_BR_PROB_BASE); @@ -1070,15 +1051,15 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, int n_dom_bbs,j; bb = bbs[i]; - n_dom_bbs = get_dominated_by (loops->cfg.dom, bb, &dom_bbs); + n_dom_bbs = get_dominated_by (CDI_DOMINATORS, bb, &dom_bbs); for (j = 0; j < n_dom_bbs; j++) { dominated = dom_bbs[j]; if (flow_bb_inside_loop_p (loop, dominated)) continue; dom_bb = nearest_common_dominator ( - loops->cfg.dom, first_active[i], first_active_latch); - set_immediate_dominator (loops->cfg.dom, dominated, dom_bb); + CDI_DOMINATORS, first_active[i], first_active_latch); + set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb); } free (dom_bbs); } @@ -1094,7 +1075,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, entry; otherwise we also force preheader block to have only one successor. The function also updates dominators stored in DOM. */ static basic_block -create_preheader (struct loop *loop, dominance_info dom, int flags) +create_preheader (struct loop *loop, int flags) { edge e, fallthru; basic_block dummy; @@ -1126,7 +1107,7 @@ create_preheader (struct loop *loop, dominance_info dom, int flags) insn = PREV_INSN (insn); else insn = get_last_insn (); - if (insn == loop->header->end) + if (insn == BB_END (loop->header)) { /* Split_block would not split block after its end. */ emit_note_after (NOTE_INSN_DELETED, insn); @@ -1141,7 +1122,7 @@ create_preheader (struct loop *loop, dominance_info dom, int flags) if (ploop->latch == dummy) ploop->latch = fallthru->dest; - add_to_dominance_info (dom, fallthru->dest); + add_to_dominance_info (CDI_DOMINATORS, fallthru->dest); /* Redirect edges. */ for (e = dummy->pred; e; e = e->pred_next) @@ -1159,15 +1140,15 @@ create_preheader (struct loop *loop, dominance_info dom, int flags) jump = redirect_edge_and_branch_force (e, loop->header); if (jump) { - add_to_dominance_info (dom, jump); - set_immediate_dominator (dom, jump, src); + add_to_dominance_info (CDI_DOMINATORS, jump); + set_immediate_dominator (CDI_DOMINATORS, jump, src); add_bb_to_loop (jump, loop); loop->latch = jump; } /* Update structures. */ - redirect_immediate_dominators (dom, dummy, loop->header); - set_immediate_dominator (dom, loop->header, dummy); + redirect_immediate_dominators (CDI_DOMINATORS, dummy, loop->header); + set_immediate_dominator (CDI_DOMINATORS, loop->header, dummy); loop->header->loop_father = loop; add_bb_to_loop (dummy, cloop); if (rtl_dump_file) @@ -1184,7 +1165,7 @@ create_preheaders (struct loops *loops, int flags) { unsigned i; for (i = 1; i < loops->num; i++) - create_preheader (loops->parray[i], loops->cfg.dom, flags); + create_preheader (loops->parray[i], flags); loops->state |= LOOPS_HAVE_PREHEADERS; } @@ -1207,7 +1188,7 @@ force_single_succ_latches (struct loops *loops) for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next) continue; - loop_split_edge_with (e, NULL_RTX, loops); + loop_split_edge_with (e, NULL_RTX); } loops->state |= LOOPS_HAVE_SIMPLE_LATCHES; } @@ -1217,7 +1198,7 @@ force_single_succ_latches (struct loops *loops) be ok after this function. The created block is placed on correct place in LOOPS structure and its dominator is set. */ basic_block -loop_split_edge_with (edge e, rtx insns, struct loops *loops) +loop_split_edge_with (edge e, rtx insns) { basic_block src, dest, new_bb; struct loop *loop_c; @@ -1231,7 +1212,7 @@ loop_split_edge_with (edge e, rtx insns, struct loops *loops) /* Create basic block for it. */ new_bb = split_edge (e); - add_to_dominance_info (loops->cfg.dom, new_bb); + add_to_dominance_info (CDI_DOMINATORS, new_bb); add_bb_to_loop (new_bb, loop_c); new_bb->flags = insns ? BB_SUPERBLOCK : 0; @@ -1243,11 +1224,11 @@ loop_split_edge_with (edge e, rtx insns, struct loops *loops) } if (insns) - emit_insn_after (insns, new_bb->end); + emit_insn_after (insns, BB_END (new_bb)); - set_immediate_dominator (loops->cfg.dom, new_bb, src); - set_immediate_dominator (loops->cfg.dom, dest, - recount_dominator (loops->cfg.dom, dest)); + set_immediate_dominator (CDI_DOMINATORS, new_bb, src); + set_immediate_dominator (CDI_DOMINATORS, dest, + recount_dominator (CDI_DOMINATORS, dest)); if (dest->loop_father->latch == src) dest->loop_father->latch = new_bb; diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index f383438e26b..c44d25285dc 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -156,9 +156,15 @@ delete_insn (rtx insn) LABEL_NUSES (JUMP_LABEL (insn))--; /* Also if deleting an insn that references a label. */ - else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX - && GET_CODE (XEXP (note, 0)) == CODE_LABEL) - LABEL_NUSES (XEXP (note, 0))--; + else + { + while ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX + && GET_CODE (XEXP (note, 0)) == CODE_LABEL) + { + LABEL_NUSES (XEXP (note, 0))--; + remove_note (insn, note); + } + } if (GET_CODE (insn) == JUMP_INSN && (GET_CODE (PATTERN (insn)) == ADDR_VEC @@ -193,7 +199,7 @@ delete_insn_and_edges (rtx insn) if (INSN_P (insn) && BLOCK_FOR_INSN (insn) - && BLOCK_FOR_INSN (insn)->end == insn) + && BB_END (BLOCK_FOR_INSN (insn)) == insn) purge = true; x = delete_insn (insn); if (purge) @@ -234,7 +240,7 @@ delete_insn_chain_and_edges (rtx first, rtx last) if (INSN_P (last) && BLOCK_FOR_INSN (last) - && BLOCK_FOR_INSN (last)->end == last) + && BB_END (BLOCK_FOR_INSN (last)) == last) purge = true; delete_insn_chain (first, last); if (purge) @@ -304,8 +310,8 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after) if (NEXT_INSN (end) == bb_note) end = bb_note; - bb->head = head; - bb->end = end; + BB_HEAD (bb) = head; + BB_END (bb) = end; bb->index = last_basic_block++; bb->flags = BB_NEW; link_block (bb, after); @@ -372,7 +378,7 @@ rtl_delete_block (basic_block b) /* Get rid of all NOTE_INSN_PREDICTIONs and NOTE_INSN_LOOP_CONTs hanging before the block. */ - for (insn = PREV_INSN (b->head); insn; insn = PREV_INSN (insn)) + for (insn = PREV_INSN (BB_HEAD (b)); insn; insn = PREV_INSN (insn)) { if (GET_CODE (insn) != NOTE) break; @@ -381,15 +387,15 @@ rtl_delete_block (basic_block b) NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; } - insn = b->head; + insn = BB_HEAD (b); - never_reached_warning (insn, b->end); + never_reached_warning (insn, BB_END (b)); if (GET_CODE (insn) == CODE_LABEL) maybe_remove_eh_handler (insn); /* Include any jump table following the basic block. */ - end = b->end; + end = BB_END (b); if (tablejump_p (end, NULL, &tmp)) end = tmp; @@ -399,7 +405,7 @@ rtl_delete_block (basic_block b) end = tmp; /* Selectively delete the entire chain. */ - b->head = NULL; + BB_HEAD (b) = NULL; delete_insn_chain (insn, end); /* Remove the edges into and out of this block. Note that there may @@ -425,10 +431,10 @@ compute_bb_for_insn (void) FOR_EACH_BB (bb) { - rtx end = bb->end; + rtx end = BB_END (bb); rtx insn; - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { BLOCK_FOR_INSN (insn) = bb; if (insn == end) @@ -455,11 +461,11 @@ update_bb_for_insn (basic_block bb) { rtx insn; - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { if (GET_CODE (insn) != BARRIER) set_block_for_insn (insn, bb); - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } @@ -478,15 +484,15 @@ rtl_split_block (basic_block bb, void *insnp) rtx insn = insnp; /* There is no point splitting the block after its end. */ - if (bb->end == insn) + if (BB_END (bb) == insn) return 0; /* Create the new basic block. */ - new_bb = create_basic_block (NEXT_INSN (insn), bb->end, bb); + new_bb = create_basic_block (NEXT_INSN (insn), BB_END (bb), bb); new_bb->count = bb->count; new_bb->frequency = bb->frequency; new_bb->loop_depth = bb->loop_depth; - bb->end = insn; + BB_END (bb) = insn; /* Redirect the outgoing edges. */ new_bb->succ = bb->succ; @@ -558,7 +564,7 @@ update_cfg_after_block_merging (basic_block a, basic_block b) static void rtl_merge_blocks (basic_block a, basic_block b) { - rtx b_head = b->head, b_end = b->end, a_end = a->end; + rtx b_head = BB_HEAD (b), b_end = BB_END (b), a_end = BB_END (a); rtx del_first = NULL_RTX, del_last = NULL_RTX; int b_empty = 0; @@ -595,7 +601,7 @@ rtl_merge_blocks (basic_block a, basic_block b) for (prev = PREV_INSN (a_end); ; prev = PREV_INSN (prev)) if (GET_CODE (prev) != NOTE || NOTE_LINE_NUMBER (prev) == NOTE_INSN_BASIC_BLOCK - || prev == a->head) + || prev == BB_HEAD (a)) break; del_first = a_end; @@ -609,7 +615,7 @@ rtl_merge_blocks (basic_block a, basic_block b) prev = prev_nonnote_insn (prev); if (!prev) - prev = a->head; + prev = BB_HEAD (a); del_first = tmp; } #endif @@ -638,7 +644,7 @@ rtl_merge_blocks (basic_block a, basic_block b) a_end = b_end; } - a->end = a_end; + BB_END (a) = a_end; } /* Return true when block A and B can be merged. */ @@ -654,9 +660,9 @@ rtl_can_merge_blocks (basic_block a,basic_block b) && a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (a->end) != JUMP_INSN + && (GET_CODE (BB_END (a)) != JUMP_INSN || (flow2_completed - ? simplejump_p (a->end) : onlyjump_p (a->end)))); + ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))); } /* Return the label in the head of basic block BLOCK. Create one if it doesn't @@ -668,12 +674,12 @@ block_label (basic_block block) if (block == EXIT_BLOCK_PTR) return NULL_RTX; - if (GET_CODE (block->head) != CODE_LABEL) + if (GET_CODE (BB_HEAD (block)) != CODE_LABEL) { - block->head = emit_label_before (gen_label_rtx (), block->head); + BB_HEAD (block) = emit_label_before (gen_label_rtx (), BB_HEAD (block)); } - return block->head; + return BB_HEAD (block); } /* Attempt to perform edge redirection by replacing possibly complex jump @@ -685,7 +691,7 @@ static bool try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) { basic_block src = e->src; - rtx insn = src->end, kill_from; + rtx insn = BB_END (src), kill_from; edge tmp; rtx set; int fallthru = 0; @@ -725,7 +731,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) { rtx insn = src->rbi->footer; - delete_insn_chain (kill_from, src->end); + delete_insn_chain (kill_from, BB_END (src)); /* Remove barriers but keep jumptables. */ while (insn) @@ -745,7 +751,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) } } else - delete_insn_chain (kill_from, PREV_INSN (target->head)); + delete_insn_chain (kill_from, PREV_INSN (BB_HEAD (target))); } /* If this already is simplejump, redirect it. */ @@ -775,11 +781,11 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) rtx barrier, label, table; emit_jump_insn_after (gen_jump (target_label), insn); - JUMP_LABEL (src->end) = target_label; + JUMP_LABEL (BB_END (src)) = target_label; LABEL_NUSES (target_label)++; if (rtl_dump_file) fprintf (rtl_dump_file, "Replacing insn %i by jump %i\n", - INSN_UID (insn), INSN_UID (src->end)); + INSN_UID (insn), INSN_UID (BB_END (src))); delete_insn_chain (kill_from, insn); @@ -790,9 +796,33 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) if (tablejump_p (insn, &label, &table)) delete_insn_chain (label, table); - barrier = next_nonnote_insn (src->end); + barrier = next_nonnote_insn (BB_END (src)); if (!barrier || GET_CODE (barrier) != BARRIER) - emit_barrier_after (src->end); + emit_barrier_after (BB_END (src)); + else + { + if (barrier != NEXT_INSN (BB_END (src))) + { + /* Move the jump before barrier so that the notes + which originally were or were created before jump table are + inside the basic block. */ + rtx new_insn = BB_END (src); + rtx tmp; + + for (tmp = NEXT_INSN (BB_END (src)); tmp != barrier; + tmp = NEXT_INSN (tmp)) + set_block_for_insn (tmp, src); + + NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn); + PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn); + + NEXT_INSN (new_insn) = barrier; + NEXT_INSN (PREV_INSN (barrier)) = new_insn; + + PREV_INSN (new_insn) = PREV_INSN (barrier); + PREV_INSN (barrier) = new_insn; + } + } } /* Keep only one edge out and set proper flags. */ @@ -809,9 +839,9 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) /* We don't want a block to end on a line-number note since that has the potential of changing the code between -g and not -g. */ - while (GET_CODE (e->src->end) == NOTE - && NOTE_LINE_NUMBER (e->src->end) >= 0) - delete_insn (e->src->end); + while (GET_CODE (BB_END (e->src)) == NOTE + && NOTE_LINE_NUMBER (BB_END (e->src)) >= 0) + delete_insn (BB_END (e->src)); if (e->dest != target) redirect_edge_succ (e, target); @@ -846,9 +876,9 @@ static bool redirect_branch_edge (edge e, basic_block target) { rtx tmp; - rtx old_label = e->dest->head; + rtx old_label = BB_HEAD (e->dest); basic_block src = e->src; - rtx insn = src->end; + rtx insn = BB_END (src); /* We can only redirect non-fallthru edges of jump insn. */ if (e->flags & EDGE_FALLTHRU) @@ -970,18 +1000,18 @@ force_nonfallthru_and_redirect (edge e, basic_block target) instruction, first redirect the jump itself and then continue by creating a basic block afterwards to redirect fallthru edge. */ if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR - && any_condjump_p (e->src->end) + && any_condjump_p (BB_END (e->src)) /* When called from cfglayout, fallthru edges do not necessarily go to the next block. */ && e->src->next_bb == e->dest - && JUMP_LABEL (e->src->end) == e->dest->head) + && JUMP_LABEL (BB_END (e->src)) == BB_HEAD (e->dest)) { rtx note; edge b = unchecked_make_edge (e->src, target, 0); - if (!redirect_jump (e->src->end, block_label (target), 0)) + if (!redirect_jump (BB_END (e->src), block_label (target), 0)) abort (); - note = find_reg_note (e->src->end, REG_BR_PROB, NULL_RTX); + note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX); if (note) { int prob = INTVAL (XEXP (note, 0)); @@ -1016,7 +1046,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target) /* We can't redirect the entry block. Create an empty block at the start of the function which we use to add the new jump. */ edge *pe1; - basic_block bb = create_basic_block (e->dest->head, NULL, ENTRY_BLOCK_PTR); + basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR); /* Change the existing edge's source to be the new block, and add a new edge from the entry block to the new block. */ @@ -1039,8 +1069,8 @@ force_nonfallthru_and_redirect (edge e, basic_block target) /* If the old block ended with a tablejump, skip its table by searching forward from there. Otherwise start searching forward from the last instruction of the old block. */ - if (!tablejump_p (e->src->end, NULL, ¬e)) - note = e->src->end; + if (!tablejump_p (BB_END (e->src), NULL, ¬e)) + note = BB_END (e->src); /* Position the new block correctly relative to loop notes. */ note = last_loop_beg_note (note); @@ -1081,19 +1111,19 @@ force_nonfallthru_and_redirect (edge e, basic_block target) if (target == EXIT_BLOCK_PTR) { if (HAVE_return) - emit_jump_insn_after (gen_return (), jump_block->end); + emit_jump_insn_after (gen_return (), BB_END (jump_block)); else abort (); } else { rtx label = block_label (target); - emit_jump_insn_after (gen_jump (label), jump_block->end); - JUMP_LABEL (jump_block->end) = label; + emit_jump_insn_after (gen_jump (label), BB_END (jump_block)); + JUMP_LABEL (BB_END (jump_block)) = label; LABEL_NUSES (label)++; } - emit_barrier_after (jump_block->end); + emit_barrier_after (BB_END (jump_block)); redirect_edge_succ_nodup (e, target); if (abnormal_edge_flags) @@ -1146,14 +1176,14 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c) So search through a sequence of barriers, labels, and notes for the head of block C and assert that we really do fall through. */ - for (q = NEXT_INSN (b->end); q != c->head; q = NEXT_INSN (q)) + for (q = NEXT_INSN (BB_END (b)); q != BB_HEAD (c); q = NEXT_INSN (q)) if (INSN_P (q)) return; /* Remove what will soon cease being the jump insn from the source block. If block B consisted only of this single jump, turn it into a deleted note. */ - q = b->end; + q = BB_END (b); if (GET_CODE (q) == JUMP_INSN && onlyjump_p (q) && (any_uncondjump_p (q) @@ -1175,8 +1205,8 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c) } /* Selectively unlink the sequence. */ - if (q != PREV_INSN (c->head)) - delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head)); + if (q != PREV_INSN (BB_HEAD (c))) + delete_insn_chain (NEXT_INSN (q), PREV_INSN (BB_HEAD (c))); e->flags |= EDGE_FALLTHRU; } @@ -1217,8 +1247,8 @@ tidy_fallthru_edges (void) && s->succ_next == NULL && s->dest == c /* If the jump insn has side effects, we can't tidy the edge. */ - && (GET_CODE (b->end) != JUMP_INSN - || onlyjump_p (b->end))) + && (GET_CODE (BB_END (b)) != JUMP_INSN + || onlyjump_p (BB_END (b)))) tidy_fallthru_edge (s, b, c); } } @@ -1244,7 +1274,7 @@ back_edge_of_syntactic_loop_p (basic_block bb1, basic_block bb2) if (!bb) return false; - for (insn = bb1->end; insn != bb2->head && count >= 0; + for (insn = BB_END (bb1); insn != BB_HEAD (bb2) && count >= 0; insn = NEXT_INSN (insn)) if (GET_CODE (insn) == NOTE) { @@ -1307,14 +1337,14 @@ rtl_split_edge (edge edge_in) we confuse the loop optimizer into thinking the loop is a phony. */ if (edge_in->dest != EXIT_BLOCK_PTR - && PREV_INSN (edge_in->dest->head) - && GET_CODE (PREV_INSN (edge_in->dest->head)) == NOTE - && (NOTE_LINE_NUMBER (PREV_INSN (edge_in->dest->head)) + && PREV_INSN (BB_HEAD (edge_in->dest)) + && GET_CODE (PREV_INSN (BB_HEAD (edge_in->dest))) == NOTE + && (NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (edge_in->dest))) == NOTE_INSN_LOOP_BEG) && !back_edge_of_syntactic_loop_p (edge_in->dest, edge_in->src)) - before = PREV_INSN (edge_in->dest->head); + before = PREV_INSN (BB_HEAD (edge_in->dest)); else if (edge_in->dest != EXIT_BLOCK_PTR) - before = edge_in->dest->head; + before = BB_HEAD (edge_in->dest); else before = NULL_RTX; @@ -1482,11 +1512,11 @@ commit_one_edge_insertion (edge e, int watch_calls) its return value. */ if (watch_calls && (e->flags & EDGE_FALLTHRU) && !e->dest->pred->pred_next && e->src != ENTRY_BLOCK_PTR - && GET_CODE (e->src->end) == CALL_INSN) + && GET_CODE (BB_END (e->src)) == CALL_INSN) { - rtx next = next_nonnote_insn (e->src->end); + rtx next = next_nonnote_insn (BB_END (e->src)); - after = e->dest->head; + after = BB_HEAD (e->dest); /* The first insn after the call may be a stack pop, skip it. */ while (next && keep_with_call_p (next)) @@ -1506,12 +1536,12 @@ commit_one_edge_insertion (edge e, int watch_calls) /* Get the location correct wrt a code label, and "nice" wrt a basic block note, and before everything else. */ - tmp = bb->head; + tmp = BB_HEAD (bb); if (GET_CODE (tmp) == CODE_LABEL) tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); - if (tmp == bb->head) + if (tmp == BB_HEAD (bb)) before = tmp; else if (tmp) after = PREV_INSN (tmp); @@ -1533,8 +1563,8 @@ commit_one_edge_insertion (edge e, int watch_calls) We know this block has a single successor, so we can just emit the queued insns before the jump. */ - if (GET_CODE (bb->end) == JUMP_INSN) - for (before = bb->end; + if (GET_CODE (BB_END (bb)) == JUMP_INSN) + for (before = BB_END (bb); GET_CODE (PREV_INSN (before)) == NOTE && NOTE_LINE_NUMBER (PREV_INSN (before)) == NOTE_INSN_LOOP_BEG; before = PREV_INSN (before)) @@ -1545,14 +1575,14 @@ commit_one_edge_insertion (edge e, int watch_calls) if ((e->flags & EDGE_FALLTHRU) == 0) abort (); - after = bb->end; + after = BB_END (bb); } } /* Otherwise we must split the edge. */ else { bb = split_edge (e); - after = bb->end; + after = BB_END (bb); } } @@ -1698,7 +1728,7 @@ rtl_dump_bb (basic_block bb, FILE *outf) dump_regset (bb->global_live_at_start, outf); putc ('\n', outf); - for (insn = bb->head, last = NEXT_INSN (bb->end); insn != last; + for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last; insn = NEXT_INSN (insn)) print_rtl_single (outf, insn); @@ -1731,9 +1761,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first) { rtx x; - start[INSN_UID (bb->head)] = bb; - end[INSN_UID (bb->end)] = bb; - for (x = bb->head; x != NULL_RTX; x = NEXT_INSN (x)) + start[INSN_UID (BB_HEAD (bb))] = bb; + end[INSN_UID (BB_END (bb))] = bb; + for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x)) { enum bb_state state = IN_MULTIPLE_BB; @@ -1741,7 +1771,7 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first) state = IN_ONE_BB; in_bb_p[INSN_UID (x)] = state; - if (x == bb->end) + if (x == BB_END (bb)) break; } } @@ -1797,9 +1827,9 @@ void update_br_prob_note (basic_block bb) { rtx note; - if (GET_CODE (bb->end) != JUMP_INSN) + if (GET_CODE (BB_END (bb)) != JUMP_INSN) return; - note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX); + note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX); if (!note || INTVAL (XEXP (note, 0)) == BRANCH_EDGE (bb)->probability) return; XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability); @@ -1836,8 +1866,8 @@ rtl_verify_flow_info_1 (void) FOR_EACH_BB_REVERSE (bb) { - rtx head = bb->head; - rtx end = bb->end; + rtx head = BB_HEAD (bb); + rtx end = BB_END (bb); /* Verify the end of the basic block is in the INSN chain. */ for (x = last_head; x != NULL_RTX; x = PREV_INSN (x)) @@ -1887,10 +1917,10 @@ rtl_verify_flow_info_1 (void) edge e, fallthru = NULL; rtx note; - if (INSN_P (bb->end) - && (note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX)) + if (INSN_P (BB_END (bb)) + && (note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX)) && bb->succ && bb->succ->succ_next - && any_condjump_p (bb->end)) + && any_condjump_p (BB_END (bb))) { if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability) { @@ -1919,52 +1949,52 @@ rtl_verify_flow_info_1 (void) n_abnormal++; } - if (n_eh && GET_CODE (PATTERN (bb->end)) != RESX - && !find_reg_note (bb->end, REG_EH_REGION, NULL_RTX)) + if (n_eh && GET_CODE (PATTERN (BB_END (bb))) != RESX + && !find_reg_note (BB_END (bb), REG_EH_REGION, NULL_RTX)) { error ("Missing REG_EH_REGION note in the end of bb %i", bb->index); err = 1; } if (n_branch - && (GET_CODE (bb->end) != JUMP_INSN - || (n_branch > 1 && (any_uncondjump_p (bb->end) - || any_condjump_p (bb->end))))) + && (GET_CODE (BB_END (bb)) != JUMP_INSN + || (n_branch > 1 && (any_uncondjump_p (BB_END (bb)) + || any_condjump_p (BB_END (bb)))))) { error ("Too many outgoing branch edges from bb %i", bb->index); err = 1; } - if (n_fallthru && any_uncondjump_p (bb->end)) + if (n_fallthru && any_uncondjump_p (BB_END (bb))) { error ("Fallthru edge after unconditional jump %i", bb->index); err = 1; } - if (n_branch != 1 && any_uncondjump_p (bb->end)) + if (n_branch != 1 && any_uncondjump_p (BB_END (bb))) { error ("Wrong amount of branch edges after unconditional jump %i", bb->index); err = 1; } - if (n_branch != 1 && any_condjump_p (bb->end) - && JUMP_LABEL (bb->end) != fallthru->dest->head) + if (n_branch != 1 && any_condjump_p (BB_END (bb)) + && JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest)) { error ("Wrong amount of branch edges after conditional jump %i", bb->index); err = 1; } - if (n_call && GET_CODE (bb->end) != CALL_INSN) + if (n_call && GET_CODE (BB_END (bb)) != CALL_INSN) { error ("Call edges for non-call insn in bb %i", bb->index); err = 1; } if (n_abnormal - && (GET_CODE (bb->end) != CALL_INSN && n_call != n_abnormal) - && (GET_CODE (bb->end) != JUMP_INSN - || any_condjump_p (bb->end) - || any_uncondjump_p (bb->end))) + && (GET_CODE (BB_END (bb)) != CALL_INSN && n_call != n_abnormal) + && (GET_CODE (BB_END (bb)) != JUMP_INSN + || any_condjump_p (BB_END (bb)) + || any_uncondjump_p (BB_END (bb)))) { error ("Abnormal edges for no purpose in bb %i", bb->index); err = 1; } - for (x = bb->head; x != NEXT_INSN (bb->end); x = NEXT_INSN (x)) + for (x = BB_HEAD (bb); x != NEXT_INSN (BB_END (bb)); x = NEXT_INSN (x)) if (BLOCK_FOR_INSN (x) != bb) { debug_rtx (x); @@ -1983,10 +2013,10 @@ rtl_verify_flow_info_1 (void) /* OK pointers are correct. Now check the header of basic block. It ought to contain optional CODE_LABEL followed by NOTE_BASIC_BLOCK. */ - x = bb->head; + x = BB_HEAD (bb); if (GET_CODE (x) == CODE_LABEL) { - if (bb->end == x) + if (BB_END (bb) == x) { error ("NOTE_INSN_BASIC_BLOCK is missing for block %d", bb->index); @@ -2003,7 +2033,7 @@ rtl_verify_flow_info_1 (void) err = 1; } - if (bb->end == x) + if (BB_END (bb) == x) /* Do checks for empty blocks her. e */ ; else @@ -2016,7 +2046,7 @@ rtl_verify_flow_info_1 (void) err = 1; } - if (x == bb->end) + if (x == BB_END (bb)) break; if (control_flow_insn_p (x)) @@ -2062,7 +2092,7 @@ rtl_verify_flow_info (void) rtx insn; /* Ensure existence of barrier in BB with no fallthru edges. */ - for (insn = bb->end; !insn || GET_CODE (insn) != BARRIER; + for (insn = BB_END (bb); !insn || GET_CODE (insn) != BARRIER; insn = NEXT_INSN (insn)) if (!insn || (GET_CODE (insn) == NOTE @@ -2086,7 +2116,7 @@ rtl_verify_flow_info (void) err = 1; } else - for (insn = NEXT_INSN (e->src->end); insn != e->dest->head; + for (insn = NEXT_INSN (BB_END (e->src)); insn != BB_HEAD (e->dest); insn = NEXT_INSN (insn)) if (GET_CODE (insn) == BARRIER #ifndef CASE_DROPS_THROUGH @@ -2149,7 +2179,7 @@ rtl_verify_flow_info (void) && returnjump_p (x) && ! condjump_p (x) && ! (NEXT_INSN (x) && GET_CODE (NEXT_INSN (x)) == BARRIER)) fatal_insn ("return not followed by barrier", x); - if (curr_bb && x == curr_bb->end) + if (curr_bb && x == BB_END (curr_bb)) curr_bb = NULL; } @@ -2169,7 +2199,7 @@ bool purge_dead_edges (basic_block bb) { edge e, next; - rtx insn = bb->end, note; + rtx insn = BB_END (bb), note; bool purged = false; /* If this instruction cannot trap, remove REG_EH_REGION notes. */ @@ -2190,12 +2220,12 @@ purge_dead_edges (basic_block bb) next = e->succ_next; if (e->flags & EDGE_EH) { - if (can_throw_internal (bb->end)) + if (can_throw_internal (BB_END (bb))) continue; } else if (e->flags & EDGE_ABNORMAL_CALL) { - if (GET_CODE (bb->end) == CALL_INSN + if (GET_CODE (BB_END (bb)) == CALL_INSN && (! (note = find_reg_note (insn, REG_EH_REGION, NULL)) || INTVAL (XEXP (note, 0)) >= 0)) continue; @@ -2245,7 +2275,7 @@ purge_dead_edges (basic_block bb) block, so we should keep the edge. */ continue; else if (e->dest != EXIT_BLOCK_PTR - && e->dest->head == JUMP_LABEL (insn)) + && BB_HEAD (e->dest) == JUMP_LABEL (insn)) /* If the destination block is the target of the jump, keep the edge. */ continue; @@ -2432,10 +2462,10 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) if (e->flags & EDGE_FALLTHRU) { /* Redirect any branch edges unified with the fallthru one. */ - if (GET_CODE (src->end) == JUMP_INSN - && JUMP_LABEL (src->end) == e->dest->head) + if (GET_CODE (BB_END (src)) == JUMP_INSN + && JUMP_LABEL (BB_END (src)) == BB_HEAD (e->dest)) { - if (!redirect_jump (src->end, block_label (dest), 0)) + if (!redirect_jump (BB_END (src), block_label (dest), 0)) abort (); } /* In case we are redirecting fallthru edge to the branch edge @@ -2445,9 +2475,9 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) { edge s = e->succ_next ? e->succ_next : src->succ; if (s->dest == dest - && any_condjump_p (src->end) - && onlyjump_p (src->end)) - delete_insn (src->end); + && any_condjump_p (BB_END (src)) + && onlyjump_p (BB_END (src))) + delete_insn (BB_END (src)); } redirect_edge_succ_nodup (e, dest); if (rtl_dump_file) @@ -2460,7 +2490,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) ret = redirect_branch_edge (e, dest); /* We don't want simplejumps in the insn stream during cfglayout. */ - if (simplejump_p (src->end)) + if (simplejump_p (BB_END (src))) abort (); return ret; @@ -2479,11 +2509,11 @@ cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest) static void cfg_layout_delete_block (basic_block bb) { - rtx insn, next, prev = PREV_INSN (bb->head), *to, remaints; + rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints; if (bb->rbi->header) { - next = bb->head; + next = BB_HEAD (bb); if (prev) NEXT_INSN (prev) = bb->rbi->header; else @@ -2495,7 +2525,7 @@ cfg_layout_delete_block (basic_block bb) NEXT_INSN (insn) = next; PREV_INSN (next) = insn; } - next = NEXT_INSN (bb->end); + next = NEXT_INSN (BB_END (bb)); if (bb->rbi->footer) { insn = bb->rbi->footer; @@ -2516,7 +2546,7 @@ cfg_layout_delete_block (basic_block bb) } if (bb->rbi->footer) { - insn = bb->end; + insn = BB_END (bb); NEXT_INSN (insn) = bb->rbi->footer; PREV_INSN (bb->rbi->footer) = insn; while (NEXT_INSN (insn)) @@ -2568,9 +2598,9 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) && a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (a->end) != JUMP_INSN + && (GET_CODE (BB_END (a)) != JUMP_INSN || (flow2_completed - ? simplejump_p (a->end) : onlyjump_p (a->end)))); + ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))); } /* Merge block A and B, abort when it is not possible. */ @@ -2583,38 +2613,38 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) #endif /* If there was a CODE_LABEL beginning B, delete it. */ - if (GET_CODE (b->head) == CODE_LABEL) - delete_insn (b->head); + if (GET_CODE (BB_HEAD (b)) == CODE_LABEL) + delete_insn (BB_HEAD (b)); /* We should have fallthru edge in a, or we can do dummy redirection to get it cleaned up. */ - if (GET_CODE (a->end) == JUMP_INSN) + if (GET_CODE (BB_END (a)) == JUMP_INSN) redirect_edge_and_branch (a->succ, b); - if (GET_CODE (a->end) == JUMP_INSN) + if (GET_CODE (BB_END (a)) == JUMP_INSN) abort (); /* Possible line number notes should appear in between. */ if (b->rbi->header) { - rtx first = a->end, last; + rtx first = BB_END (a), last; - last = emit_insn_after (b->rbi->header, a->end); + last = emit_insn_after (b->rbi->header, BB_END (a)); delete_insn_chain (NEXT_INSN (first), last); b->rbi->header = NULL; } /* In the case basic blocks are not adjacent, move them around. */ - if (NEXT_INSN (a->end) != b->head) + if (NEXT_INSN (BB_END (a)) != BB_HEAD (b)) { - rtx first = unlink_insn_chain (b->head, b->end); + rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b)); - emit_insn_after (first, a->end); + emit_insn_after (first, BB_END (a)); /* Skip possible DELETED_LABEL insn. */ if (!NOTE_INSN_BASIC_BLOCK_P (first)) first = NEXT_INSN (first); if (!NOTE_INSN_BASIC_BLOCK_P (first)) abort (); - b->head = NULL; + BB_HEAD (b) = NULL; delete_insn (first); } /* Otherwise just re-associate the instructions. */ @@ -2622,16 +2652,18 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) { rtx insn; - for (insn = b->head; insn != NEXT_INSN (b->end); insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (b); + insn != NEXT_INSN (BB_END (b)); + insn = NEXT_INSN (insn)) set_block_for_insn (insn, a); - insn = b->head; + insn = BB_HEAD (b); /* Skip possible DELETED_LABEL insn. */ if (!NOTE_INSN_BASIC_BLOCK_P (insn)) insn = NEXT_INSN (insn); if (!NOTE_INSN_BASIC_BLOCK_P (insn)) abort (); - b->head = NULL; - a->end = b->end; + BB_HEAD (b) = NULL; + BB_END (a) = BB_END (b); delete_insn (insn); } @@ -2666,7 +2698,7 @@ cfg_layout_split_edge (edge e) edge new_e; basic_block new_bb = create_basic_block (e->src != ENTRY_BLOCK_PTR - ? NEXT_INSN (e->src-> end) : get_insns (), + ? NEXT_INSN (BB_END (e->src)) : get_insns (), NULL_RTX, e->src); new_bb->count = e->count; diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 5daea448500..91b08a65c69 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -268,7 +268,7 @@ cgraph_mark_needed_node (struct cgraph_node *node) cgraph_mark_reachable_node (node); } -/* Record call from CALLER to CALLEE */ +/* Record call from CALLER to CALLEE. */ struct cgraph_edge * cgraph_record_call (tree caller, tree callee) @@ -428,8 +428,6 @@ cgraph_varpool_node (tree decl) if (!cgraph_varpool_hash) cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node, eq_cgraph_varpool_node, NULL); - - slot = (struct cgraph_varpool_node **) htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl), IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (decl)), @@ -444,6 +442,85 @@ cgraph_varpool_node (tree decl) return node; } +/* Set the DECL_ASSEMBLER_NAME and update cgraph hashtables. */ +void +change_decl_assembler_name (tree decl, tree name) +{ + struct cgraph_node *node = NULL; + struct cgraph_varpool_node *vnode = NULL; + void **slot; + + if (!DECL_ASSEMBLER_NAME_SET_P (decl)) + { + SET_DECL_ASSEMBLER_NAME (decl, name); + return; + } + if (name == DECL_ASSEMBLER_NAME (decl)) + return; + + if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) + && DECL_RTL_SET_P (decl)) + warning ("%D renamed after being referenced in assembly", decl); + + if (TREE_CODE (decl) == FUNCTION_DECL && cgraph_hash) + { + /* Take a look whether declaration is in the cgraph structure. */ + slot = + htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (decl), + IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME + (decl)), NO_INSERT); + if (slot) + node = *slot; + + /* It is, verify that we are the canonical node for this decl. */ + if (node && node->decl == decl) + { + node = *slot; + htab_clear_slot (cgraph_hash, slot); + } + else + node = NULL; + } + if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) && cgraph_varpool_hash) + { + /* Take a look whether declaration is in the cgraph structure. */ + slot = + htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl), + IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME + (decl)), NO_INSERT); + if (slot) + vnode = *slot; + + /* It is, verify that we are the canonical vnode for this decl. */ + if (vnode && vnode->decl == decl) + { + vnode = *slot; + htab_clear_slot (cgraph_varpool_hash, slot); + } + else + vnode = NULL; + } + SET_DECL_ASSEMBLER_NAME (decl, name); + if (node) + { + slot = + htab_find_slot_with_hash (cgraph_hash, name, + IDENTIFIER_HASH_VALUE (name), INSERT); + if (*slot) + abort (); + *slot = node; + } + if (vnode) + { + slot = + htab_find_slot_with_hash (cgraph_varpool_hash, name, + IDENTIFIER_HASH_VALUE (name), INSERT); + if (*slot) + abort (); + *slot = vnode; + } +} + /* Try to find existing function for identifier ID. */ struct cgraph_varpool_node * cgraph_varpool_node_for_identifier (tree id) @@ -536,7 +613,7 @@ bool cgraph_function_possibly_inlined_p (tree decl) { if (!cgraph_global_info_ready) - return (DECL_INLINE (decl) && !flag_no_inline); + return (DECL_INLINE (decl) && !flag_really_no_inline); return cgraph_node (decl)->global.inlined; } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a37227e95c9..9540eccd937 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -75,7 +75,7 @@ struct cgraph_rtl_info GTY(()) }; -/* The cgraph data strutcture. +/* The cgraph data structure. Each function decl has assigned cgraph_node listing callees and callers. */ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) @@ -122,7 +122,7 @@ struct cgraph_edge GTY(()) bool inline_call; }; -/* The cgraph_varpool data strutcture. +/* The cgraph_varpool data structure. Each static variable decl has assigned cgraph_varpool_node. */ struct cgraph_varpool_node GTY(()) diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 673419fa008..d2d4d4cb996 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -486,7 +486,6 @@ static void cgraph_expand_function (struct cgraph_node *node) { tree decl = node->decl; - struct cgraph_edge *e; if (flag_unit_at_a_time) announce_function (decl); @@ -497,21 +496,8 @@ cgraph_expand_function (struct cgraph_node *node) via lang_expand_decl_stmt. */ (*lang_hooks.callgraph.expand_function) (decl); - if (!flag_unit_at_a_time) - { - if (!node->local.inlinable - || (!node->local.disregard_inline_limits - && !cgraph_default_inline_p (node))) - DECL_SAVED_TREE (node->decl) = NULL; - } - else - { - for (e = node->callers; e; e = e->next_caller) - if (e->inline_call) - break; - if (!e) - DECL_SAVED_TREE (decl) = NULL; - } + if (!cgraph_function_possibly_inlined_p (decl)) + DECL_SAVED_TREE (decl) = NULL; current_function_decl = NULL; } @@ -945,7 +931,7 @@ cgraph_default_inline_p (struct cgraph_node *n) All inline candidates are put into prioritized heap based on estimated growth of the overall number of instructions and then update the estimates. - INLINED and INLINED_CALEES are just pointers to arrays large enought + INLINED and INLINED_CALEES are just pointers to arrays large enough to be passed to cgraph_inlined_into and cgraph_inlined_callees. */ static void diff --git a/gcc/collect2.c b/gcc/collect2.c index 2d49cce3ffe..9b69a0b8e1c 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -30,23 +30,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "coretypes.h" #include "tm.h" -#include -#if ! defined( SIGCHLD ) && defined( SIGCLD ) -# define SIGCHLD SIGCLD -#endif - -#ifdef vfork /* Autoconf may define this to fork for us. */ -# define VFORK_STRING "fork" +#ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN +# include #else -# define VFORK_STRING "vfork" -#endif -#ifdef HAVE_VFORK_H -#include -#endif -#ifdef VMS -#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ - lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) -#endif /* VMS */ +# include +# if ! defined( SIGCHLD ) && defined( SIGCLD ) +# define SIGCHLD SIGCLD +# endif +#endif #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" @@ -249,7 +241,17 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs, static const char *const libexts[3] = {"a", "so", NULL}; /* possible library extensions */ #endif -static void handler (int); +static void clean_up_temp_files (void); +#ifdef _WIN32 +static BOOL WINAPI handler (DWORD); +static LONG unhanded_filter (LPEXCEPTION_POINTERS); +#else +static void handler (int); +#endif +static void install_handlers (void); +static void disable_break (void); +static void enable_break (void); + static int is_ctor_dtor (const char *); static char *find_a_file (struct path_prefix *, const char *); static void add_prefix (struct path_prefix *, const char *); @@ -290,26 +292,6 @@ static char *resolve_lib_name (const char *); #endif static char *extract_string (const char **); -#ifndef HAVE_DUP2 -static int -dup2 (int oldfd, int newfd) -{ - int fdtmp[256]; - int fdx = 0; - int fd; - - if (oldfd == newfd) - return oldfd; - close (newfd); - while ((fd = dup (oldfd)) != newfd && fd >= 0) /* good enough for low fd's */ - fdtmp[fdx++] = fd; - while (fdx > 0) - close (fdtmp[--fdx]); - - return fd; -} -#endif /* ! HAVE_DUP2 */ - /* Delete tempfiles and exit function. */ void @@ -407,7 +389,7 @@ fancy_abort (void) } static void -handler (int signo) +clean_up_temp_files (void) { if (c_file != 0 && c_file[0]) maybe_unlink (c_file); @@ -422,11 +404,117 @@ handler (int signo) if (export_file != 0 && export_file[0]) maybe_unlink (export_file); #endif +} + +/* Signal handling needs to be drastically different between Windows + and Unix. */ +#ifdef _WIN32 + +static BOOL WINAPI +handler (DWORD signo ATTRIBUTE_UNUSED) +{ + clean_up_temp_files (); + return FALSE; /* not handled - default handler will terminate process */ +} + +static LONG +unhandled_filter (LPEXCEPTION_POINTERS pointers ATTRIBUTE_UNUSED) +{ + clean_up_temp_files (); + return EXCEPTION_CONTINUE_SEARCH; /* carry on and terminate process */ +} + + +static void +install_handlers (void) +{ + SetConsoleCtrlHandler (handler, TRUE); + /* This is not really the right way to do this; in fact I'm not + sure it will work. But it might. */ + SetUnhandledExceptionFilter (unhandled_filter); +} + +static void +disable_break (void) +{ + /* This only works on Windows NT, and only disables CTRL-C; + CTRL-BREAK is not disabled (but does get caught by the handler). */ + if (!(GetVersion() & 0x80000000)) + SetConsoleCtrlHandler (NULL, TRUE); +} +static void +enable_break (void) +{ + if (!(GetVersion() & 0x80000000)) + SetConsoleCtrlHandler (NULL, FALSE); +} + +#else /* not _WIN32 */ + +static void +handler (int signo) +{ + clean_up_temp_files (); signal (signo, SIG_DFL); kill (getpid (), signo); } +static void +install_handlers () +{ +#ifdef SIGQUIT + if (signal (SIGQUIT, SIG_IGN) != SIG_IGN) + signal (SIGQUIT, handler); +#endif + if (signal (SIGINT, SIG_IGN) != SIG_IGN) + signal (SIGINT, handler); +#ifdef SIGALRM + if (signal (SIGALRM, SIG_IGN) != SIG_IGN) + signal (SIGALRM, handler); +#endif +#ifdef SIGHUP + if (signal (SIGHUP, SIG_IGN) != SIG_IGN) + signal (SIGHUP, handler); +#endif + if (signal (SIGSEGV, SIG_IGN) != SIG_IGN) + signal (SIGSEGV, handler); +#ifdef SIGBUS + if (signal (SIGBUS, SIG_IGN) != SIG_IGN) + signal (SIGBUS, handler); +#endif +#ifdef SIGCHLD + /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will + receive the signal. A different setting is inheritable */ + signal (SIGCHLD, SIG_DFL); +#endif +} + +static void (*int_handler) PARAMS ((int)); +#ifdef SIGQUIT +static void (*quit_handler) PARAMS ((int)); +#endif + +static void +disable_break () +{ + int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN); +#ifdef SIGQUIT + quit_handler = (void (*) PARAMS ((int))) signal (SIGQUIT, SIG_IGN); +#endif +} + +static void +enable_break () +{ + signal (SIGINT, int_handler); +#ifdef SIGQUIT + signal (SIGQUIT, quit_handler); +#endif +} + +#endif /* not _WIN32 */ + int file_exists (const char *name) @@ -821,6 +909,8 @@ main (int argc, char **argv) int first_file; int num_c_args = argc+9; + pexec_set_program_name (argv[0]); + no_demangle = !! getenv ("COLLECT_NO_DEMANGLE"); /* Suppress demangling by the real linker, which may be broken. */ @@ -831,12 +921,6 @@ main (int argc, char **argv) COLLECT2_HOST_INITIALIZATION; #endif -#ifdef SIGCHLD - /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will - receive the signal. A different setting is inheritable */ - signal (SIGCHLD, SIG_DFL); -#endif - gcc_init_libintl (); /* Do not invoke xcalloc before this point, since locale needs to be @@ -884,34 +968,16 @@ main (int argc, char **argv) } obstack_free (&temporary_obstack, temporary_firstobj); - /* -fno-exceptions -w */ - num_c_args += 2; + /* -fno-profile-arcs -fno-test-coverage -fno-branch-probabilities + -fno-exceptions -w */ + num_c_args += 5; c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args)); if (argc < 2) fatal ("no arguments"); -#ifdef SIGQUIT - if (signal (SIGQUIT, SIG_IGN) != SIG_IGN) - signal (SIGQUIT, handler); -#endif - if (signal (SIGINT, SIG_IGN) != SIG_IGN) - signal (SIGINT, handler); -#ifdef SIGALRM - if (signal (SIGALRM, SIG_IGN) != SIG_IGN) - signal (SIGALRM, handler); -#endif -#ifdef SIGHUP - if (signal (SIGHUP, SIG_IGN) != SIG_IGN) - signal (SIGHUP, handler); -#endif - if (signal (SIGSEGV, SIG_IGN) != SIG_IGN) - signal (SIGSEGV, handler); -#ifdef SIGBUS - if (signal (SIGBUS, SIG_IGN) != SIG_IGN) - signal (SIGBUS, handler); -#endif + install_handlers (); /* Extract COMPILER_PATH and PATH into our prefix list. */ prefix_from_env ("COMPILER_PATH", &cpath); @@ -1046,6 +1112,9 @@ main (int argc, char **argv) } } obstack_free (&temporary_obstack, temporary_firstobj); + *c_ptr++ = "-fno-profile-arcs"; + *c_ptr++ = "-fno-test-coverage"; + *c_ptr++ = "-fno-branch-probabilities"; *c_ptr++ = "-fno-exceptions"; *c_ptr++ = "-w"; @@ -1428,10 +1497,10 @@ main (int argc, char **argv) fork_execute ("gcc", c_argv); #ifdef COLLECT_EXPORT_LIST - /* On AIX we must call tlink because of possible templates resolution */ + /* On AIX we must call tlink because of possible templates resolution. */ do_tlink (ld2_argv, object_lst); #else - /* Otherwise, simply call ld because tlink is already done */ + /* Otherwise, simply call ld because tlink is already done. */ fork_execute ("ld", ld2_argv); /* Let scan_prog_file do any final mods (OSF/rose needs this for @@ -1457,7 +1526,8 @@ collect_wait (const char *prog) { int status; - pwait (pid, &status, 0); + if (pwait (pid, &status, 0) < 0) + fatal ("could not obtain exit status for `%s'", prog); if (status) { if (WIFSIGNALED (status)) @@ -1492,11 +1562,7 @@ do_wait (const char *prog) void collect_execute (const char *prog, char **argv, const char *redir) { - char *errmsg_fmt; - char *errmsg_arg; int redir_handle = -1; - int stdout_save = -1; - int stderr_save = -1; if (vflag || debug) { @@ -1514,9 +1580,6 @@ collect_execute (const char *prog, char **argv, const char *redir) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* If we cannot find a program we need, complain error. Do this here since we might not end up needing something that we could not find. */ @@ -1525,38 +1588,15 @@ collect_execute (const char *prog, char **argv, const char *redir) if (redir) { - /* Open response file. */ - redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); - - /* Duplicate the stdout and stderr file handles - so they can be restored later. */ - stdout_save = dup (STDOUT_FILENO); - if (stdout_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - stderr_save = dup (STDERR_FILENO); - if (stderr_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - - /* Redirect stdout & stderr to our response file. */ - dup2 (redir_handle, STDOUT_FILENO); - dup2 (redir_handle, STDERR_FILENO); + redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IWUSR); + if (redir_handle == -1) + fatal ("cannot open `%s' for writing", redir); } - pid = pexecute (argv[0], argv, argv[0], NULL, &errmsg_fmt, &errmsg_arg, - (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH)); + pid = pexec (argv[0], argv, 1, -1, redir_handle, redir_handle); - if (redir) - { - /* Restore stdout and stderr to their previous settings. */ - dup2 (stdout_save, STDOUT_FILENO); - dup2 (stderr_save, STDERR_FILENO); - - /* Close response file. */ - close (redir_handle); - } - - if (pid == -1) - fatal_perror (errmsg_fmt, errmsg_arg); + if (pid == -1) + fatal_perror ("pexec"); } static void @@ -1984,8 +2024,6 @@ write_aix_file (FILE *stream, struct id *list) static void scan_prog_file (const char *prog_name, enum pass which_pass) { - void (*int_handler) (int); - void (*quit_handler) (int); char *real_nm_argv[4]; const char **nm_argv = (const char **) real_nm_argv; int argc = 0; @@ -2007,7 +2045,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) nm_argv[argc++] = prog_name; nm_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) + if (pmkpipe (pipe_fd) < 0) fatal_perror ("pipe"); inf = fdopen (pipe_fd[0], "r"); @@ -2026,38 +2064,14 @@ scan_prog_file (const char *prog_name, enum pass which_pass) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* Spawn child nm on pipe. */ - pid = vfork (); + pid = pexec (nm_file_name, real_nm_argv, 0, -1, pipe_fd[1], -1); + if (pid == -1) - fatal_perror (VFORK_STRING); - - if (pid == 0) /* child context */ - { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (nm_file_name, real_nm_argv); - fatal_perror ("execv %s", nm_file_name); - } - + fatal_perror ("pexec"); + /* Parent context from here on. */ - int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); -#ifdef SIGQUIT - quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); -#endif - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + disable_break (); if (debug) fprintf (stderr, "\nnm output with constructors/destructors.\n"); @@ -2136,10 +2150,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) do_wait (nm_file_name); - signal (SIGINT, int_handler); -#ifdef SIGQUIT - signal (SIGQUIT, quit_handler); -#endif + enable_break (); } #if SUNOS4_SHARED_LIBRARIES @@ -2416,8 +2427,6 @@ scan_libraries (const char *prog_name) { static struct head libraries; /* list of shared libraries found */ struct id *list; - void (*int_handler) (int); - void (*quit_handler) (int); char *real_ldd_argv[4]; const char **ldd_argv = (const char **) real_ldd_argv; int argc = 0; @@ -2436,7 +2445,7 @@ scan_libraries (const char *prog_name) ldd_argv[argc++] = prog_name; ldd_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) + if (pmkpipe (pipe_fd) < 0) fatal_perror ("pipe"); inf = fdopen (pipe_fd[0], "r"); @@ -2455,38 +2464,14 @@ scan_libraries (const char *prog_name) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* Spawn child ldd on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); - - if (pid == 0) /* child context */ - { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (ldd_file_name, real_ldd_argv); - fatal_perror ("execv %s", ldd_file_name); - } + pexecute_pid = pexec (ldd_file_name, real_ldd_argv, 0, -1, infpipe[1], -1); + + if (pexecute_pid == -1) + fatal_perror ("pexec"); /* Parent context from here on. */ - int_handler = (void (*) (int))) signal (SIGINT, SIG_IGN; -#ifdef SIGQUIT - quit_handler = (void (*) (int))) signal (SIGQUIT, SIG_IGN; -#endif - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + disable_break (); if (debug) notice ("\nldd output with constructors/destructors.\n"); @@ -2529,11 +2514,7 @@ scan_libraries (const char *prog_name) do_wait (ldd_file_name); - signal (SIGINT, int_handler); -#ifdef SIGQUIT - signal (SIGQUIT, quit_handler); -#endif - + enable_break (); /* now iterate through the library list adding their symbols to the list. */ for (list = libraries.first; list; list = list->next) @@ -2552,7 +2533,7 @@ scan_libraries (const char *prog_name) #ifdef OBJECT_FORMAT_COFF -#if defined(EXTENDED_COFF) +#if defined (EXTENDED_COFF) # define GCC_SYMBOLS(X) (SYMHEADER(X).isymMax + SYMHEADER(X).iextMax) # define GCC_SYMENT SYMR @@ -2565,14 +2546,26 @@ scan_libraries (const char *prog_name) # define GCC_SYMBOLS(X) (HEADER(ldptr).f_nsyms) # define GCC_SYMENT SYMENT -# define GCC_OK_SYMBOL(X) \ - (((X).n_sclass == C_EXT) && \ - ((X).n_scnum > N_UNDEF) && \ - (aix64_flag \ - || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ - || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) -# define GCC_UNDEF_SYMBOL(X) \ - (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF)) +# if defined (C_WEAKEXT) +# define GCC_OK_SYMBOL(X) \ + (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \ + ((X).n_scnum > N_UNDEF) && \ + (aix64_flag \ + || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ + || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) +# define GCC_UNDEF_SYMBOL(X) \ + (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \ + ((X).n_scnum == N_UNDEF)) +# else +# define GCC_OK_SYMBOL(X) \ + (((X).n_sclass == C_EXT) && \ + ((X).n_scnum > N_UNDEF) && \ + (aix64_flag \ + || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ + || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) +# define GCC_UNDEF_SYMBOL(X) \ + (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF)) +# endif # define GCC_SYMINC(X) ((X).n_numaux+1) # define GCC_SYMZERO(X) 0 diff --git a/gcc/combine.c b/gcc/combine.c index c36d9223724..2c92d247aa8 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -345,7 +345,6 @@ static void setup_incoming_promotions (void); static void set_nonzero_bits_and_sign_copies (rtx, rtx, void *); static int cant_combine_insn_p (rtx); static int can_combine_p (rtx, rtx, rtx, rtx, rtx *, rtx *); -static int sets_function_arg_p (rtx); static int combinable_i3pat (rtx, rtx *, rtx, rtx, int, rtx *); static int contains_muldiv (rtx); static rtx try_combine (rtx, rtx, rtx, int *); @@ -609,8 +608,8 @@ combine_instructions (rtx f, unsigned int nregs) FOR_EACH_BB (this_basic_block) { - for (insn = this_basic_block->head; - insn != NEXT_INSN (this_basic_block->end); + for (insn = BB_HEAD (this_basic_block); + insn != NEXT_INSN (BB_END (this_basic_block)); insn = next ? next : NEXT_INSN (insn)) { next = 0; @@ -1205,45 +1204,6 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, return 1; } -/* Check if PAT is an insn - or a part of it - used to set up an - argument for a function in a hard register. */ - -static int -sets_function_arg_p (rtx pat) -{ - int i; - rtx inner_dest; - - switch (GET_CODE (pat)) - { - case INSN: - return sets_function_arg_p (PATTERN (pat)); - - case PARALLEL: - for (i = XVECLEN (pat, 0); --i >= 0;) - if (sets_function_arg_p (XVECEXP (pat, 0, i))) - return 1; - - break; - - case SET: - inner_dest = SET_DEST (pat); - while (GET_CODE (inner_dest) == STRICT_LOW_PART - || GET_CODE (inner_dest) == SUBREG - || GET_CODE (inner_dest) == ZERO_EXTRACT) - inner_dest = XEXP (inner_dest, 0); - - return (GET_CODE (inner_dest) == REG - && REGNO (inner_dest) < FIRST_PSEUDO_REGISTER - && FUNCTION_ARG_REGNO_P (REGNO (inner_dest))); - - default: - break; - } - - return 0; -} - /* LOC is the location within I3 that contains its pattern or the component of a PARALLEL of the pattern. We validate that it is valid for combining. @@ -2377,7 +2337,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) for (insn = NEXT_INSN (i3); insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR - || insn != this_basic_block->next_bb->head); + || insn != BB_HEAD (this_basic_block->next_bb)); insn = NEXT_INSN (insn)) { if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn))) @@ -2586,7 +2546,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) SET_DEST (XVECEXP (PATTERN (i2), 0, i)))) for (temp = NEXT_INSN (i2); temp && (this_basic_block->next_bb == EXIT_BLOCK_PTR - || this_basic_block->head != temp); + || BB_HEAD (this_basic_block) != temp); temp = NEXT_INSN (temp)) if (temp != i3 && INSN_P (temp)) for (link = LOG_LINKS (temp); link; link = XEXP (link, 1)) @@ -6083,10 +6043,11 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, { if (tmode != inner_mode) { - if (in_dest) + /* We can't call gen_lowpart_for_combine in a DEST since we + always want a SUBREG (see below) and it would sometimes + return a new hard register. */ + if (pos || in_dest) { - /* We can't call gen_lowpart_for_combine here since we always want - a SUBREG and it would sometimes return a new hard register. */ HOST_WIDE_INT final_word = pos / BITS_PER_WORD; if (WORDS_BIG_ENDIAN @@ -12018,7 +11979,7 @@ reg_dead_at_p (rtx reg, rtx insn) else { FOR_EACH_BB (block) - if (insn == block->head) + if (insn == BB_HEAD (block)) break; if (block == EXIT_BLOCK_PTR) @@ -12657,7 +12618,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) { if (! INSN_P (tem)) { - if (tem == bb->head) + if (tem == BB_HEAD (bb)) break; continue; } @@ -12702,11 +12663,12 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) This might delete other dead insns recursively. First set the pattern to something that won't use any register. */ + rtx old_notes = REG_NOTES (tem); PATTERN (tem) = pc_rtx; + REG_NOTES (tem) = NULL; - distribute_notes (REG_NOTES (tem), tem, tem, - NULL_RTX); + distribute_notes (old_notes, tem, tem, NULL_RTX); distribute_links (LOG_LINKS (tem)); PUT_CODE (tem, NOTE); @@ -12718,10 +12680,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) if (cc0_setter) { PATTERN (cc0_setter) = pc_rtx; + old_notes = REG_NOTES (cc0_setter); + REG_NOTES (cc0_setter) = NULL; - distribute_notes (REG_NOTES (cc0_setter), - cc0_setter, cc0_setter, - NULL_RTX); + distribute_notes (old_notes, cc0_setter, + cc0_setter, NULL_RTX); distribute_links (LOG_LINKS (cc0_setter)); PUT_CODE (cc0_setter, NOTE); @@ -12782,7 +12745,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) break; } - if (tem == bb->head) + if (tem == BB_HEAD (bb)) break; } @@ -12879,7 +12842,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) { if (! INSN_P (tem)) { - if (tem == bb->head) + if (tem == BB_HEAD (bb)) { SET_BIT (refresh_blocks, this_basic_block->index); @@ -12986,7 +12949,7 @@ distribute_links (rtx links) for (insn = NEXT_INSN (XEXP (link, 0)); (insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR - || this_basic_block->next_bb->head != insn)); + || BB_HEAD (this_basic_block->next_bb) != insn)); insn = NEXT_INSN (insn)) if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn))) { diff --git a/gcc/common.opt b/gcc/common.opt index 2ad0e0a58f6..302dfac6709 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -366,10 +366,6 @@ fgcse-las Common Perform redundant load after store elimination in global common subexpression elimination -fgnu-linker -Common -Output GNU ld formatted global initializers - fguess-branch-probability Common Enable guessing of branch probabilities @@ -517,6 +513,14 @@ fprofile-arcs Common Insert arc-based program profiling code +fprofile-generate +Common +Enable common options for generating profile info for profile feedback directed optimizations + +fprofile-use +Common +Enable common options for performing profile feedback directed optimizations + fprofile-values Common Insert code to profile values of expressions @@ -628,18 +632,6 @@ fsingle-precision-constant Common Convert floating point constants to single precision constants -fssa -Common -Enable static single assignment optimizations - -fssa-ccp -Common -Enable SSA conditional constant propagation - -fssa-dce -Common -Enable aggressive SSA dead code elimination - fstack-check Common Insert stack checking code into the program @@ -751,14 +743,6 @@ gcoff Common JoinedOrMissing Generate debug information in COFF format -gdwarf -Common JoinedOrMissing -Generate debug information in DWARF v1 format - -gdwarf+ -Common JoinedOrMissing -Generate debug information in extended DWARF v1 format - gdwarf-2 Common JoinedOrMissing Generate debug information in DWARF v2 format diff --git a/gcc/config.gcc b/gcc/config.gcc index 5249689ab17..680aa3cdab6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1,5 +1,5 @@ # GCC target-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. #This file is part of GCC. @@ -182,7 +182,23 @@ md_file= # Obsolete configurations. case ${target} in - dummy) + d30v-* | \ + dsp16xx-* | \ + i370-* | \ + i960-* | \ + i?86-moss-msdos | i?86-*-moss* | \ + i?86-ncr-sysv4* | \ + i?86-*-netware | \ + i?86-*-freebsd2* | i?86-*-freebsd*aout* | \ + i?86-*-linux*aout* | \ + i?86-*-linux*libc1* | \ + i?86-*-interix | \ + i?86-*-mach* | \ + i?86-*-udk* | \ + i?86-*-sysv[123]* | \ + i386-*-vsta | \ + m68k-hp-hpux* | m68000-hp-hpux* | \ + m68k-*-sysv4*) if test "x$enable_obsolete" != xyes; then echo "*** Configuration ${target} is obsolete." >&2 echo "*** Specify --enable-obsolete to build it anyway." >&2 @@ -643,7 +659,7 @@ arm*-*-netbsd*) use_collect2=yes ;; arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h" + tm_file="dbxelf.h elfos.h linux.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h" tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" gnu_ld=yes @@ -875,7 +891,6 @@ i370-*-linux*) ;; i[34567]86-*-darwin*) tm_file="${tm_file} i386/darwin.h" - use_fixproto=yes ;; i[34567]86-*-elf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h" @@ -1324,12 +1339,14 @@ m68k-*-coff*) ;; m68020-*-elf* | m68k-*-elf*) tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h" + tm_defines="MOTOROLA USE_GAS" tmake_file=m68k/t-m68kelf extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; m68010-*-netbsdelf* | m68k*-*-netbsdelf*) tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h" + tm_defines="MOTOROLA USE_GAS" case ${target} in m68010*) target_cpu_default="0" @@ -1340,6 +1357,13 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*) esac ;; m68k*-*-netbsd*) + if test "x$enable_obsolete" != xyes; then + echo "*** Configuration ${target} is obsolete." >&2 + echo "*** Specify --enable-obsolete to build it anyway." >&2 + echo "*** Support will be REMOVED in the next major release of GCC," >&2 + echo "*** unless a maintainer comes forward." >&2 + exit 1 + fi tm_file="m68k/m68k.h netbsd.h netbsd-aout.h m68k/netbsd.h" tmake_file=t-netbsd extra_parts="" @@ -1376,6 +1400,7 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux m68k-*-rtems*) tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems" tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h" + tm_defines="MOTOROLA USE_GAS" extra_parts="crtbegin.o crtend.o" ;; mcore-*-elf) @@ -1418,6 +1443,7 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI ;; mips-sgi-irix6*) # SGI System V.4., IRIX 6 tm_file="${tm_file} mips/iris5.h mips/iris6.h" + tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6" if test x$gas = xyes then tm_file="${tm_file} mips/iris6gas.h" @@ -1425,8 +1451,8 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6 if test "x$gnu_ld" = xyes then tm_file="${tm_file} mips/iris6gld.h" + tmake_file="$tmake_file mips/t-iris6gld" fi - tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6" target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT" tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" # See comment in mips/iris5.h file. Only enabled for O32 ABI @@ -1653,11 +1679,8 @@ powerpc-*-beos*) ;; powerpc-*-darwin*) tm_file="${tm_file} rs6000/darwin.h" - tmake_file="t-darwin rs6000/t-darwin" + tmake_file="t-darwin t-slibgcc-darwin rs6000/t-darwin" extra_headers=altivec.h - # override ppc default - need_64bit_hwint= - use_fixproto=yes ;; powerpc*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h" @@ -1823,6 +1846,7 @@ s390x-ibm-tpf*) tm_p_file=s390/s390-protos.h md_file=s390/s390.md extra_modes=s390/s390-modes.def + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" out_file=s390/s390.c tmake_file="t-slibgcc-elf-ver s390/t-crtstuff s390/t-tpf" ;; @@ -2191,6 +2215,13 @@ vax-*-ultrix*) # VAXen running ultrix use_fixproto=yes ;; vax-*-*) # VAX default entry + if test "x$enable_obsolete" != xyes; then + echo "*** Configuration ${target} is obsolete." >&2 + echo "*** Specify --enable-obsolete to build it anyway." >&2 + echo "*** Support will be REMOVED in the next major release of GCC," >&2 + echo "*** unless a maintainer comes forward." >&2 + exit 1 + fi use_fixproto=yes ;; xscale-*-elf) @@ -2368,7 +2399,7 @@ fi ;; arm*-*-*) - supported_defaults="arch cpu float tune" + supported_defaults="arch cpu float tune fpu" for which in cpu tune; do eval "val=\$with_$which" case "$val" in @@ -2395,7 +2426,7 @@ fi case "$with_arch" in "" \ - | armv[2345] | armv2a | armv3m | armv4t | armv5t \ + | armv[23456] | armv2a | armv3m | armv4t | armv5t \ | armv5te | armv6j | ep9312) # OK ;; @@ -2407,7 +2438,7 @@ fi case "$with_float" in "" \ - | soft | hard) + | soft | hard | softfp) # OK ;; *) @@ -2416,6 +2447,17 @@ fi ;; esac + case "$with_fpu" in + "" \ + | fpa | fpe2 | fpe3 | maverick | vfp ) + # OK + ;; + *) + echo "Unknown fpu used in --with-fpu=$fpu" 2>&1 + exit 1 + ;; + esac + if test "x$with_arch" != x && test "x$with_cpu" != x; then echo "Warning: --with-arch overrides --with-cpu" 1>&2 fi @@ -2502,7 +2544,7 @@ fi | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \ | 601 | 602 | 603 | 603e | ec603e | 604 \ | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \ - | 8540 | 801 | 821 | 823 | 860 | 970) + | 8540 | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5) # OK ;; *) @@ -2701,7 +2743,7 @@ fi esac t= - all_defaults="abi cpu arch tune schedule float mode" + all_defaults="abi cpu arch tune schedule float mode fpu" for option in $all_defaults do eval "val=\$with_$option" diff --git a/gcc/config.guess b/gcc/config.guess deleted file mode 100755 index fd7602dabd9..00000000000 --- a/gcc/config.guess +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Use the top-level config.guess so that we don't have two of them. -guesssys=`echo $0 | sed 's|config.guess|../config.guess|'` -exec ${guesssys} "$@" diff --git a/gcc/config.in b/gcc/config.in index 3a44fed9ee8..f4145a217d0 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -115,6 +115,9 @@ /* Define if you have the header file. */ #undef HAVE_FCNTL_H +/* Define if you have the header file. */ +#undef HAVE_ICONV_H + /* Define if you have the header file. */ #undef HAVE_LANGINFO_H @@ -241,9 +244,15 @@ through valgrind (a memory checker). This is extremely expensive. */ #undef ENABLE_VALGRIND_CHECKING +/* Define if valgrind's valgrind/memcheck.h header is installed. */ +#undef HAVE_VALGRIND_MEMCHECK_H + /* Define if valgrind's memcheck.h header is installed. */ #undef HAVE_MEMCHECK_H +/* Define to enable detailed memory allocation stats gathering. */ +#undef GATHER_STATISTICS + /* Always define this when using the GNU C Library */ #undef _GNU_SOURCE @@ -511,9 +520,6 @@ /* Define if your linker supports -pie option. */ #undef HAVE_LD_PIE -/* Define if your MIPS libgloss linker scripts consistently include STARTUP directives. */ -#undef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES - /* Define to PREFIX/include if cpp should also search that directory. */ #undef PREFIX_INCLUDE_DIR diff --git a/gcc/config/alpha/alpha-modes.def b/gcc/config/alpha/alpha-modes.def index b3747a1dae8..8e9e6984bd2 100644 --- a/gcc/config/alpha/alpha-modes.def +++ b/gcc/config/alpha/alpha-modes.def @@ -19,5 +19,5 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 128-bit floating point. This gets reset in alpha_override_options - if VAX float format is in use. */ + 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 29caf8f095b..95f1ad25c7c 100644 --- a/gcc/config/alpha/alpha-protos.h +++ b/gcc/config/alpha/alpha-protos.h @@ -80,7 +80,6 @@ extern void print_operand (FILE *, rtx, int); extern void print_operand_address (FILE *, rtx); extern void alpha_initialize_trampoline (rtx, rtx, rtx, int, int, int); -extern tree alpha_build_va_list (void); extern void alpha_va_start (tree, rtx); extern rtx alpha_va_arg (tree, tree); extern rtx function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int); diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index b2ff003a959..9d7da136499 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2012,38 +2012,22 @@ split_small_symbolic_operand (rtx x) Technically we could copy them if we could set up a mapping from one sequence number to another, across the set of insns to be duplicated. This seems overly complicated and error-prone since interblock motion - from sched-ebb could move one of the pair of insns to a different block. */ + from sched-ebb could move one of the pair of insns to a different block. + + Also cannot allow jsr insns to be duplicated. If they throw exceptions, + then they'll be in a different block from their ldgp. Which could lead + the bb reorder code to think that it would be ok to copy just the block + containing the call and branch to the block containing the ldgp. */ static bool alpha_cannot_copy_insn_p (rtx insn) { - rtx pat; - if (!reload_completed || !TARGET_EXPLICIT_RELOCS) return false; - - if (GET_CODE (insn) != INSN) - return false; - if (asm_noperands (insn) >= 0) - return false; - - pat = PATTERN (insn); - if (GET_CODE (pat) != SET) + if (recog_memoized (insn) >= 0) + return get_attr_cannot_copy (insn); + else return false; - pat = SET_SRC (pat); - if (GET_CODE (pat) == UNSPEC_VOLATILE) - { - if (XINT (pat, 1) == UNSPECV_LDGP1 - || XINT (pat, 1) == UNSPECV_PLDGP2) - return true; - } - else if (GET_CODE (pat) == UNSPEC) - { - if (XINT (pat, 1) == UNSPEC_LDGP2) - return true; - } - - return false; } @@ -5141,7 +5125,7 @@ alpha_multipass_dfa_lookahead (void) struct machine_function GTY(()) { - /* For unicosmk. */ + /* For unicosmk. */ /* List of call information words for calls from this function. */ struct rtx_def *first_ciw; struct rtx_def *last_ciw; @@ -5150,7 +5134,7 @@ struct machine_function GTY(()) /* List of deferred case vectors. */ struct rtx_def *addr_list; - /* For OSF. */ + /* For OSF. */ const char *some_ld_name; }; @@ -6096,10 +6080,10 @@ function_value (tree valtype, tree func ATTRIBUTE_UNUSED, return gen_rtx_REG (mode, regnum); } -tree -alpha_build_va_list (void) +static tree +alpha_build_builtin_va_list (void) { - tree base, ofs, record, type_decl; + tree base, ofs, space, record, type_decl; if (TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK) return ptr_type_node; @@ -6111,9 +6095,16 @@ alpha_build_va_list (void) /* C++? SET_IS_AGGR_TYPE (record, 1); */ + /* Dummy field to prevent alignment warnings. */ + space = build_decl (FIELD_DECL, NULL_TREE, integer_type_node); + DECL_FIELD_CONTEXT (space) = record; + DECL_ARTIFICIAL (space) = 1; + DECL_IGNORED_P (space) = 1; + ofs = build_decl (FIELD_DECL, get_identifier ("__offset"), integer_type_node); DECL_FIELD_CONTEXT (ofs) = record; + TREE_CHAIN (ofs) = space; base = build_decl (FIELD_DECL, get_identifier ("__base"), ptr_type_node); @@ -6686,7 +6677,7 @@ alpha_expand_builtin (tree exp, rtx target, /* These variables are used for communication between the following functions. They indicate various things about the current function being compiled that are used to tell what kind of prologue, epilogue and procedure - descriptior to generate. */ + descriptor to generate. */ /* Nonzero if we need a stack procedure. */ enum alpha_procedure_types {PT_NULL = 0, PT_REGISTER = 1, PT_STACK = 2}; @@ -6712,13 +6703,10 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP) unsigned long fmask = 0; unsigned int i; - /* Irritatingly, there are two kinds of thunks -- those created with - TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go - through the regular part of the compiler. In the - TARGET_ASM_OUTPUT_MI_THUNK case we don't have valid register life - info, but assemble_start_function wants to output .frame and - .mask directives. */ - if (current_function_is_thunk && !no_new_pseudos) + /* When outputting a thunk, we don't have valid register life info, + but assemble_start_function wants to output .frame and .mask + directives. */ + if (current_function_is_thunk) { *imaskP = 0; *fmaskP = 0; @@ -6942,12 +6930,21 @@ alpha_does_function_need_gp (void) if (! TARGET_ABI_OSF) return 0; + /* We need the gp to load the address of __mcount. */ if (TARGET_PROFILING_NEEDS_GP && current_function_profile) return 1; + /* The code emitted by alpha_output_mi_thunk_osf uses the gp. */ if (current_function_is_thunk) return 1; + /* The nonlocal receiver pattern assumes that the gp is valid for + the nested function. Reasonable because it's almost always set + correctly already. For the cases where that's wrong, make sure + the nested function loads its gp on entry. */ + if (current_function_has_nonlocal_goto) + return 1; + /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first. Even if we are a static function, we still need to do this in case our address is taken and passed to something like qsort. */ @@ -8829,7 +8826,7 @@ alpha_align_insns (unsigned int max_align, int nop_count = (align - ofs) / 4; rtx where; - /* Insert nops before labels, branches, and calls to truely merge + /* Insert nops before labels, branches, and calls to truly merge the execution of the nops with the previous instruction group. */ where = prev_nonnote_insn (i); if (where) @@ -10204,6 +10201,9 @@ alpha_init_libfuncs (void) #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST alpha_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index a6d33220709..fac277240a3 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -818,7 +818,7 @@ enum reg_class { 'U' is a symbolic operand. - 'W' is a vector zero. */ + 'W' is a vector zero. */ #define EXTRA_CONSTRAINT alpha_extra_constraint @@ -1679,10 +1679,6 @@ do { \ {"some_small_symbolic_operand", {SET, PARALLEL, PREFETCH, UNSPEC, \ UNSPEC_VOLATILE}}, -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = alpha_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ alpha_va_start (valist, nextarg) diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 01f96ca47c2..6c25d67dff9 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -97,8 +97,8 @@ ;; separately. (define_attr "type" - "ild,fld,ldsym,ist,fst,ibr,callpal,fbr,jsr,iadd,ilog,shift,icmov,fcmov,icmp,imul,\ -fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" + "ild,fld,ldsym,ist,fst,ibr,callpal,fbr,jsr,iadd,ilog,shift,icmov,fcmov, + icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (const_string "iadd")) ;; Describe a user's asm statement. @@ -154,6 +154,14 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" ] (const_string "no"))) +;; The CANNOT_COPY attribute marks instructions with relocations that +;; cannot easily be duplicated. This includes insns with gpdisp relocs +;; since they have to stay in 1-1 correspondence with one another. This +;; also includes jsr insns, since they must stay in correspondence with +;; the immediately following gpdisp instructions. + +(define_attr "cannot_copy" "false,true" + (const_string "false")) ;; Include scheduling descriptions. @@ -4740,7 +4748,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (use (match_operand 3 "const_int_operand" ""))] "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" "jsr $26,(%0),%2%J3" - [(set_attr "type" "jsr")]) + [(set_attr "type" "jsr") + (set_attr "cannot_copy" "true")]) ;; We output a nop after noreturn calls at the very end of the function to ;; ensure that the return address always remains in the caller's code range, @@ -6814,7 +6823,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (match_operand 2 "const_int_operand" "")] UNSPECV_LDGP1))] "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" - "ldah %0,0(%1)\t\t!gpdisp!%2") + "ldah %0,0(%1)\t\t!gpdisp!%2" + [(set_attr "cannot_copy" "true")]) (define_insn "*ldgp_er_2" [(set (match_operand:DI 0 "register_operand" "=r") @@ -6822,7 +6832,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (match_operand 2 "const_int_operand" "")] UNSPEC_LDGP2))] "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" - "lda %0,0(%1)\t\t!gpdisp!%2") + "lda %0,0(%1)\t\t!gpdisp!%2" + [(set_attr "cannot_copy" "true")]) (define_insn "*prologue_ldgp_er_2" [(set (match_operand:DI 0 "register_operand" "=r") @@ -6830,7 +6841,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (match_operand 2 "const_int_operand" "")] UNSPECV_PLDGP2))] "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" - "lda %0,0(%1)\t\t!gpdisp!%2\n$%~..ng:") + "lda %0,0(%1)\t\t!gpdisp!%2\n$%~..ng:" + [(set_attr "cannot_copy" "true")]) (define_insn "*prologue_ldgp_1" [(set (match_operand:DI 0 "register_operand" "=r") @@ -6838,7 +6850,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (match_operand 2 "const_int_operand" "")] UNSPECV_LDGP1))] "" - "ldgp %0,0(%1)\n$%~..ng:") + "ldgp %0,0(%1)\n$%~..ng:" + [(set_attr "cannot_copy" "true")]) (define_insn "*prologue_ldgp_2" [(set (match_operand:DI 0 "register_operand" "=r") @@ -7974,7 +7987,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" (use (match_operand 4 "" ""))] "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" "jsr $26,(%1),%3%J4" - [(set_attr "type" "jsr")]) + [(set_attr "type" "jsr") + (set_attr "cannot_copy" "true")]) (define_insn "*call_value_osf_1_noreturn" [(set (match_operand 0 "" "") diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index f84fe3df5a2..34bba3ecb17 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -18,7 +18,7 @@ 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 COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +Boston, MA 02111-1307, USA. */ #undef OBJECT_FORMAT_COFF #undef EXTENDED_COFF @@ -215,7 +215,7 @@ extern void sdata_section (void); #undef SECTION_FUNCTION_TEMPLATE #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \ -void FN () \ +void FN (void) \ { \ if (in_section != ENUM) \ { \ @@ -389,7 +389,7 @@ void FN () \ /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the (even more) magical crtbegin.o file which provides part of the support for getting C++ file-scope static object constructed - before entering `main'. */ + before entering `main'. */ #undef STARTFILE_SPEC #ifdef HAVE_LD_PIE diff --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h index db2a278db4a..40348c60abb 100644 --- a/gcc/config/alpha/gnu.h +++ b/gcc/config/alpha/gnu.h @@ -6,11 +6,8 @@ #undef TARGET_OS_CPP_BUILTINS /* config.gcc includes alpha/linux.h. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ - builtin_define ("__GNU__"); \ - builtin_define ("__gnu_hurd__"); \ + HURD_TARGET_OS_CPP_BUILTINS(); \ builtin_define ("_LONGLONG"); \ - builtin_define_std ("unix"); \ - builtin_assert ("system=gnu"); \ } while (0) #undef ELF_DYNAMIC_LINKER diff --git a/gcc/config/alpha/lib1funcs.asm b/gcc/config/alpha/lib1funcs.asm index 6bea231bc06..a2abb1f8ae4 100644 --- a/gcc/config/alpha/lib1funcs.asm +++ b/gcc/config/alpha/lib1funcs.asm @@ -307,7 +307,7 @@ $46: conventions. */ #if TYPE == UNSIGNED && SIZE == 32 /* This could be avoided by adding some CPP hair to the divide loop. - It is probably not worth the added complexity. */ + It is probably not worth the added complexity. */ addl RETREG,0,RETREG #endif diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 2c9cc8ea6a1..a4bc3d3e4a4 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("linux"); \ builtin_define_std ("unix"); \ builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ /* The GNU C++ standard library requires this. */ \ if (c_dialect_cxx ()) \ builtin_define ("_GNU_SOURCE"); \ diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h index 45f627de142..b9df2e4255c 100644 --- a/gcc/config/alpha/openbsd.h +++ b/gcc/config/alpha/openbsd.h @@ -72,7 +72,7 @@ Boston, MA 02111-1307, USA. */ /* Assembler format: exception region output. */ /* All configurations that don't use elf must be explicit about not using - dwarf unwind information. */ + dwarf unwind information. */ #ifdef INCOMING_RETURN_ADDR_RTX #undef DWARF2_UNWIND_INFO #define DWARF2_UNWIND_INFO 0 diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h index 13e7626baca..fd72ba38132 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf.h @@ -49,6 +49,13 @@ Boston, MA 02111-1307, USA. */ to be defined for . */ \ if (LONG_DOUBLE_TYPE_SIZE == 128) \ builtin_define ("__X_FLOAT"); \ + \ + /* Tru64 UNIX V4/V5 provide several ISO C94 \ + features protected by the corresponding \ + __STDC_VERSION__ macro. libstdc++ v3 \ + needs them as well. */ \ + if (c_dialect_cxx ()) \ + builtin_define ("__STDC_VERSION__=199409L"); \ } while (0) /* Accept DEC C flags for multithreaded programs. We use _PTHREAD_USE_D4 diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h index c7f2bfe4aa7..5f75bbb87af 100644 --- a/gcc/config/alpha/unicosmk.h +++ b/gcc/config/alpha/unicosmk.h @@ -290,7 +290,7 @@ SSIB_SECTION extern void common_section (void); #define COMMON_SECTION \ void \ -common_section () \ +common_section (void) \ { \ in_section = in_common; \ } @@ -298,7 +298,7 @@ common_section () \ extern void ssib_section (void); #define SSIB_SECTION \ void \ -ssib_section () \ +ssib_section (void) \ { \ in_section = in_ssib; \ } @@ -480,7 +480,6 @@ ssib_section () \ #undef SDB_DEBUGGING_INFO #undef MIPS_DEBUGGING_INFO #undef DBX_DEBUGGING_INFO -#undef DWARF_DEBUGGING_INFO #undef DWARF2_DEBUGGING_INFO #undef DWARF2_UNWIND_INFO #undef INCOMING_RETURN_ADDR_RTX @@ -496,7 +495,6 @@ ssib_section () \ #undef LIB_SPEC #define LIB_SPEC "-L/opt/ctl/craylibs/craylibs -lu -lm -lc -lsma" -#undef BUILD_VA_LIST_TYPE #undef EXPAND_BUILTIN_VA_START #undef EXPAND_BUILTIN_VA_ARG diff --git a/gcc/config/alpha/vms-cc.c b/gcc/config/alpha/vms-cc.c index 8dd12da9f43..672a30fe468 100644 --- a/gcc/config/alpha/vms-cc.c +++ b/gcc/config/alpha/vms-cc.c @@ -49,22 +49,22 @@ static char *default_defines = (char *) ""; static char *defines; /* Translate a Unix syntax directory specification into VMS syntax. - If indicators of VMS syntax found, return input string. */ + If indicators of VMS syntax found, return input string. */ static char *to_host_dir_spec (char *); /* Translate a Unix syntax file specification into VMS syntax. - If indicators of VMS syntax found, return input string. */ + If indicators of VMS syntax found, return input string. */ static char *to_host_file_spec (char *); -/* Add a translated arg to the list to be passed to DEC CC */ +/* Add a translated arg to the list to be passed to DEC CC. */ static void addarg (const char *); /* Preprocess the number of args in P_ARGC and contained in ARGV. - Look for special flags, etc. that must be handled first. */ + Look for special flags, etc. that must be handled first. */ static void preprocess_args (int *, char **); /* Process the number of args in P_ARGC and contained in ARGV. Look - for special flags, etc. that must be handled for the VMS compiler. */ + for special flags, etc. that must be handled for the VMS compiler. */ static void process_args (int *, char **); /* Action routine called by decc$to_vms */ diff --git a/gcc/config/alpha/vms-crt0-64.c b/gcc/config/alpha/vms-crt0-64.c index 845059c83cd..9792f9205a5 100644 --- a/gcc/config/alpha/vms-crt0-64.c +++ b/gcc/config/alpha/vms-crt0-64.c @@ -77,7 +77,7 @@ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6) #pragma __pointer_size long - /* Reallocate argv with 64 bit pointers. */ + /* Reallocate argv with 64 bit pointers. */ long_argv = (char **) malloc (sizeof (char *) * (argc + 1)); for (i = 0; i < argc; i++) diff --git a/gcc/config/alpha/vms-crt0.c b/gcc/config/alpha/vms-crt0.c index a3c1310da0d..88896c63af7 100644 --- a/gcc/config/alpha/vms-crt0.c +++ b/gcc/config/alpha/vms-crt0.c @@ -33,7 +33,7 @@ You Lose! This file can only be compiled with DEC C. #else /* This file can only be compiled with DEC C, due to the call to - lib$establish. */ + lib$establish. */ #include #include diff --git a/gcc/config/alpha/vms-ld.c b/gcc/config/alpha/vms-ld.c index bb7495ed14d..cb1d4c93faa 100644 --- a/gcc/config/alpha/vms-ld.c +++ b/gcc/config/alpha/vms-ld.c @@ -44,7 +44,7 @@ static char *vmsdwarf2spec = 0; /* File specification for vms-dwarf2eh.o. */ static char *vmsdwarf2ehspec = 0; -/* verbose = 1 if -v passed. */ +/* verbose = 1 if -v passed. */ static int verbose = 0; /* save_temps = 1 if -save-temps passed. */ @@ -95,10 +95,10 @@ static void addarg (const char *); static int is_regular_file (char *); /* Translate a Unix syntax file specification FILESPEC into VMS syntax. - If indicators of VMS syntax found, return input string. */ + If indicators of VMS syntax found, return input string. */ static char *to_host_file_spec (char *); -/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */ +/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */ static char *locate_lib (char *, char *); /* Given a library name NAME, i.e. foo, Look for libfoo.lib and then @@ -106,15 +106,15 @@ static char *locate_lib (char *, char *); static const char *expand_lib (char *); /* Preprocess the number of args P_ARGC in ARGV. - Look for special flags, etc. that must be handled first. */ + Look for special flags, etc. that must be handled first. */ static void preprocess_args (int *, char **); /* Preprocess the number of args P_ARGC in ARGV. Look for - special flags, etc. that must be handled for the VMS linker. */ + special flags, etc. that must be handled for the VMS linker. */ static void process_args (int *, char **); /* Action routine called by decc$to_vms. NAME is a file name or - directory name. TYPE is unused. */ + directory name. TYPE is unused. */ static int translate_unix (char *, int); int main (int, char **); diff --git a/gcc/config/alpha/vms-psxcrt0-64.c b/gcc/config/alpha/vms-psxcrt0-64.c index 7f93392e484..8ca9e1d07b5 100644 --- a/gcc/config/alpha/vms-psxcrt0-64.c +++ b/gcc/config/alpha/vms-psxcrt0-64.c @@ -79,7 +79,7 @@ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6) #pragma __pointer_size long - /* Reallocate argv with 64 bit pointers. */ + /* Reallocate argv with 64 bit pointers. */ long_argv = (char **) malloc (sizeof (char *) * (argc + 1)); for (i = 0; i < argc; i++) diff --git a/gcc/config/alpha/vms-psxcrt0.c b/gcc/config/alpha/vms-psxcrt0.c index 1b51f6d2172..65962ee2219 100644 --- a/gcc/config/alpha/vms-psxcrt0.c +++ b/gcc/config/alpha/vms-psxcrt0.c @@ -33,7 +33,7 @@ You Lose! This file can only be compiled with DEC C. #else /* This file can only be compiled with DEC C, due to the call to - lib$establish. */ + lib$establish. */ #include #include diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index 8b065e7b9b0..338ed559a32 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -218,7 +218,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info; #undef EXTRA_SECTION_FUNCTIONS #define EXTRA_SECTION_FUNCTIONS \ void \ -link_section () \ +link_section (void) \ { \ if (in_section != in_link) \ { \ @@ -227,7 +227,7 @@ link_section () \ } \ } \ void \ -literals_section () \ +literals_section (void) \ { \ if (in_section != in_literals) \ { \ @@ -422,7 +422,7 @@ do { \ } /* Link with vms-dwarf2.o if -g (except -g0). This causes the - VMS link to pull all the dwarf2 debug sections together. */ + VMS link to pull all the dwarf2 debug sections together. */ #undef LINK_SPEC #define LINK_SPEC "%{g:-g vms-dwarf2.o%s} %{g0} %{g1:-g1 vms-dwarf2.o%s} \ %{g2:-g2 vms-dwarf2.o%s} %{g3:-g3 vms-dwarf2.o%s} %{shared} %{v} %{map}" diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index 511c1c76026..681e9e1ad92 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -20,58 +20,57 @@ Boston, MA 02111-1307, USA. */ #ifdef RTX_CODE #ifdef TREE_CODE -extern void arc_va_start PARAMS ((tree, rtx)); -extern rtx arc_va_arg PARAMS ((tree, tree)); +extern void arc_va_start (tree, rtx); +extern rtx arc_va_arg (tree, tree); #endif /* TREE_CODE */ -extern enum machine_mode arc_select_cc_mode PARAMS ((enum rtx_code, rtx, rtx)); +extern enum machine_mode arc_select_cc_mode (enum rtx_code, rtx, rtx); /* Define the function that build the compare insn for scc and bcc. */ -extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx)); +extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx); /* Declarations for various fns used in the .md file. */ -extern const char *output_shift PARAMS ((rtx *)); +extern const char *output_shift (rtx *); -extern int symbolic_operand PARAMS ((rtx, enum machine_mode)); -extern int arc_double_limm_p PARAMS ((rtx)); -extern int arc_eligible_for_epilogue_delay PARAMS ((rtx, int)); -extern void arc_initialize_trampoline PARAMS ((rtx, rtx, rtx)); -extern void arc_print_operand PARAMS ((FILE *, rtx, int)); -extern void arc_print_operand_address PARAMS ((FILE *, rtx)); -extern void arc_final_prescan_insn PARAMS ((rtx, rtx *, int)); -extern int call_address_operand PARAMS ((rtx, enum machine_mode)); -extern int call_operand PARAMS ((rtx, enum machine_mode)); -extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int short_immediate_operand PARAMS ((rtx, enum machine_mode)); -extern int long_immediate_operand PARAMS ((rtx, enum machine_mode)); -extern int long_immediate_loadstore_operand PARAMS ((rtx, enum machine_mode)); -extern int move_src_operand PARAMS ((rtx, enum machine_mode)); -extern int move_double_src_operand PARAMS ((rtx, enum machine_mode)); -extern int move_dest_operand PARAMS ((rtx, enum machine_mode)); -extern int load_update_operand PARAMS ((rtx, enum machine_mode)); -extern int store_update_operand PARAMS ((rtx, enum machine_mode)); -extern int nonvol_nonimm_operand PARAMS ((rtx, enum machine_mode)); -extern int const_sint32_operand PARAMS ((rtx, enum machine_mode)); -extern int const_uint32_operand PARAMS ((rtx, enum machine_mode)); -extern int proper_comparison_operator PARAMS ((rtx, enum machine_mode)); -extern int shift_operator PARAMS ((rtx, enum machine_mode)); +extern int symbolic_operand (rtx, enum machine_mode); +extern int arc_double_limm_p (rtx); +extern int arc_eligible_for_epilogue_delay (rtx, int); +extern void arc_initialize_trampoline (rtx, rtx, rtx); +extern void arc_print_operand (FILE *, rtx, int); +extern void arc_print_operand_address (FILE *, rtx); +extern void arc_final_prescan_insn (rtx, rtx *, int); +extern int call_address_operand (rtx, enum machine_mode); +extern int call_operand (rtx, enum machine_mode); +extern int symbolic_memory_operand (rtx, enum machine_mode); +extern int short_immediate_operand (rtx, enum machine_mode); +extern int long_immediate_operand (rtx, enum machine_mode); +extern int long_immediate_loadstore_operand (rtx, enum machine_mode); +extern int move_src_operand (rtx, enum machine_mode); +extern int move_double_src_operand (rtx, enum machine_mode); +extern int move_dest_operand (rtx, enum machine_mode); +extern int load_update_operand (rtx, enum machine_mode); +extern int store_update_operand (rtx, enum machine_mode); +extern int nonvol_nonimm_operand (rtx, enum machine_mode); +extern int const_sint32_operand (rtx, enum machine_mode); +extern int const_uint32_operand (rtx, enum machine_mode); +extern int proper_comparison_operator (rtx, enum machine_mode); +extern int shift_operator (rtx, enum machine_mode); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern enum arc_function_type arc_compute_function_type PARAMS ((tree)); -extern void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, tree, - int *, int)); +extern enum arc_function_type arc_compute_function_type (tree); +extern void arc_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree, int *, int); #endif /* TREE_CODE */ -extern void arc_init PARAMS ((void)); -extern unsigned int arc_compute_frame_size PARAMS ((int)); -extern void arc_save_restore PARAMS ((FILE *, const char *, unsigned int, - unsigned int, const char *)); -extern int arc_delay_slots_for_epilogue PARAMS ((void)); -extern void arc_finalize_pic PARAMS ((void)); -extern void arc_ccfsm_at_label PARAMS ((const char *, int)); -extern int arc_ccfsm_branch_deleted_p PARAMS ((void)); -extern void arc_ccfsm_record_branch_deleted PARAMS ((void)); +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 *); +extern int arc_delay_slots_for_epilogue (void); +extern void arc_finalize_pic (void); +extern void arc_ccfsm_at_label (const char *, int); +extern int arc_ccfsm_branch_deleted_p (void); +extern void arc_ccfsm_record_branch_deleted (void); diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 4e2022e5111..876bef56828 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -86,18 +86,18 @@ static int arc_ccfsm_target_label; arc_print_operand. */ static int last_insn_set_cc_p; static int current_insn_set_cc_p; -static void record_cc_ref PARAMS ((rtx)); -static void arc_init_reg_tables PARAMS ((void)); -static int get_arc_condition_code PARAMS ((rtx)); +static void record_cc_ref (rtx); +static void arc_init_reg_tables (void); +static int get_arc_condition_code (rtx); const struct attribute_spec arc_attribute_table[]; -static tree arc_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, bool *)); -static bool arc_assemble_integer PARAMS ((rtx, unsigned int, int)); -static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static void arc_file_start PARAMS ((void)); -static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long)); -static bool arc_rtx_costs PARAMS ((rtx, int, int, int *)); -static int arc_address_cost PARAMS ((rtx)); +static tree arc_handle_interrupt_attribute (tree *, tree, tree, int, bool *); +static bool arc_assemble_integer (rtx, unsigned int, int); +static void arc_output_function_prologue (FILE *, HOST_WIDE_INT); +static void arc_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void arc_file_start (void); +static void arc_internal_label (FILE *, const char *, unsigned long); +static bool arc_rtx_costs (rtx, int, int, int *); +static int arc_address_cost (rtx); /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -128,7 +128,7 @@ struct gcc_target targetm = TARGET_INITIALIZER; /* Called by OVERRIDE_OPTIONS to initialize various things. */ void -arc_init () +arc_init (void) { char *tmp; @@ -183,8 +183,7 @@ static const char *const arc_condition_codes[] = `(eq (...) (...))'. */ static int -get_arc_condition_code (comparison) - rtx comparison; +get_arc_condition_code (rtx comparison) { switch (GET_CODE (comparison)) { @@ -208,9 +207,9 @@ get_arc_condition_code (comparison) return the mode to be used for the comparison. */ enum machine_mode -arc_select_cc_mode (op, x, y) - enum rtx_code op; - rtx x, y ATTRIBUTE_UNUSED; +arc_select_cc_mode (enum rtx_code op, + rtx x ATTRIBUTE_UNUSED, + rtx y ATTRIBUTE_UNUSED) { switch (op) { @@ -284,7 +283,7 @@ unsigned int arc_mode_class [NUM_MACHINE_MODES]; enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER]; static void -arc_init_reg_tables () +arc_init_reg_tables (void) { int i; @@ -357,12 +356,11 @@ const struct attribute_spec arc_attribute_table[] = /* Handle an "interrupt" attribute; arguments as in struct attribute_spec.handler. */ static tree -arc_handle_interrupt_attribute (node, name, args, flags, no_add_attrs) - tree *node ATTRIBUTE_UNUSED; - tree name; - tree args; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +arc_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED, + tree name, + tree args, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { tree value = TREE_VALUE (args); @@ -387,9 +385,7 @@ arc_handle_interrupt_attribute (node, name, args, flags, no_add_attrs) /* Acceptable arguments to the call insn. */ int -call_address_operand (op, mode) - rtx op; - enum machine_mode mode; +call_address_operand (rtx op, enum machine_mode mode) { return (symbolic_operand (op, mode) || (GET_CODE (op) == CONST_INT && LEGITIMATE_CONSTANT_P (op)) @@ -397,9 +393,7 @@ call_address_operand (op, mode) } int -call_operand (op, mode) - rtx op; - enum machine_mode mode; +call_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != MEM) return 0; @@ -410,9 +404,7 @@ call_operand (op, mode) /* Returns 1 if OP is a symbol reference. */ int -symbolic_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -429,9 +421,7 @@ symbolic_operand (op, mode) operand of mode MODE. */ int -symbolic_memory_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) == SUBREG) op = SUBREG_REG (op); @@ -445,9 +435,7 @@ symbolic_memory_operand (op, mode) /* Return true if OP is a short immediate (shimm) value. */ int -short_immediate_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +short_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return 0; @@ -458,9 +446,7 @@ short_immediate_operand (op, mode) This is currently only used when calculating length attributes. */ int -long_immediate_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +long_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -488,9 +474,8 @@ long_immediate_operand (op, mode) This is currently only used when calculating length attributes. */ int -long_immediate_loadstore_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +long_immediate_loadstore_operand (rtx op, + enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != MEM) return 0; @@ -530,9 +515,7 @@ long_immediate_loadstore_operand (op, mode) move source. */ int -move_src_operand (op, mode) - rtx op; - enum machine_mode mode; +move_src_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -572,9 +555,7 @@ move_src_operand (op, mode) move source. */ int -move_double_src_operand (op, mode) - rtx op; - enum machine_mode mode; +move_double_src_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -604,9 +585,7 @@ move_double_src_operand (op, mode) /* Return true if OP is an acceptable argument for a move destination. */ int -move_dest_operand (op, mode) - rtx op; - enum machine_mode mode; +move_dest_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -629,9 +608,7 @@ move_dest_operand (op, mode) /* Return true if OP is valid load with update operand. */ int -load_update_operand (op, mode) - rtx op; - enum machine_mode mode; +load_update_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != MEM || GET_MODE (op) != mode) @@ -648,9 +625,7 @@ load_update_operand (op, mode) /* Return true if OP is valid store with update operand. */ int -store_update_operand (op, mode) - rtx op; - enum machine_mode mode; +store_update_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != MEM || GET_MODE (op) != mode) @@ -670,9 +645,7 @@ store_update_operand (op, mode) and only the standard movXX patterns are set up to handle them. */ int -nonvol_nonimm_operand (op, mode) - rtx op; - enum machine_mode mode; +nonvol_nonimm_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == MEM && MEM_VOLATILE_P (op)) return 0; @@ -684,9 +657,7 @@ nonvol_nonimm_operand (op, mode) contexts. */ int -const_sint32_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +const_sint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { /* All allowed constants will fit a CONST_INT. */ return (GET_CODE (op) == CONST_INT @@ -698,9 +669,7 @@ const_sint32_operand (op, mode) need some extra crud to make it work when hosted on 64-bit machines. */ int -const_uint32_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +const_uint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { #if HOST_BITS_PER_WIDE_INT > 32 /* All allowed constants will fit a CONST_INT. */ @@ -719,9 +688,7 @@ const_uint32_operand (op, mode) comparisons that use the bits that are valid. */ int -proper_comparison_operator (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +proper_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { enum rtx_code code = GET_CODE (op); @@ -742,9 +709,7 @@ proper_comparison_operator (op, mode) return the rtx for the cc reg in the proper mode. */ rtx -gen_compare_reg (code, x, y) - enum rtx_code code; - rtx x, y; +gen_compare_reg (enum rtx_code code, rtx x, rtx y) { enum machine_mode mode = SELECT_CC_MODE (code, x, y); rtx cc_reg; @@ -761,8 +726,7 @@ gen_compare_reg (code, x, y) We assume the value can be either signed or unsigned. */ int -arc_double_limm_p (value) - rtx value; +arc_double_limm_p (rtx value) { HOST_WIDE_INT low, high; @@ -798,12 +762,11 @@ arc_double_limm_p (value) to compensate. */ void -arc_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int *pretend_size; - int no_rtl; +arc_setup_incoming_varargs (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + int *pretend_size, + int no_rtl) { int first_anon_arg; @@ -845,11 +808,7 @@ arc_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) scanned. In either case, *TOTAL contains the cost result. */ static bool -arc_rtx_costs (x, code, outer_code, total) - rtx x; - int code; - int outer_code ATTRIBUTE_UNUSED; - int *total; +arc_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) { switch (code) { @@ -903,8 +862,7 @@ arc_rtx_costs (x, code, outer_code, total) If ADDR is not a valid address, its cost is irrelevant. */ static int -arc_address_cost (addr) - rtx addr; +arc_address_cost (rtx addr) { switch (GET_CODE (addr)) { @@ -1019,8 +977,7 @@ static struct arc_frame_info zero_frame_info; call with DECL = NULL_TREE. */ enum arc_function_type -arc_compute_function_type (decl) - tree decl; +arc_compute_function_type (tree decl) { tree a; /* Cached value. */ @@ -1090,8 +1047,7 @@ arc_compute_function_type (decl) SIZE is the size needed for local variables. */ unsigned int -arc_compute_frame_size (size) - int size; /* # of var. bytes allocated. */ +arc_compute_frame_size (int size /* # of var. bytes allocated. */) { int regno; unsigned int total_size, var_size, args_size, pretend_size, extra_size; @@ -1155,12 +1111,11 @@ arc_compute_frame_size (size) /* Common code to save/restore registers. */ void -arc_save_restore (file, base_reg, offset, gmask, op) - FILE *file; - const char *base_reg; - unsigned int offset; - unsigned int gmask; - const char *op; +arc_save_restore (FILE *file, + const char *base_reg, + unsigned int offset, + unsigned int gmask, + const char *op) { int regno; @@ -1183,10 +1138,7 @@ arc_save_restore (file, base_reg, offset, gmask, op) symbols. */ static bool -arc_assemble_integer (x, size, aligned_p) - rtx x; - unsigned int size; - int aligned_p; +arc_assemble_integer (rtx x, unsigned int size, int aligned_p) { if (size == UNITS_PER_WORD && aligned_p && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x)) @@ -1203,9 +1155,7 @@ arc_assemble_integer (x, size, aligned_p) /* Set up the stack and frame pointer (if desired) for the function. */ static void -arc_output_function_prologue (file, size) - FILE *file; - HOST_WIDE_INT size; +arc_output_function_prologue (FILE *file, HOST_WIDE_INT size) { const char *sp_str = reg_names[STACK_POINTER_REGNUM]; const char *fp_str = reg_names[FRAME_POINTER_REGNUM]; @@ -1281,9 +1231,7 @@ arc_output_function_prologue (file, size) and regs. */ static void -arc_output_function_epilogue (file, size) - FILE *file; - HOST_WIDE_INT size; +arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) { rtx epilogue_delay = current_function_epilogue_delay_list; int noepilogue = FALSE; @@ -1446,7 +1394,7 @@ arc_output_function_epilogue (file, size) delay slot so for now we only consider functions with empty frames. */ int -arc_delay_slots_for_epilogue () +arc_delay_slots_for_epilogue (void) { if (arc_compute_function_type (current_function_decl) != ARC_FUNCTION_NORMAL) return 0; @@ -1462,9 +1410,7 @@ arc_delay_slots_for_epilogue () pointer or any call-saved register is OK. SLOT will always be 0. */ int -arc_eligible_for_epilogue_delay (trial, slot) - rtx trial; - int slot; +arc_eligible_for_epilogue_delay (rtx trial, int slot) { if (slot != 0) abort (); @@ -1489,7 +1435,7 @@ arc_eligible_for_epilogue_delay (trial, slot) /* Emit special PIC prologues and epilogues. */ void -arc_finalize_pic () +arc_finalize_pic (void) { /* nothing to do */ } @@ -1497,9 +1443,7 @@ arc_finalize_pic () /* Return true if OP is a shift operator. */ int -shift_operator (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -1527,8 +1471,7 @@ shift_operator (op, mode) using it here will give us a chance to play with it. */ const char * -output_shift (operands) - rtx *operands; +output_shift (rtx *operands) { rtx shift = operands[3]; enum machine_mode mode = GET_MODE (shift); @@ -1649,8 +1592,9 @@ output_shift (operands) CXT is an RTX for the static chain value for the function. */ void -arc_initialize_trampoline (tramp, fnaddr, cxt) - rtx tramp ATTRIBUTE_UNUSED, fnaddr ATTRIBUTE_UNUSED, cxt ATTRIBUTE_UNUSED; +arc_initialize_trampoline (rtx tramp ATTRIBUTE_UNUSED, + rtx fnaddr ATTRIBUTE_UNUSED, + rtx cxt ATTRIBUTE_UNUSED) { } @@ -1658,7 +1602,7 @@ arc_initialize_trampoline (tramp, fnaddr, cxt) at the top of the file. */ static void -arc_file_start () +arc_file_start (void) { default_file_start (); fprintf (asm_out_file, "\t.cpu %s\n", arc_cpu_string); @@ -1669,10 +1613,7 @@ arc_file_start () For `%' followed by punctuation, CODE is the punctuation and X is null. */ void -arc_print_operand (file, x, code) - FILE *file; - rtx x; - int code; +arc_print_operand (FILE *file, rtx x, int code) { switch (code) { @@ -1884,9 +1825,7 @@ arc_print_operand (file, x, code) /* Print a memory address as an operand to reference that memory location. */ void -arc_print_operand_address (file, addr) - FILE *file; - rtx addr; +arc_print_operand_address (FILE *file, rtx addr) { register rtx base, index = 0; int offset = 0; @@ -1943,8 +1882,7 @@ arc_print_operand_address (file, addr) /* Update compare/branch separation marker. */ static void -record_cc_ref (insn) - rtx insn; +record_cc_ref (rtx insn) { last_insn_set_cc_p = current_insn_set_cc_p; @@ -2000,10 +1938,9 @@ record_cc_ref (insn) we may not be outputting the branch. */ void -arc_final_prescan_insn (insn, opvec, noperands) - rtx insn; - rtx *opvec ATTRIBUTE_UNUSED; - int noperands ATTRIBUTE_UNUSED; +arc_final_prescan_insn (rtx insn, + rtx *opvec ATTRIBUTE_UNUSED, + int noperands ATTRIBUTE_UNUSED) { /* BODY will hold the body of INSN. */ register rtx body = PATTERN (insn); @@ -2285,9 +2222,7 @@ arc_final_prescan_insn (insn, opvec, noperands) Called from (*targetm.asm_out.internal_label). */ void -arc_ccfsm_at_label (prefix, num) - const char *prefix; - int num; +arc_ccfsm_at_label (const char *prefix, int num) { if (arc_ccfsm_state == 3 && arc_ccfsm_target_label == num && !strcmp (prefix, "L")) @@ -2301,7 +2236,7 @@ arc_ccfsm_at_label (prefix, num) deleted. */ int -arc_ccfsm_branch_deleted_p () +arc_ccfsm_branch_deleted_p (void) { if (arc_ccfsm_state == 1 || arc_ccfsm_state == 2) return 1; @@ -2312,7 +2247,7 @@ arc_ccfsm_branch_deleted_p () conditionalized. */ void -arc_ccfsm_record_branch_deleted () +arc_ccfsm_record_branch_deleted (void) { /* Indicate we're conditionalizing insns now. */ arc_ccfsm_state += 2; @@ -2324,9 +2259,7 @@ arc_ccfsm_record_branch_deleted () } void -arc_va_start (valist, nextarg) - tree valist; - rtx nextarg; +arc_va_start (tree valist, rtx nextarg) { /* See arc_setup_incoming_varargs for reasons for this oddity. */ if (current_function_args_info < 8 @@ -2337,8 +2270,7 @@ arc_va_start (valist, nextarg) } rtx -arc_va_arg (valist, type) - tree valist, type; +arc_va_arg (tree valist, tree type) { rtx addr_rtx; tree addr, incr; @@ -2413,10 +2345,7 @@ arc_va_arg (valist, type) PREFIX is the class of label and NUM is the number within the class. */ static void -arc_internal_label (stream, prefix, labelno) - FILE *stream; - const char *prefix; - unsigned long labelno; +arc_internal_label (FILE *stream, const char *prefix, unsigned long labelno) { arc_ccfsm_at_label (prefix, labelno); default_internal_label (stream, prefix, labelno); diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 2135c6c057d..5a5f168a83c 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1245,7 +1245,6 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0) /* Generate DBX and DWARF debugging information. */ #define DBX_DEBUGGING_INFO 1 -#define DWARF_DEBUGGING_INFO 1 /* Prefer STABS (for now). */ #undef PREFERRED_DEBUGGING_TYPE diff --git a/gcc/config/arc/initfini.c b/gcc/config/arc/initfini.c index a20ae7f7947..ca88a76aee9 100644 --- a/gcc/config/arc/initfini.c +++ b/gcc/config/arc/initfini.c @@ -66,11 +66,11 @@ static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors"))) refers to one particular associated `__DTOR_LIST__' which belongs to the same particular root executable or shared library file. */ -static void __do_global_dtors () +static void __do_global_dtors (void) asm ("__do_global_dtors") __attribute__ ((section (".text"))); static void -__do_global_dtors () +__do_global_dtors (void) { func_ptr *p; for (p = __DTOR_LIST__ + 1; *p; p++) @@ -125,11 +125,11 @@ static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors"))) /* Run all global constructors for the program. Note that they are run in reverse order. */ -static void __do_global_ctors () +static void __do_global_ctors (void) asm ("__do_global_ctors") __attribute__ ((section (".text"))); static void -__do_global_ctors () +__do_global_ctors (void) { func_ptr *p; for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h index 2650a0eedd2..8f058e26406 100644 --- a/gcc/config/arm/aof.h +++ b/gcc/config/arm/aof.h @@ -133,7 +133,7 @@ /* Some systems use __main in a way incompatible with its use in gcc, in these cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to give the same symbol without quotes for an alternative entry point. You - must define both, or neither. */ + must define both, or neither. */ #define NAME__MAIN "__gccmain" #define SYMBOL__MAIN __gccmain @@ -246,7 +246,12 @@ do { \ "wr0", "wr1", "wr2", "wr3", \ "wr4", "wr5", "wr6", "wr7", \ "wr8", "wr9", "wr10", "wr11", \ - "wr12", "wr13", "wr14", "wr15" \ + "wr12", "wr13", "wr14", "wr15", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \ + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \ + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \ + "vfpcc" } #define ADDITIONAL_REGISTER_NAMES \ @@ -267,6 +272,22 @@ do { \ {"r13", 13}, {"sp", 13}, \ {"r14", 14}, {"lr", 14}, \ {"r15", 15}, {"pc", 15} \ + {"d0", 63}, \ + {"d1", 65}, \ + {"d2", 67}, \ + {"d3", 69}, \ + {"d4", 71}, \ + {"d5", 73}, \ + {"d6", 75}, \ + {"d7", 77}, \ + {"d8", 79}, \ + {"d9", 81}, \ + {"d10", 83}, \ + {"d11", 85}, \ + {"d12", 87}, \ + {"d13", 89}, \ + {"d14", 91}, \ + {"d15", 93}, \ } #define REGISTER_PREFIX "__" @@ -290,7 +311,7 @@ do { \ #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ fprintf ((STREAM), "\tDCD\t|L..%d|\n", (VALUE)) -/* A label marking the start of a jump table is a data label. */ +/* A label marking the start of a jump table is a data label. */ #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \ fprintf ((STREAM), "\tALIGN\n|%s..%d|\n", (PREFIX), (NUM)) diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h index 1f060fafc7b..e18a1158484 100644 --- a/gcc/config/arm/aout.h +++ b/gcc/config/arm/aout.h @@ -49,7 +49,7 @@ /* The assembler's names for the registers. */ #ifndef REGISTER_NAMES -#define REGISTER_NAMES \ +#define REGISTER_NAMES \ { \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \ @@ -63,7 +63,12 @@ "wr0", "wr1", "wr2", "wr3", \ "wr4", "wr5", "wr6", "wr7", \ "wr8", "wr9", "wr10", "wr11", \ - "wr12", "wr13", "wr14", "wr15" \ + "wr12", "wr13", "wr14", "wr15", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \ + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \ + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \ + "vfpcc" \ } #endif @@ -152,7 +157,23 @@ {"mvdx12", 39}, \ {"mvdx13", 40}, \ {"mvdx14", 41}, \ - {"mvdx15", 42} \ + {"mvdx15", 42}, \ + {"d0", 63}, \ + {"d1", 65}, \ + {"d2", 67}, \ + {"d3", 69}, \ + {"d4", 71}, \ + {"d5", 73}, \ + {"d6", 75}, \ + {"d7", 77}, \ + {"d8", 79}, \ + {"d9", 81}, \ + {"d10", 83}, \ + {"d11", 85}, \ + {"d12", 87}, \ + {"d13", 89}, \ + {"d14", 91}, \ + {"d15", 93}, \ } #endif diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def new file mode 100644 index 00000000000..038773c2b53 --- /dev/null +++ b/gcc/config/arm/arm-cores.def @@ -0,0 +1,87 @@ +/* ARM CPU Cores + Copyright (C) 2003 Free Software Foundation, Inc. + Written by CodeSourcery, LLC + + 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 2, 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 COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Before using #include to read this file, define a macro: + + ARM_CORE(CORE_NAME, FLAGS) + + The CORE_NAME is the name of the core, represented as an identifier + rather than a string constant. The FLAGS are the bitwise-or of the + traits that apply to that core. + + If you update this table, you must update the "tune" attribue in + arm.md. */ + +ARM_CORE(arm2, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE(arm250, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE(arm3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE(arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm60, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm600, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm610, FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm620, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm7, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +/* arm7m doesn't exist on its own, but only with D, (and I), but + those don't alter the code, so arm7m is sometimes used. */ +ARM_CORE(arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul) +ARM_CORE(arm7d, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm7dm, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul) +ARM_CORE(arm7di, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm7dmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul) +ARM_CORE(arm70, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm700, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm700i, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm710, FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm720, FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm710c, FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm7100, FL_MODE26 | FL_MODE32, slowmul) +ARM_CORE(arm7500, FL_MODE26 | FL_MODE32, slowmul) +/* Doesn't have an external co-proc, but does have embedded fpa. */ +ARM_CORE(arm7500fe, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul) +/* V4 Architecture Processors */ +ARM_CORE(arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul) +ARM_CORE(arm710t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul) +ARM_CORE(arm720t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul) +ARM_CORE(arm740t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul) +ARM_CORE(arm8, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul) +ARM_CORE(arm810, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul) +ARM_CORE(arm9, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul) +ARM_CORE(arm920, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul) +ARM_CORE(arm920t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul) +ARM_CORE(arm940t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul) +ARM_CORE(arm9tdmi, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul) +ARM_CORE(arm9e, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, 9e) + +ARM_CORE(ep9312, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS, fastmul) +ARM_CORE(strongarm, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE(strongarm110, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE(strongarm1100, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE(strongarm1110, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul) +/* V5 Architecture Processors */ +ARM_CORE(arm10tdmi, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5, fastmul) +ARM_CORE(arm1020t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5, fastmul) +ARM_CORE(arm926ejs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E, 9e) +ARM_CORE(arm1026ejs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E, 9e) +ARM_CORE(xscale, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE, xscale) +ARM_CORE(iwmmxt, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT, xscale) +/* V6 Architecture Processors */ +ARM_CORE(arm1136js, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6, 9e) +ARM_CORE(arm1136jfs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 | FL_VFPV2, 9e) diff --git a/gcc/config/arm/arm-generic.md b/gcc/config/arm/arm-generic.md new file mode 100644 index 00000000000..ec2df47b465 --- /dev/null +++ b/gcc/config/arm/arm-generic.md @@ -0,0 +1,152 @@ +;; Generic ARM Pipeline Description +;; Copyright (C) 2003 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 2, 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 COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +(define_automaton "arm") + +;; Write buffer +; +; Strictly, we should model a 4-deep write buffer for ARM7xx based chips +; +; The write buffer on some of the arm6 processors is hard to model exactly. +; There is room in the buffer for up to two addresses and up to eight words +; of memory, but the two needn't be split evenly. When writing the two +; addresses are fully pipelined. However, a read from memory that is not +; currently in the cache will block until the writes have completed. +; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so +; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous +; (they aren't allowed to be at present) then there is a startup cost of 1MCLK +; cycle to add as well. +(define_cpu_unit "write_buf" "arm") + +;; Write blockage unit +; +; The write_blockage unit models (partially), the fact that reads will stall +; until the write buffer empties. +; The f_mem_r and r_mem_f could also block, but they are to the stack, +; so we don't model them here +(define_cpu_unit "write_blockage" "arm") + +;; Core +; +(define_cpu_unit "core" "arm") + +(define_insn_reservation "r_mem_f_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "r_mem_f"))) + "core+write_buf*3") + +(define_insn_reservation "store_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store1"))) + "core+write_buf*3+write_blockage*5") + +(define_insn_reservation "store2_wbuf" 7 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store2"))) + "core+write_buf*4+write_blockage*7") + +(define_insn_reservation "store3_wbuf" 9 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store3"))) + "core+write_buf*5+write_blockage*9") + +(define_insn_reservation "store4_wbuf" 11 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store4"))) + "core+write_buf*6+write_blockage*11") + +(define_insn_reservation "store2" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store2"))) + "core*3") + +(define_insn_reservation "store3" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store3"))) + "core*4") + +(define_insn_reservation "store4" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store4"))) + "core*5") + +(define_insn_reservation "store_ldsched" 1 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (eq_attr "type" "store1"))) + "core") + +(define_insn_reservation "load_ldsched_xscale" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "yes")))) + "core") + +(define_insn_reservation "load_ldsched" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "no")))) + "core") + +(define_insn_reservation "load_or_store" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "!yes") + (eq_attr "type" "load_byte,load1,load2,load3,load4,store1"))) + "core*2") + +(define_insn_reservation "mult" 16 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "no") (eq_attr "type" "mult"))) + "core*16") + +(define_insn_reservation "mult_ldsched_strongarm" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "yes") + (eq_attr "type" "mult")))) + "core*2") + +(define_insn_reservation "mult_ldsched" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "no") + (eq_attr "type" "mult")))) + "core*4") + +(define_insn_reservation "multi_cycle" 32 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "core_cycles" "multi") + (eq_attr "type" "!mult,load_byte,load1,load2,load3,load4,store1,store2,store3,store4"))) + "core*32") + +(define_insn_reservation "single_cycle" 1 + (and (eq_attr "generic_sched" "yes") + (eq_attr "core_cycles" "single")) + "core") diff --git a/gcc/config/arm/arm-modes.def b/gcc/config/arm/arm-modes.def index 1d58b18bb23..b8535519141 100644 --- a/gcc/config/arm/arm-modes.def +++ b/gcc/config/arm/arm-modes.def @@ -31,7 +31,7 @@ FLOAT_MODE (XF, 12, 0); CC_NOOVmode should be used with SImode integer equalities. CC_Zmode should be used if only the Z flag is set correctly CC_Nmode should be used if only the N (sign) flag is set correctly - CCmode should be used otherwise. */ + CCmode should be used otherwise. */ CC_MODE (CC_NOOV); CC_MODE (CC_Z); diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 61c28be8629..25f563109ab 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -1,5 +1,6 @@ /* Prototypes for exported functions defined in arm.c and pe.c - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) @@ -24,11 +25,11 @@ #define GCC_ARM_PROTOS_H extern void arm_override_options (void); -extern int use_return_insn (int); +extern int use_return_insn (int, rtx); extern int arm_regno_class (int); extern void arm_finalize_pic (int); extern int arm_volatile_func (void); -extern const char *arm_output_epilogue (int); +extern const char *arm_output_epilogue (rtx); extern void arm_expand_prologue (void); extern HOST_WIDE_INT arm_get_frame_size (void); extern const char *arm_strip_name_encoding (const char *); @@ -53,12 +54,14 @@ extern int arm_legitimate_address_p (enum machine_mode, rtx, int); extern int thumb_legitimate_address_p (enum machine_mode, rtx, int); extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT); extern rtx arm_legitimize_address (rtx, rtx, enum machine_mode); -extern int const_double_rtx_ok_for_fpa (rtx); +extern int arm_const_double_rtx (rtx); extern int neg_const_double_rtx_ok_for_fpa (rtx); +extern enum reg_class vfp_secondary_reload_class (enum machine_mode, rtx); /* Predicates. */ extern int s_register_operand (rtx, enum machine_mode); extern int arm_hard_register_operand (rtx, enum machine_mode); +extern int arm_general_register_operand (rtx, enum machine_mode); extern int f_register_operand (rtx, enum machine_mode); extern int reg_or_int_operand (rtx, enum machine_mode); extern int arm_reload_memory_operand (rtx, enum machine_mode); @@ -70,8 +73,8 @@ extern int arm_not_operand (rtx, enum machine_mode); extern int offsettable_memory_operand (rtx, enum machine_mode); extern int alignable_memory_operand (rtx, enum machine_mode); extern int bad_signed_byte_operand (rtx, enum machine_mode); -extern int fpa_rhs_operand (rtx, enum machine_mode); -extern int fpa_add_operand (rtx, enum machine_mode); +extern int arm_float_rhs_operand (rtx, enum machine_mode); +extern int arm_float_add_operand (rtx, enum machine_mode); extern int power_of_two_operand (rtx, enum machine_mode); extern int nonimmediate_di_operand (rtx, enum machine_mode); extern int di_operand (rtx, enum machine_mode); @@ -95,6 +98,13 @@ extern int cirrus_general_operand (rtx, enum machine_mode); extern int cirrus_register_operand (rtx, enum machine_mode); extern int cirrus_shift_const (rtx, enum machine_mode); extern int cirrus_memory_offset (rtx); +extern int vfp_mem_operand (rtx); +extern int vfp_compare_operand (rtx, enum machine_mode); +extern int arm_float_compare_operand (rtx, enum machine_mode); +extern int arm_no_early_store_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); extern int symbol_mentioned_p (rtx); extern int label_mentioned_p (rtx); @@ -138,6 +148,7 @@ extern int arm_debugger_arg_offset (int, rtx); extern int arm_is_longcall_p (rtx, int, int); extern int arm_emit_vector_const (FILE *, rtx); extern const char * arm_output_load_gr (rtx *); +extern const char *vfp_output_fstmx (rtx *); #if defined TREE_CODE extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f127b1d2904..1a1f92f18d2 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1,6 +1,6 @@ /* Output routines for GCC for ARM. - Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -74,7 +74,6 @@ static bool arm_assemble_integer (rtx, unsigned int, int); #endif static const char *fp_const_from_val (REAL_VALUE_TYPE *); static arm_cc get_arm_condition_code (rtx); -static void init_fpa_table (void); static HOST_WIDE_INT int_log2 (HOST_WIDE_INT); static rtx is_jump_table (rtx); static const char *output_multi_immediate (rtx *, const char *, const char *, @@ -123,7 +122,10 @@ static void arm_internal_label (FILE *, const char *, unsigned long); static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static int arm_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); -static bool arm_rtx_costs (rtx, int, int, int *); +static bool arm_slowmul_rtx_costs (rtx, int, int, int *); +static bool arm_fastmul_rtx_costs (rtx, int, int, int *); +static bool arm_xscale_rtx_costs (rtx, int, int, int *); +static bool arm_9e_rtx_costs (rtx, int, int, int *); static int arm_address_cost (rtx); static bool arm_memory_load_p (rtx); static bool arm_cirrus_insn_p (rtx); @@ -219,8 +221,9 @@ static void aof_file_end (void); #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall +/* This will be overridden in arm_override_options. */ #undef TARGET_RTX_COSTS -#define TARGET_RTX_COSTS arm_rtx_costs +#define TARGET_RTX_COSTS arm_slowmul_rtx_costs #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST arm_address_cost @@ -251,17 +254,32 @@ int making_const_table; stored from the compare operation. */ rtx arm_compare_op0, arm_compare_op1; -/* What type of floating point are we tuning for? */ -enum fputype arm_fpu_tune; +/* The processor for which instructions should be scheduled. */ +enum processor_type arm_tune = arm_none; + +/* Which floating point model to use. */ +enum arm_fp_model arm_fp_model; -/* What type of floating point instructions are available? */ +/* Which floating point hardware is available. */ enum fputype arm_fpu_arch; +/* Which floating point hardware to schedule for. */ +enum fputype arm_fpu_tune; + +/* Whether to use floating point hardware. */ +enum float_abi_type arm_float_abi; + /* What program mode is the cpu running in? 26-bit mode or 32-bit mode. */ enum prog_mode_type arm_prgmode; -/* Set by the -mfp=... option. */ -const char * target_fp_name = NULL; +/* Set by the -mfpu=... option. */ +const char * target_fpu_name = NULL; + +/* Set by the -mfpe=... option. */ +const char * target_fpe_name = NULL; + +/* Set by the -mfloat-abi=... option. */ +const char * target_float_abi_name = NULL; /* Used to parse -mstructure_size_boundary command line option. */ const char * structure_size_string = NULL; @@ -269,7 +287,7 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY; /* Bit values used to identify processor capabilities. */ #define FL_CO_PROC (1 << 0) /* Has external co-processor bus */ -#define FL_FAST_MULT (1 << 1) /* Fast multiply */ +#define FL_ARCH3M (1 << 1) /* Extended multiply */ #define FL_MODE26 (1 << 2) /* 26-bit mode support */ #define FL_MODE32 (1 << 3) /* 32-bit mode support */ #define FL_ARCH4 (1 << 4) /* Architecture rel 4 */ @@ -280,26 +298,25 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY; #define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */ #define FL_XSCALE (1 << 10) /* XScale */ #define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */ -#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */ -#define FL_ARCH6J (1 << 12) /* Architecture rel 6. Adds +#define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds media instructions. */ #define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */ +#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */ + /* The bits in this mask specify which instructions we are allowed to generate. */ static unsigned long insn_flags = 0; /* The bits in this mask specify which instruction scheduling options should - be used. Note - there is an overlap with the FL_FAST_MULT. For some - hardware we want to be able to generate the multiply instructions, but to - tune as if they were not present in the architecture. */ + be used. */ static unsigned long tune_flags = 0; /* The following are used in the arm.md file as equivalents to bits in the above two flag variables. */ -/* Nonzero if this is an "M" variant of the processor. */ -int arm_fast_multiply = 0; +/* Nonzero if this chip supports the ARM Architecture 3M extensions. */ +int arm_arch3m = 0; /* Nonzero if this chip supports the ARM Architecture 4 extensions. */ int arm_arch4 = 0; @@ -310,6 +327,9 @@ int arm_arch5 = 0; /* Nonzero if this chip supports the ARM Architecture 5E extensions. */ int arm_arch5e = 0; +/* Nonzero if this chip supports the ARM Architecture 6 extensions. */ +int arm_arch6 = 0; + /* Nonzero if this chip can benefit from load scheduling. */ int arm_ld_sched = 0; @@ -328,9 +348,6 @@ int arm_tune_xscale = 0; /* Nonzero if this chip is an ARM6 or an ARM7. */ int arm_is_6_or_7 = 0; -/* Nonzero if this chip is a Cirrus/DSP. */ -int arm_is_cirrus = 0; - /* Nonzero if generating Thumb instructions. */ int thumb_code = 0; @@ -374,7 +391,9 @@ static const char * const arm_condition_codes[] = struct processors { const char *const name; + enum processor_type core; const unsigned long flags; + bool (* rtx_costs) (rtx, int, int, int *); }; /* Not all of these give usefully different compilation alternatives, @@ -382,83 +401,35 @@ struct processors static const struct processors all_cores[] = { /* ARM Cores */ - - {"arm2", FL_CO_PROC | FL_MODE26 }, - {"arm250", FL_CO_PROC | FL_MODE26 }, - {"arm3", FL_CO_PROC | FL_MODE26 }, - {"arm6", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm60", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm600", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm610", FL_MODE26 | FL_MODE32 }, - {"arm620", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* arm7m doesn't exist on its own, but only with D, (and I), but - those don't alter the code, so arm7m is sometimes used. */ - {"arm7m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7d", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dm", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7di", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dmi", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm70", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700i", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm710", FL_MODE26 | FL_MODE32 }, - {"arm720", FL_MODE26 | FL_MODE32 }, - {"arm710c", FL_MODE26 | FL_MODE32 }, - {"arm7100", FL_MODE26 | FL_MODE32 }, - {"arm7500", FL_MODE26 | FL_MODE32 }, - /* Doesn't have an external co-proc, but does have embedded fpa. */ - {"arm7500fe", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* V4 Architecture Processors */ - {"arm7tdmi", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm710t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm720t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm740t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm8", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm810", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm9", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm920", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm920t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm940t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9e", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"strongarm", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1100", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - /* V5 Architecture Processors */ - {"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm926ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"arm1026ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - /* V6 Architecture Processors */ - {"arm1136js", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - {"arm1136jfs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J | FL_VFPV2 }, - {NULL, 0} +#define ARM_CORE(NAME, FLAGS, COSTS) \ + {#NAME, arm_none, FLAGS, arm_##COSTS##_rtx_costs}, +#include "arm-cores.def" +#undef ARM_CORE + {NULL, arm_none, 0, NULL} }; static const struct processors all_architectures[] = { /* ARM Architectures */ + /* We don't specify rtx_costs here as it will be figured out + from the core. */ - { "armv2", FL_CO_PROC | FL_MODE26 }, - { "armv2a", FL_CO_PROC | FL_MODE26 }, - { "armv3", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - { "armv3m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - { "armv4", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 }, + { "armv2", arm2, FL_CO_PROC | FL_MODE26 , NULL}, + { "armv2a", arm2, FL_CO_PROC | FL_MODE26 , NULL}, + { "armv3", arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32 , NULL}, + { "armv3m", arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M , NULL}, + { "armv4", arm7tdmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 , NULL}, /* Strictly, FL_MODE26 is a permitted option for v4t, but there are no implementations that support it, so we will leave it out for now. */ - { "armv4t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - { "armv5", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5te", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - { "armv6j", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - { "ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - { NULL, 0 } + { "armv4t", arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB , NULL}, + { "armv5", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 , NULL}, + { "armv5t", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 , NULL}, + { "armv5te", arm1026ejs, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E , NULL}, + { "armv6", arm1136js, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 , NULL}, + { "armv6j", arm1136js, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 , NULL}, + { "ep9312", ep9312, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS , NULL}, + {"iwmmxt", iwmmxt, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT , NULL}, + { NULL, arm_none, 0 , NULL} }; /* This is a magic structure. The 'string' field is magically filled in @@ -473,6 +444,57 @@ struct arm_cpu_select arm_select[] = { NULL, "-mtune=", all_cores } }; +struct fpu_desc +{ + const char * name; + enum fputype fpu; +}; + + +/* Available values for for -mfpu=. */ + +static const struct fpu_desc all_fpus[] = +{ + {"fpa", FPUTYPE_FPA}, + {"fpe2", FPUTYPE_FPA_EMU2}, + {"fpe3", FPUTYPE_FPA_EMU2}, + {"maverick", FPUTYPE_MAVERICK}, + {"vfp", FPUTYPE_VFP} +}; + + +/* Floating point models used by the different hardware. + See fputype in arm.h. */ + +static const enum fputype fp_model_for_fpu[] = +{ + /* No FP hardware. */ + ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU2 */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */ + ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */ + ARM_FP_MODEL_VFP /* FPUTYPE_VFP */ +}; + + +struct float_abi +{ + const char * name; + enum float_abi_type abi_type; +}; + + +/* Available values for -mfloat-abi=. */ + +static const struct float_abi all_float_abis[] = +{ + {"soft", ARM_FLOAT_ABI_SOFT}, + {"softfp", ARM_FLOAT_ABI_SOFTFP}, + {"hard", ARM_FLOAT_ABI_HARD} +}; + + /* Return the number of bits set in VALUE. */ static unsigned bit_count (unsigned long value) @@ -494,7 +516,7 @@ void arm_override_options (void) { unsigned i; - + /* Set up the flags based on the cpu/architecture selected by the user. */ for (i = ARRAY_SIZE (arm_select); i--;) { @@ -507,9 +529,19 @@ arm_override_options (void) for (sel = ptr->processors; sel->name != NULL; sel++) if (streq (ptr->string, sel->name)) { - if (i == 2) - tune_flags = sel->flags; - else + /* Determine the processor core for which we should + tune code-generation. */ + if (/* -mcpu= is a sensible default. */ + i == 0 + /* If -march= is used, and -mcpu= has not been used, + assume that we should tune for a representative + CPU from that architecture. */ + || i == 1 + /* -mtune= overrides -mcpu= and -march=. */ + || i == 2) + arm_tune = (enum processor_type) (sel - ptr->processors); + + if (i != 2) { /* If we have been given an architecture and a processor make sure that they are compatible. We only generate @@ -556,10 +588,10 @@ arm_override_options (void) { TARGET_CPU_xscale, "xscale" }, { TARGET_CPU_ep9312, "ep9312" }, { TARGET_CPU_iwmmxt, "iwmmxt" }, - { TARGET_CPU_arm926ej_s, "arm926ej-s" }, - { TARGET_CPU_arm1026ej_s, "arm1026ej-s" }, - { TARGET_CPU_arm1136j_s, "arm1136j_s" }, - { TARGET_CPU_arm1136jf_s, "arm1136jf_s" }, + { TARGET_CPU_arm926ejs, "arm926ejs" }, + { TARGET_CPU_arm1026ejs, "arm1026ejs" }, + { TARGET_CPU_arm1136js, "arm1136js" }, + { TARGET_CPU_arm1136jfs, "arm1136jfs" }, { TARGET_CPU_generic, "arm" }, { 0, 0 } }; @@ -583,7 +615,7 @@ arm_override_options (void) abort (); insn_flags = sel->flags; - + /* Now check to see if the user has specified some command line switch that require certain abilities from the cpu. */ sought = 0; @@ -653,12 +685,17 @@ arm_override_options (void) insn_flags = sel->flags; } + if (arm_tune == arm_none) + arm_tune = (enum processor_type) (sel - all_cores); } - /* If tuning has not been specified, tune for whichever processor or - architecture has been selected. */ - if (tune_flags == 0) - tune_flags = insn_flags; + /* The processor for which we should tune should now have been + chosen. */ + if (arm_tune == arm_none) + abort (); + + tune_flags = all_cores[(int)arm_tune].flags; + targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs; /* Make sure that the processor choice does not conflict with any of the other command line choices. */ @@ -747,66 +784,110 @@ arm_override_options (void) warning ("passing floating point arguments in fp regs not yet supported"); /* Initialize boolean versions of the flags, for use in the arm.md file. */ - arm_fast_multiply = (insn_flags & FL_FAST_MULT) != 0; - arm_arch4 = (insn_flags & FL_ARCH4) != 0; - arm_arch5 = (insn_flags & FL_ARCH5) != 0; - arm_arch5e = (insn_flags & FL_ARCH5E) != 0; - arm_arch_xscale = (insn_flags & FL_XSCALE) != 0; - - arm_ld_sched = (tune_flags & FL_LDSCHED) != 0; - arm_is_strong = (tune_flags & FL_STRONG) != 0; - thumb_code = (TARGET_ARM == 0); - arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32)) - && !(tune_flags & FL_ARCH4))) != 0; - arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; - arm_is_cirrus = (tune_flags & FL_CIRRUS) != 0; - arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; + arm_arch3m = (insn_flags & FL_ARCH3M) != 0; + arm_arch4 = (insn_flags & FL_ARCH4) != 0; + arm_arch5 = (insn_flags & FL_ARCH5) != 0; + arm_arch5e = (insn_flags & FL_ARCH5E) != 0; + arm_arch6 = (insn_flags & FL_ARCH6) != 0; + arm_arch_xscale = (insn_flags & FL_XSCALE) != 0; + + arm_ld_sched = (tune_flags & FL_LDSCHED) != 0; + arm_is_strong = (tune_flags & FL_STRONG) != 0; + thumb_code = (TARGET_ARM == 0); + arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32)) + && !(tune_flags & FL_ARCH4))) != 0; + arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; + arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; if (TARGET_IWMMXT && (! TARGET_ATPCS)) target_flags |= ARM_FLAG_ATPCS; - if (arm_is_cirrus) + arm_fp_model = ARM_FP_MODEL_UNKNOWN; + if (target_fpu_name == NULL && target_fpe_name != NULL) { - arm_fpu_tune = FPUTYPE_MAVERICK; - - /* Ignore -mhard-float if -mcpu=ep9312. */ - if (TARGET_HARD_FLOAT) - target_flags ^= ARM_FLAG_SOFT_FLOAT; + if (streq (target_fpe_name, "2")) + target_fpu_name = "fpe2"; + else if (streq (target_fpe_name, "3")) + target_fpu_name = "fpe3"; + else + error ("invalid floating point emulation option: -mfpe=%s", + target_fpe_name); + } + if (target_fpu_name != NULL) + { + /* The user specified a FPU. */ + for (i = 0; i < ARRAY_SIZE (all_fpus); i++) + { + if (streq (all_fpus[i].name, target_fpu_name)) + { + arm_fpu_arch = all_fpus[i].fpu; + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + break; + } + } + if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) + error ("invalid floating point option: -mfpu=%s", target_fpu_name); } else - /* Default value for floating point code... if no co-processor - bus, then schedule for emulated floating point. Otherwise, - assume the user has an FPA. - Note: this does not prevent use of floating point instructions, - -msoft-float does that. */ - arm_fpu_tune = (tune_flags & FL_CO_PROC) ? FPUTYPE_FPA : FPUTYPE_FPA_EMU3; - - if (target_fp_name) { - if (streq (target_fp_name, "2")) +#ifdef FPUTYPE_DEFAULT + /* Use the default is it is specified for this platform. */ + arm_fpu_arch = FPUTYPE_DEFAULT; + arm_fpu_tune = FPUTYPE_DEFAULT; +#else + /* Pick one based on CPU type. */ + if ((insn_flags & FL_VFP) != 0) + arm_fpu_arch = FPUTYPE_VFP; + else if (insn_flags & FL_CIRRUS) + arm_fpu_arch = FPUTYPE_MAVERICK; + else arm_fpu_arch = FPUTYPE_FPA_EMU2; - else if (streq (target_fp_name, "3")) - arm_fpu_arch = FPUTYPE_FPA_EMU3; +#endif + if (tune_flags & FL_CO_PROC && arm_fpu_arch == FPUTYPE_FPA_EMU2) + arm_fpu_tune = FPUTYPE_FPA; else - error ("invalid floating point emulation option: -mfpe-%s", - target_fp_name); + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) + abort (); + } + + if (target_float_abi_name != NULL) + { + /* The user specified a FP ABI. */ + for (i = 0; i < ARRAY_SIZE (all_float_abis); i++) + { + if (streq (all_float_abis[i].name, target_float_abi_name)) + { + arm_float_abi = all_float_abis[i].abi_type; + break; + } + } + if (i == ARRAY_SIZE (all_float_abis)) + error ("invalid floating point abi: -mfloat-abi=%s", + target_float_abi_name); } else - arm_fpu_arch = FPUTYPE_DEFAULT; - - if (TARGET_FPE) { - if (arm_fpu_tune == FPUTYPE_FPA_EMU3) - arm_fpu_tune = FPUTYPE_FPA_EMU2; - else if (arm_fpu_tune == FPUTYPE_MAVERICK) - warning ("-mfpe switch not supported by ep9312 target cpu - ignored."); - else if (arm_fpu_tune != FPUTYPE_FPA) - arm_fpu_tune = FPUTYPE_FPA_EMU2; + /* Use soft-float target flag. */ + if (target_flags & ARM_FLAG_SOFT_FLOAT) + arm_float_abi = ARM_FLOAT_ABI_SOFT; + else + arm_float_abi = ARM_FLOAT_ABI_HARD; } + + if (arm_float_abi == ARM_FLOAT_ABI_SOFTFP) + sorry ("-mfloat-abi=softfp"); + /* If soft-float is specified then don't use FPU. */ + if (TARGET_SOFT_FLOAT) + arm_fpu_arch = FPUTYPE_NONE; /* For arm2/3 there is no need to do any scheduling if there is only a floating point emulator, or we are doing software floating-point. */ - if ((TARGET_SOFT_FLOAT || arm_fpu_tune != FPUTYPE_FPA) + if ((TARGET_SOFT_FLOAT + || arm_fpu_tune == FPUTYPE_FPA_EMU2 + || arm_fpu_tune == FPUTYPE_FPA_EMU3) && (tune_flags & FL_MODE32) == 0) flag_schedule_insns = flag_schedule_insns_after_reload = 0; @@ -847,14 +928,14 @@ arm_override_options (void) if (optimize_size) { - /* If optimizing for space, we let the compiler synthesize constants - with up to 2 insns, which uses the same space as a load from memory. - This gives the opportunity to take even less space when different - offsets can be factorized into multiple pre-indexed loads or stores. */ - arm_constant_limit = 2; + /* There's some dispute as to whether this should be 1 or 2. However, + experiments seem to show that in pathological cases a setting of + 1 degrades less severely than a setting of 2. This could change if + other parts of the compiler change their behavior. */ + arm_constant_limit = 1; /* If optimizing for size, bump the number of instructions that we - are prepared to conditionally execute (even on a StrongARM). */ + are prepared to conditionally execute (even on a StrongARM). */ max_insns_skipped = 6; } else @@ -867,7 +948,7 @@ arm_override_options (void) /* On XScale the longer latency of a load makes it more difficult to achieve a good schedule, so it's faster to synthesize - constants that can be done in two insns. */ + constants that can be done in two insns. */ if (arm_tune_xscale) arm_constant_limit = 2; @@ -1002,23 +1083,22 @@ arm_current_func_type (void) return cfun->machine->func_type; } -/* Return 1 if it is possible to return using a single instruction. */ +/* Return 1 if it is possible to return using a single instruction. + If SIBLING is non-null, this is a test for a return before a sibling + call. SIBLING is the call insn, so we can examine its register usage. */ int -use_return_insn (int iscond) +use_return_insn (int iscond, rtx sibling) { int regno; unsigned int func_type; unsigned long saved_int_regs; + unsigned HOST_WIDE_INT stack_adjust; /* Never use a return instruction before reload has run. */ if (!reload_completed) return 0; - /* We need two instructions when there's a frame pointer. */ - if (frame_pointer_needed) - return 0; - func_type = arm_current_func_type (); /* Naked functions and volatile functions need special @@ -1029,19 +1109,61 @@ use_return_insn (int iscond) /* So do interrupt functions that use the frame pointer. */ if (IS_INTERRUPT (func_type) && frame_pointer_needed) return 0; - + + stack_adjust = arm_get_frame_size () + current_function_outgoing_args_size; + /* As do variadic functions. */ if (current_function_pretend_args_size || cfun->machine->uses_anonymous_args - /* Of if the function calls __builtin_eh_return () */ + /* Or if the function calls __builtin_eh_return () */ || ARM_FUNC_TYPE (func_type) == ARM_FT_EXCEPTION_HANDLER - /* Or if there is no frame pointer and there is a stack adjustment. */ - || ((arm_get_frame_size () + current_function_outgoing_args_size != 0) - && !frame_pointer_needed)) + /* Or if the function calls alloca */ + || current_function_calls_alloca + /* Or if there is a stack adjustment. However, if the stack pointer + is saved on the stack, we can use a pre-incrementing stack load. */ + || !(stack_adjust == 0 || (frame_pointer_needed && stack_adjust == 4))) return 0; saved_int_regs = arm_compute_save_reg_mask (); + /* Unfortunately, the insn + + ldmib sp, {..., sp, ...} + + triggers a bug on most SA-110 based devices, such that the stack + pointer won't be correctly restored if the instruction takes a + page fault. We work around this problem by popping r3 along with + the other registers, since that is never slower than executing + another instruction. + + We test for !arm_arch5 here, because code for any architecture + less than this could potentially be run on one of the buggy + chips. */ + if (stack_adjust == 4 && !arm_arch5) + { + /* Validate that r3 is a call-clobbered register (always true in + the default abi) ... */ + if (!call_used_regs[3]) + return 0; + + /* ... that it isn't being used for a return value (always true + until we implement return-in-regs), or for a tail-call + argument ... */ + if (sibling) + { + if (GET_CODE (sibling) != CALL_INSN) + abort (); + + if (find_regno_fusage (sibling, USE, 3)) + return 0; + } + + /* ... and that there are no call-saved registers in r0-r2 + (always true in the default ABI). */ + if (saved_int_regs & 0x7) + return 0; + } + /* Can't be done if interworking with Thumb, and any registers have been stacked. */ if (TARGET_INTERWORK && saved_int_regs != 0) @@ -1067,8 +1189,14 @@ use_return_insn (int iscond) /* Can't be done if any of the FPA regs are pushed, since this also requires an insn. */ - if (TARGET_HARD_FLOAT) - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) + if (TARGET_HARD_FLOAT && TARGET_FPA) + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) + if (regs_ever_live[regno] && !call_used_regs[regno]) + return 0; + + /* Likewise VFP regs. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + for (regno = FIRST_VFP_REGNUM; regno <= LAST_VFP_REGNUM; regno++) if (regs_ever_live[regno] && !call_used_regs[regno]) return 0; @@ -1967,20 +2095,19 @@ arm_return_in_memory (tree type) return 1; } -/* Indicate whether or not words of a double are in big-endian order. */ +/* Indicate whether or not words of a double are in big-endian order. */ int arm_float_words_big_endian (void) { - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) return 0; /* For FPA, float words are always big-endian. For VFP, floats words follow the memory system mode. */ - if (TARGET_HARD_FLOAT) + if (TARGET_FPA) { - /* FIXME: TARGET_HARD_FLOAT currently implies FPA. */ return 1; } @@ -2723,6 +2850,24 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) } } + else if (TARGET_HARD_FLOAT && TARGET_VFP && mode == DFmode) + { + if (GET_CODE (x) == PLUS + && arm_address_register_rtx_p (XEXP (x, 0), strict_p) + && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); + + /* ??? valid arm offsets are a subset of VFP offsets. + For now only allow this subset. Proper fix is to add an + additional memory constraint for arm address modes. + Alternatively allow full vfp addressing and let + output_move_double fix it up with a sub-optimal sequence. */ + if (val == 4 || val == -4 || val == -8) + return 1; + } + } + else if (GET_CODE (x) == PLUS) { rtx xop0 = XEXP (x, 0); @@ -2769,12 +2914,12 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p) HOST_WIDE_INT range; enum rtx_code code = GET_CODE (index); - if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + if (TARGET_HARD_FLOAT && TARGET_FPA && GET_MODE_CLASS (mode) == MODE_FLOAT) return (code == CONST_INT && INTVAL (index) < 1024 && INTVAL (index) > -1024 && (INTVAL (index) & 3) == 0); - if (TARGET_CIRRUS + if (TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_MODE_CLASS (mode) == MODE_FLOAT || mode == DImode)) return (code == CONST_INT && INTVAL (index) < 255 @@ -2827,7 +2972,7 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p) && INTVAL (index) > -range); } -/* Return nonzero if X is valid as an ARM state addressing register. */ +/* Return nonzero if X is valid as a Thumb state base register. */ static int thumb_base_register_rtx_p (rtx x, enum machine_mode mode, int strict_p) { @@ -2842,10 +2987,11 @@ thumb_base_register_rtx_p (rtx x, enum machine_mode mode, int strict_p) return THUMB_REGNO_MODE_OK_FOR_BASE_P (regno, mode); return (regno <= LAST_LO_REGNUM - || regno >= FIRST_PSEUDO_REGISTER + || regno > LAST_VIRTUAL_REGISTER || regno == FRAME_POINTER_REGNUM || (GET_MODE_SIZE (mode) >= 4 && (regno == STACK_POINTER_REGNUM + || regno >= FIRST_PSEUDO_REGISTER || x == hard_frame_pointer_rtx || x == arg_pointer_rtx))); } @@ -2922,8 +3068,6 @@ thumb_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) if (GET_MODE_SIZE (mode) <= 4 && XEXP (x, 0) != frame_pointer_rtx && XEXP (x, 1) != frame_pointer_rtx - && XEXP (x, 0) != virtual_stack_vars_rtx - && XEXP (x, 1) != virtual_stack_vars_rtx && thumb_index_register_rtx_p (XEXP (x, 0), strict_p) && thumb_index_register_rtx_p (XEXP (x, 1), strict_p)) return 1; @@ -3009,7 +3153,10 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) rtx base_reg, val; n = INTVAL (xop1); - if (mode == DImode || (TARGET_SOFT_FLOAT && mode == DFmode)) + /* VFP addressing modes actually allow greater offsets, but for + now we just stick with the lowest common denominator. */ + if (mode == DImode + || ((TARGET_SOFT_FLOAT || TARGET_VFP) && mode == DFmode)) { low_n = n & 0x0f; n &= ~0x0f; @@ -3079,129 +3226,133 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) #ifndef COSTS_N_INSNS #define COSTS_N_INSNS(N) ((N) * 4 - 2) #endif -/* Worker routine for arm_rtx_costs. */ static inline int -arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) +thumb_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) { enum machine_mode mode = GET_MODE (x); - enum rtx_code subcode; - int extra_cost; - if (TARGET_THUMB) + switch (code) { - switch (code) - { - case ASHIFT: - case ASHIFTRT: - case LSHIFTRT: - case ROTATERT: - case PLUS: - case MINUS: - case COMPARE: - case NEG: - case NOT: - return COSTS_N_INSNS (1); - - case MULT: - if (GET_CODE (XEXP (x, 1)) == CONST_INT) - { - int cycles = 0; - unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1)); - - while (i) - { - i >>= 2; - cycles++; - } - return COSTS_N_INSNS (2) + cycles; - } - return COSTS_N_INSNS (1) + 16; - - case SET: - return (COSTS_N_INSNS (1) - + 4 * ((GET_CODE (SET_SRC (x)) == MEM) - + GET_CODE (SET_DEST (x)) == MEM)); + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + case ROTATERT: + case PLUS: + case MINUS: + case COMPARE: + case NEG: + case NOT: + return COSTS_N_INSNS (1); + + case MULT: + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + int cycles = 0; + unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1)); - case CONST_INT: - if (outer == SET) + while (i) { - if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256) - return 0; - if (thumb_shiftable_const (INTVAL (x))) - return COSTS_N_INSNS (2); - return COSTS_N_INSNS (3); - } - else if ((outer == PLUS || outer == COMPARE) - && INTVAL (x) < 256 && INTVAL (x) > -256) - return 0; - else if (outer == AND - && INTVAL (x) < 256 && INTVAL (x) >= -256) - return COSTS_N_INSNS (1); - else if (outer == ASHIFT || outer == ASHIFTRT - || outer == LSHIFTRT) - return 0; - return COSTS_N_INSNS (2); - - case CONST: - case CONST_DOUBLE: - case LABEL_REF: - case SYMBOL_REF: - return COSTS_N_INSNS (3); - - case UDIV: - case UMOD: - case DIV: - case MOD: - return 100; + i >>= 2; + cycles++; + } + return COSTS_N_INSNS (2) + cycles; + } + return COSTS_N_INSNS (1) + 16; + + case SET: + return (COSTS_N_INSNS (1) + + 4 * ((GET_CODE (SET_SRC (x)) == MEM) + + GET_CODE (SET_DEST (x)) == MEM)); + + case CONST_INT: + if (outer == SET) + { + if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256) + return 0; + if (thumb_shiftable_const (INTVAL (x))) + return COSTS_N_INSNS (2); + return COSTS_N_INSNS (3); + } + else if ((outer == PLUS || outer == COMPARE) + && INTVAL (x) < 256 && INTVAL (x) > -256) + return 0; + else if (outer == AND + && INTVAL (x) < 256 && INTVAL (x) >= -256) + return COSTS_N_INSNS (1); + else if (outer == ASHIFT || outer == ASHIFTRT + || outer == LSHIFTRT) + return 0; + return COSTS_N_INSNS (2); + + case CONST: + case CONST_DOUBLE: + case LABEL_REF: + case SYMBOL_REF: + return COSTS_N_INSNS (3); + + case UDIV: + case UMOD: + case DIV: + case MOD: + return 100; - case TRUNCATE: - return 99; + case TRUNCATE: + return 99; - case AND: - case XOR: - case IOR: - /* XXX guess. */ - return 8; - - case ADDRESSOF: - case MEM: - /* XXX another guess. */ - /* Memory costs quite a lot for the first word, but subsequent words - load at the equivalent of a single insn each. */ - return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) - + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) - ? 4 : 0)); - - case IF_THEN_ELSE: - /* XXX a guess. */ - if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC) - return 14; - return 2; + case AND: + case XOR: + case IOR: + /* XXX guess. */ + return 8; - case ZERO_EXTEND: - /* XXX still guessing. */ - switch (GET_MODE (XEXP (x, 0))) - { - case QImode: - return (1 + (mode == DImode ? 4 : 0) - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - - case HImode: - return (4 + (mode == DImode ? 4 : 0) - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - - case SImode: - return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + case ADDRESSOF: + case MEM: + /* XXX another guess. */ + /* Memory costs quite a lot for the first word, but subsequent words + load at the equivalent of a single insn each. */ + return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) + + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) + ? 4 : 0)); + + case IF_THEN_ELSE: + /* XXX a guess. */ + if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC) + return 14; + return 2; + + case ZERO_EXTEND: + /* XXX still guessing. */ + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + return (1 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - default: - return 99; - } + case HImode: + return (4 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + case SImode: + return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + default: return 99; } + + default: + return 99; } - +} + + +/* Worker routine for arm_rtx_costs. */ +static inline int +arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) +{ + enum machine_mode mode = GET_MODE (x); + enum rtx_code subcode; + int extra_cost; + switch (code) { case MEM: @@ -3213,7 +3364,9 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) case DIV: case MOD: - return 100; + case UDIV: + case UMOD: + return optimize_size ? COSTS_N_INSNS (2) : 100; case ROTATE: if (mode == SImode && GET_CODE (XEXP (x, 1)) == REG) @@ -3251,11 +3404,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) if (GET_MODE_CLASS (mode) == MODE_FLOAT) return (2 + ((REG_OR_SUBREG_REG (XEXP (x, 1)) || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 1)))) + && arm_const_double_rtx (XEXP (x, 1)))) ? 0 : 8) + ((REG_OR_SUBREG_REG (XEXP (x, 0)) || (GET_CODE (XEXP (x, 0)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 0)))) + && arm_const_double_rtx (XEXP (x, 0)))) ? 0 : 8)); if (((GET_CODE (XEXP (x, 0)) == CONST_INT @@ -3280,7 +3433,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return (2 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8) + ((REG_OR_SUBREG_REG (XEXP (x, 1)) || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 1)))) + && arm_const_double_rtx (XEXP (x, 1)))) ? 0 : 8)); /* Fall through */ @@ -3330,43 +3483,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 8; case MULT: - /* There is no point basing this on the tuning, since it is always the - fast variant if it exists at all. */ - if (arm_fast_multiply && mode == DImode - && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) - && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND - || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) - return 8; - - if (GET_MODE_CLASS (mode) == MODE_FLOAT - || mode == DImode) - return 30; - - if (GET_CODE (XEXP (x, 1)) == CONST_INT) - { - unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) - & (unsigned HOST_WIDE_INT) 0xffffffff); - int add_cost = const_ok_for_arm (i) ? 4 : 8; - int j; - - /* Tune as appropriate. */ - int booth_unit_size = ((tune_flags & FL_FAST_MULT) ? 8 : 2); - - for (j = 0; i && j < 32; j += booth_unit_size) - { - i >>= booth_unit_size; - add_cost += 2; - } - - return add_cost; - } - - return (((tune_flags & FL_FAST_MULT) ? 8 : 30) - + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4)); + /* This should have been handled by the CPU specific routines. */ + abort (); case TRUNCATE: - if (arm_fast_multiply && mode == SImode + if (arm_arch3m && mode == SImode && GET_CODE (XEXP (x, 0)) == LSHIFTRT && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT && (GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) @@ -3447,7 +3568,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 6; case CONST_DOUBLE: - if (const_double_rtx_ok_for_fpa (x)) + if (arm_const_double_rtx (x)) return outer == SET ? 2 : -1; else if ((outer == COMPARE || outer == PLUS) && neg_const_double_rtx_ok_for_fpa (x)) @@ -3459,43 +3580,312 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) } } +/* RTX costs for cores with a slow MUL implimentation. */ + static bool -arm_rtx_costs (rtx x, int code, int outer_code, int *total) +arm_slowmul_rtx_costs (rtx x, int code, int outer_code, int *total) { - *total = arm_rtx_costs_1 (x, code, outer_code); - return true; + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + int j, booth_unit_size; + + /* Tune as appropriate. */ + cost = const_ok ? 4 : 8; + booth_unit_size = 2; + for (j = 0; i && j < 32; j += booth_unit_size) + { + i >>= booth_unit_size; + cost += 2; + } + + *total = cost; + return true; + } + + *total = 30 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } } + +/* RTX cost for cores with a fast multiply unit (M variants). */ + +static bool +arm_fastmul_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 8; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + int j, booth_unit_size; + + /* Tune as appropriate. */ + cost = const_ok ? 4 : 8; + booth_unit_size = 8; + for (j = 0; i && j < 32; j += booth_unit_size) + { + i >>= booth_unit_size; + cost += 2; + } + + *total = cost; + return true; + } + + *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} + + +/* RTX cost for XScale CPUs. */ + +static bool +arm_xscale_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 8; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + unsigned HOST_WIDE_INT masked_const; + + /* The cost will be related to two insns. + First a load of the constant (MOV or LDR), then a multiply. */ + cost = 2; + if (! const_ok) + cost += 1; /* LDR is probably more expensive because + of longer result latency. */ + masked_const = i & 0xffff8000; + if (masked_const != 0 && masked_const != 0xffff8000) + { + masked_const = i & 0xf8000000; + if (masked_const == 0 || masked_const == 0xf8000000) + cost += 1; + else + cost += 2; + } + *total = cost; + return true; + } + + *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} + + +/* RTX costs for 9e (and later) cores. */ + +static bool +arm_9e_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + int nonreg_cost; + int cost; + + if (TARGET_THUMB) + { + switch (code) + { + case MULT: + *total = COSTS_N_INSNS (3); + return true; + + default: + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 3; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT) + { + *total = 30; + return true; + } + if (mode == DImode) + { + cost = 7; + nonreg_cost = 8; + } + else + { + cost = 2; + nonreg_cost = 4; + } + + + *total = cost + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : nonreg_cost) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : nonreg_cost); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} /* All address computations that can be done are free, but rtx cost returns the same for practically all of them. So we weight the different types of address here in the order (most pref first): - PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */ + PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */ +static inline int +arm_arm_address_cost (rtx x) +{ + enum rtx_code c = GET_CODE (x); + + if (c == PRE_INC || c == PRE_DEC || c == POST_INC || c == POST_DEC) + return 0; + if (c == MEM || c == LABEL_REF || c == SYMBOL_REF) + return 10; + + if (c == PLUS || c == MINUS) + { + char cl0 = GET_RTX_CLASS (GET_CODE (XEXP (x, 0))); + char cl1 = GET_RTX_CLASS (GET_CODE (XEXP (x, 1))); + + if (GET_CODE (XEXP (x, 0)) == CONST_INT) + return 2; + + if (cl0 == '2' || cl0 == 'c' || cl1 == '2' || cl1 == 'c') + return 3; + + return 4; + } + + return 6; +} + +static inline int +arm_thumb_address_cost (rtx x) +{ + enum rtx_code c = GET_CODE (x); + + if (c == REG) + return 1; + if (c == PLUS + && GET_CODE (XEXP (x, 0)) == REG + && GET_CODE (XEXP (x, 1)) == CONST_INT) + return 1; + + return 2; +} + static int arm_address_cost (rtx x) { -#define ARM_ADDRESS_COST(X) \ - (10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF \ - || GET_CODE (X) == SYMBOL_REF) \ - ? 0 \ - : ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC \ - || GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \ - ? 10 \ - : (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \ - ? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2 \ - : ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2' \ - || GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c' \ - || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2' \ - || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \ - ? 1 : 0)) \ - : 4))))) - -#define THUMB_ADDRESS_COST(X) \ - ((GET_CODE (X) == REG \ - || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ - && GET_CODE (XEXP (X, 1)) == CONST_INT)) \ - ? 1 : 2) - - return (TARGET_ARM ? ARM_ADDRESS_COST (x) : THUMB_ADDRESS_COST (x)); + return TARGET_ARM ? arm_arm_address_cost (x) : arm_thumb_address_cost (x); } static int @@ -3523,7 +3913,8 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) operand for INSN. If we have a shifted input operand and the instruction we depend on is another ALU instruction, then we may have to account for an additional stall. */ - if (shift_opnum != 0 && attr_type == TYPE_NORMAL) + if (shift_opnum != 0 + && (attr_type == TYPE_ALU_SHIFT || attr_type == TYPE_ALU_SHIFT_REG)) { rtx shifted_operand; int opno; @@ -3581,47 +3972,51 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) return cost; } -static int fpa_consts_inited = 0; +static int fp_consts_inited = 0; -static const char * const strings_fpa[8] = +/* Only zero is valid for VFP. Other values are also valid for FPA. */ +static const char * const strings_fp[8] = { "0", "1", "2", "3", "4", "5", "0.5", "10" }; -static REAL_VALUE_TYPE values_fpa[8]; +static REAL_VALUE_TYPE values_fp[8]; static void -init_fpa_table (void) +init_fp_table (void) { int i; REAL_VALUE_TYPE r; - for (i = 0; i < 8; i++) + if (TARGET_VFP) + fp_consts_inited = 1; + else + fp_consts_inited = 8; + + for (i = 0; i < fp_consts_inited; i++) { - r = REAL_VALUE_ATOF (strings_fpa[i], DFmode); - values_fpa[i] = r; + r = REAL_VALUE_ATOF (strings_fp[i], DFmode); + values_fp[i] = r; } - - fpa_consts_inited = 1; } -/* Return TRUE if rtx X is a valid immediate FPA constant. */ +/* Return TRUE if rtx X is a valid immediate FP constant. */ int -const_double_rtx_ok_for_fpa (rtx x) +arm_const_double_rtx (rtx x) { REAL_VALUE_TYPE r; int i; - if (!fpa_consts_inited) - init_fpa_table (); + if (!fp_consts_inited) + init_fp_table (); REAL_VALUE_FROM_CONST_DOUBLE (r, x); if (REAL_VALUE_MINUS_ZERO (r)) return 0; - for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) + for (i = 0; i < fp_consts_inited; i++) + if (REAL_VALUES_EQUAL (r, values_fp[i])) return 1; return 0; @@ -3634,8 +4029,8 @@ neg_const_double_rtx_ok_for_fpa (rtx x) REAL_VALUE_TYPE r; int i; - if (!fpa_consts_inited) - init_fpa_table (); + if (!fp_consts_inited) + init_fp_table (); REAL_VALUE_FROM_CONST_DOUBLE (r, x); r = REAL_VALUE_NEGATE (r); @@ -3643,7 +4038,7 @@ neg_const_double_rtx_ok_for_fpa (rtx x) return 0; for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) + if (REAL_VALUES_EQUAL (r, values_fp[i])) return 1; return 0; @@ -3686,6 +4081,21 @@ arm_hard_register_operand (rtx op, enum machine_mode mode) && REGNO (op) < FIRST_PSEUDO_REGISTER); } +/* An arm register operand. */ +int +arm_general_register_operand (rtx op, enum machine_mode mode) +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return (GET_CODE (op) == REG + && (REGNO (op) <= LAST_ARM_REGNUM + || REGNO (op) >= FIRST_PSEUDO_REGISTER)); +} + /* Only accept reg, subreg(reg), const_int. */ int reg_or_int_operand (rtx op, enum machine_mode mode) @@ -3857,9 +4267,10 @@ f_register_operand (rtx op, enum machine_mode mode) || REGNO_REG_CLASS (REGNO (op)) == FPA_REGS)); } -/* Return TRUE for valid operands for the rhs of an FPA instruction. */ +/* Return TRUE for valid operands for the rhs of an floating point insns. + Allows regs or certain consts on FPA, just regs for everything else. */ int -fpa_rhs_operand (rtx op, enum machine_mode mode) +arm_float_rhs_operand (rtx op, enum machine_mode mode) { if (s_register_operand (op, mode)) return TRUE; @@ -3867,14 +4278,14 @@ fpa_rhs_operand (rtx op, enum machine_mode mode) if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; - if (GET_CODE (op) == CONST_DOUBLE) - return const_double_rtx_ok_for_fpa (op); + if (TARGET_FPA && GET_CODE (op) == CONST_DOUBLE) + return arm_const_double_rtx (op); return FALSE; } int -fpa_add_operand (rtx op, enum machine_mode mode) +arm_float_add_operand (rtx op, enum machine_mode mode) { if (s_register_operand (op, mode)) return TRUE; @@ -3882,13 +4293,27 @@ fpa_add_operand (rtx op, enum machine_mode mode) if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; - if (GET_CODE (op) == CONST_DOUBLE) - return (const_double_rtx_ok_for_fpa (op) + if (TARGET_FPA && GET_CODE (op) == CONST_DOUBLE) + return (arm_const_double_rtx (op) || neg_const_double_rtx_ok_for_fpa (op)); return FALSE; } + +/* Return TRUE if OP is suitable for the rhs of a floating point comparison. + Depends which fpu we are targeting. */ + +int +arm_float_compare_operand (rtx op, enum machine_mode mode) +{ + if (TARGET_VFP) + return vfp_compare_operand (op, mode); + else + return arm_float_rhs_operand (op, mode); +} + + /* Return nonzero if OP is a valid Cirrus memory address pattern. */ int cirrus_memory_offset (rtx op) @@ -3965,6 +4390,84 @@ cirrus_shift_const (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) && INTVAL (op) < 64); } + +/* Return TRUE if OP is a valid VFP memory address pattern. */ +/* Copied from cirrus_memory_offset but with restricted offset range. */ + +int +vfp_mem_operand (rtx op) +{ + /* Reject eliminable registers. */ + + if (! (reload_in_progress || reload_completed) + && ( reg_mentioned_p (frame_pointer_rtx, op) + || reg_mentioned_p (arg_pointer_rtx, op) + || reg_mentioned_p (virtual_incoming_args_rtx, op) + || reg_mentioned_p (virtual_outgoing_args_rtx, op) + || reg_mentioned_p (virtual_stack_dynamic_rtx, op) + || reg_mentioned_p (virtual_stack_vars_rtx, op))) + return FALSE; + + /* Constants are converted into offets from labels. */ + if (GET_CODE (op) == MEM) + { + rtx ind; + + ind = XEXP (op, 0); + + if (reload_completed + && (GET_CODE (ind) == LABEL_REF + || (GET_CODE (ind) == CONST + && GET_CODE (XEXP (ind, 0)) == PLUS + && GET_CODE (XEXP (XEXP (ind, 0), 0)) == LABEL_REF + && GET_CODE (XEXP (XEXP (ind, 0), 1)) == CONST_INT))) + return TRUE; + + /* Match: (mem (reg)). */ + if (GET_CODE (ind) == REG) + return arm_address_register_rtx_p (ind, 0); + + /* Match: + (mem (plus (reg) + (const))). */ + if (GET_CODE (ind) == PLUS + && GET_CODE (XEXP (ind, 0)) == REG + && REG_MODE_OK_FOR_BASE_P (XEXP (ind, 0), VOIDmode) + && GET_CODE (XEXP (ind, 1)) == CONST_INT + && INTVAL (XEXP (ind, 1)) > -1024 + && INTVAL (XEXP (ind, 1)) < 1024) + return TRUE; + } + + return FALSE; +} + + +/* Return TRUE if OP is a REG or constant zero. */ +int +vfp_compare_operand (rtx op, enum machine_mode mode) +{ + if (s_register_operand (op, mode)) + return TRUE; + + return (GET_CODE (op) == CONST_DOUBLE + && arm_const_double_rtx (op)); +} + + +/* Return GENERAL_REGS if a scratch register required to reload x to/from + VFP registers. Otherwise return NO_REGS. */ + +enum reg_class +vfp_secondary_reload_class (enum machine_mode mode, rtx x) +{ + if (vfp_mem_operand (x) || s_register_operand (x, mode)) + return NO_REGS; + + return GENERAL_REGS; +} + + /* Returns TRUE if INSN is an "LDR REG, ADDR" instruction. Use by the Cirrus Maverick code which has to workaround a hardware bug triggered by such instructions. */ @@ -4200,7 +4703,7 @@ nonimmediate_di_operand (rtx op, enum machine_mode mode) return FALSE; } -/* Return TRUE for a valid operand of a DFmode operation when -msoft-float. +/* Return TRUE for a valid operand of a DFmode operation when soft-float. Either: REG, SUBREG, CONST_DOUBLE or MEM(DImode_address). Note that this disallows MEM(REG+REG), but allows MEM(PRE/POST_INC/DEC(REG)). */ @@ -5549,7 +6052,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) case LE: case GT: case GE: - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) return CCFPmode; return CCFPEmode; @@ -6865,6 +7368,9 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) if (!constrain_operands (1)) fatal_insn_not_found (insn); + if (recog_data.n_alternatives == 0) + return false; + /* Fill in recog_op_alt with information about the constraints of this insn. */ preprocess_constraints (); @@ -7092,13 +7598,13 @@ fp_immediate_constant (rtx x) REAL_VALUE_TYPE r; int i; - if (!fpa_consts_inited) - init_fpa_table (); + if (!fp_consts_inited) + init_fp_table (); REAL_VALUE_FROM_CONST_DOUBLE (r, x); for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) - return strings_fpa[i]; + if (REAL_VALUES_EQUAL (r, values_fp[i])) + return strings_fp[i]; abort (); } @@ -7109,12 +7615,12 @@ fp_const_from_val (REAL_VALUE_TYPE *r) { int i; - if (!fpa_consts_inited) - init_fpa_table (); + if (!fp_consts_inited) + init_fp_table (); for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (*r, values_fpa[i])) - return strings_fpa[i]; + if (REAL_VALUES_EQUAL (*r, values_fp[i])) + return strings_fp[i]; abort (); } @@ -7159,6 +7665,124 @@ print_multi_reg (FILE *stream, const char *instr, int reg, int mask) fprintf (stream, "\n"); } + +/* Output the operands of a FLDM/FSTM instruction to STREAM. + REG is the base register, + INSTR is the possibly suffixed load or store instruction. + FMT specifies now to print the register name. + START and COUNT specify the register range. */ + +static void +vfp_print_multi (FILE *stream, const char *instr, int reg, + const char * fmt, int start, int count) +{ + int i; + + fputc ('\t', stream); + asm_fprintf (stream, instr, reg); + fputs (", {", stream); + + for (i = start; i < start + count; i++) + { + if (i > start) + fputs (", ", stream); + asm_fprintf (stream, fmt, i); + } + fputs ("}\n", stream); +} + + +/* Output the assembly for a store multiple. */ + +const char * +vfp_output_fstmx (rtx * operands) +{ + char pattern[100]; + int p; + int base; + int i; + + strcpy (pattern, "fstmfdx\t%m0!, {%P1"); + p = strlen (pattern); + + if (GET_CODE (operands[1]) != REG) + abort (); + + base = (REGNO (operands[1]) - FIRST_VFP_REGNUM) / 2; + for (i = 1; i < XVECLEN (operands[2], 0); i++) + { + p += sprintf (&pattern[p], ", d%d", base + i); + } + strcpy (&pattern[p], "}"); + + output_asm_insn (pattern, operands); + return ""; +} + + +/* Emit RTL to save block of VFP register pairs to the stack. */ + +static rtx +vfp_emit_fstmx (int base_reg, int count) +{ + rtx par; + rtx dwarf; + rtx tmp, reg; + int i; + + /* ??? The frame layout is implementation defined. We describe + standard format 1 (equivalent to a FSTMD insn and unused pad word). + We really need some way of representing the whole block so that the + unwinder can figure it out at runtime. */ + par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); + dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1)); + + reg = gen_rtx_REG (DFmode, base_reg); + base_reg += 2; + + XVECEXP (par, 0, 0) + = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (BLKmode, + gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)), + gen_rtx_UNSPEC (BLKmode, + gen_rtvec (1, reg), + UNSPEC_PUSH_MULT)); + + tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (SImode, stack_pointer_rtx, + GEN_INT (-(count * 8 + 4)))); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, 0) = tmp; + + tmp = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (DFmode, stack_pointer_rtx), + reg); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, 1) = tmp; + + for (i = 1; i < count; i++) + { + reg = gen_rtx_REG (DFmode, base_reg); + base_reg += 2; + XVECEXP (par, 0, i) = gen_rtx_USE (VOIDmode, reg); + + tmp = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (DFmode, + gen_rtx_PLUS (SImode, + stack_pointer_rtx, + GEN_INT (i * 8))), + reg); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, i + 1) = tmp; + } + + par = emit_insn (par); + REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, + REG_NOTES (par)); + return par; +} + + /* Output a 'call' insn. */ const char * output_call (rtx *operands) @@ -7940,7 +8564,7 @@ output_ascii_pseudo_op (FILE *stream, const unsigned char *p, int len) case '\\': putc ('\\', stream); len_so_far++; - /* drop through. */ + /* Drop through. */ default: if (c >= ' ' && c <= '~') @@ -8098,7 +8722,7 @@ arm_compute_save_reg_mask (void) return save_reg_mask; } -/* Generate a function exit sequence. If REALLY_RETURN is true, then do +/* Generate a function exit sequence. If REALLY_RETURN is false, then do everything bar the final return instruction. */ const char * output_return_instruction (rtx operand, int really_return, int reverse) @@ -8116,8 +8740,9 @@ output_return_instruction (rtx operand, int really_return, int reverse) if (IS_VOLATILE (func_type) && TARGET_ABORT_NORETURN) { - /* If this function was declared non-returning, and we have found a tail - call, then we have to trust that the called function won't return. */ + /* If this function was declared non-returning, and we have + found a tail call, then we have to trust that the called + function won't return. */ if (really_return) { rtx ops[2]; @@ -8189,11 +8814,29 @@ output_return_instruction (rtx operand, int really_return, int reverse) char *p; int first = 1; - /* Generate the load multiple instruction to restore the registers. */ - if (frame_pointer_needed) - sprintf (instr, "ldm%sea\t%%|fp, {", conditional); - else if (live_regs_mask & (1 << SP_REGNUM)) - sprintf (instr, "ldm%sfd\t%%|sp, {", conditional); + /* Generate the load multiple instruction to restore the + registers. Note we can get here, even if + frame_pointer_needed is true, but only if sp already + points to the base of the saved core registers. */ + if (live_regs_mask & (1 << SP_REGNUM)) + { + unsigned HOST_WIDE_INT stack_adjust = + arm_get_frame_size () + current_function_outgoing_args_size; + + if (stack_adjust != 0 && stack_adjust != 4) + abort (); + + if (stack_adjust && arm_arch5) + sprintf (instr, "ldm%sib\t%%|sp, {", conditional); + else + { + /* If we can't use ldmib (SA110 bug), then try to pop r3 + instead. */ + if (stack_adjust) + live_regs_mask |= 1 << 3; + sprintf (instr, "ldm%sfd\t%%|sp, {", conditional); + } + } else sprintf (instr, "ldm%sfd\t%%|sp!, {", conditional); @@ -8400,7 +9043,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) } const char * -arm_output_epilogue (int really_return) +arm_output_epilogue (rtx sibling) { int reg; unsigned long saved_regs_mask; @@ -8413,10 +9056,12 @@ arm_output_epilogue (int really_return) FILE * f = asm_out_file; rtx eh_ofs = cfun->machine->eh_epilogue_sp_ofs; unsigned int lrm_count = 0; + int really_return = (sibling == NULL); + int start_reg; /* If we have already generated the return instruction then it is futile to generate anything else. */ - if (use_return_insn (FALSE) && return_used_this_function) + if (use_return_insn (FALSE, sibling) && return_used_this_function) return ""; func_type = arm_current_func_type (); @@ -8458,11 +9103,12 @@ arm_output_epilogue (int really_return) if (frame_pointer_needed) { + /* This variable is for the Virtual Frame Pointer, not VFP regs. */ int vfp_offset = 4; if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { floats_offset += 12; @@ -8472,9 +9118,9 @@ arm_output_epilogue (int really_return) } else { - int start_reg = LAST_ARM_FP_REGNUM; + start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -8505,6 +9151,62 @@ arm_output_epilogue (int really_return) FP_REGNUM, floats_offset - vfp_offset); } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + int nregs = 0; + + /* We save regs in pairs. */ + /* A special insn for saving/restoring VFP registers. This does + not have base+offset addressing modes, so we use IP to + hold the address. Each block requires nregs*2+1 words. */ + start_reg = FIRST_VFP_REGNUM; + /* Cound how many blocks of registers need saving. */ + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + floats_offset += 4; + start_reg = reg + 2; + } + else + { + floats_offset += 8; + nregs++; + } + } + if (start_reg != reg) + floats_offset += 4; + + if (nregs > 0) + { + asm_fprintf (f, "\tsub\t%r, %r, #%d\n", IP_REGNUM, + FP_REGNUM, floats_offset - vfp_offset); + } + start_reg = FIRST_VFP_REGNUM; + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + { + vfp_print_multi (f, "fldmfdx\t%r!", IP_REGNUM, "d%d", + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } + start_reg = reg + 2; + } + } + if (start_reg != reg) + { + vfp_print_multi (f, "fldmfdx\t%r!", IP_REGNUM, "d%d", + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } + } + if (TARGET_IWMMXT) { /* The frame pointer is guaranteed to be non-double-word aligned. @@ -8552,9 +9254,13 @@ arm_output_epilogue (int really_return) longer indicate the safe area of stack, and we can get stack corruption. Using SP as the base register means that it will be reset correctly to the original value, should an interrupt - occur. */ - asm_fprintf (f, "\tsub\t%r,%r,#%d\n", SP_REGNUM, FP_REGNUM, - 4 * bit_count (saved_regs_mask)); + occur. If the stack pointer already points at the right + place, then omit the subtraction. */ + if (((frame_size + current_function_outgoing_args_size + floats_offset) + != 4 * (1 + (int) bit_count (saved_regs_mask))) + || current_function_calls_alloca) + asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, FP_REGNUM, + 4 * bit_count (saved_regs_mask)); print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); if (IS_INTERRUPT (func_type)) @@ -8575,16 +9281,16 @@ arm_output_epilogue (int really_return) if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) if (regs_ever_live[reg] && !call_used_regs[reg]) asm_fprintf (f, "\tldfe\t%r, [%r], #12\n", reg, SP_REGNUM); } else { - int start_reg = FIRST_ARM_FP_REGNUM; + start_reg = FIRST_FPA_REGNUM; - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -8612,6 +9318,30 @@ arm_output_epilogue (int really_return) start_reg, reg - start_reg, SP_REGNUM); } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + start_reg = FIRST_VFP_REGNUM; + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + { + vfp_print_multi (f, "fldmfdx\t%r!", SP_REGNUM, "d%d", + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } + start_reg = reg + 2; + } + } + if (start_reg != reg) + { + vfp_print_multi (f, "fldmfdx\t%r!", SP_REGNUM, "d%d", + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } + } if (TARGET_IWMMXT) for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) if (regs_ever_live[reg] && !call_used_regs[reg]) @@ -8725,7 +9455,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, /* We need to take into account any stack-frame rounding. */ frame_size = arm_get_frame_size (); - if (use_return_insn (FALSE) + if (use_return_insn (FALSE, NULL) && return_used_this_function && (frame_size + current_function_outgoing_args_size) != 0 && !frame_pointer_needed) @@ -8914,6 +9644,7 @@ emit_sfm (int base_reg, int count) return par; } + /* Compute the distance from register FROM to register TO. These can be the arg pointer (26), the soft frame pointer (25), the stack pointer (13) or the hard frame pointer (11). @@ -8975,6 +9706,7 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) { unsigned int reg_mask; unsigned int reg; + bool new_block; /* Make sure that we compute which registers will be saved on the stack using the same algorithm that is used by @@ -8995,10 +9727,31 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) /* If the hard floating point registers are going to be used then they must be saved on the stack as well. Each register occupies 12 bytes of stack space. */ - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) if (regs_ever_live[reg] && ! call_used_regs[reg]) call_saved_registers += 12; + /* Likewise VFP regs. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + new_block = TRUE; + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((regs_ever_live[reg] && !call_used_regs[reg]) + || (regs_ever_live[reg + 1] && !call_used_regs[reg + 1])) + { + if (new_block) + { + call_saved_registers += 4; + new_block = FALSE; + } + call_saved_registers += 8; + } + else + new_block = TRUE; + } + } + if (TARGET_REALLY_IWMMXT) /* Check for the call-saved iWMMXt registers. */ for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) @@ -9094,6 +9847,7 @@ arm_get_frame_size (void) int entry_size = 0; unsigned long func_type = arm_current_func_type (); int leaf; + bool new_block; if (! TARGET_ARM) abort(); @@ -9137,12 +9891,33 @@ arm_get_frame_size (void) /* Space for saved registers. */ entry_size += bit_count (arm_compute_save_reg_mask ()) * 4; - /* Space for saved FPA registers. */ if (! IS_VOLATILE (func_type)) { - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) + /* Space for saved FPA registers. */ + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) if (regs_ever_live[regno] && ! call_used_regs[regno]) entry_size += 12; + + /* Space for saved VFP registers. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + new_block = TRUE; + for (regno = FIRST_VFP_REGNUM; regno < LAST_VFP_REGNUM; regno += 2) + { + if ((regs_ever_live[regno] && !call_used_regs[regno]) + || (regs_ever_live[regno + 1] && !call_used_regs[regno + 1])) + { + if (new_block) + { + entry_size += 4; + new_block = FALSE; + } + entry_size += 8; + } + else + new_block = TRUE; + } + } } if (TARGET_REALLY_IWMMXT) @@ -9337,11 +10112,13 @@ arm_expand_prologue (void) if (! IS_VOLATILE (func_type)) { + int start_reg; + /* Save any floating point call-saved registers used by this function. */ if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { insn = gen_rtx_PRE_DEC (XFmode, stack_pointer_rtx); @@ -9353,9 +10130,9 @@ arm_expand_prologue (void) } else { - int start_reg = LAST_ARM_FP_REGNUM; + start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -9383,6 +10160,31 @@ arm_expand_prologue (void) RTX_FRAME_RELATED_P (insn) = 1; } } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + start_reg = FIRST_VFP_REGNUM; + + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + { + insn = vfp_emit_fstmx (start_reg, + (reg - start_reg) / 2); + RTX_FRAME_RELATED_P (insn) = 1; + } + start_reg = reg + 2; + } + } + if (start_reg != reg) + { + insn = vfp_emit_fstmx (start_reg, + (reg - start_reg) / 2); + RTX_FRAME_RELATED_P (insn) = 1; + } + } } if (frame_pointer_needed) @@ -9702,6 +10504,27 @@ arm_print_operand (FILE *stream, rtx x, int code) } return; + /* Print a VFP double precision register name. */ + case 'P': + { + int mode = GET_MODE (x); + int num; + + if (mode != DImode && mode != DFmode) + abort (); + + if (GET_CODE (x) != REG + || !IS_VFP_REGNUM (REGNO (x))) + abort (); + + num = REGNO(x) - FIRST_VFP_REGNUM; + if (num & 1) + abort (); + + fprintf (stream, "d%d", num >> 1); + } + return; + default: if (x == 0) abort (); @@ -9737,7 +10560,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) output_addr_const (asm_out_file, x); /* Mark symbols as position independent. We only do this in the - .text segment, not in the .data segment. */ + .text segment, not in the .data segment. */ if (NEED_GOT_RELOC && flag_pic && making_const_table && (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)) { @@ -10182,7 +11005,7 @@ arm_final_prescan_insn (rtx insn) /* Fail if a conditional return is undesirable (eg on a StrongARM), but still allow this if optimizing for size. */ else if (GET_CODE (scanbody) == RETURN - && !use_return_insn (TRUE) + && !use_return_insn (TRUE, NULL) && !optimize_size) fail = TRUE; else if (GET_CODE (scanbody) == RETURN @@ -10248,7 +11071,7 @@ arm_final_prescan_insn (rtx insn) } if (!this_insn) { - /* Oh, dear! we ran off the end.. give up */ + /* Oh, dear! we ran off the end.. give up. */ recog (PATTERN (insn), insn, NULL); arm_ccfsm_state = 0; arm_target_insn = NULL; @@ -10297,7 +11120,7 @@ int arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) { if (GET_MODE_CLASS (mode) == MODE_CC) - return regno == CC_REGNUM; + return regno == CC_REGNUM || regno == VFPCC_REGNUM; if (TARGET_THUMB) /* For the Thumb we only allow values bigger than SImode in @@ -10315,6 +11138,17 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) get sign extended to 64bits-- aldyh. */ return (GET_MODE_CLASS (mode) == MODE_FLOAT) || (mode == DImode); + if (IS_VFP_REGNUM (regno)) + { + if (mode == SFmode || mode == SImode) + return TRUE; + + /* DFmode values are only valid in even register pairs. */ + if (mode == DFmode) + return ((regno - FIRST_VFP_REGNUM) & 1) == 0; + return FALSE; + } + if (IS_IWMMXT_GR_REGNUM (regno)) return mode == SImode; @@ -10333,8 +11167,8 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) /* The only registers left are the FPA registers which we only allow to hold FP values. */ return GET_MODE_CLASS (mode) == MODE_FLOAT - && regno >= FIRST_ARM_FP_REGNUM - && regno <= LAST_ARM_FP_REGNUM; + && regno >= FIRST_FPA_REGNUM + && regno <= LAST_FPA_REGNUM; } int @@ -10356,12 +11190,15 @@ arm_regno_class (int regno) || regno == ARG_POINTER_REGNUM) return GENERAL_REGS; - if (regno == CC_REGNUM) + if (regno == CC_REGNUM || regno == VFPCC_REGNUM) return NO_REGS; if (IS_CIRRUS_REGNUM (regno)) return CIRRUS_REGS; + if (IS_VFP_REGNUM (regno)) + return VFP_REGS; + if (IS_IWMMXT_REGNUM (regno)) return IWMMXT_REGS; @@ -10425,7 +11262,7 @@ arm_debugger_arg_offset (int value, rtx addr) which is the frame pointer a constant integer - then... */ + then... */ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { @@ -10557,13 +11394,13 @@ static const struct builtin_description bdesc_2arg[] = IWMMXT_BUILTIN2 (lshrv2si3_di, WSRLW) IWMMXT_BUILTIN2 (lshrv2si3, WSRLWI) IWMMXT_BUILTIN2 (lshrdi3_di, WSRLD) - IWMMXT_BUILTIN2 (lshrdi3, WSRLDI) + IWMMXT_BUILTIN2 (lshrdi3_iwmmxt, WSRLDI) IWMMXT_BUILTIN2 (ashrv4hi3_di, WSRAH) IWMMXT_BUILTIN2 (ashrv4hi3, WSRAHI) IWMMXT_BUILTIN2 (ashrv2si3_di, WSRAW) IWMMXT_BUILTIN2 (ashrv2si3, WSRAWI) IWMMXT_BUILTIN2 (ashrdi3_di, WSRAD) - IWMMXT_BUILTIN2 (ashrdi3, WSRADI) + IWMMXT_BUILTIN2 (ashrdi3_iwmmxt, WSRADI) IWMMXT_BUILTIN2 (rorv4hi3_di, WRORH) IWMMXT_BUILTIN2 (rorv4hi3, WRORHI) IWMMXT_BUILTIN2 (rorv2si3_di, WRORW) @@ -11753,7 +12590,7 @@ is_called_in_ARM_mode (tree func) #endif } -/* The bits which aren't usefully expanded as rtl. */ +/* The bits which aren't usefully expanded as rtl. */ const char * thumb_unexpanded_epilogue (void) { @@ -11838,7 +12675,7 @@ thumb_unexpanded_epilogue (void) mask &= (2 << regno) - 1; /* A noop if regno == 8 */ - /* Pop the values into the low register(s). */ + /* Pop the values into the low register(s). */ thumb_pushpop (asm_out_file, mask, 0); /* Move the value(s) into the high registers. */ @@ -11866,7 +12703,7 @@ thumb_unexpanded_epilogue (void) { /* The stack backtrace structure creation code had to push R7 in order to get a work register, so we pop - it now. */ + it now. */ live_regs_mask |= (1 << LAST_LO_REGNUM); } @@ -12221,7 +13058,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) the assembler to bypass the ARM code when this function is called from a Thumb encoded function elsewhere in the same file. Hence the definition of STUB_NAME here must - agree with the definition in gas/config/tc-arm.c */ + agree with the definition in gas/config/tc-arm.c. */ #define STUB_NAME ".real_start_of" @@ -12296,7 +13133,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) if (regs_ever_live [LAST_ARG_REGNUM] == 0) work_register = LAST_ARG_REGNUM; - else /* We must push a register of our own */ + else /* We must push a register of our own. */ live_regs_mask |= (1 << LAST_LO_REGNUM); } @@ -12897,7 +13734,7 @@ aof_globalize_label (FILE *stream, const char *name) } static void -aof_file_start () +aof_file_start (void) { fputs ("__r0\tRN\t0\n", asm_out_file); fputs ("__a1\tRN\t0\n", asm_out_file); @@ -13044,6 +13881,8 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, tree function) { + static int thunk_label = 0; + char label[256]; int mi_delta = delta; const char *const mi_op = mi_delta < 0 ? "sub" : "add"; int shift = 0; @@ -13051,6 +13890,14 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, ? 1 : 0); if (mi_delta < 0) mi_delta = - mi_delta; + if (TARGET_THUMB) + { + int labelno = thunk_label++; + ASM_GENERATE_INTERNAL_LABEL (label, "LTHUMBFUNC", labelno); + fputs ("\tldr\tr12, ", file); + assemble_name (file, label); + fputc ('\n', file); + } while (mi_delta != 0) { if ((mi_delta & (3 << shift)) == 0) @@ -13064,17 +13911,26 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, shift += 8; } } - fputs ("\tb\t", file); - assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); - if (NEED_PLT_RELOC) - fputs ("(PLT)", file); - fputc ('\n', file); + if (TARGET_THUMB) + { + fprintf (file, "\tbx\tr12\n"); + ASM_OUTPUT_ALIGN (file, 2); + assemble_name (file, label); + fputs (":\n", file); + assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1); + } + else + { + fputs ("\tb\t", file); + assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); + if (NEED_PLT_RELOC) + fputs ("(PLT)", file); + fputc ('\n', file); + } } int -arm_emit_vector_const (file, x) - FILE * file; - rtx x; +arm_emit_vector_const (FILE *file, rtx x) { int i; const char * pattern; @@ -13103,8 +13959,7 @@ arm_emit_vector_const (file, x) } const char * -arm_output_load_gr (operands) - rtx * operands; +arm_output_load_gr (rtx *operands) { rtx reg; rtx offset; @@ -13131,3 +13986,117 @@ arm_output_load_gr (operands) return ""; } + +/* Return non-zero if the CONSUMER instruction (a store) does not need + PRODUCER's value to calculate the address. */ + +int +arm_no_early_store_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, 0); + + return !reg_overlap_mentioned_p (value, addr); +} + +/* Return non-zero if the CONSUMER instruction (an ALU op) does not + have an early register shift value or amount dependency on the + result of PRODUCER. */ + +int +arm_no_early_alu_shift_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + 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 (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the whole shift + operation. */ + if (GET_CODE (early_op) == REG) + early_op = op; + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return non-zero if the CONSUMER instruction (an ALU op) does not + have an early register shift value dependency on the result of + PRODUCER. */ + +int +arm_no_early_alu_shift_value_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + 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 (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the value being + shifted, in either case. */ + if (GET_CODE (early_op) != REG) + early_op = XEXP (early_op, 0); + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return non-zero if the CONSUMER (a mul or mac op) does not + have an early register mult dependency on the result of + PRODUCER. */ + +int +arm_no_early_mul_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = 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 (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + return (GET_CODE (op) == PLUS + && !reg_overlap_mentioned_p (value, XEXP (op, 0))); +} + diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 0cb1562e636..6ed84a72a7b 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 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -30,9 +30,10 @@ #define TARGET_CPU_CPP_BUILTINS() \ do \ { \ - if (TARGET_ARM) \ - builtin_define ("__arm__"); \ - else \ + /* Define __arm__ even when in thumb mode, for \ + consistency with armcc. */ \ + builtin_define ("__arm__"); \ + if (TARGET_THUMB) \ builtin_define ("__thumb__"); \ \ if (TARGET_BIG_END) \ @@ -58,9 +59,7 @@ if (TARGET_SOFT_FLOAT) \ builtin_define ("__SOFTFP__"); \ \ - /* FIXME: TARGET_HARD_FLOAT currently implies \ - FPA. */ \ - if (TARGET_VFP && !TARGET_HARD_FLOAT) \ + if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ /* Add a define for interworking. \ @@ -98,13 +97,27 @@ #define TARGET_CPU_xscale 0x0100 #define TARGET_CPU_ep9312 0x0200 #define TARGET_CPU_iwmmxt 0x0400 -#define TARGET_CPU_arm926ej_s 0x0800 -#define TARGET_CPU_arm1026ej_s 0x1000 -#define TARGET_CPU_arm1136j_s 0x2000 -#define TARGET_CPU_arm1136jf_s 0x4000 +#define TARGET_CPU_arm926ejs 0x0800 +#define TARGET_CPU_arm1026ejs 0x1000 +#define TARGET_CPU_arm1136js 0x2000 +#define TARGET_CPU_arm1136jfs 0x4000 /* Configure didn't specify. */ #define TARGET_CPU_generic 0x8000 +/* The various ARM cores. */ +enum processor_type +{ +#define ARM_CORE(NAME, FLAGS, COSTS) \ + NAME, +#include "arm-cores.def" +#undef ARM_CORE + /* Used to indicate that no processor has been specified. */ + arm_none +}; + +/* The processor for which instructions should be scheduled. */ +extern enum processor_type arm_tune; + typedef enum arm_cond_code { ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC, @@ -121,8 +134,12 @@ extern int arm_ccfsm_state; extern GTY(()) rtx arm_target_insn; /* Run-time compilation parameters selecting different hardware subsets. */ extern int target_flags; -/* The floating point instruction architecture, can be 2 or 3 */ -extern const char * target_fp_name; +/* The floating point mode. */ +extern const char *target_fpu_name; +/* For backwards compatability. */ +extern const char *target_fpe_name; +/* Whether to use floating point hardware. */ +extern const char *target_float_abi_name; /* Define the information needed to generate branch insns. This is stored from the compare operation. */ extern GTY(()) rtx arm_compare_op0; @@ -130,12 +147,12 @@ extern GTY(()) rtx arm_compare_op1; /* The label of the current constant pool. */ extern rtx pool_vector_label; /* Set to 1 when a return insn is output, this means that the epilogue - is not needed. */ + is not needed. */ extern int return_used_this_function; /* Used to produce AOF syntax assembler. */ extern GTY(()) rtx aof_pic_label; -/* Just in case configure has failed to define anything. */ +/* Just in case configure has failed to define anything. */ #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT TARGET_CPU_generic #endif @@ -181,6 +198,14 @@ extern GTY(()) rtx aof_pic_label; #if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__" #else +#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm926ejs || \ + TARGET_CPU_DEFAULT == TARGET_CPU_arm1026ejs) +#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TEJ__" +#else +#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm1136js || \ + TARGET_CPU_DEFAULT == TARGET_CPU_arm1136jfs) +#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_6J__" +#else #error Unrecognized value in TARGET_CPU_DEFAULT. #endif #endif @@ -190,6 +215,8 @@ extern GTY(()) rtx aof_pic_label; #endif #endif #endif +#endif +#endif #undef CPP_SPEC #define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec) \ @@ -225,7 +252,11 @@ extern GTY(()) rtx aof_pic_label; %{march=arm9:-D__ARM_ARCH_4T__} \ %{march=arm920:-D__ARM_ARCH_4__} \ %{march=arm920t:-D__ARM_ARCH_4T__} \ +%{march=arm926ejs:-D__ARM_ARCH_5TEJ__} \ %{march=arm9tdmi:-D__ARM_ARCH_4T__} \ +%{march=arm1026ejs:-D__ARM_ARCH_5TEJ__} \ +%{march=arm1136js:-D__ARM_ARCH_6J__} \ +%{march=arm1136jfs:-D__ARM_ARCH_6J__} \ %{march=strongarm:-D__ARM_ARCH_4__} \ %{march=strongarm110:-D__ARM_ARCH_4__} \ %{march=strongarm1100:-D__ARM_ARCH_4__} \ @@ -243,6 +274,8 @@ extern GTY(()) rtx aof_pic_label; %{march=armv5t:-D__ARM_ARCH_5T__} \ %{march=armv5e:-D__ARM_ARCH_5E__} \ %{march=armv5te:-D__ARM_ARCH_5TE__} \ +%{march=armv6:-D__ARM_ARCH6__} \ +%{march=armv6j:-D__ARM_ARCH6J__} \ %{!march=*: \ %{mcpu=arm2:-D__ARM_ARCH_2__} \ %{mcpu=arm250:-D__ARM_ARCH_2__} \ @@ -266,7 +299,11 @@ extern GTY(()) rtx aof_pic_label; %{mcpu=arm9:-D__ARM_ARCH_4T__} \ %{mcpu=arm920:-D__ARM_ARCH_4__} \ %{mcpu=arm920t:-D__ARM_ARCH_4T__} \ + %{mcpu=arm926ejs:-D__ARM_ARCH_5TEJ__} \ %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__} \ + %{mcpu=arm1026ejs:-D__ARM_ARCH_5TEJ__} \ + %{mcpu=arm1136js:-D__ARM_ARCH_6J__} \ + %{mcpu=arm1136jfs:-D__ARM_ARCH_6J__} \ %{mcpu=strongarm:-D__ARM_ARCH_4__} \ %{mcpu=strongarm110:-D__ARM_ARCH_4__} \ %{mcpu=strongarm1100:-D__ARM_ARCH_4__} \ @@ -371,7 +408,7 @@ extern GTY(()) rtx aof_pic_label; function tries to return. */ #define ARM_FLAG_ABORT_NORETURN (1 << 13) -/* Nonzero if function prologues should not load the PIC register. */ +/* Nonzero if function prologues should not load the PIC register. */ #define ARM_FLAG_SINGLE_PIC_BASE (1 << 14) /* Nonzero if all call instructions should be indirect. */ @@ -414,13 +451,14 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT) #define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS) #define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS) -#define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_CIRRUS (arm_is_cirrus) -#define TARGET_ANY_HARD_FLOAT (TARGET_HARD_FLOAT || TARGET_CIRRUS) +#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT) +#define TARGET_SOFT_FLOAT_ABI (arm_float_abi != ARM_FLOAT_ABI_HARD) +#define TARGET_HARD_FLOAT (arm_float_abi == ARM_FLOAT_ABI_HARD) +#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA) +#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK) +#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP) #define TARGET_IWMMXT (arm_arch_iwmmxt) #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM) -#define TARGET_VFP (target_flags & ARM_FLAG_VFP) #define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END) #define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK) #define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS) @@ -523,20 +561,23 @@ extern GTY(()) rtx aof_pic_label; {"", TARGET_DEFAULT, "" } \ } -#define TARGET_OPTIONS \ -{ \ - {"cpu=", & arm_select[0].string, \ - N_("Specify the name of the target CPU"), 0}, \ - {"arch=", & arm_select[1].string, \ - N_("Specify the name of the target architecture"), 0}, \ - {"tune=", & arm_select[2].string, "", 0}, \ - {"fpe=", & target_fp_name, "" , 0}, \ - {"fp=", & target_fp_name, \ - N_("Specify the version of the floating point emulator"), 0},\ - {"structure-size-boundary=", & structure_size_string, \ - N_("Specify the minimum bit alignment of structures"), 0}, \ - {"pic-register=", & arm_pic_register_string, \ - N_("Specify the register to be used for PIC addressing"), 0} \ +#define TARGET_OPTIONS \ +{ \ + {"cpu=", & arm_select[0].string, \ + N_("Specify the name of the target CPU"), 0}, \ + {"arch=", & arm_select[1].string, \ + N_("Specify the name of the target architecture"), 0}, \ + {"tune=", & arm_select[2].string, "", 0}, \ + {"fpe=", & target_fpe_name, "", 0}, \ + {"fp=", & target_fpe_name, "", 0}, \ + {"fpu=", & target_fpu_name, \ + N_("Specify the name of the target floating point hardware/format"), 0}, \ + {"float-abi=", & target_float_abi_name, \ + N_("Specify if floating point hardware should be used"), 0}, \ + {"structure-size-boundary=", & structure_size_string, \ + N_("Specify the minimum bit alignment of structures"), 0}, \ + {"pic-register=", & arm_pic_register_string, \ + N_("Specify the register to be used for PIC addressing"), 0} \ } /* Support for a compile-time default CPU, et cetera. The rules are: @@ -545,13 +586,16 @@ extern GTY(()) rtx aof_pic_label; by --with-arch. --with-tune is ignored if -mtune or -mcpu are specified (but not affected by -march). - --with-float is ignored if -mhard-float or -msoft-float are - specified. */ + --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are + specified. + --with-fpu is ignored if -mfpu is specified. */ #define OPTION_DEFAULT_SPECS \ {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \ {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \ - {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" } + {"float", \ + "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \ + {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, struct arm_cpu_select { @@ -571,17 +615,31 @@ enum prog_mode_type prog_mode32 }; -/* Recast the program mode class to be the prog_mode attribute */ +/* Recast the program mode class to be the prog_mode attribute. */ #define arm_prog_mode ((enum attr_prog_mode) arm_prgmode) extern enum prog_mode_type arm_prgmode; -/* What sort of floating point unit do we have? Hardware or software. - If software, is it issue 2 or issue 3? */ +/* Which floating point model to use. */ +enum arm_fp_model +{ + ARM_FP_MODEL_UNKNOWN, + /* FPA model (Hardware or software). */ + ARM_FP_MODEL_FPA, + /* Cirrus Maverick floating point model. */ + ARM_FP_MODEL_MAVERICK, + /* VFP floating point model. */ + ARM_FP_MODEL_VFP +}; + +extern enum arm_fp_model arm_fp_model; + +/* Which floating point hardware is available. Also update + fp_model_for_fpu in arm.c when adding entries to this list. */ enum fputype { - /* Software floating point, FPA style double fmt. */ - FPUTYPE_SOFT_FPA, + /* No FP hardware. */ + FPUTYPE_NONE, /* Full FPA support. */ FPUTYPE_FPA, /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */ @@ -589,7 +647,9 @@ enum fputype /* Emulated FPA hardware, Issue 3 emulator. */ FPUTYPE_FPA_EMU3, /* Cirrus Maverick floating point co-processor. */ - FPUTYPE_MAVERICK + FPUTYPE_MAVERICK, + /* VFP. */ + FPUTYPE_VFP }; /* Recast the floating point class to be the floating point attribute. */ @@ -601,8 +661,21 @@ extern enum fputype arm_fpu_tune; /* What type of floating point instructions are available */ extern enum fputype arm_fpu_arch; +enum float_abi_type +{ + ARM_FLOAT_ABI_SOFT, + ARM_FLOAT_ABI_SOFTFP, + ARM_FLOAT_ABI_HARD +}; + +extern enum float_abi_type arm_float_abi; + /* Default floating point architecture. Override in sub-target if - necessary. */ + necessary. + FIXME: Is this still neccessary/desirable? Do we want VFP chips to + default to VFP unless overridden by a subtarget? If so it would be best + to remove these definitions. It also assumes there is only one cpu model + with a Maverick fpu. */ #ifndef FPUTYPE_DEFAULT #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU2 #endif @@ -612,19 +685,21 @@ extern enum fputype arm_fpu_arch; #define FPUTYPE_DEFAULT FPUTYPE_MAVERICK #endif -/* Nonzero if the processor has a fast multiply insn, and one that does - a 64-bit multiply of two 32-bit values. */ -extern int arm_fast_multiply; +/* Nonzero if this chip supports the ARM Architecture 3M extensions. */ +extern int arm_arch3m; -/* Nonzero if this chip supports the ARM Architecture 4 extensions */ +/* Nonzero if this chip supports the ARM Architecture 4 extensions. */ extern int arm_arch4; -/* Nonzero if this chip supports the ARM Architecture 5 extensions */ +/* Nonzero if this chip supports the ARM Architecture 5 extensions. */ extern int arm_arch5; -/* Nonzero if this chip supports the ARM Architecture 5E extensions */ +/* Nonzero if this chip supports the ARM Architecture 5E extensions. */ extern int arm_arch5e; +/* Nonzero if this chip supports the ARM Architecture 6 extensions. */ +extern int arm_arch6; + /* Nonzero if this chip can benefit from load scheduling. */ extern int arm_ld_sched; @@ -876,6 +951,11 @@ extern const char * structure_size_string; mvf1-mvf3 Cirrus floating point scratch mvf4-mvf15 S Cirrus floating point variable. */ +/* s0-s15 VFP scratch (aka d0-d7). + s16-s31 S VFP variable (aka d8-d15). + vfpcc Not a real register. Represents the VFP condition + code flags. */ + /* The stack backtrace structure is as follows: fp points to here: | save code pointer | [fp] | return link value | [fp, #-4] @@ -900,17 +980,22 @@ extern const char * structure_size_string; /* 1 for registers that have pervasive standard uses and are not available for the register allocator. */ -#define FIXED_REGISTERS \ -{ \ - 0,0,0,0,0,0,0,0, \ - 0,0,0,0,0,1,0,1, \ - 0,0,0,0,0,0,0,0, \ +#define FIXED_REGISTERS \ +{ \ + 0,0,0,0,0,0,0,0, \ + 0,0,0,0,0,1,0,1, \ + 0,0,0,0,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,1,1,1,1,1,1, \ - 1,1,1,1,1,1,1,1, \ - 1,1,1,1 \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1 \ } /* 1 for registers not available across function calls. @@ -920,7 +1005,7 @@ extern const char * structure_size_string; and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. The CC is not preserved over function calls on the ARM 6, so it is - easier to assume this for all. SFP is preserved, since FP is. */ + easier to assume this for all. SFP is preserved, since FP is. */ #define CALL_USED_REGISTERS \ { \ 1,1,1,1,0,0,0,0, \ @@ -931,7 +1016,12 @@ extern const char * structure_size_string; 1,1,1,1,1,1,1,1, \ 1,1,1,1,1,1,1,1, \ 1,1,1,1,1,1,1,1, \ - 1,1,1,1 \ + 1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1 \ } #ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE @@ -942,10 +1032,10 @@ extern const char * structure_size_string; { \ int regno; \ \ - if (TARGET_SOFT_FLOAT || TARGET_THUMB) \ + if (TARGET_SOFT_FLOAT || TARGET_THUMB || !TARGET_FPA) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++regno) \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ @@ -953,22 +1043,40 @@ extern const char * structure_size_string; { \ /* When optimizing for size, it's better not to use \ the HI regs, because of the overhead of stacking \ - them. */ \ + them. */ \ for (regno = FIRST_HI_REGNUM; \ regno <= LAST_HI_REGNUM; ++regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ - if (TARGET_CIRRUS) \ + /* The link register can be clobbered by any branch insn, \ + but we have no way to track that at present, so mark \ + it as unavailable. */ \ + if (TARGET_THUMB) \ + fixed_regs[LR_REGNUM] = call_used_regs[LR_REGNUM] = 1; \ + \ + if (TARGET_ARM && TARGET_HARD_FLOAT) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++ regno) \ - fixed_regs[regno] = call_used_regs[regno] = 1; \ - for (regno = FIRST_CIRRUS_FP_REGNUM; \ - regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \ + if (TARGET_MAVERICK) \ { \ - fixed_regs[regno] = 0; \ - call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++ regno) \ + fixed_regs[regno] = call_used_regs[regno] = 1; \ + for (regno = FIRST_CIRRUS_FP_REGNUM; \ + regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \ + { \ + fixed_regs[regno] = 0; \ + call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \ + } \ + } \ + if (TARGET_VFP) \ + { \ + for (regno = FIRST_VFP_REGNUM; \ + regno <= LAST_VFP_REGNUM; ++ regno) \ + { \ + fixed_regs[regno] = 0; \ + call_used_regs[regno] = regno < FIRST_VFP_REGNUM + 16; \ + } \ } \ } \ \ @@ -1030,7 +1138,8 @@ extern const char * structure_size_string; /* Convert fron bytes to ints. */ #define ARM_NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) -/* The number of (integer) registers required to hold a quantity of type MODE. */ +/* The number of (integer) registers required to hold a quantity of type MODE. + Also used for VFP registers. */ #define ARM_NUM_REGS(MODE) \ ARM_NUM_INTS (GET_MODE_SIZE (MODE)) @@ -1109,8 +1218,8 @@ extern const char * structure_size_string; #define STACK_POINTER_REGNUM SP_REGNUM /* ARM floating pointer registers. */ -#define FIRST_ARM_FP_REGNUM 16 -#define LAST_ARM_FP_REGNUM 23 +#define FIRST_FPA_REGNUM 16 +#define LAST_FPA_REGNUM 23 #define FIRST_IWMMXT_GR_REGNUM 43 #define LAST_IWMMXT_GR_REGNUM 46 @@ -1132,10 +1241,16 @@ extern const char * structure_size_string; #define IS_CIRRUS_REGNUM(REGNUM) \ (((REGNUM) >= FIRST_CIRRUS_FP_REGNUM) && ((REGNUM) <= LAST_CIRRUS_FP_REGNUM)) +#define FIRST_VFP_REGNUM 63 +#define LAST_VFP_REGNUM 94 +#define IS_VFP_REGNUM(REGNUM) \ + (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM)) + /* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP. */ /* + 16 Cirrus registers take us up to 43. */ /* Intel Wireless MMX Technology registers add 16 + 4 more. */ -#define FIRST_PSEUDO_REGISTER 63 +/* VFP adds 32 + 1 more. */ +#define FIRST_PSEUDO_REGISTER 96 /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed @@ -1156,9 +1271,10 @@ extern const char * structure_size_string; mode. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ ((TARGET_ARM \ - && REGNO >= FIRST_ARM_FP_REGNUM \ + && REGNO >= FIRST_FPA_REGNUM \ && REGNO != FRAME_POINTER_REGNUM \ && REGNO != ARG_POINTER_REGNUM) \ + && !IS_VFP_REGNUM (REGNO) \ ? 1 : ARM_NUM_REGS (MODE)) /* Return true if REGNO is suitable for holding a quantity of type MODE. */ @@ -1184,6 +1300,7 @@ extern const char * structure_size_string; clobber it anyway. Allocate r0 through r3 in reverse order since r3 is least likely to contain a function parameter; in addition results are returned in r0. */ + #define REG_ALLOC_ORDER \ { \ 3, 2, 1, 0, 12, 14, 4, 5, \ @@ -1194,7 +1311,12 @@ extern const char * structure_size_string; 43, 44, 45, 46, 47, 48, 49, 50, \ 51, 52, 53, 54, 55, 56, 57, 58, \ 59, 60, 61, 62, \ - 24, 25, 26 \ + 24, 25, 26, \ + 78, 77, 76, 75, 74, 73, 72, 71, \ + 70, 69, 68, 67, 66, 65, 64, 63, \ + 79, 80, 81, 82, 83, 84, 85, 86, \ + 87, 88, 89, 90, 91, 92, 93, 94, \ + 95 \ } /* Interrupt functions can only use registers that have already been @@ -1213,6 +1335,7 @@ enum reg_class NO_REGS, FPA_REGS, CIRRUS_REGS, + VFP_REGS, IWMMXT_GR_REGS, IWMMXT_REGS, LO_REGS, @@ -1220,6 +1343,7 @@ enum reg_class BASE_REGS, HI_REGS, CC_REG, + VFPCC_REG, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES @@ -1227,12 +1351,13 @@ enum reg_class #define N_REG_CLASSES (int) LIM_REG_CLASSES -/* Give names of register classes as strings for dump file. */ +/* Give names of register classes as strings for dump file. */ #define REG_CLASS_NAMES \ { \ "NO_REGS", \ "FPA_REGS", \ "CIRRUS_REGS", \ + "VFP_REGS", \ "IWMMXT_GR_REGS", \ "IWMMXT_REGS", \ "LO_REGS", \ @@ -1240,6 +1365,7 @@ enum reg_class "BASE_REGS", \ "HI_REGS", \ "CC_REG", \ + "VFPCC_REG" \ "GENERAL_REGS", \ "ALL_REGS", \ } @@ -1247,20 +1373,22 @@ enum reg_class /* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */ -#define REG_CLASS_CONTENTS \ -{ \ - { 0x00000000, 0x0 }, /* NO_REGS */ \ - { 0x00FF0000, 0x0 }, /* FPA_REGS */ \ - { 0xF8000000, 0x000007FF }, /* CIRRUS_REGS */ \ - { 0x00000000, 0x00007800 }, /* IWMMXT_GR_REGS */\ - { 0x00000000, 0x7FFF8000 }, /* IWMMXT_REGS */ \ - { 0x000000FF, 0x0 }, /* LO_REGS */ \ - { 0x00002000, 0x0 }, /* STACK_REG */ \ - { 0x000020FF, 0x0 }, /* BASE_REGS */ \ - { 0x0000FF00, 0x0 }, /* HI_REGS */ \ - { 0x01000000, 0x0 }, /* CC_REG */ \ - { 0x0200FFFF, 0x0 }, /* GENERAL_REGS */\ - { 0xFAFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \ +#define REG_CLASS_CONTENTS \ +{ \ + { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ + { 0x00FF0000, 0x00000000, 0x00000000 }, /* FPA_REGS */ \ + { 0xF8000000, 0x000007FF, 0x00000000 }, /* CIRRUS_REGS */ \ + { 0x00000000, 0x80000000, 0x7FFFFFFF }, /* VFP_REGS */ \ + { 0x00000000, 0x00007800, 0x00000000 }, /* IWMMXT_GR_REGS */ \ + { 0x00000000, 0x7FFF8000, 0x00000000 }, /* IWMMXT_REGS */ \ + { 0x000000FF, 0x00000000, 0x00000000 }, /* LO_REGS */ \ + { 0x00002000, 0x00000000, 0x00000000 }, /* STACK_REG */ \ + { 0x000020FF, 0x00000000, 0x00000000 }, /* BASE_REGS */ \ + { 0x0000FF00, 0x00000000, 0x00000000 }, /* HI_REGS */ \ + { 0x01000000, 0x00000000, 0x00000000 }, /* CC_REG */ \ + { 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \ + { 0x0200FFFF, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \ + { 0xFAFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \ } /* The same information, inverted: @@ -1269,11 +1397,14 @@ enum reg_class or could index an array. */ #define REGNO_REG_CLASS(REGNO) arm_regno_class (REGNO) -/* FPA registers can't do dubreg as all values are reformatted to internal - precision. */ +/* FPA registers can't do subreg as all values are reformatted to internal + precision. VFP registers may only be accesed in the mode they + were set. */ #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FPA_REGS, (CLASS)) : 0) + ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \ + || reg_classes_intersect_p (VFP_REGS, (CLASS)) \ + : 0) /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS (TARGET_THUMB ? LO_REGS : GENERAL_REGS) @@ -1291,7 +1422,7 @@ enum reg_class /* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows registers explicitly used in the rtl to be used as spill registers but prevents the compiler from extending the lifetime of these - registers. */ + registers. */ #define SMALL_REGISTER_CLASSES TARGET_THUMB /* Get reg_class from a letter such as appears in the machine description. @@ -1300,6 +1431,7 @@ enum reg_class #define REG_CLASS_FROM_LETTER(C) \ ( (C) == 'f' ? FPA_REGS \ : (C) == 'v' ? CIRRUS_REGS \ + : (C) == 'w' ? VFP_REGS \ : (C) == 'y' ? IWMMXT_REGS \ : (C) == 'z' ? IWMMXT_GR_REGS \ : (C) == 'l' ? (TARGET_ARM ? GENERAL_REGS : LO_REGS) \ @@ -1344,10 +1476,10 @@ enum reg_class (TARGET_ARM ? \ CONST_OK_FOR_ARM_LETTER (VALUE, C) : CONST_OK_FOR_THUMB_LETTER (VALUE, C)) -/* Constant letter 'G' for the FPA immediate constants. +/* Constant letter 'G' for the FP immediate constants. 'H' means the same constant negated. */ #define CONST_DOUBLE_OK_FOR_ARM_LETTER(X, C) \ - ((C) == 'G' ? const_double_rtx_ok_for_fpa (X) : \ + ((C) == 'G' ? arm_const_double_rtx (X) : \ (C) == 'H' ? neg_const_double_rtx_ok_for_fpa (X) : 0) #define CONST_DOUBLE_OK_FOR_LETTER_P(X, C) \ @@ -1358,7 +1490,8 @@ enum reg_class an offset from a register. `S' means any symbol that has the SYMBOL_REF_FLAG set or a CONSTANT_POOL address. This means that the symbol is in the text segment and can be - accessed without using a load. */ + accessed without using a load. + 'U' is an address valid for VFP load/store insns. */ #define EXTRA_CONSTRAINT_ARM(OP, C) \ ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG : \ @@ -1367,6 +1500,7 @@ enum reg_class && CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) : \ (C) == 'S' ? (optimize > 0 && CONSTANT_ADDRESS_P (OP)) : \ (C) == 'T' ? cirrus_memory_offset (OP) : \ + (C) == 'U' ? vfp_mem_operand (OP) : \ 0) #define EXTRA_CONSTRAINT_THUMB(X, C) \ @@ -1377,6 +1511,8 @@ enum reg_class (TARGET_ARM ? \ EXTRA_CONSTRAINT_ARM (X, C) : EXTRA_CONSTRAINT_THUMB (X, C)) +#define EXTRA_MEMORY_CONSTRAINT(C, STR) ((C) == 'U') + /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. In general this is just CLASS, but for the Thumb we prefer @@ -1404,15 +1540,23 @@ enum reg_class or out of a register in CLASS in MODE. If it can be done directly, NO_REGS is returned. */ #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ - (TARGET_ARM ? \ - (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \ + /* Restrict which direct reloads are allowed for VFP regs. */ \ + ((TARGET_VFP && TARGET_HARD_FLOAT \ + && (CLASS) == VFP_REGS) \ + ? vfp_secondary_reload_class (MODE, X) \ + : TARGET_ARM \ + ? (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \ ? GENERAL_REGS : NO_REGS) \ : THUMB_SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)) -/* If we need to load shorts byte-at-a-time, then we need a scratch. */ +/* If we need to load shorts byte-at-a-time, then we need a scratch. */ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ + /* Restrict which direct reloads are allowed for VFP regs. */ \ + ((TARGET_VFP && TARGET_HARD_FLOAT \ + && (CLASS) == VFP_REGS) \ + ? vfp_secondary_reload_class (MODE, X) : \ /* Cannot load constants into Cirrus registers. */ \ - ((TARGET_CIRRUS \ + (TARGET_MAVERICK && TARGET_HARD_FLOAT \ && (CLASS) == CIRRUS_REGS \ && (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \ ? GENERAL_REGS : \ @@ -1446,13 +1590,14 @@ enum reg_class HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ HOST_WIDE_INT low, high; \ \ - if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \ + if (MODE == DImode || (TARGET_SOFT_FLOAT && TARGET_FPA \ + && MODE == DFmode)) \ low = ((val & 0xf) ^ 0x8) - 0x8; \ - else if (TARGET_CIRRUS) \ + else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \ /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (MODE == SImode \ - || (MODE == SFmode && TARGET_SOFT_FLOAT) \ + || (MODE == SFmode && TARGET_SOFT_FLOAT && TARGET_FPA) \ || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \ /* Need to be careful, -4096 is not a valid offset. */ \ low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \ @@ -1460,7 +1605,7 @@ enum reg_class /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \ - && TARGET_HARD_FLOAT) \ + && TARGET_HARD_FLOAT && TARGET_FPA) \ /* Need to be careful, -1024 is not a valid offset. */ \ low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \ else \ @@ -1533,6 +1678,8 @@ enum reg_class (TARGET_ARM ? \ ((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 : \ (FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 : \ + (FROM) == VFP_REGS && (TO) != VFP_REGS ? 10 : \ + (FROM) != VFP_REGS && (TO) == VFP_REGS ? 10 : \ (FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 : \ (FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 : \ (FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 : \ @@ -1563,7 +1710,7 @@ enum reg_class /* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. */ /* The push insns do not do this rounding implicitly. - So don't define this. */ + So don't define this. */ /* #define PUSH_ROUNDING(NPUSHED) ROUND_UP_WORD (NPUSHED) */ /* Define this if the maximum size of all the outgoing args is to be @@ -1588,9 +1735,11 @@ enum reg_class /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - (TARGET_ARM && TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT \ - ? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \ - : TARGET_ARM && TARGET_CIRRUS && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \ + : TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ ? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \ : TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \ ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \ @@ -1608,18 +1757,20 @@ enum reg_class /* On a Cirrus chip, mvf0 can return results. */ #define FUNCTION_VALUE_REGNO_P(REGNO) \ ((REGNO) == ARG_REGISTER (1) \ - || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) && TARGET_CIRRUS) \ + || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \ + && TARGET_HARD_FLOAT && TARGET_MAVERICK) \ || (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \ - || (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT)) + || (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \ + && TARGET_HARD_FLOAT && TARGET_FPA)) /* How large values are returned */ /* A C expression which can inhibit the returning of certain function values - in registers, based on the type of value. */ + in registers, based on the type of value. */ #define RETURN_IN_MEMORY(TYPE) arm_return_in_memory (TYPE) /* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return values must be in memory. On the ARM, they need only do so if larger - than a word, or if they contain elements offset from zero in the struct. */ + than a word, or if they contain elements offset from zero in the struct. */ #define DEFAULT_PCC_STRUCT_RETURN 0 /* Flags for the call/call_value rtl operations set up by function_arg. */ @@ -1653,7 +1804,7 @@ enum reg_class #define ARM_FT_INTERRUPT (1 << 2) /* Note overlap with FT_ISR and above. */ #define ARM_FT_NAKED (1 << 3) /* No prologue or epilogue. */ #define ARM_FT_VOLATILE (1 << 4) /* Does not return. */ -#define ARM_FT_NESTED (1 << 5) /* Embedded inside another func. */ +#define ARM_FT_NESTED (1 << 5) /* Embedded inside another func. */ /* Some macros to test these flags. */ #define ARM_FUNC_TYPE(t) (t & ARM_FT_TYPE_MASK) @@ -1697,7 +1848,7 @@ typedef struct int iwmmxt_nregs; int named_count; int nargs; - /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT . */ + /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT. */ int call_cookie; } CUMULATIVE_ARGS; @@ -1864,7 +2015,7 @@ typedef struct /* Determine if the epilogue should be output as RTL. You should override this if you define FUNCTION_EXTRA_EPILOGUE. */ #define USE_RETURN_INSN(ISCOND) \ - (TARGET_ARM ? use_return_insn (ISCOND) : 0) + (TARGET_ARM ? use_return_insn (ISCOND, NULL) : 0) /* Definitions for register eliminations. @@ -2049,7 +2200,7 @@ typedef struct They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber - has been allocated, which happens in local-alloc.c. */ + has been allocated, which happens in local-alloc.c. */ #define TEST_REGNO(R, TEST, VALUE) \ ((R TEST VALUE) || ((unsigned) reg_renumber[R] TEST VALUE)) @@ -2075,7 +2226,7 @@ typedef struct REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode) /* Maximum number of registers that can appear in a valid memory address. - Shifts in addresses can't be by a register. */ + Shifts in addresses can't be by a register. */ #define MAX_REGS_PER_ADDRESS 2 /* Recognize any constant value that is a valid address. */ @@ -2108,6 +2259,7 @@ typedef struct #define THUMB_LEGITIMATE_CONSTANT_P(X) \ ( GET_CODE (X) == CONST_INT \ || GET_CODE (X) == CONST_DOUBLE \ + || GET_CODE (X) == CONSTANT_P_RTX \ || CONSTANT_ADDRESS_P (X) \ || flag_pic) @@ -2283,7 +2435,7 @@ do { \ /* Define as C expression which evaluates to nonzero if the tablejump instruction expects the table to contain offsets from the address of the table. - Do not define this if the table should contain absolute addresses. */ + Do not define this if the table should contain absolute addresses. */ /* #define CASE_VECTOR_PC_RELATIVE 1 */ /* signed 'char' is most compatible, but RISC OS wants it unsigned. @@ -2328,7 +2480,7 @@ do { \ /* This is all wrong. Defining SHIFT_COUNT_TRUNCATED tells combine that code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y). On the arm, Y in a register is used modulo 256 for the shift. Only for - rotates is modulo 32 used. */ + rotates is modulo 32 used. */ /* #define SHIFT_COUNT_TRUNCATED 1 */ /* All integers have the same format so truncation is easy. */ @@ -2396,7 +2548,7 @@ extern int making_const_table; c_register_pragma (0, "long_calls_off", arm_pr_long_calls_off); \ } while (0) -/* Condition code information. */ +/* Condition code information. */ /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. */ @@ -2463,10 +2615,11 @@ extern int making_const_table; { \ if (TARGET_THUMB) \ { \ - if (is_called_in_ARM_mode (DECL)) \ + if (is_called_in_ARM_mode (DECL) \ + || current_function_is_thunk) \ fprintf (STREAM, "\t.code 32\n") ; \ else \ - fprintf (STREAM, "\t.thumb_func\n") ; \ + fprintf (STREAM, "\t.code 16\n\t.thumb_func\n") ; \ } \ if (TARGET_POKE_FUNCTION_NAME) \ arm_poke_function_name (STREAM, (char *) NAME); \ @@ -2547,8 +2700,8 @@ extern int making_const_table; HOST_WIDE_INT offset = 0; \ if (GET_CODE (base) != REG) \ { \ - /* Ensure that BASE is a register */ \ - /* (one of them must be). */ \ + /* Ensure that BASE is a register. */ \ + /* (one of them must be). */ \ rtx temp = base; \ base = index; \ index = temp; \ @@ -2695,12 +2848,13 @@ extern int making_const_table; /* Define the codes that are matched by predicates in arm.c */ #define PREDICATE_CODES \ {"s_register_operand", {SUBREG, REG}}, \ + {"arm_general_register_operand", {SUBREG, REG}}, \ {"arm_hard_register_operand", {REG}}, \ {"f_register_operand", {SUBREG, REG}}, \ {"arm_add_operand", {SUBREG, REG, CONST_INT}}, \ {"arm_addimm_operand", {CONST_INT}}, \ - {"fpa_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \ - {"fpa_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \ + {"arm_float_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \ + {"arm_float_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \ {"arm_rhs_operand", {SUBREG, REG, CONST_INT}}, \ {"arm_not_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_int_operand", {SUBREG, REG, CONST_INT}}, \ @@ -2732,12 +2886,14 @@ extern int making_const_table; {"cirrus_register_operand", {REG}}, \ {"cirrus_fp_register", {REG}}, \ {"cirrus_shift_const", {CONST_INT}}, \ - {"dominant_cc_register", {REG}}, + {"dominant_cc_register", {REG}}, \ + {"arm_float_compare_operand", {REG, CONST_DOUBLE}}, \ + {"vfp_compare_operand", {REG, CONST_DOUBLE}}, /* Define this if you have special predicates that know special things about modes. Genrecog will warn about certain forms of match_operand without a mode; if the operand predicate is listed in - SPECIAL_MODE_PREDICATES, the warning will be suppressed. */ + SPECIAL_MODE_PREDICATES, the warning will be suppressed. */ #define SPECIAL_MODE_PREDICATES \ "cc_register", "dominant_cc_register", diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 9a693a839d0..6cfd5f552c1 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -1,6 +1,6 @@ ;;- Machine description for ARM for GNU compiler ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003 Free Software Foundation, Inc. +;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -145,7 +145,7 @@ ; Floating Point Unit. If we only have floating point emulation, then there ; is no point in scheduling the floating point insns. (Well, for best ; performance we should try and group them together). -(define_attr "fpu" "softfpa,fpa,fpe2,fpe3,maverick" +(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp" (const (symbol_ref "arm_fpu_attr"))) ; LENGTH of an instruction (in bytes) @@ -167,13 +167,26 @@ (set_attr "length" "4") (set_attr "pool_range" "250")]) +;; The instruction used to implement a particular pattern. This +;; information is used by pipeline descriptions to provide accurate +;; scheduling information. + +(define_attr "insn" + "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,other" + (const_string "other")) + ; TYPE attribute is used to detect floating point instructions which, if ; running on a co-processor can run in parallel with other, basic instructions ; If write-buffer scheduling is enabled then it can also be used in the ; scheduling of writes. ; Classification of each insn -; normal any data instruction that doesn't hit memory or fp regs +; alu any alu instruction that doesn't hit memory or fp +; regs or have a shifted source operand +; alu_shift any data instruction that doesn't hit memory or fp +; regs, but has a source operand shifted by a constant +; alu_shift_reg any data instruction that doesn't hit memory or fp +; regs, but has a source operand shifted by a register value ; mult a multiply instruction ; block blockage insn, this blocks all functional units ; float a floating point arithmetic operation (subject to expansion) @@ -191,19 +204,27 @@ ; r_mem_f the reverse of f_mem_r ; f_2_r fast transfer float to arm (no memory needed) ; r_2_f fast transfer arm to float +; branch a branch ; call a subroutine call -; load any load from memory -; store1 store 1 word to memory from arm registers +; load_byte load byte(s) from memory to arm registers +; load1 load 1 word from memory to arm registers +; load2 load 2 words from memory to arm registers +; load3 load 3 words from memory to arm registers +; load4 load 4 words from memory to arm registers +; store store 1 word to memory from arm registers ; store2 store 2 words ; store3 store 3 words -; store4 store 4 words +; store4 store 4 (or more) words ; Additions for Cirrus Maverick co-processor: ; mav_farith Floating point arithmetic (4 cycle) ; mav_dmult Double multiplies (7 cycle) ; (define_attr "type" - "normal,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,call,load,store1,store2,store3,store4,mav_farith,mav_dmult" - (const_string "normal")) + "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult" + (if_then_else + (eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals") + (const_string "mult") + (const_string "alu"))) ; Load scheduling, set from the arm_ld_sched variable ; initialized by arm_override_options() @@ -251,7 +272,7 @@ ; to stall the processor. Used with model_wbuf above. (define_attr "write_conflict" "no,yes" (if_then_else (eq_attr "type" - "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load") + "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load1") (const_string "yes") (const_string "no"))) @@ -259,7 +280,7 @@ ; than one on the main cpu execution unit. (define_attr "core_cycles" "single,multi" (if_then_else (eq_attr "type" - "normal,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") + "alu,alu_shift,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") (const_string "single") (const_string "multi"))) @@ -267,115 +288,27 @@ ;; distant label. Only applicable to Thumb code. (define_attr "far_jump" "yes,no" (const_string "no")) -(define_automaton "arm") +;;--------------------------------------------------------------------------- +;; Pipeline descriptions -;; Write buffer -; -; Strictly, we should model a 4-deep write buffer for ARM7xx based chips -; -; The write buffer on some of the arm6 processors is hard to model exactly. -; There is room in the buffer for up to two addresses and up to eight words -; of memory, but the two needn't be split evenly. When writing the two -; addresses are fully pipelined. However, a read from memory that is not -; currently in the cache will block until the writes have completed. -; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so -; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous -; (they aren't allowed to be at present) then there is a startup cost of 1MCLK -; cycle to add as well. -(define_cpu_unit "write_buf" "arm") - -;; Write blockage unit -; -; The write_blockage unit models (partially), the fact that reads will stall -; until the write buffer empties. -; The f_mem_r and r_mem_f could also block, but they are to the stack, -; so we don't model them here -(define_cpu_unit "write_blockage" "arm") +;; Processor type. This attribute must exactly match the table in +;; arm-cores.def. +(define_attr "tune" + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7m,arm7d,arm7dm,arm7di,arm7dmi,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7tdmi,arm710t,arm720t,arm740t,arm8,arm810,arm9,arm920,arm920t,arm940t,arm9tdmi,arm9e,ep9312,strongarm,strongarm110,strongarm1100,strongarm1110,arm10tdmi,arm1020t,arm926ejs,arm1026ejs,xscale,iwmmxt,arm1136js,arm1136jfs" + (const (symbol_ref "arm_tune"))) -;; Core -; -(define_cpu_unit "core" "arm") - -(define_insn_reservation "r_mem_f_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "r_mem_f")) - "core+write_buf*3") - -(define_insn_reservation "store1_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store1")) - "core+write_buf*3+write_blockage*5") - -(define_insn_reservation "store2_wbuf" 7 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store2")) - "core+write_buf*4+write_blockage*7") - -(define_insn_reservation "store3_wbuf" 9 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store3")) - "core+write_buf*5+write_blockage*9") - -(define_insn_reservation "store4_wbuf" 11 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store4")) - "core+write_buf*6+write_blockage*11") - -(define_insn_reservation "store2" 3 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store2")) - "core*3") - -(define_insn_reservation "store3" 4 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store3")) - "core*4") - -(define_insn_reservation "store4" 5 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store4")) - "core*5") - -(define_insn_reservation "store1_ldsched" 1 - (and (eq_attr "ldsched" "yes") (eq_attr "type" "store1")) - "core") - -(define_insn_reservation "load_ldsched_xscale" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "yes")) - "core") - -(define_insn_reservation "load_ldsched" 2 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "no")) - "core") - -(define_insn_reservation "load_or_store" 2 - (and (eq_attr "ldsched" "!yes") (eq_attr "type" "load,store1")) - "core*2") - -(define_insn_reservation "mult" 16 - (and (eq_attr "ldsched" "no") (eq_attr "type" "mult")) - "core*16") - -(define_insn_reservation "mult_ldsched_strongarm" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "yes")) - (eq_attr "type" "mult")) - "core*2") - -(define_insn_reservation "mult_ldsched" 4 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "no")) - (eq_attr "type" "mult")) - "core*4") - -(define_insn_reservation "multi_cycle" 32 - (and (eq_attr "core_cycles" "multi") - (eq_attr "type" "!mult,load,store1,store2,store3,store4")) - "core*32") - -(define_insn_reservation "single_cycle" 1 - (eq_attr "core_cycles" "single") - "core") +;; True if the generic scheduling description should be used. + +(define_attr "generic_sched" "yes,no" + (if_then_else + (eq_attr "tune" "arm926ejs,arm1026ejs,arm1136js,arm1136jfs") + (const_string "no") + (const_string "yes"))) + +(include "arm-generic.md") +(include "arm926ejs.md") +(include "arm1026ejs.md") +(include "arm1136jfs.md") ;;--------------------------------------------------------------------------- @@ -397,7 +330,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], DImode)) operands[0] = force_reg (DImode, operands[0]); @@ -433,7 +366,7 @@ (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0") (match_operand:DI 2 "s_register_operand" "r, 0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -461,7 +394,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -490,7 +423,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -792,16 +725,19 @@ ) (define_insn "*addsi3_carryin_shift" - [(set (match_operand:SI 0 "s_register_operand" "") + [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0)) (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "") - (match_operand:SI 4 "reg_or_int_operand" "")]) - (match_operand:SI 1 "s_register_operand" ""))))] + [(match_operand:SI 3 "s_register_operand" "r") + (match_operand:SI 4 "reg_or_int_operand" "rM")]) + (match_operand:SI 1 "s_register_operand" "r"))))] "TARGET_ARM" "adc%?\\t%0, %1, %3%S2" - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*addsi3_carryin_alt1" @@ -847,13 +783,27 @@ (set_attr "length" "4,8")] ) +; transform ((x << y) - 1) to ~(~(x-1) << y) Where X is a constant. +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (plus:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "") + (match_operand:SI 2 "s_register_operand" "")) + (const_int -1))) + (clobber (match_operand:SI 3 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 3) (match_dup 1)) + (set (match_dup 0) (not:SI (ashift:SI (match_dup 3) (match_dup 2))))] + " + operands[1] = GEN_INT (~(INTVAL (operands[1]) - 1)); +") + (define_expand "addsf3" [(set (match_operand:SF 0 "s_register_operand" "") (plus:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 2 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -861,10 +811,10 @@ (define_expand "adddf3" [(set (match_operand:DF 0 "s_register_operand" "") (plus:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -877,7 +827,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS + if (TARGET_HARD_FLOAT && TARGET_MAVERICK && TARGET_ARM && cirrus_fp_register (operands[0], DImode) && cirrus_fp_register (operands[1], DImode)) @@ -1073,11 +1023,11 @@ (define_expand "subsf3" [(set (match_operand:SF 0 "s_register_operand" "") - (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "") + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], SFmode)) operands[1] = force_reg (SFmode, operands[1]); @@ -1088,11 +1038,11 @@ (define_expand "subdf3" [(set (match_operand:DF 0 "s_register_operand" "") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "") + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[1]); @@ -1119,7 +1069,7 @@ (match_operand:SI 1 "s_register_operand" "%?r,0")))] "TARGET_ARM" "mul%?\\t%0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "mul") (set_attr "predicable" "yes")] ) @@ -1140,7 +1090,7 @@ return \"mul\\t%0, %0, %2\"; " [(set_attr "length" "4,4,2") - (set_attr "type" "mult")] + (set_attr "insn" "mul")] ) (define_insn "*mulsi3_compare0" @@ -1154,7 +1104,7 @@ "TARGET_ARM && !arm_arch_xscale" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) (define_insn "*mulsi_compare0_scratch" @@ -1167,7 +1117,7 @@ "TARGET_ARM && !arm_arch_xscale" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) ;; Unnamed templates to match MLA instruction. @@ -1180,7 +1130,7 @@ (match_operand:SI 3 "s_register_operand" "?r,r,0,0")))] "TARGET_ARM" "mla%?\\t%0, %2, %1, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "mla") (set_attr "predicable" "yes")] ) @@ -1198,7 +1148,7 @@ "TARGET_ARM && !arm_arch_xscale" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) (define_insn "*mulsi3addsi_compare0_scratch" @@ -1213,10 +1163,10 @@ "TARGET_ARM && !arm_arch_xscale" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) -;; Unnamed template to match long long multiply-accumlate (smlal) +;; Unnamed template to match long long multiply-accumulate (smlal) (define_insn "*mulsidi3adddi" [(set (match_operand:DI 0 "s_register_operand" "=&r") @@ -1225,9 +1175,9 @@ (sign_extend:DI (match_operand:SI 2 "s_register_operand" "%r")) (sign_extend:DI (match_operand:SI 3 "s_register_operand" "r"))) (match_operand:DI 1 "s_register_operand" "0")))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smlal") (set_attr "predicable" "yes")] ) @@ -1236,9 +1186,9 @@ (mult:DI (sign_extend:DI (match_operand:SI 1 "s_register_operand" "%r")) (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1247,13 +1197,13 @@ (mult:DI (zero_extend:DI (match_operand:SI 1 "s_register_operand" "%r")) (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) -;; Unnamed template to match long long unsigned multiply-accumlate (umlal) +;; Unnamed template to match long long unsigned multiply-accumulate (umlal) (define_insn "*umulsidi3adddi" [(set (match_operand:DI 0 "s_register_operand" "=&r") @@ -1262,9 +1212,9 @@ (zero_extend:DI (match_operand:SI 2 "s_register_operand" "%r")) (zero_extend:DI (match_operand:SI 3 "s_register_operand" "r"))) (match_operand:DI 1 "s_register_operand" "0")))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umlal") (set_attr "predicable" "yes")] ) @@ -1277,9 +1227,9 @@ (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r,r"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=&r,&r"))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1292,9 +1242,9 @@ (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r,r"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=&r,&r"))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) @@ -1306,7 +1256,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smulbb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1319,7 +1269,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smultb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1332,7 +1282,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smulbt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1346,7 +1296,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smultt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1359,7 +1309,7 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlabb%?\\t%0, %2, %3, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smlaxy") (set_attr "predicable" "yes")] ) @@ -1373,16 +1323,16 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlalbb%?\\t%Q0, %R0, %2, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "smlalxy") (set_attr "predicable" "yes")]) (define_expand "mulsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mult:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -1390,10 +1340,10 @@ (define_expand "muldf3" [(set (match_operand:DF 0 "s_register_operand" "") (mult:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -1402,16 +1352,16 @@ (define_expand "divsf3" [(set (match_operand:SF 0 "s_register_operand" "") - (div:SF (match_operand:SF 1 "fpa_rhs_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "") + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_expand "divdf3" [(set (match_operand:DF 0 "s_register_operand" "") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "") + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") ;; Modulo insns @@ -1419,15 +1369,15 @@ (define_expand "modsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mod:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_expand "moddf3" [(set (match_operand:DF 0 "s_register_operand" "") (mod:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; Boolean and,ior,xor insns @@ -1738,6 +1688,28 @@ }" ) +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "shiftable_operator" + [(zero_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" "")) + (match_operand:SI 5 "s_register_operand" "")])) + (clobber (match_operand:SI 6 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 6) (ashift:SI (match_dup 2) (match_dup 3))) + (set (match_dup 0) + (match_op_dup 1 + [(lshiftrt:SI (match_dup 6) (match_dup 4)) + (match_dup 5)]))] + "{ + HOST_WIDE_INT temp = INTVAL (operands[3]); + + operands[3] = GEN_INT (32 - temp - INTVAL (operands[4])); + operands[4] = GEN_INT (32 - temp); + }" +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (sign_extract:SI (match_operand:SI 1 "s_register_operand" "") @@ -1754,6 +1726,28 @@ }" ) +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "shiftable_operator" + [(sign_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" "")) + (match_operand:SI 5 "s_register_operand" "")])) + (clobber (match_operand:SI 6 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 6) (ashift:SI (match_dup 2) (match_dup 3))) + (set (match_dup 0) + (match_op_dup 1 + [(ashiftrt:SI (match_dup 6) (match_dup 4)) + (match_dup 5)]))] + "{ + HOST_WIDE_INT temp = INTVAL (operands[3]); + + operands[3] = GEN_INT (32 - temp - INTVAL (operands[4])); + operands[4] = GEN_INT (32 - temp); + }" +) + ;;; ??? This pattern is bogus. If operand3 has bits outside the range ;;; represented by the bitfield, then this will produce incorrect results. ;;; Somewhere, the value needs to be truncated. On targets like the m68k, @@ -1990,16 +1984,18 @@ ) (define_insn "andsi_not_shiftsi_si" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (and:SI (not:SI (match_operator:SI 4 "shift_operator" - [(match_operand:SI 2 "s_register_operand" "r") - (match_operand:SI 3 "arm_rhs_operand" "rM")])) - (match_operand:SI 1 "s_register_operand" "r")))] + [(set (match_operand:SI 0 "s_register_operand" "=r") + (and:SI (not:SI (match_operator:SI 4 "shift_operator" + [(match_operand:SI 2 "s_register_operand" "r") + (match_operand:SI 3 "arm_rhs_operand" "rM")])) + (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_ARM" "bic%?\\t%0, %1, %2%S4" [(set_attr "predicable" "yes") (set_attr "shift" "2") - ] + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*andsi_notsi_si_compare0" @@ -2262,6 +2258,109 @@ (set_attr "predicable" "yes")] ) +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "logical_binary_operator" + [(zero_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" "")) + (match_operator:SI 9 "logical_binary_operator" + [(lshiftrt:SI (match_operand:SI 5 "s_register_operand" "") + (match_operand:SI 6 "const_int_operand" "")) + (match_operand:SI 7 "s_register_operand" "")])])) + (clobber (match_operand:SI 8 "s_register_operand" ""))] + "TARGET_ARM + && GET_CODE (operands[1]) == GET_CODE (operands[9]) + && INTVAL (operands[3]) == 32 - INTVAL (operands[6])" + [(set (match_dup 8) + (match_op_dup 1 + [(ashift:SI (match_dup 2) (match_dup 4)) + (match_dup 5)])) + (set (match_dup 0) + (match_op_dup 1 + [(lshiftrt:SI (match_dup 8) (match_dup 6)) + (match_dup 7)]))] + " + operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4]))); +") + +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "logical_binary_operator" + [(match_operator:SI 9 "logical_binary_operator" + [(lshiftrt:SI (match_operand:SI 5 "s_register_operand" "") + (match_operand:SI 6 "const_int_operand" "")) + (match_operand:SI 7 "s_register_operand" "")]) + (zero_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" ""))])) + (clobber (match_operand:SI 8 "s_register_operand" ""))] + "TARGET_ARM + && GET_CODE (operands[1]) == GET_CODE (operands[9]) + && INTVAL (operands[3]) == 32 - INTVAL (operands[6])" + [(set (match_dup 8) + (match_op_dup 1 + [(ashift:SI (match_dup 2) (match_dup 4)) + (match_dup 5)])) + (set (match_dup 0) + (match_op_dup 1 + [(lshiftrt:SI (match_dup 8) (match_dup 6)) + (match_dup 7)]))] + " + operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4]))); +") + +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "logical_binary_operator" + [(sign_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" "")) + (match_operator:SI 9 "logical_binary_operator" + [(ashiftrt:SI (match_operand:SI 5 "s_register_operand" "") + (match_operand:SI 6 "const_int_operand" "")) + (match_operand:SI 7 "s_register_operand" "")])])) + (clobber (match_operand:SI 8 "s_register_operand" ""))] + "TARGET_ARM + && GET_CODE (operands[1]) == GET_CODE (operands[9]) + && INTVAL (operands[3]) == 32 - INTVAL (operands[6])" + [(set (match_dup 8) + (match_op_dup 1 + [(ashift:SI (match_dup 2) (match_dup 4)) + (match_dup 5)])) + (set (match_dup 0) + (match_op_dup 1 + [(ashiftrt:SI (match_dup 8) (match_dup 6)) + (match_dup 7)]))] + " + operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4]))); +") + +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "logical_binary_operator" + [(match_operator:SI 9 "logical_binary_operator" + [(ashiftrt:SI (match_operand:SI 5 "s_register_operand" "") + (match_operand:SI 6 "const_int_operand" "")) + (match_operand:SI 7 "s_register_operand" "")]) + (sign_extract:SI (match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "const_int_operand" "") + (match_operand:SI 4 "const_int_operand" ""))])) + (clobber (match_operand:SI 8 "s_register_operand" ""))] + "TARGET_ARM + && GET_CODE (operands[1]) == GET_CODE (operands[9]) + && INTVAL (operands[3]) == 32 - INTVAL (operands[6])" + [(set (match_dup 8) + (match_op_dup 1 + [(ashift:SI (match_dup 2) (match_dup 4)) + (match_dup 5)])) + (set (match_dup 0) + (match_op_dup 1 + [(ashiftrt:SI (match_dup 8) (match_dup 6)) + (match_dup 7)]))] + " + operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4]))); +") ;; Minimum and maximum insns @@ -2376,6 +2475,41 @@ ;; Shift and rotation insns +(define_expand "ashldi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashift:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashldi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)) + FAIL; + " +) + +(define_insn "arm_ashldi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashift:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashlsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashift:SI (match_operand:SI 1 "s_register_operand" "") @@ -2400,6 +2534,41 @@ [(set_attr "length" "2")] ) +(define_expand "ashrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_ashrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2421,6 +2590,41 @@ [(set_attr "length" "2")] ) +(define_expand "lshrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_lshrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_lshrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "lshrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (lshiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2491,19 +2695,6 @@ [(set_attr "length" "2")] ) -(define_expand "ashldi3" - [(set (match_operand:DI 0 "s_register_operand" "") - (ashift:DI (match_operand:DI 1 "general_operand" "") - (match_operand:SI 2 "general_operand" "")))] - "TARGET_ARM && (TARGET_IWMMXT || TARGET_CIRRUS)" - " - if (! s_register_operand (operands[1], DImode)) - operands[1] = copy_to_mode_reg (DImode, operands[1]); - if (! s_register_operand (operands[2], SImode)) - operands[2] = copy_to_mode_reg (SImode, operands[2]); - " -) - (define_insn "*arm_shiftsi3" [(set (match_operand:SI 0 "s_register_operand" "=r") (match_operator:SI 3 "shift_operator" @@ -2513,7 +2704,9 @@ "mov%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0" @@ -2528,7 +2721,9 @@ "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0_scratch" @@ -2541,8 +2736,7 @@ "TARGET_ARM" "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") - (set_attr "shift" "1") - ] + (set_attr "shift" "1")] ) (define_insn "*notsi_shiftsi" @@ -2554,7 +2748,9 @@ "mvn%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*notsi_shiftsi_compare0" @@ -2569,7 +2765,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*not_shiftsi_compare0_scratch" @@ -2583,7 +2781,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; We don't really have extzv, but defining this using shifts helps @@ -2680,14 +2880,14 @@ (define_expand "negsf2" [(set (match_operand:SF 0 "s_register_operand" "") (neg:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "" ) (define_expand "negdf2" [(set (match_operand:DF 0 "s_register_operand" "") (neg:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; abssi2 doesn't really clobber the condition codes if a different register @@ -2734,25 +2934,25 @@ (define_expand "abssf2" [(set (match_operand:SF 0 "s_register_operand" "") (abs:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "absdf2" [(set (match_operand:DF 0 "s_register_operand" "") (abs:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "sqrtsf2" [(set (match_operand:SF 0 "s_register_operand" "") (sqrt:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_expand "sqrtdf2" [(set (match_operand:DF 0 "s_register_operand" "") (sqrt:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_insn_and_split "one_cmpldi2" @@ -2823,9 +3023,9 @@ (define_expand "floatsisf2" [(set (match_operand:SF 0 "s_register_operand" "") (float:SF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1])); DONE; @@ -2835,9 +3035,9 @@ (define_expand "floatsidf2" [(set (match_operand:DF 0 "s_register_operand" "") (float:DF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1])); DONE; @@ -2847,9 +3047,9 @@ (define_expand "fix_truncsfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], SImode)) operands[0] = force_reg (SImode, operands[0]); @@ -2863,9 +3063,9 @@ (define_expand "fix_truncdfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[0]); @@ -2880,7 +3080,7 @@ [(set (match_operand:SF 0 "s_register_operand" "") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -2909,7 +3109,7 @@ ldr%?b\\t%Q0, %1\;mov%?\\t%R0, #0" [(set_attr "length" "8") (set_attr "predicable" "yes") - (set_attr "type" "*,load") + (set_attr "type" "*,load_byte") (set_attr "pool_range" "*,4092") (set_attr "neg_pool_range" "*,4084")] ) @@ -2938,72 +3138,42 @@ "TARGET_EITHER" " { - if (TARGET_ARM) + if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM) { - if (arm_arch4 && GET_CODE (operands[1]) == MEM) - { - /* Note: We do not have to worry about TARGET_MMU_TRAPS - here because the insn below will generate an LDRH instruction - rather than an LDR instruction, so we cannot get an unaligned - word access. */ - emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_ZERO_EXTEND (SImode, - operands[1]))); - DONE; - } - if (TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM) - { - emit_insn (gen_movhi_bytes (operands[0], operands[1])); - DONE; - } - if (!s_register_operand (operands[1], HImode)) - operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); + /* Note: We do not have to worry about TARGET_MMU_TRAPS + here because the insn below will generate an LDRH instruction + rather than an LDR instruction, so we cannot get an unaligned + word access. */ + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); + DONE; } - else /* TARGET_THUMB */ - { - if (GET_CODE (operands[1]) == MEM) - { - rtx tmp; - tmp = gen_rtx_ZERO_EXTEND (SImode, operands[1]); - tmp = gen_rtx_SET (VOIDmode, operands[0], tmp); - emit_insn (tmp); - } - else - { - rtx ops[3]; - - if (!s_register_operand (operands[1], HImode)) - operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); + if (TARGET_ARM && TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM) + { + emit_insn (gen_movhi_bytes (operands[0], operands[1])); + DONE; + } - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (16); + if (!s_register_operand (operands[1], HImode)) + operands[1] = copy_to_mode_reg (HImode, operands[1]); - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_LSHIFTRT (SImode, ops[1], - ops[2]))); - } - DONE; + if (arm_arch6) + { + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); + DONE; } + + operands[1] = gen_lowpart (SImode, operands[1]); + operands[2] = gen_reg_rtx (SImode); }" ) (define_insn "*thumb_zero_extendhisi2" - [(set (match_operand:SI 0 "register_operand" "=l") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_THUMB" + [(set (match_operand:SI 0 "register_operand" "=l") + (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_THUMB && !arm_arch6" "* rtx mem = XEXP (operands[1], 0); @@ -3038,21 +3208,91 @@ return \"ldrh\\t%0, %1\"; " [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "60")] ) +(define_insn "*thumb_zero_extendhisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))] + "TARGET_THUMB && arm_arch6" + "* + rtx mem; + + if (which_alternative == 0) + return \"uxth\\t%0, %1\"; + + 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) + { + rtx ops[2]; + ops[0] = operands[0]; + ops[1] = a; + + output_asm_insn (\"mov %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\"; + " + [(set_attr "length" "2,4") + (set_attr "type" "alu_shift,load_byte") + (set_attr "pool_range" "*,60")] +) + (define_insn "*arm_zero_extendhisi2" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" "ldr%?h\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) +(define_insn "*arm_zero_extendhisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + 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")] +) + +(define_insn "*arm_zero_extendhisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (zero_extend:SI (match_operand:HI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "uxtah%?\\t%0, %2, %1" + [(set_attr "type" "alu_shift") + (set_attr "predicable" "yes")] +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (zero_extend:SI (match_operand:HI 1 "alignable_memory_operand" ""))) @@ -3088,7 +3328,7 @@ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] "TARGET_EITHER" " - if (GET_CODE (operands[1]) != MEM) + if (!arm_arch6 && GET_CODE (operands[1]) != MEM) { if (TARGET_ARM) { @@ -3124,26 +3364,61 @@ ) (define_insn "*thumb_zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=l") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_THUMB" + [(set (match_operand:SI 0 "register_operand" "=l") + (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_THUMB && !arm_arch6" "ldrb\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "32")] ) +(define_insn "*thumb_zero_extendqisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,m")))] + "TARGET_THUMB && arm_arch6" + "@ + 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")] +) + (define_insn "*arm_zero_extendqisi2" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ARM" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_ARM && !arm_arch6" "ldr%?b\\t%0, %1\\t%@ zero_extendqisi2" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] ) +(define_insn "*arm_zero_extendqisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + 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")] +) + +(define_insn "*arm_zero_extendqisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (zero_extend:SI (match_operand:QI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "uxtab%?\\t%0, %2, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "alu_shift")] +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (zero_extend:SI (subreg:QI (match_operand:SI 1 "" "") 0))) @@ -3173,15 +3448,23 @@ "TARGET_EITHER" " { - if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM) + if (GET_CODE (operands[1]) == MEM) { - /* Note: We do not have to worry about TARGET_MMU_TRAPS - here because the insn below will generate an LDRH instruction - rather than an LDR instruction, so we cannot get an unaligned - word access. */ - emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_SIGN_EXTEND (SImode, operands[1]))); - DONE; + if (TARGET_THUMB) + { + emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1])); + DONE; + } + else if (arm_arch4) + { + /* Note: We do not have to worry about TARGET_MMU_TRAPS + here because the insn below will generate an LDRH instruction + rather than an LDR instruction, so we cannot get an unaligned + word access. */ + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; + } } if (TARGET_ARM && TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM) @@ -3189,39 +3472,31 @@ emit_insn (gen_extendhisi2_mem (operands[0], operands[1])); DONE; } + if (!s_register_operand (operands[1], HImode)) operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); - if (TARGET_THUMB) + if (arm_arch6) { - rtx ops[3]; - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); - - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFTRT (SImode, ops[1], ops[2]))); - + if (TARGET_THUMB) + emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1])); + else + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; } + + operands[1] = gen_lowpart (SImode, operands[1]); + operands[2] = gen_reg_rtx (SImode); }" ) -(define_insn "*thumb_extendhisi2_insn" - [(set (match_operand:SI 0 "register_operand" "=l") - (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))) - (clobber (match_scratch:SI 2 "=&l"))] - "TARGET_THUMB" +(define_insn "thumb_extendhisi2" + [(set (match_operand:SI 0 "register_operand" "=l") + (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))) + (clobber (match_scratch:SI 2 "=&l"))] + "TARGET_THUMB && !arm_arch6" "* { rtx ops[4]; @@ -3271,10 +3546,83 @@ return \"\"; }" [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "1020")] ) +;; We used to have an early-clobber on the scratch register here. +;; However, there's a bug somewhere in reload which means that this +;; can be partially ignored during spill allocation if the memory +;; address also needs reloading; this causes an abort later on when +;; we try to verify the operands. Fortunately, we don't really need +;; the early-clobber: we can always use operand 0 if operand 2 +;; overlaps the address. +(define_insn "*thumb_extendhisi2_insn_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m"))) + (clobber (match_scratch:SI 2 "=X,l"))] + "TARGET_THUMB && arm_arch6" + "* + { + rtx ops[4]; + rtx mem; + + if (which_alternative == 0) + return \"sxth\\t%0, %1\"; + + mem = XEXP (operands[1], 0); + + /* This code used to try to use 'V', and fix the address only if it was + offsettable, but this fails for e.g. REG+48 because 48 is outside the + range of QImode offsets, and offsettable_address_p does a QImode + address check. */ + + 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); + + if (GET_CODE (a) == LABEL_REF + && GET_CODE (b) == CONST_INT) + return \"ldr\\t%0, %1\"; + + if (GET_CODE (b) == REG) + return \"ldrsh\\t%0, %1\"; + + ops[1] = a; + ops[2] = b; + } + else + { + ops[1] = mem; + ops[2] = const0_rtx; + } + + if (GET_CODE (ops[1]) != REG) + { + debug_rtx (ops[1]); + abort (); + } + + ops[0] = operands[0]; + if (reg_mentioned_p (operands[2], ops[1])) + ops[3] = ops[0]; + else + ops[3] = operands[2]; + output_asm_insn (\"mov\\t%3, %2\;ldrsh\\t%0, [%1, %3]\", ops); + return \"\"; + }" + [(set_attr "length" "2,4") + (set_attr "type" "alu_shift,load_byte") + (set_attr "pool_range" "*,1020")] +) + (define_expand "extendhisi2_mem" [(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" ""))) (set (match_dup 3) @@ -3312,17 +3660,38 @@ }" ) -(define_insn "*arm_extendhisi_insn" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" +(define_insn "*arm_extendhisi2" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" "ldr%?sh\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) +(define_insn "*arm_extendhisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + sxth%?\\t%0, %1 + ldr%?sh\\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")] +) + +(define_insn "*arm_extendhisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (sign_extend:SI (match_operand:HI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "sxtah%?\\t%0, %2, %1" +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (sign_extend:SI (match_operand:HI 1 "alignable_memory_operand" ""))) @@ -3384,12 +3753,12 @@ (sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))] "TARGET_ARM && arm_arch4" "* - /* If the address is invalid, this will split the instruction into two. */ + /* If the address is invalid, this will split the instruction into two. */ if (bad_signed_byte_operand (operands[1], VOIDmode)) return \"#\"; return \"ldr%?sb\\t%0, %1\"; " - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "length" "8") (set_attr "pool_range" "256") @@ -3420,7 +3789,7 @@ XEXP (operands[2], 0) = plus_constant (operands[3], low); operands[1] = plus_constant (XEXP (operands[1], 0), offset - low); } - /* Ensure the sum is in correct canonical form */ + /* Ensure the sum is in correct canonical form. */ else if (GET_CODE (operands[1]) == PLUS && GET_CODE (XEXP (operands[1], 1)) != CONST_INT && !s_register_operand (XEXP (operands[1], 1), VOIDmode)) @@ -3440,60 +3809,78 @@ "TARGET_EITHER" " { - if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM) + if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM) { - emit_insn (gen_rtx_SET (VOIDmode, - operands[0], + emit_insn (gen_rtx_SET (VOIDmode, operands[0], gen_rtx_SIGN_EXTEND (SImode, operands[1]))); DONE; } + if (!s_register_operand (operands[1], QImode)) operands[1] = copy_to_mode_reg (QImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); - - if (TARGET_THUMB) - { - rtx ops[3]; - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (24); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (24); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFTRT (SImode, ops[1], ops[2]))); - - DONE; + if (arm_arch6) + { + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; } + + operands[1] = gen_lowpart (SImode, operands[1]); + operands[2] = gen_reg_rtx (SImode); }" ) ; Rather than restricting all byte accesses to memory addresses that ldrsb ; can handle, we fix up the ones that ldrsb can't grok with a split. -(define_insn "*arm_extendqisi_insn" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" +(define_insn "*arm_extendqisi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" "* - /* If the address is invalid, this will split the instruction into two. */ + /* If the address is invalid, this will split the instruction into two. */ if (bad_signed_byte_operand (operands[1], VOIDmode)) return \"#\"; return \"ldr%?sb\\t%0, %1\"; " - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "length" "8") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) +(define_insn "*arm_extendqisi_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "* + if (which_alternative == 0) + return \"sxtb%?\\t%0, %1\"; + + /* If the address is invalid, this will split the instruction into two. */ + if (bad_signed_byte_operand (operands[1], VOIDmode)) + return \"#\"; + + return \"ldr%?sb\\t%0, %1\"; + " + [(set_attr "type" "alu_shift,load_byte") + (set_attr "predicable" "yes") + (set_attr "length" "4,8") + (set_attr "pool_range" "*,256") + (set_attr "neg_pool_range" "*,244")] +) + +(define_insn "*arm_extendqisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (sign_extend:SI (match_operand:QI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "sxtab%?\\t%0, %2, %1" + [(set_attr "type" "alu_shift") + (set_attr "predicable" "yes")] +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (sign_extend:SI (match_operand:QI 1 "bad_signed_byte_operand" "")))] @@ -3517,7 +3904,7 @@ XEXP (operands[2], 0) = plus_constant (operands[0], low); operands[1] = plus_constant (XEXP (operands[1], 0), offset - low); } - /* Ensure the sum is in correct canonical form */ + /* Ensure the sum is in correct canonical form. */ else if (GET_CODE (operands[1]) == PLUS && GET_CODE (XEXP (operands[1], 1)) != CONST_INT && !s_register_operand (XEXP (operands[1], 1), VOIDmode)) @@ -3527,10 +3914,10 @@ }" ) -(define_insn "*thumb_extendqisi2_insn" - [(set (match_operand:SI 0 "register_operand" "=l,l") - (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))] - "TARGET_THUMB" +(define_insn "*thumb_extendqisi2" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))] + "TARGET_THUMB && !arm_arch6" "* { rtx ops[3]; @@ -3602,14 +3989,95 @@ return \"\"; }" [(set_attr "length" "2,6") - (set_attr "type" "load,load") + (set_attr "type" "load_byte,load_byte") (set_attr "pool_range" "32,32")] ) +(define_insn "*thumb_extendqisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l,l") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,V,m")))] + "TARGET_THUMB && arm_arch6" + "* + { + rtx ops[3]; + rtx mem; + + if (which_alternative == 0) + return \"sxtb\\t%0, %1\"; + + 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 + && GET_CODE (XEXP (mem, 0)) == LABEL_REF) + return \"ldr\\t%0, %1\"; + + if (which_alternative == 0) + return \"ldrsb\\t%0, %1\"; + + ops[0] = operands[0]; + + if (GET_CODE (mem) == PLUS) + { + rtx a = XEXP (mem, 0); + rtx b = XEXP (mem, 1); + + ops[1] = a; + ops[2] = b; + + if (GET_CODE (a) == REG) + { + if (GET_CODE (b) == REG) + output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops); + else if (REGNO (a) == REGNO (ops[0])) + { + output_asm_insn (\"ldrb\\t%0, [%1, %2]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + else if (GET_CODE (b) != REG) + abort (); + else + { + if (REGNO (b) == REGNO (ops[0])) + { + output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + } + else if (GET_CODE (mem) == REG && REGNO (ops[0]) == REGNO (mem)) + { + output_asm_insn (\"ldrb\\t%0, [%0, #0]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + { + ops[1] = mem; + ops[2] = const0_rtx; + + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + return \"\"; + }" + [(set_attr "length" "2,2,4") + (set_attr "type" "alu_shift,load_byte,load_byte") + (set_attr "pool_range" "*,32,32")] +) + (define_expand "extendsfdf2" [(set (match_operand:DF 0 "s_register_operand" "") (float_extend:DF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -3693,12 +4161,14 @@ (define_insn "*arm_movdi" [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>") (match_operand:DI 1 "di_operand" "rIK,mi,r"))] - "TARGET_ARM && !TARGET_CIRRUS && ! TARGET_IWMMXT" + "TARGET_ARM + && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP)) + && !TARGET_IWMMXT" "* return (output_move_double (operands)); " [(set_attr "length" "8") - (set_attr "type" "*,load,store2") + (set_attr "type" "*,load2,store2") (set_attr "pool_range" "*,1020,*") (set_attr "neg_pool_range" "*,1008,*")] ) @@ -3711,7 +4181,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r") (match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))] "TARGET_THUMB - && !TARGET_CIRRUS + && !(TARGET_HARD_FLOAT && TARGET_MAVERICK) && ( register_operand (operands[0], DImode) || register_operand (operands[1], DImode))" "* @@ -3746,7 +4216,7 @@ } }" [(set_attr "length" "4,4,6,2,2,6,4,4") - (set_attr "type" "*,*,*,load,store2,load,store2,*") + (set_attr "type" "*,*,*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,*,*,1020,*,*")] ) @@ -3757,10 +4227,11 @@ " if (TARGET_ARM) { - /* Everything except mem = const or mem = mem can be done easily */ + /* Everything except mem = const or mem = mem can be done easily. */ if (GET_CODE (operands[0]) == MEM) operands[1] = force_reg (SImode, operands[1]); - if (GET_CODE (operands[1]) == CONST_INT + if (arm_general_register_operand (operands[0], SImode) + && GET_CODE (operands[1]) == CONST_INT && !(const_ok_for_arm (INTVAL (operands[1])) || const_ok_for_arm (~INTVAL (operands[1])))) { @@ -3771,7 +4242,7 @@ DONE; } } - else /* TARGET_THUMB.... */ + else /* TARGET_THUMB.... */ { if (!no_new_pseudos) { @@ -3793,6 +4264,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m") (match_operand:SI 1 "general_operand" "rI,K,mi,r"))] "TARGET_ARM && ! TARGET_IWMMXT + && !(TARGET_HARD_FLOAT && TARGET_VFP) && ( register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" "@ @@ -3800,14 +4272,14 @@ mvn%?\\t%0, #%B1 ldr%?\\t%0, %1 str%?\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,4096,*") (set_attr "neg_pool_range" "*,*,4084,*")] ) (define_split - [(set (match_operand:SI 0 "s_register_operand" "") + [(set (match_operand:SI 0 "arm_general_register_operand" "") (match_operand:SI 1 "const_int_operand" ""))] "TARGET_ARM && (!(const_ok_for_arm (INTVAL (operands[1])) @@ -3837,7 +4309,7 @@ str\\t%1, %0 mov\\t%0, %1" [(set_attr "length" "2,2,4,4,2,2,2,2,2") - (set_attr "type" "*,*,*,*,load,store1,load,store1,*") + (set_attr "type" "*,*,*,*,load1,store1,load1,store1,*") (set_attr "pool_range" "*,*,*,*,*,*,1020,*,*")] ) @@ -3889,7 +4361,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_ARM && flag_pic" "ldr%?\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 4096)) (set (attr "neg_pool_range") (const_int 4084))] ) @@ -3899,7 +4371,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_THUMB && flag_pic" "ldr\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 1024))] ) @@ -3925,7 +4397,7 @@ output_asm_insn (\"ldr%?\\t%0, %a1\", operands); return \"\"; " - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (if_then_else (eq_attr "is_thumb" "yes") (const_int 1024) @@ -4007,7 +4479,7 @@ (set (match_dup 2) (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) ;; store the high byte - (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe + (set (match_dup 4) (match_dup 5))] "TARGET_ARM" " { @@ -4023,7 +4495,8 @@ operands[1] = adjust_address (operands[1], QImode, 0); operands[3] = gen_lowpart (QImode, operands[0]); operands[0] = gen_lowpart (SImode, operands[0]); - operands[2] = gen_reg_rtx (SImode); + operands[2] = gen_reg_rtx (SImode); + operands[5] = gen_lowpart (QImode, operands[2]); }" ) @@ -4031,7 +4504,7 @@ [(set (match_dup 4) (match_dup 3)) (set (match_dup 2) (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) - (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))] + (set (match_operand 1 "" "") (match_dup 5))] "TARGET_ARM" " { @@ -4048,13 +4521,14 @@ operands[3] = gen_lowpart (QImode, operands[0]); operands[0] = gen_lowpart (SImode, operands[0]); operands[2] = gen_reg_rtx (SImode); + operands[5] = gen_lowpart (QImode, operands[2]); }" ) ;; Subroutine to store a half word integer constant into memory. (define_expand "storeinthi" [(set (match_operand 0 "" "") - (subreg:QI (match_operand 1 "" "") 0)) + (match_operand 1 "" "")) (set (match_dup 3) (match_dup 2))] "TARGET_ARM" " @@ -4095,6 +4569,7 @@ operands[3] = adjust_address (op0, QImode, 1); operands[0] = adjust_address (operands[0], QImode, 0); operands[2] = gen_lowpart (QImode, operands[2]); + operands[1] = gen_lowpart (QImode, operands[1]); }" ) @@ -4255,7 +4730,7 @@ } } } - /* Handle loading a large integer during reload */ + /* Handle loading a large integer during reload. */ else if (GET_CODE (operands[1]) == CONST_INT && !const_ok_for_arm (INTVAL (operands[1])) && !const_ok_for_arm (~INTVAL (operands[1]))) @@ -4299,7 +4774,7 @@ = replace_equiv_address (operands[1], copy_to_reg (XEXP (operands[1], 0))); } - /* Handle loading a large integer during reload */ + /* Handle loading a large integer during reload. */ else if (GET_CODE (operands[1]) == CONST_INT && !CONST_OK_FOR_THUMB_LETTER (INTVAL (operands[1]), 'I')) { @@ -4350,7 +4825,7 @@ return \"ldrh %0, %1\"; }" [(set_attr "length" "2,4,2,2,2,2") - (set_attr "type" "*,load,store1,*,*,*") + (set_attr "type" "*,load1,store1,*,*,*") (set_attr "pool_range" "*,64,*,*,*,*")] ) @@ -4369,7 +4844,7 @@ output_asm_insn (\"ldr%?\\t%0, %1\\t%@ load-rotate\", ops); return \"\"; }" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -4415,11 +4890,12 @@ (set (match_dup 3) (ashiftrt:SI (match_dup 2) (const_int 16))) (set (match_operand:HI 0 "s_register_operand" "") - (subreg:HI (match_dup 3) 0))] + (match_dup 4))] "TARGET_ARM" " operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode); + operands[4] = gen_lowpart (HImode, operands[3]); " ) @@ -4437,7 +4913,7 @@ mvn%?\\t%0, #%B1\\t%@ movhi str%?h\\t%1, %0\\t%@ movhi ldr%?h\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,store1,load") + [(set_attr "type" "*,*,store1,load1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,*,256") (set_attr "neg_pool_range" "*,*,*,244")] @@ -4457,7 +4933,7 @@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi ldr%?\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,load") + [(set_attr "type" "*,*,load1") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] @@ -4477,7 +4953,7 @@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi ldr%?\\t%0, %1\\t%@ movhi_bigend\;mov%?\\t%0, %0, asr #16" - [(set_attr "type" "*,*,load") + [(set_attr "type" "*,*,load1") (set_attr "predicable" "yes") (set_attr "length" "4,4,8") (set_attr "pool_range" "*,*,4092") @@ -4492,7 +4968,7 @@ && BYTES_BIG_ENDIAN && !TARGET_MMU_TRAPS" "ldr%?\\t%0, %1\\t%@ movhi_bigend" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] @@ -4603,7 +5079,7 @@ = replace_equiv_address (operands[1], copy_to_reg (XEXP (operands[1], 0))); } - /* Handle loading a large integer during reload */ + /* Handle loading a large integer during reload. */ else if (GET_CODE (operands[1]) == CONST_INT && !CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'I')) { @@ -4632,7 +5108,7 @@ mvn%?\\t%0, #%B1 ldr%?b\\t%0, %1 str%?b\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes")] ) @@ -4650,7 +5126,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,*,*,*") + (set_attr "type" "*,load1,store1,*,*,*") (set_attr "pool_range" "*,32,*,*,*,*")] ) @@ -4679,7 +5155,7 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "") (match_operand:SF 1 "immediate_operand" ""))] "TARGET_ARM - && !TARGET_HARD_FLOAT + && !(TARGET_HARD_FLOAT && TARGET_FPA) && reload_completed && GET_CODE (operands[1]) == CONST_DOUBLE" [(set (match_dup 2) (match_dup 3))] @@ -4695,7 +5171,6 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m") (match_operand:SF 1 "general_operand" "r,mE,r"))] "TARGET_ARM - && !TARGET_CIRRUS && TARGET_SOFT_FLOAT && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" @@ -4705,7 +5180,7 @@ str%?\\t%1, %0\\t%@ float" [(set_attr "length" "4,4,4") (set_attr "predicable" "yes") - (set_attr "type" "*,load,store1") + (set_attr "type" "*,load1,store1") (set_attr "pool_range" "*,4096,*") (set_attr "neg_pool_range" "*,4084,*")] ) @@ -4726,7 +5201,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,load,store1,*,*") + (set_attr "type" "*,load1,store1,load1,store1,*,*") (set_attr "pool_range" "*,*,*,1020,*,*,*")] ) @@ -4798,11 +5273,10 @@ [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,m") (match_operand:DF 1 "soft_df_operand" "r,mF,r"))] "TARGET_ARM && TARGET_SOFT_FLOAT - && !TARGET_CIRRUS " "* return output_move_double (operands);" [(set_attr "length" "8,8,8") - (set_attr "type" "*,load,store2") + (set_attr "type" "*,load2,store2") (set_attr "pool_range" "1020") (set_attr "neg_pool_range" "1008")] ) @@ -4843,7 +5317,7 @@ } " [(set_attr "length" "4,2,2,6,4,4") - (set_attr "type" "*,load,store2,load,store2,*") + (set_attr "type" "*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,1020,*,*")] ) @@ -4916,7 +5390,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 5" "ldm%?ia\\t%1!, {%3, %4, %5, %6}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) @@ -4933,7 +5407,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1!, {%3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -4948,7 +5422,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1!, {%3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -4966,7 +5440,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1, {%2, %3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) @@ -4980,7 +5454,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1, {%2, %3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -4992,7 +5466,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 2" "ldm%?ia\\t%1, {%2, %3}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -5002,7 +5476,7 @@ (use (match_operand:SI 2 "" ""))])] "TARGET_ARM" " - /* Support only fixed point registers */ + /* Support only fixed point registers. */ if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 14 || INTVAL (operands[2]) < 2 @@ -6242,12 +6716,9 @@ (define_expand "cmpsf" [(match_operand:SF 0 "s_register_operand" "") - (match_operand:SF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 1 "arm_float_compare_operand" "")] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], SFmode)) - operands[1] = force_reg (SFmode, operands[1]); - arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; DONE; @@ -6256,12 +6727,9 @@ (define_expand "cmpdf" [(match_operand:DF 0 "s_register_operand" "") - (match_operand:DF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 1 "arm_float_compare_operand" "")] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], DFmode)) - operands[1] = force_reg (DFmode, operands[1]); - arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; DONE; @@ -6289,7 +6757,9 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*cmpsi_shiftsi_swp" @@ -6302,7 +6772,9 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*cmpsi_neg_shiftsi" @@ -6315,7 +6787,9 @@ "cmn%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; Cirrus SF compare instruction @@ -6323,7 +6797,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "cirrus_fp_register" "v") (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmps%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6334,7 +6808,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "cirrus_fp_register" "v") (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmpd%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6344,7 +6818,7 @@ (define_expand "cmpdi" [(match_operand:DI 0 "cirrus_fp_register" "") (match_operand:DI 1 "cirrus_fp_register" "")] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "{ arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; @@ -6355,7 +6829,7 @@ [(set (reg:CC CC_REGNUM) (compare:CC (match_operand:DI 0 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmp64%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6473,7 +6947,7 @@ (if_then_else (unordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6483,7 +6957,7 @@ (if_then_else (ordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6493,7 +6967,7 @@ (if_then_else (ungt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6502,7 +6976,7 @@ (if_then_else (unlt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6511,7 +6985,7 @@ (if_then_else (unge (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6520,7 +6994,7 @@ (if_then_else (unle (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6531,7 +7005,7 @@ (if_then_else (uneq (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);" ) @@ -6540,7 +7014,7 @@ (if_then_else (ltgt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);" ) @@ -6554,7 +7028,7 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6571,7 +7045,7 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6597,7 +7071,8 @@ } return \"b%d1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) ; Special pattern to match reversed UNEQ. @@ -6606,7 +7081,7 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6623,7 +7098,7 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6649,7 +7124,8 @@ } return \"b%D1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) @@ -6729,7 +7205,7 @@ (define_expand "sunordered" [(set (match_operand:SI 0 "s_register_operand" "") (unordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6737,7 +7213,7 @@ (define_expand "sordered" [(set (match_operand:SI 0 "s_register_operand" "") (ordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6745,7 +7221,7 @@ (define_expand "sungt" [(set (match_operand:SI 0 "s_register_operand" "") (ungt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6753,7 +7229,7 @@ (define_expand "sunge" [(set (match_operand:SI 0 "s_register_operand" "") (unge:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6761,7 +7237,7 @@ (define_expand "sunlt" [(set (match_operand:SI 0 "s_register_operand" "") (unlt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6769,7 +7245,7 @@ (define_expand "sunle" [(set (match_operand:SI 0 "s_register_operand" "") (unle:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6780,14 +7256,14 @@ ; (define_expand "suneq" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (uneq:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" +; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" ; "abort ();" ; ) ; ; (define_expand "sltgt" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (ltgt:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" +; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" ; "abort ();" ; ) @@ -6859,8 +7335,8 @@ /* When compiling for SOFT_FLOAT, ensure both arms are in registers. Otherwise, ensure it is a valid FP add operand */ - if ((!TARGET_HARD_FLOAT) - || (!fpa_add_operand (operands[3], SFmode))) + if ((!(TARGET_HARD_FLOAT && TARGET_FPA)) + || (!arm_float_add_operand (operands[3], SFmode))) operands[3] = force_reg (SFmode, operands[3]); ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1); @@ -6872,8 +7348,8 @@ [(set (match_operand:DF 0 "s_register_operand" "") (if_then_else:DF (match_operand 1 "arm_comparison_operator" "") (match_operand:DF 2 "s_register_operand" "") - (match_operand:DF 3 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 3 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" " { enum rtx_code code = GET_CODE (operands[1]); @@ -7239,7 +7715,7 @@ } return output_return_instruction (const_true_rtx, TRUE, FALSE); }" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "length" "12") (set_attr "predicable" "yes")] ) @@ -7262,7 +7738,7 @@ }" [(set_attr "conds" "use") (set_attr "length" "12") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) (define_insn "*cond_return_inverted" @@ -7282,7 +7758,7 @@ return output_return_instruction (operands[0], TRUE, TRUE); }" [(set_attr "conds" "use") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) ;; Generate a sequence of instructions to determine if the processor is @@ -7426,7 +7902,7 @@ (match_operand:SI 0 "memory_operand" "m"))] "TARGET_ARM" "ldr%?\\t%|pc, %0\\t%@ indirect memory jump" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084") (set_attr "predicable" "yes")] @@ -7472,9 +7948,29 @@ "%i1%?\\t%0, %2, %4%S3" [(set_attr "predicable" "yes") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (match_operator:SI 1 "shiftable_operator" + [(match_operator:SI 2 "shiftable_operator" + [(match_operator:SI 3 "shift_operator" + [(match_operand:SI 4 "s_register_operand" "") + (match_operand:SI 5 "reg_or_int_operand" "")]) + (match_operand:SI 6 "s_register_operand" "")]) + (match_operand:SI 7 "arm_rhs_operand" "")])) + (clobber (match_operand:SI 8 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 8) + (match_op_dup 2 [(match_op_dup 3 [(match_dup 4) (match_dup 5)]) + (match_dup 6)])) + (set (match_dup 0) + (match_op_dup 1 [(match_dup 8) (match_dup 7)]))] + "") + (define_insn "*arith_shiftsi_compare0" [(set (reg:CC_NOOV CC_REGNUM) (compare:CC_NOOV (match_operator:SI 1 "shiftable_operator" @@ -7490,7 +7986,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*arith_shiftsi_compare0_scratch" @@ -7506,7 +8004,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi" @@ -7519,7 +8019,9 @@ "sub%?\\t%0, %1, %3%S2" [(set_attr "predicable" "yes") (set_attr "shift" "3") - ] + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0" @@ -7536,8 +8038,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0_scratch" @@ -7552,8 +8056,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) @@ -7979,6 +8485,44 @@ [(set_attr "conds" "clob") (set_attr "length" "20")]) +(define_split + [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (ior:SI + (and:SI (match_operand:SI 0 "s_register_operand" "") + (const_int 1)) + (match_operator:SI 1 "comparison_operator" + [(match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "arm_add_operand" "")])) + (const_int 0))) + (clobber (match_operand:SI 4 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 4) + (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)]) + (match_dup 0))) + (set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1)) + (const_int 0)))] + "") + +(define_split + [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (ior:SI + (match_operator:SI 1 "comparison_operator" + [(match_operand:SI 2 "s_register_operand" "") + (match_operand:SI 3 "arm_add_operand" "")]) + (and:SI (match_operand:SI 0 "s_register_operand" "") + (const_int 1))) + (const_int 0))) + (clobber (match_operand:SI 4 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 4) + (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)]) + (match_dup 0))) + (set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1)) + (const_int 0)))] + "") + (define_insn "*negscc" [(set (match_operand:SI 0 "s_register_operand" "=r") (neg:SI (match_operator 3 "arm_comparison_operator" @@ -8031,7 +8575,7 @@ return \"bics\\t%0, %2, %3, asr #32\;movcs\\t%0, %1\"; } /* The only case that falls through to here is when both ops 1 & 2 - are constants */ + are constants. */ } if (GET_CODE (operands[5]) == GE @@ -8050,7 +8594,7 @@ return \"ands\\t%0, %2, %3, asr #32\;movcc\\t%0, %1\"; } /* The only case that falls through to here is when both ops 1 & 2 - are constants */ + are constants. */ } if (GET_CODE (operands[4]) == CONST_INT && !const_ok_for_arm (INTVAL (operands[4]))) @@ -8187,7 +8731,7 @@ "* /* If we have an operation where (op x 0) is the identity operation and the conditional operator is LT or GE and we are comparing against zero and - everything is in registers then we can do this in two instructions */ + everything is in registers then we can do this in two instructions. */ if (operands[3] == const0_rtx && GET_CODE (operands[7]) != AND && GET_CODE (operands[5]) == REG @@ -8388,7 +8932,10 @@ mvn%D5\\t%0, #%B1\;mov%d5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_move_shift" @@ -8424,7 +8971,10 @@ mvn%d5\\t%0, #%B1\;mov%D5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_shift_shift" @@ -8461,7 +9011,12 @@ "mov%d5\\t%0, %1%S6\;mov%D5\\t%0, %3%S7" [(set_attr "conds" "use") (set_attr "shift" "1") - (set_attr "length" "8")] + (set_attr "length" "8") + (set (attr "type") (if_then_else + (and (match_operand 2 "const_int_operand" "") + (match_operand 4 "const_int_operand" "")) + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_not_arith" @@ -8662,7 +9217,7 @@ }" [(set_attr "length" "12") (set_attr "predicable" "yes") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) ;; the arm can support extended pre-inc instructions @@ -8719,7 +9274,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, %2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8735,7 +9290,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, -%2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8752,7 +9307,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, %2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8769,7 +9324,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, -%2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8817,7 +9372,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, %2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -8833,7 +9388,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, -%2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -8852,7 +9407,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, %2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8871,7 +9426,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, -%2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8925,7 +9480,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?b\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8943,7 +9498,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?b\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8997,7 +9552,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -9015,7 +9570,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")]) (define_insn "*loadhi_shiftpreinc" @@ -9035,7 +9590,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, %3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -9056,7 +9611,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, -%3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -9168,7 +9723,7 @@ (set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))] "TARGET_ARM - && (!TARGET_CIRRUS + && (!(TARGET_HARD_FLOAT && TARGET_MAVERICK) || (!cirrus_fp_register (operands[0], SImode) && !cirrus_fp_register (operands[1], SImode))) " @@ -9334,9 +9889,9 @@ (unspec_volatile [(return)] VUNSPEC_EPILOGUE)])] "TARGET_ARM" "* - if (USE_RETURN_INSN (FALSE)) + if (use_return_insn (FALSE, next_nonnote_insn (insn))) return output_return_instruction (const_true_rtx, FALSE, FALSE); - return arm_output_epilogue (FALSE); + return arm_output_epilogue (next_nonnote_insn (insn)); " ;; Length is absolute worst case [(set_attr "length" "44") @@ -9352,7 +9907,7 @@ "TARGET_EITHER" "* if (TARGET_ARM) - return arm_output_epilogue (TRUE); + return arm_output_epilogue (NULL); else /* TARGET_THUMB */ return thumb_unexpanded_epilogue (); " @@ -9612,7 +10167,7 @@ [(set (match_operand:BLK 0 "memory_operand" "=m") (unspec:BLK [(match_operand:XF 1 "f_register_operand" "f")] UNSPEC_PUSH_MULT))])] - "TARGET_ARM" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* { char pattern[100]; @@ -9832,3 +10387,6 @@ (include "cirrus.md") ;; Load the Intel Wireless Multimedia Extension patterns (include "iwmmxt.md") +;; Load the VFP co-processor patterns +(include "vfp.md") + diff --git a/gcc/config/arm/arm1026ejs.md b/gcc/config/arm/arm1026ejs.md new file mode 100644 index 00000000000..5dd433269ac --- /dev/null +++ b/gcc/config/arm/arm1026ejs.md @@ -0,0 +1,241 @@ +;; ARM 1026EJ-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; 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 2, 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 COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1026EJ-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1026EJ-S core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are two pipelines: +;; +;; - An Arithmetic Logic Unit (ALU) pipeline. +;; +;; The ALU pipeline has fetch, issue, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. +;; +;; - A Load-Store Unit (LSU) pipeline. +;; +;; The LSU pipeline has decode, execute, memory, and write stages. +;; We only model the execute, memory and write stages. + +(define_cpu_unit "a_e,a_m,a_w" "arm1026ejs") +(define_cpu_unit "l_e,l_m,l_w" "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "alu_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "alu_shift_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift_reg")) + "a_e*2,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. + +;; The result of the "smul" and "smulw" instructions is not available +;; until after the memory stage. +(define_insn_reservation "mult1" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smulxy,smulwy")) + "a_e,a_m,a_w") + +;; The "smlaxy" and "smlawx" instructions require two iterations through +;; the execute stage; the result is available immediately following +;; the execute stage. +(define_insn_reservation "mult2" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlaxy,smlalxy,smlawx")) + "a_e*2,a_m,a_w") + +;; The "smlalxy", "mul", and "mla" instructions require two iterations +;; through the execute stage; the result is not available until after +;; the memory stage. +(define_insn_reservation "mult3" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlalxy,mul,mla")) + "a_e*2,a_m,a_w") + +;; The "muls" and "mlas" instructions loop in the execute stage for +;; four iterations in order to set the flags. The value result is +;; available after three iterations. +(define_insn_reservation "mult4" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "muls,mlas")) + "a_e*4,a_m,a_w") + +;; Long multiply instructions that produce two registers of +;; output (such as umull) make their results available in two cycles; +;; the least significant word is available before the most significant +;; word. That fact is not modeled; instead, the instructions are +;; described.as if the entire result was available at the end of the +;; cycle in which both words are available. + +;; The "umull", "umlal", "smull", and "smlal" instructions all take +;; three iterations through the execute cycle, and make their results +;; available after the memory cycle. +(define_insn_reservation "mult5" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "a_e*3,a_m,a_w") + +;; The "umulls", "umlals", "smulls", and "smlals" instructions loop in +;; the execute stage for five iterations in order to set the flags. +;; The value result is vailable after four iterations. +(define_insn_reservation "mult6" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "a_e*5,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; LSU instructions require six cycles to execute. They use the ALU +;; pipeline in all but the 5th cycle, and the LSU pipeline in cycles +;; three through six. +;; Loads and stores which use a scaled register offset or scaled +;; register pre-indexed addressing mode take three cycles EXCEPT for +;; those that are base + offset with LSL of 0 or 2, or base - offset +;; with LSL of zero. The remainder take 1 cycle to execute. +;; For 4byte loads there is a bypass from the load stage + +(define_insn_reservation "load1_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load_byte,load1")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store1_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store1")) + "a_e+l_e,l_m,a_w+l_w") + +;; A load's result can be stored by an immediately following store +(define_bypass 1 "load1_op" "store1_op" "arm_no_early_store_addr_dep") + +;; On a LDM/STM operation, the LSU pipeline iterates until all of the +;; registers have been processed. +;; +;; The time it takes to load the data depends on whether or not the +;; base address is 64-bit aligned; if it is not, an additional cycle +;; is required. This model assumes that the address is always 64-bit +;; aligned. Because the processor can load two registers per cycle, +;; that assumption means that we use the same instruction rservations +;; for loading 2k and 2k - 1 registers. +;; +;; The ALU pipeline is stalled until the completion of the last memory +;; stage in the LSU pipeline. That is modeled by keeping the ALU +;; execute stage busy until that point. +;; +;; As with ALU operations, if one of the destination registers is the +;; PC, there are additional stalls; that is not modeled. + +(define_insn_reservation "load2_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store2_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "load34_op" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load3,load4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +(define_insn_reservation "store34_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store3,store4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "branch_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "branch")) + "nothing") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to postive infinity. + +(define_insn_reservation "call_op" 32 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "call")) + "nothing") diff --git a/gcc/config/arm/arm1136jfs.md b/gcc/config/arm/arm1136jfs.md new file mode 100644 index 00000000000..acfce1b5681 --- /dev/null +++ b/gcc/config/arm/arm1136jfs.md @@ -0,0 +1,377 @@ +;; ARM 1136J[F]-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; 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 2, 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 COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1136JF-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1136J-S and 1136JF-S cores. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1136jfs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are three distinct pipelines (page 1-26 and following): +;; +;; - A 4-stage decode pipeline, shared by all three. It has fetch (1), +;; fetch (2), decode, and issue stages. Since this is always involved, +;; we do not model it in the scheduler. +;; +;; - A 4-stage ALU pipeline. It has shifter, ALU (main integer operations), +;; and saturation stages. The fourth stage is writeback; see below. +;; +;; - A 4-stage multiply-accumulate pipeline. It has three stages, called +;; MAC1 through MAC3, and a fourth writeback stage. +;; +;; The 4th-stage writeback is shared between the ALU and MAC pipelines, +;; which operate in lockstep. Results from either pipeline will be +;; moved into the writeback stage. Because the two pipelines operate +;; in lockstep, we schedule them as a single "execute" pipeline. +;; +;; - A 4-stage LSU pipeline. It has address generation, data cache (1), +;; data cache (2), and writeback stages. (Note that this pipeline, +;; including the writeback stage, is independant from the ALU & LSU pipes.) + +(define_cpu_unit "e_1,e_2,e_3,e_wb" "arm1136jfs") ; ALU and MAC +; e_1 = Sh/Mac1, e_2 = ALU/Mac2, e_3 = SAT/Mac3 +(define_cpu_unit "l_a,l_dc1,l_dc2,l_wb" "arm1136jfs") ; Load/Store + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require eight cycles to execute, and use the ALU +;; pipeline in each of the eight stages. The results are available +;; after the alu stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modelled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "11_alu_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "11_alu_shift_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the shift stage. +(define_insn_reservation "11_alu_shift_reg_op" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift_reg")) + "e_1*2,e_2,e_3,e_wb") + +;; alu_ops can start sooner, if there is no shifter dependency +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_op") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_op") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the first two execute stages until +;; the instruction has been passed through the multiplier array enough +;; times. + +;; Multiply and multiply-accumulate results are available after four stages. +(define_insn_reservation "11_mult1" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "mul,mla")) + "e_1*2,e_2,e_3,e_wb") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult2" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "muls,mlas")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult1,11_mult2" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_op") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Signed and unsigned multiply long results are available across two cycles; +;; the less significant word is available one cycle before the more significant +;; word. Here we conservatively wait until both are available, which is +;; after three iterations and the memory cycle. The same is also true of +;; the two multiply-accumulate instructions. +(define_insn_reservation "11_mult3" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smull,umull,smlal,umlal")) + "e_1*3,e_2,e_3,e_wb*2") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult4" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulls,umulls,smlals,umlals")) + "e_1*3,e_2,e_3,e_wb*2") + +(define_bypass 4 "11_mult3,11_mult4" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_op") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Various 16x16->32 multiplies and multiply-accumulates, using combinations +;; of high and low halves of the argument registers. They take a single +;; pass through the pipeline and make the result available after three +;; cycles. +(define_insn_reservation "11_mult5" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulxy,smlaxy,smulwy,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx")) + "e_1,e_2,e_3,e_wb") + +(define_bypass 2 "11_mult5" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_mult5" + "11_alu_op") +(define_bypass 2 "11_mult5" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_mult5" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_mult5" + "11_store1" + "arm_no_early_store_addr_dep") + +;; The same idea, then the 32-bit result is added to a 64-bit quantity. +(define_insn_reservation "11_mult6" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smlalxy")) + "e_1*2,e_2,e_3,e_wb*2") + +;; Signed 32x32 multiply, then the most significant 32 bits are extracted +;; and are available after the memory stage. +(define_insn_reservation "11_mult7" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smmul,smmulr")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult6,11_mult7" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_op") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_store1" + "arm_no_early_store_addr_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; These vary greatly depending on their arguments and the results of +;; stat prediction. Cycle count ranges from zero (unconditional branch, +;; folded dynamic prediction) to seven (incorrect predictions, etc). We +;; assume an optimal case for now, because the cost of a cache miss +;; overwhelms the cost of everything else anyhow. + +(define_insn_reservation "11_branches" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "branch")) + "nothing") + +;; Call latencies are not predictable. A semi-arbitrary very large +;; number is used as "positive infinity" so that everything should be +;; finished by the time of return. +(define_insn_reservation "11_call" 32 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "call")) + "nothing") + +;; Branches are predicted. A correctly predicted branch will be no +;; cost, but we're conservative here, and use the timings a +;; late-register would give us. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_branches") +(define_bypass 2 "11_alu_shift_reg_op" + "11_branches") +(define_bypass 2 "11_load1,11_load2" + "11_branches") +(define_bypass 3 "11_load34" + "11_branches") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback. +;; These models assume that all memory references hit in dcache. Also, +;; if the PC is one of the registers involved, there are additional stalls +;; not modelled here. Addressing modes are also not modelled. + +(define_insn_reservation "11_load1" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load byte results are not available until the writeback stage, where +;; the correct byte is extracted. + +(define_insn_reservation "11_loadb" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load_byte")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store1" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store double words into adjacent registers. The timing and +;; latencies are different depending on whether the address is 64-bit +;; aligned. This model assumes that it is. +(define_insn_reservation "11_load2" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store2" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store multiple registers. Two registers are stored per cycle. +;; Actual timing depends on how many registers are affected, so we +;; optimistically schedule a low latency. +(define_insn_reservation "11_load34" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load3,load4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +(define_insn_reservation "11_store34" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store3,store4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +;; A store can start immediately after an alu op, if that alu op does +;; not provide part of the address to access. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_store1" + "arm_no_early_store_addr_dep") + +;; An alu op can start sooner after a load, if that alu op does not +;; have an early register dependancy on the load +(define_bypass 2 "11_load1" + "11_alu_op") +(define_bypass 2 "11_load1" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_load1" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 3 "11_loadb" + "11_alu_op") +(define_bypass 3 "11_loadb" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_loadb" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +;; A mul op can start sooner after a load, if that mul op does not +;; have an early multiply dependency +(define_bypass 2 "11_load1" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_load34" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_loadb" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;; A store can start sooner after a load, if that load does not +;; produce part of the address to access +(define_bypass 2 "11_load1" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 3 "11_loadb" + "11_store1" + "arm_no_early_store_addr_dep") diff --git a/gcc/config/arm/arm926ejs.md b/gcc/config/arm/arm926ejs.md new file mode 100644 index 00000000000..e8ba17cf551 --- /dev/null +++ b/gcc/config/arm/arm926ejs.md @@ -0,0 +1,188 @@ +;; ARM 926EJ-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; 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 2, 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 COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 926EJ-S core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm926ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There is a single pipeline +;; +;; The ALU pipeline has fetch, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. + +(define_cpu_unit "e,m,w" "arm926ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "9_alu_op" 1 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "alu,alu_shift")) + "e,m,w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "9_alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "alu_shift_reg")) + "e*2,m,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. Multiply operations occur in both the execute and memory +;; stages of the pipeline + +(define_insn_reservation "9_mult1" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smlalxy,mul,mla")) + "e*2,m,w") + +(define_insn_reservation "9_mult2" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "muls,mlas")) + "e*3,m,w") + +(define_insn_reservation "9_mult3" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "e*3,m,w") + +(define_insn_reservation "9_mult4" 5 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "e*4,m,w") + +(define_insn_reservation "9_mult5" 2 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smulxy,smlaxy,smlawx")) + "e,m,w") + +(define_insn_reservation "9_mult6" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smlalxy")) + "e*2,m,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; Loads with a shifted offset take 3 cycles, and are (a) probably the +;; most common and (b) the pessimistic assumption will lead to fewer stalls. +(define_insn_reservation "9_load1_op" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load1,load_byte")) + "e*2,m,w") + +(define_insn_reservation "9_store1_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store1")) + "e,m,w") + +;; multiple word loads and stores +(define_insn_reservation "9_load2_op" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load2")) + "e,m*2,w") + +(define_insn_reservation "9_load3_op" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load3")) + "e,m*3,w") + +(define_insn_reservation "9_load4_op" 5 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load4")) + "e,m*4,w") + +(define_insn_reservation "9_store2_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store2")) + "e,m*2,w") + +(define_insn_reservation "9_store3_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store3")) + "e,m*3,w") + +(define_insn_reservation "9_store4_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store4")) + "e,m*4,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "9_branch_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "branch")) + "nothing") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to postive infinity. + +(define_insn_reservation "9_call_op" 32 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "call")) + "nothing") diff --git a/gcc/config/arm/cirrus.md b/gcc/config/arm/cirrus.md index 0da8469ddd2..9bd01be45cb 100644 --- a/gcc/config/arm/cirrus.md +++ b/gcc/config/arm/cirrus.md @@ -34,7 +34,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (plus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadd64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -44,7 +44,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (plus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfadd32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -54,7 +54,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (plus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadds%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -64,7 +64,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (plus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfaddd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -74,7 +74,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (minus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsub64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -84,7 +84,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (minus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsub32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -94,7 +94,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (minus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubs%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -104,7 +104,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (minus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -114,7 +114,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmul32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -124,7 +124,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (mult:DI (match_operand:DI 2 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmul64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -136,7 +136,7 @@ (mult:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")) (match_operand:SI 3 "cirrus_fp_register" "0")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmac32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -149,7 +149,7 @@ (match_operand:SI 1 "cirrus_fp_register" "0") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 3 "cirrus_fp_register" "v"))))] - "0 && TARGET_ARM && TARGET_CIRRUS" + "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmsc32%?\\t%V0, %V2, %V3" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -159,7 +159,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (mult:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuls%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -169,7 +169,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (mult:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuld%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -179,7 +179,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -188,7 +188,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashiftrt:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -197,7 +197,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfrshl32%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -206,7 +206,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfrshl64%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -215,7 +215,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -224,7 +224,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashiftrt:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -232,7 +232,7 @@ (define_insn "*cirrus_absdi2" [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (abs:DI (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabs64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -242,7 +242,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (neg:DI (match_operand:DI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfneg64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -250,7 +250,7 @@ (define_insn "*cirrus_negsi2" [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (neg:SI (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfneg32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -258,7 +258,7 @@ (define_insn "*cirrus_negsf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (neg:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegs%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -266,7 +266,7 @@ (define_insn "*cirrus_negdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (neg:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -276,7 +276,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (abs:SI (match_operand:SI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfabs32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -284,7 +284,7 @@ (define_insn "*cirrus_abssf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (abs:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabss%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -292,7 +292,7 @@ (define_insn "*cirrus_absdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (abs:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -302,7 +302,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -312,7 +312,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -321,14 +321,14 @@ (define_insn "floatdisf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64s%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) (define_insn "floatdidf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64d%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) @@ -336,7 +336,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8") (set_attr "cirrus" "normal")] @@ -346,7 +346,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8")] ) @@ -355,7 +355,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float_truncate:SF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtds%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -363,7 +363,7 @@ (define_insn "*cirrus_extendsfdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float_extend:DF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -371,7 +371,7 @@ (define_insn "*cirrus_arm_movdi" [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,o<>,v,r,v,m,v") (match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,m,v,v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "* { switch (which_alternative) @@ -394,7 +394,7 @@ } }" [(set_attr "length" " 8, 8, 8, 8, 8, 4, 4, 4") - (set_attr "type" " *,load,store2, *, *, load,store2, *") + (set_attr "type" " *,load2,store2, *, *, load2,store2, *") (set_attr "pool_range" " *,1020, *, *, *, *, *, *") (set_attr "neg_pool_range" " *,1012, *, *, *, *, *, *") (set_attr "cirrus" "not, not, not,move,normal,double,double,normal")] @@ -406,7 +406,7 @@ (define_insn "*cirrus_arm_movsi_insn" [(set (match_operand:SI 0 "general_operand" "=r,r,r,m,*v,r,*v,T,*v") (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,*v,T,*v,*v"))] - "TARGET_ARM && TARGET_CIRRUS && 0 + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0 && (register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" "@ @@ -419,7 +419,7 @@ cfldr32%?\\t%V0, %1 cfstr32%?\\t%V1, %0 cfsh32%?\\t%V0, %V1, #0" - [(set_attr "type" "*, *, load,store1, *, *, load,store1, *") + [(set_attr "type" "*, *, load1,store1, *, *, load1,store1, *") (set_attr "pool_range" "*, *, 4096, *, *, *, 1024, *, *") (set_attr "neg_pool_range" "*, *, 4084, *, *, *, 1012, *, *") (set_attr "cirrus" "not,not, not, not,move,normal,normal,normal,normal")] @@ -428,7 +428,7 @@ (define_insn "*cirrus_movsf_hard_insn" [(set (match_operand:SF 0 "nonimmediate_operand" "=v,v,v,r,m,r,r,m") (match_operand:SF 1 "general_operand" "v,m,r,v,v,r,mE,r"))] - "TARGET_ARM && TARGET_CIRRUS + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -441,7 +441,7 @@ ldr%?\\t%0, %1\\t%@ float str%?\\t%1, %0\\t%@ float" [(set_attr "length" " *, *, *, *, *, 4, 4, 4") - (set_attr "type" " *, load, *, *,store1, *,load,store1") + (set_attr "type" " *, load1, *, *,store1, *,load1,store1") (set_attr "pool_range" " *, *, *, *, *, *,4096, *") (set_attr "neg_pool_range" " *, *, *, *, *, *,4084, *") (set_attr "cirrus" "normal,normal,move,normal,normal,not, not, not")] @@ -451,7 +451,7 @@ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,Q,r,m,r,v,v,v,r,m") (match_operand:DF 1 "general_operand" "Q,r,r,r,mF,v,m,r,v,v"))] "TARGET_ARM - && TARGET_CIRRUS + && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -469,7 +469,7 @@ default: abort (); } }" - [(set_attr "type" "load,store2, *,store2,load, *, load, *, *,store2") + [(set_attr "type" "load1,store2, *,store2,load1, *, load1, *, *,store2") (set_attr "length" " 4, 4, 8, 8, 8, 4, 4, 8, 8, 4") (set_attr "pool_range" " *, *, *, *, 252, *, *, *, *, *") (set_attr "neg_pool_range" " *, *, *, *, 244, *, *, *, *, *") diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index 581f7267900..e3f393aa9d9 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -46,7 +46,7 @@ #ifndef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC "\ -%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}" +%{mapcs-float:-mfloat}" #endif #ifndef ASM_SPEC @@ -58,6 +58,8 @@ %{mapcs-*:-mapcs-%*} \ %(subtarget_asm_float_spec) \ %{mthumb-interwork:-mthumb-interwork} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %(subtarget_extra_asm_spec)" #endif diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md index 3b6efbfbbda..2eb74ee8c8b 100644 --- a/gcc/config/arm/fpa.md +++ b/gcc/config/arm/fpa.md @@ -100,8 +100,8 @@ (define_insn "*addsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") (plus:SF (match_operand:SF 1 "s_register_operand" "%f,f") - (match_operand:SF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?s\\t%0, %1, %2 suf%?s\\t%0, %1, #%N2" @@ -112,8 +112,8 @@ (define_insn "*adddf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (match_operand:DF 1 "s_register_operand" "%f,f") - (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -125,8 +125,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f,f")) - (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -139,7 +139,7 @@ (plus:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -151,7 +151,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -159,9 +159,9 @@ (define_insn "*subsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") - (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") + (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?s\\t%0, %1, %2 rsf%?s\\t%0, %2, %1" @@ -170,9 +170,9 @@ (define_insn "*subdf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") - (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") + (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -184,8 +184,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -193,10 +193,10 @@ (define_insn "*subdf_df_esfdf_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f,f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -210,7 +210,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -219,8 +219,8 @@ (define_insn "*mulsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (mult:SF (match_operand:SF 1 "s_register_operand" "f") - (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fml%?s\\t%0, %1, %2" [(set_attr "type" "ffmul") (set_attr "predicable" "yes")] @@ -229,8 +229,8 @@ (define_insn "*muldf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (mult:DF (match_operand:DF 1 "s_register_operand" "f") - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -240,8 +240,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -252,7 +252,7 @@ (mult:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -263,7 +263,7 @@ (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -273,9 +273,9 @@ (define_insn "*divsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") - (div:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") - (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") + (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ fdv%?s\\t%0, %1, %2 frd%?s\\t%0, %2, %1" @@ -285,9 +285,9 @@ (define_insn "*divdf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") - (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") + (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ dvf%?d\\t%0, %1, %2 rdf%?d\\t%0, %2, %1" @@ -299,8 +299,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (div:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -308,10 +308,10 @@ (define_insn "*divdf_df_esfdf_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "fG") + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "fG") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rdf%?d\\t%0, %2, %1" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -323,7 +323,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -332,8 +332,8 @@ (define_insn "*modsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (mod:SF (match_operand:SF 1 "s_register_operand" "f") - (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?s\\t%0, %1, %2" [(set_attr "type" "fdivs") (set_attr "predicable" "yes")] @@ -342,8 +342,8 @@ (define_insn "*moddf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (mod:DF (match_operand:DF 1 "s_register_operand" "f") - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -353,8 +353,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mod:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -365,7 +365,7 @@ (mod:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -377,7 +377,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -386,7 +386,7 @@ (define_insn "*negsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (neg:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -395,7 +395,7 @@ (define_insn "*negdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -405,7 +405,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -414,7 +414,7 @@ (define_insn "*abssf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (abs:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -423,7 +423,7 @@ (define_insn "*absdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -433,7 +433,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -442,7 +442,7 @@ (define_insn "*sqrtsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?s\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -451,7 +451,7 @@ (define_insn "*sqrtdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -461,7 +461,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -470,7 +470,7 @@ (define_insn "*floatsisf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (float:SF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?s\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -479,7 +479,7 @@ (define_insn "*floatsidf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float:DF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?d\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -488,7 +488,7 @@ (define_insn "*fix_truncsfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -497,7 +497,7 @@ (define_insn "*fix_truncdfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -507,7 +507,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -516,7 +516,7 @@ (define_insn "*extendsfdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -526,7 +526,7 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f, m,f,r,r,r, m") (match_operand:SF 1 "general_operand" "fG,H,mE,f,r,f,r,mE,r"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -542,7 +542,7 @@ [(set_attr "length" "4,4,4,4,8,8,4,4,4") (set_attr "predicable" "yes") (set_attr "type" - "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load,store1") + "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1") (set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*") (set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")] ) @@ -553,7 +553,7 @@ (match_operand:DF 1 "general_operand" "Q, r,r,r,mF,fG,H,mF,f,r, f"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -576,7 +576,7 @@ [(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8") (set_attr "predicable" "yes") (set_attr "type" - "load,store2,*,store2,load,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") + "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") (set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*") (set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")] ) @@ -589,7 +589,7 @@ (define_insn "*movxf_fpa" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,f,m,f,r,r") (match_operand:XF 1 "general_operand" "fG,H,m,f,r,f,r"))] - "TARGET_ARM && TARGET_HARD_FLOAT && reload_completed" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA && reload_completed" "* switch (which_alternative) { @@ -613,8 +613,8 @@ (define_insn "*cmpsf_fpa" [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "s_register_operand" "f,f") - (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -625,8 +625,8 @@ (define_insn "*cmpdf_fpa" [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "s_register_operand" "f,f") - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -638,8 +638,8 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -652,7 +652,7 @@ (compare:CCFP (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -661,8 +661,8 @@ (define_insn "*cmpsf_trap_fpa" [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:SF 0 "s_register_operand" "f,f") - (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -673,8 +673,8 @@ (define_insn "*cmpdf_trap_fpa" [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f,f") - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -686,8 +686,8 @@ [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -700,7 +700,7 @@ (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?e\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -711,9 +711,9 @@ (if_then_else:SF (match_operator 3 "arm_comparison_operator" [(match_operand 4 "cc_register" "") (const_int 0)]) - (match_operand:SF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") - (match_operand:SF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") + (match_operand:SF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3s\\t%0, %2 mnf%D3s\\t%0, #%N2 @@ -733,9 +733,9 @@ (if_then_else:DF (match_operator 3 "arm_comparison_operator" [(match_operand 4 "cc_register" "") (const_int 0)]) - (match_operand:DF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") - (match_operand:DF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") + (match_operand:DF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3d\\t%0, %2 mnf%D3d\\t%0, #%N2 diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md index f8070a88594..6c87500093e 100644 --- a/gcc/config/arm/iwmmxt.md +++ b/gcc/config/arm/iwmmxt.md @@ -86,7 +86,7 @@ } }" [(set_attr "length" "8,8,8,4,4,4,4,4") - (set_attr "type" "*,load,store2,*,*,*,*,*") + (set_attr "type" "*,load1,store2,*,*,*,*,*") (set_attr "pool_range" "*,1020,*,*,*,*,*,*") (set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")] ) @@ -110,7 +110,7 @@ case 7: return \"wstrw\\t%1, %0\"; default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\"; }" - [(set_attr "type" "*,*,load,store1,*,*,load,store1,*") + [(set_attr "type" "*,*,load1,store1,*,*,load1,store1,*") (set_attr "length" "*,*,*, *,*,*, 16, *,8") (set_attr "pool_range" "*,*,4096, *,*,*,1024, *,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*") @@ -148,7 +148,7 @@ case 4: return \"tmcr%?\\t%0, %1\"; default: return \"tmrc%?\\t%0, %1\"; }" - [(set_attr "type" "*,*,load,store1,*,*") + [(set_attr "type" "*,*,load1,store1,*,*") (set_attr "pool_range" "*,*,4096, *,*,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*")] ) @@ -169,7 +169,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -189,7 +189,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -209,7 +209,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 24") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -225,7 +225,7 @@ "* return output_move_double (operands);" [(set_attr "predicable" "yes") (set_attr "length" "8") - (set_attr "type" "load") + (set_attr "type" "load1") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")]) @@ -1149,7 +1149,7 @@ "wsrawg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "ashrdi3" +(define_insn "ashrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (ashiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] @@ -1173,7 +1173,7 @@ "wsrlwg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "lshrdi3" +(define_insn "lshrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (lshiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm index fe14070e812..ce8551abc27 100644 --- a/gcc/config/arm/lib1funcs.asm +++ b/gcc/config/arm/lib1funcs.asm @@ -230,6 +230,25 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_DIV_BODY dividend, divisor, result, curbit +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \curbit, \dividend + clz \result, \divisor + sub \curbit, \result, \curbit + rsbs \curbit, \curbit, #31 + addne \curbit, \curbit, \curbit, lsl #1 + mov \result, #0 + addne pc, pc, \curbit, lsl #2 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + adc \result, \result, \result + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \curbit, \divisor @@ -240,7 +259,7 @@ pc .req r15 mov \curbit, \curbit, lsl \result mov \result, #0 -#else +#else /* __ARM_ARCH__ < 5 */ @ Initially shift the divisor left 3 bits if possible, @ set curbit accordingly. This allows for curbit to be located @@ -271,7 +290,7 @@ pc .req r15 mov \result, #0 -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Division loop 1: cmp \dividend, \divisor @@ -291,6 +310,8 @@ pc .req r15 movne \divisor, \divisor, lsr #4 bne 1b +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro ARM_DIV2_ORDER divisor, order @@ -325,6 +346,22 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_MOD_BODY dividend, divisor, order, spare +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \order, \divisor + clz \spare, \dividend + sub \order, \order, \spare + rsbs \order, \order, #31 + addne pc, pc, \order, lsl #3 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \order, \divisor @@ -332,7 +369,7 @@ pc .req r15 sub \order, \order, \spare mov \divisor, \divisor, lsl \order -#else +#else /* __ARM_ARCH__ < 5 */ mov \order, #0 @@ -354,7 +391,7 @@ pc .req r15 addlo \order, \order, #1 blo 1b -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Perform all needed substractions to keep only the reminder. @ Do comparisons in batch of 4 first. @@ -391,6 +428,9 @@ pc .req r15 4: cmp \dividend, \divisor subhs \dividend, \dividend, \divisor 5: + +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro THUMB_DIV_MOD_BODY modulo diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index f55a42562cb..a77678648d6 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -47,17 +47,18 @@ #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" /* Now we define the strings used to build the spec file. */ +#undef LIB_SPEC #define LIB_SPEC \ "%{pthread:-lpthread} \ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" +#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add the GNU/Linux magical crtbegin.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static - object constructed before entering `main'. */ + object constructed before entering `main'. */ #undef STARTFILE_SPEC #define STARTFILE_SPEC \ @@ -89,14 +90,7 @@ %{mbig-endian:-EB}" \ SUBTARGET_EXTRA_LINK_SPEC -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=posix"); \ - } while (0) +#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() /* This is how we tell the assembler that two symbols have the same value. */ #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h index a8b43f645d3..d1661ec5fe3 100644 --- a/gcc/config/arm/netbsd-elf.h +++ b/gcc/config/arm/netbsd-elf.h @@ -57,14 +57,11 @@ #define SUBTARGET_EXTRA_ASM_SPEC \ "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}" -/* Default floating point model is soft-VFP. - FIXME: -mhard-float currently implies FPA. */ +/* Default to full VFP if -mhard-float is specified. */ #undef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC \ - "%{mhard-float:-mfpu=fpa} \ - %{msoft-float:-mfpu=softvfp} \ - %{!mhard-float: \ - %{!msoft-float:-mfpu=softvfp}}" + "%{mhard-float:{!mfpu=*:-mfpu=vfp}} \ + %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -171,3 +168,7 @@ do \ (void) sysarch (0, &s); \ } \ while (0) + +#undef FPUTYPE_DEFAULT +#define FPUTYPE_DEFAULT FPUTYPE_VFP + diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h index bd0b6606247..7fba10b1d06 100644 --- a/gcc/config/arm/pe.h +++ b/gcc/config/arm/pe.h @@ -187,7 +187,7 @@ #define DRECTVE_SECTION_FUNCTION \ void \ -drectve_section () \ +drectve_section (void) \ { \ if (in_section != in_drectve) \ { \ @@ -203,11 +203,8 @@ drectve_section () \ ASM_DECLARE_OBJECT_NAME and then switch back to the original section afterwards. */ #define SWITCH_TO_SECTION_FUNCTION \ -static void switch_to_section PARAMS ((enum in_section, tree)); \ static void \ -switch_to_section (section, decl) \ - enum in_section section; \ - tree decl; \ +switch_to_section (enum in_section section, tree decl) \ { \ switch (section) \ { \ @@ -221,3 +218,4 @@ switch_to_section (section, decl) \ default: abort (); break; \ } \ } + diff --git a/gcc/config/arm/semi.h b/gcc/config/arm/semi.h index 8847f8c2369..0c9dadc208f 100644 --- a/gcc/config/arm/semi.h +++ b/gcc/config/arm/semi.h @@ -64,7 +64,8 @@ %{mcpu=*:-mcpu=%*} \ %{march=*:-march=%*} \ %{mapcs-float:-mfloat} \ -%{msoft-float:-mfpu=softfpa} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %{mthumb-interwork:-mthumb-interwork} \ %(subtarget_extra_asm_spec)" #endif diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md new file mode 100644 index 00000000000..a4b6bfb334d --- /dev/null +++ b/gcc/config/arm/vfp.md @@ -0,0 +1,744 @@ +;; ARM VFP coprocessor Machine Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; 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 2, 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 COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; Additional register numbers +(define_constants + [(VFPCC_REGNUM 95)] +) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipeline description +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_automaton "vfp11") + +;; There are 3 pipelines in the VFP11 unit. +;; +;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from +;; fourth stage for simple operations. +;; +;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns. +;; These insns also uses first execute stage of FMAC pipeline. +;; +;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from +;; second memory stage for loads. + +;; We do not model Write-After-Read hazards. +;; We do not do write scheduling with the arm core, so it is only neccessary +;; to model the first stage of each pieline +;; ??? Need to model LS pipeline properly for load/store multiple? +;; We do not model fmstat properly. This could be done by modeiling pipelines +;; properly and defining an absence set between a dummy fmstat unit and all +;; other vfp units. + +(define_cpu_unit "fmac" "vfp11") + +(define_cpu_unit "ds" "vfp11") + +(define_cpu_unit "vfp_ls" "vfp11") + +;; The VFP "type" attributes differ from those used in the FPA model. +;; ffarith Fast floating point insns, eg. abs, neg, cpy, cmp. +;; farith Most arithmetic insns. +;; fmul Double preision multiply. +;; fdivs Single precision sqrt or division. +;; fdivd Double precision sqrt or division. +;; f_load Floating point load from memory. +;; f_store Floating point store to memory. +;; f_2_r Transfer vfp to arm reg. +;; r_2_f Transfer arm to vfp reg. + +(define_insn_reservation "vfp_ffarith" 4 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "ffarith")) + "fmac") + +(define_insn_reservation "vfp_farith" 8 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "farith")) + "fmac") + +(define_insn_reservation "vfp_fmul" 9 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "fmul")) + "fmac*2") + +(define_insn_reservation "vfp_fdivs" 19 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "fdivs")) + "ds*15") + +(define_insn_reservation "vfp_fdivd" 33 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "fdivd")) + "fmac+ds*29") + +;; Moves to/from arm regs also use the load/store pipeline. +(define_insn_reservation "vfp_fload" 4 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "f_load,r_2_f")) + "vfp_ls") + +(define_insn_reservation "vfp_fstore" 4 + (and (eq_attr "fpu" "vfp") + (eq_attr "type" "f_load,f_2_r")) + "vfp_ls") + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Insn pattersn +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; SImode moves +;; ??? For now do not allow loading constants into vfp regs. This causes +;; problems because small sonstants get converted into adds. +(define_insn "*arm_movsi_vfp" + [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r ,m,!w,r,!w,!w, U") + (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,!w,!w,Ui,!w"))] + "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT + && ( s_register_operand (operands[0], SImode) + || s_register_operand (operands[1], SImode))" + "@ + mov%?\\t%0, %1 + mvn%?\\t%0, #%B1 + ldr%?\\t%0, %1 + str%?\\t%1, %0 + fmsr%?\\t%0, %1\\t%@ int + fmrs%?\\t%0, %1\\t%@ int + fcpys%?\\t%0, %1\\t%@ int + flds%?\\t%0, %1\\t%@ int + fsts%?\\t%1, %0\\t%@ int" + [(set_attr "predicable" "yes") + (set_attr "type" "*,*,load1,store1,r_2_f,f_2_r,ffarith,f_load,f_store") + (set_attr "pool_range" "*,*,4096,*,*,*,*,1020,*") + (set_attr "neg_pool_range" "*,*,4084,*,*,*,*,1008,*")] +) + + +;; DImode moves + +(define_insn "*arm_movdi_vfp" + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,o<>,w,r,w,w ,U") + (match_operand:DI 1 "di_operand" "rIK,mi,r ,r,w,w,Ui,w"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "* + switch (which_alternative) + { + case 0: case 1: case 2: + return (output_move_double (operands)); + case 3: + return \"fmdrr%?\\t%P0, %1\\t%@ int\"; + case 4: + return \"fmrrd%?\\t%0, %1\\t%@ int\"; + case 5: + return \"fcpyd%?\\t%P0, %P1\\t%@ int\"; + case 6: + return \"fldd%?\\t%P0, %1\\t%@ int\"; + case 7: + return \"fstd%?\\t%P1, %0\\t%@ int\"; + default: + abort (); + } + " + [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_load,f_store") + (set_attr "length" "8,8,8,4,4,4,4,4") + (set_attr "pool_range" "*,1020,*,*,*,*,1020,*") + (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")] +) + + +;; SFmode moves + +(define_insn "*movsf_vfp" + [(set (match_operand:SF 0 "nonimmediate_operand" "=w,r,w ,U,r ,m,w,r") + (match_operand:SF 1 "general_operand" " r,w,UE,w,mE,r,w,r"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP + && ( s_register_operand (operands[0], SFmode) + || s_register_operand (operands[1], SFmode))" + "@ + fmsr%?\\t%0, %1 + fmrs%?\\t%0, %1 + flds%?\\t%0, %1 + fsts%?\\t%1, %0 + ldr%?\\t%0, %1\\t%@ float + str%?\\t%1, %0\\t%@ float + fcpys%?\\t%0, %1 + mov%?\\t%0, %1\\t%@ float" + [(set_attr "predicable" "yes") + (set_attr "type" "r_2_f,f_2_r,ffarith,*,f_load,f_store,load1,store1") + (set_attr "pool_range" "*,*,1020,*,4096,*,*,*") + (set_attr "neg_pool_range" "*,*,1008,*,4080,*,*,*")] +) + + +;; DFmode moves + +(define_insn "*movdf_vfp" + [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,r,r, m,w ,U,w,r") + (match_operand:DF 1 "soft_df_operand" " r,w,mF,r,UF,w,w,r"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "* + { + switch (which_alternative) + { + case 0: + return \"fmdrr%?\\t%P0, %Q1, %R1\"; + case 1: + return \"fmrrd%?\\t%Q0, %R0, %P1\"; + case 2: case 3: case 7: + return output_move_double (operands); + case 4: + return \"fldd%?\\t%P0, %1\"; + case 5: + return \"fstd%?\\t%P1, %0\"; + case 6: + return \"fcpyd%?\\t%P0, %P1\"; + default: + abort (); + } + } + " + [(set_attr "type" "r_2_f,f_2_r,ffarith,*,load2,store2,f_load,f_store") + (set_attr "length" "4,4,8,8,4,4,4,8") + (set_attr "pool_range" "*,*,1020,*,1020,*,*,*") + (set_attr "neg_pool_range" "*,*,1008,*,1008,*,*,*")] +) + + +;; Conditional move patterns + +(define_insn "*movsfcc_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r") + (if_then_else:SF + (match_operator 3 "arm_comparison_operator" + [(match_operand 4 "cc_register" "") (const_int 0)]) + (match_operand:SF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w") + (match_operand:SF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcpys%D3\\t%0, %2 + fcpys%d3\\t%0, %1 + fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1 + fmsr%D3\\t%0, %2 + fmsr%d3\\t%0, %1 + fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1 + fmrs%D3\\t%0, %2 + fmrs%d3\\t%0, %1 + fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1" + [(set_attr "conds" "use") + (set_attr "length" "4,4,8,4,4,8,4,4,8") + (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")] +) + +(define_insn "*movdfcc_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r") + (if_then_else:DF + (match_operator 3 "arm_comparison_operator" + [(match_operand 4 "cc_register" "") (const_int 0)]) + (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w") + (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcpyd%D3\\t%P0, %P2 + fcpyd%d3\\t%P0, %P1 + fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1 + fmdrr%D3\\t%P0, %Q2, %R2 + fmdrr%d3\\t%P0, %Q1, %R1 + fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1 + fmrrd%D3\\t%Q0, %R0, %P2 + fmrrd%d3\\t%Q0, %R0, %P1 + fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1" + [(set_attr "conds" "use") + (set_attr "length" "4,4,8,4,4,8,4,4,8") + (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")] +) + + +;; Sign manipulation functions + +(define_insn "*abssf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (abs:SF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fabss%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*absdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (abs:DF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fabsd%?\\t%P0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*negsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (neg:SF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnegs%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*negdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (neg:DF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnegd%?\\t%P0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + + +;; Arithmetic insns + +(define_insn "*addsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (plus:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fadds%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*adddf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (plus:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "faddd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + + +(define_insn "*subsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsubs%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*subdf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsubd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + + +;; Division insns + +(define_insn "*divsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (div:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fdivs%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivs")] +) + +(define_insn "*divdf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (div:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fdivd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivd")] +) + + +;; Multiplication insns + +(define_insn "*mulsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (mult:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmuls%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (mult:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmuld%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +(define_insn "*mulsf3negsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "w")) + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmuls%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3negdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w")) + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmuld%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; Multiply-accumulate insns + +;; 0 = 1 * 2 + 0 +(define_insn "*mulsf3addsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmacs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3adddf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmacd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + +;; 0 = 1 * 2 - 0 +(define_insn "*mulsf3subsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmscs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3subdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmscd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + +;; 0 = -(1 * 2) + 0 +(define_insn "*mulsf3negsfaddsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (match_operand:SF 1 "s_register_operand" "0") + (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmacs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*fmuldf3negdfadddf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (match_operand:DF 1 "s_register_operand" "0") + (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmacd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; 0 = -(1 * 2) - 0 +(define_insn "*mulsf3negsfsubsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (mult:SF + (neg:SF (match_operand:SF 2 "s_register_operand" "w")) + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmscs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3negdfsubdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (mult:DF + (neg:DF (match_operand:DF 2 "s_register_operand" "w")) + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmscd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; Conversion routines + +(define_insn "*extendsfdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (float_extend:DF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fcvtds%?\\t%P0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*truncdfsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (float_truncate:SF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fcvtsd%?\\t%0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*truncsisf2_vfp" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftosizs%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*truncsidf2_vfp" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftosizd%?\\t%0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*floatsisf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (float:SF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsitos%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*floatsidf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (float:DF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsitod%?\\t%P0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + + +;; Sqrt insns. + +(define_insn "*sqrtsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (sqrt:SF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsqrts%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivs")] +) + +(define_insn "*sqrtdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (sqrt:DF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsqrtd%?\\t%P0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivd")] +) + + +;; Patterns to split/copy vfp condition flags. + +(define_insn "*movcc_vfp" + [(set (reg CC_REGNUM) + (reg VFPCC_REGNUM))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmstat%?" + [(set_attr "conds" "set") + (set_attr "type" "ffarith")] +) + +(define_insn_and_split "*cmpsf_split_vfp" + [(set (reg:CCFP CC_REGNUM) + (compare:CCFP (match_operand:SF 0 "s_register_operand" "w") + (match_operand:SF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_dup 0) + (match_dup 1))) + (set (reg:CCFP CC_REGNUM) + (reg:CCFP VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpsf_trap_split_vfp" + [(set (reg:CCFPE CC_REGNUM) + (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w") + (match_operand:SF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_dup 0) + (match_dup 1))) + (set (reg:CCFPE CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpdf_split_vfp" + [(set (reg:CCFP CC_REGNUM) + (compare:CCFP (match_operand:DF 0 "s_register_operand" "w") + (match_operand:DF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_dup 0) + (match_dup 1))) + (set (reg:CCFP CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpdf_trap_split_vfp" + [(set (reg:CCFPE CC_REGNUM) + (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w") + (match_operand:DF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_dup 0) + (match_dup 1))) + (set (reg:CCFPE CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + + +;; Comparison patterns + +(define_insn "*cmpsf_vfp" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_operand:SF 0 "s_register_operand" "w,w") + (match_operand:SF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmps%?\\t%0, %1 + fcmpzs%?\\t%0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpsf_trap_vfp" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w,w") + (match_operand:SF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmpes%?\\t%0, %1 + fcmpezs%?\\t%0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpdf_vfp" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_operand:DF 0 "s_register_operand" "w,w") + (match_operand:DF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmpd%?\\t%P0, %P1 + fcmpzd%?\\t%P0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpdf_trap_vfp" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w,w") + (match_operand:DF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmped%?\\t%P0, %P1 + fcmpezd%?\\t%P0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + + +;; Store multiple insn used in function prologue. + +(define_insn "*push_multi_vfp" + [(match_parallel 2 "multi_register_push" + [(set (match_operand:BLK 0 "memory_operand" "=m") + (unspec:BLK [(match_operand:DF 1 "s_register_operand" "w")] + UNSPEC_PUSH_MULT))])] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "* return vfp_output_fstmx (operands);" + [(set_attr "type" "f_store")] +) + + +;; Unimplemented insns: +;; fldm* +;; fstm* +;; fmdhr et al (VFPv1) +;; Support for xD (single precisio only) variants. +;; fmrrs, fmsrr +;; fuito* +;; ftoui* diff --git a/gcc/config/arm/vxworks.h b/gcc/config/arm/vxworks.h index a5a6a09f6e8..afe6b7043be 100644 --- a/gcc/config/arm/vxworks.h +++ b/gcc/config/arm/vxworks.h @@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA. */ #define LIB_SPEC "" /* VxWorks uses object files, not loadable images. make linker just - combine objects. */ + combine objects. */ #undef LINK_SPEC #define LINK_SPEC "-r" diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index a7a71871552..216ec863ba8 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -39,6 +39,7 @@ #include "obstack.h" #include "function.h" #include "recog.h" +#include "ggc.h" #include "tm_p.h" #include "target.h" #include "target-def.h" @@ -77,18 +78,14 @@ static int default_rtx_costs (rtx, enum rtx_code, enum rtx_code); static bool avr_rtx_costs (rtx, int, int, int *); static int avr_address_cost (rtx); -/* Allocate registers from r25 to r8 for parameters for function calls */ +/* Allocate registers from r25 to r8 for parameters for function calls. */ #define FIRST_CUM_REG 26 /* Temporary register RTX (gen_rtx (REG,QImode,TMP_REGNO)) */ -rtx tmp_reg_rtx; +static GTY(()) rtx tmp_reg_rtx; /* Zeroed register RTX (gen_rtx (REG,QImode,ZERO_REGNO)) */ -rtx zero_reg_rtx; - -/* RTX for register which will be used for loading immediate values to - r0-r15 registers. */ -rtx ldi_reg_rtx; +static GTY(()) rtx zero_reg_rtx; /* AVR register names {"r0", "r1", ..., "r31"} */ static const char *const avr_regnames[] = REGISTER_NAMES; @@ -274,31 +271,12 @@ avr_override_options (void) if (optimize && !TARGET_NO_TABLEJUMP) avr_case_values_threshold = (!AVR_MEGA || TARGET_CALL_PROLOGUES) ? 8 : 17; -} -#if 0 /* Does not play nice with GC. FIXME. */ -/* Initialize TMP_REG_RTX and ZERO_REG_RTX */ -void -avr_init_once (void) -{ - tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion)); - PUT_CODE (tmp_reg_rtx, REG); - PUT_MODE (tmp_reg_rtx, QImode); - XINT (tmp_reg_rtx, 0) = TMP_REGNO; - - zero_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion)); - PUT_CODE (zero_reg_rtx, REG); - PUT_MODE (zero_reg_rtx, QImode); - XINT (zero_reg_rtx, 0) = ZERO_REGNO; - - ldi_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion)); - PUT_CODE (ldi_reg_rtx, REG); - PUT_MODE (ldi_reg_rtx, QImode); - XINT (ldi_reg_rtx, 0) = LDI_REG_REGNO; + tmp_reg_rtx = gen_rtx_REG (QImode, TMP_REGNO); + zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO); } -#endif -/* return register class from register number */ +/* return register class from register number. */ static const int reg_class_tab[]={ GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS, @@ -314,7 +292,7 @@ static const int reg_class_tab[]={ STACK_REG,STACK_REG /* SPL,SPH */ }; -/* Return register class for register R */ +/* Return register class for register R. */ enum reg_class avr_regno_reg_class (int r) @@ -437,7 +415,7 @@ avr_regs_to_save (HARD_REG_SET *set) return count; } -/* Compute offset between arg_pointer and frame_pointer */ +/* Compute offset between arg_pointer and frame_pointer. */ int initial_elimination_offset (int from, int to) @@ -468,7 +446,7 @@ avr_simple_epilogue (void) && ! TREE_THIS_VOLATILE (current_function_decl)); } -/* This function checks sequence of live registers */ +/* This function checks sequence of live registers. */ static int sequent_regs_live (void) @@ -625,7 +603,7 @@ out_set_stack_ptr (FILE *file, int before, int after) } -/* Output function prologue */ +/* Output function prologue. */ static void avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) @@ -755,7 +733,7 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) fprintf (file, "/* prologue end (size=%d) */\n", prologue_size); } -/* Output function epilogue */ +/* Output function epilogue. */ static void avr_output_function_epilogue (FILE *file, HOST_WIDE_INT size) @@ -1002,7 +980,7 @@ legitimize_address (rtx x, rtx oldx, enum machine_mode mode) } -/* Return a pointer register name as a string */ +/* Return a pointer register name as a string. */ static const char * ptrreg_to_str (int regno) @@ -1049,7 +1027,7 @@ cond_string (enum rtx_code code) } } -/* Output ADDR to FILE as address */ +/* Output ADDR to FILE as address. */ void print_operand_address (FILE *file, rtx addr) @@ -1083,7 +1061,7 @@ print_operand_address (FILE *file, rtx addr) } -/* Output X as assembler operand to file FILE */ +/* Output X as assembler operand to file FILE. */ void print_operand (FILE *file, rtx x, int code) @@ -1154,7 +1132,7 @@ print_operand (FILE *file, rtx x, int code) print_operand_address (file, x); } -/* Recognize operand OP of mode MODE used in call instructions */ +/* Recognize operand OP of mode MODE used in call instructions. */ int call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) @@ -1476,7 +1454,7 @@ avr_num_arg_regs (enum machine_mode mode, tree type) } /* Controls whether a function argument is passed - in a register, and which register. */ + in a register, and which register. */ rtx function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, @@ -2614,7 +2592,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) return ""; } -/* Return 1 if frame pointer for current function required */ +/* Return 1 if frame pointer for current function required. */ int frame_pointer_required_p (void) @@ -2670,7 +2648,7 @@ compare_eq_p (rtx insn) } -/* Output test instruction for HImode */ +/* Output test instruction for HImode. */ const char * out_tsthi (rtx insn, int *l) @@ -2683,7 +2661,7 @@ out_tsthi (rtx insn, int *l) if (reg_unused_after (insn, SET_SRC (PATTERN (insn))) && compare_eq_p (insn)) { - /* faster than sbiw if we can clobber the operand */ + /* Faster than sbiw if we can clobber the operand. */ if (l) *l = 1; return AS2 (or,%A0,%B0); } @@ -2698,7 +2676,7 @@ out_tsthi (rtx insn, int *l) } -/* Output test instruction for SImode */ +/* Output test instruction for SImode. */ const char * out_tstsi (rtx insn, int *l) @@ -4237,7 +4215,7 @@ adjust_insn_length (rtx insn, int len) return len; } -/* Return nonzero if register REG dead after INSN */ +/* Return nonzero if register REG dead after INSN. */ int reg_unused_after (rtx insn, rtx reg) @@ -4368,7 +4346,7 @@ avr_assemble_integer (rtx x, unsigned int size, int aligned_p) return default_assemble_integer (x, size, aligned_p); } -/* Sets section name for declaration DECL */ +/* Sets section name for declaration DECL. */ static void avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) @@ -4405,7 +4383,7 @@ avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) generated assembly code more compact (and thus faster to assemble) as well as more readable, especially for targets like the i386 (where the only alternative is to output character sequences as - comma separated lists of numbers). */ + comma separated lists of numbers). */ void gas_output_limited_string(FILE *file, const char *str) @@ -4860,7 +4838,7 @@ avr_rtx_costs (rtx x, int code, int outer_code, int *total) } } -/* Calculate the cost of a memory address */ +/* Calculate the cost of a memory address. */ static int avr_address_cost (rtx x) @@ -4925,7 +4903,7 @@ extra_constraint (rtx x, int c) return 0; } -/* Convert condition code CONDITION to the valid AVR condition code */ +/* Convert condition code CONDITION to the valid AVR condition code. */ RTX_CODE avr_normalize_condition (RTX_CODE condition) @@ -4970,7 +4948,7 @@ avr_reorg (void) { if (GET_CODE (SET_SRC (pattern)) == COMPARE) { - /* Now we work under compare insn */ + /* Now we work under compare insn. */ pattern = SET_SRC (pattern); if (true_regnum (XEXP (pattern,0)) >= 0 @@ -5389,3 +5367,4 @@ avr_asm_out_dtor (rtx symbol, int priority) default_dtor_section_asm_out_destructor (symbol, priority); } +#include "gt-avr.h" diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 735e75d3b63..0d5cd7c145c 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -20,7 +20,7 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Names to predefine in the preprocessor for this target machine. */ +/* Names to predefine in the preprocessor for this target machine. */ #define TARGET_CPU_CPP_BUILTINS() \ do \ @@ -41,7 +41,7 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* This declaration should be present. */ +/* This declaration should be present. */ extern int target_flags; #define MASK_ALL_DEBUG 0x00000FE0 @@ -130,10 +130,10 @@ extern int avr_asm_only_p; frame pointer. If this macro is defined, GCC will turn on the `-fomit-frame-pointer' option whenever `-O' is specified. */ -/* Define this if most significant byte of a word is the lowest numbered. */ +/* Define this if most significant byte of a word is the lowest numbered. */ #define BITS_BIG_ENDIAN 0 -/* Define this if most significant byte of a word is the lowest numbered. */ +/* Define this if most significant byte of a word is the lowest numbered. */ #define BYTES_BIG_ENDIAN 0 /* Define this if most significant word of a multiword number is the lowest @@ -144,7 +144,7 @@ extern int avr_asm_only_p; /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */ #define UNITS_PER_WORD 4 #else -/* Width of a word, in units (bytes). */ +/* Width of a word, in units (bytes). */ #define UNITS_PER_WORD 1 #endif @@ -157,16 +157,16 @@ extern int avr_asm_only_p; DImode or Dfmode ... */ #define MAX_FIXED_MODE_SIZE 32 -/* Allocation boundary (in *bits*) for storing arguments in argument list. */ +/* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY 8 -/* Allocation boundary (in *bits*) for the code of a function. */ +/* Allocation boundary (in *bits*) for the code of a function. */ #define FUNCTION_BOUNDARY 8 -/* Alignment of field after `int : 0' in a structure. */ +/* Alignment of field after `int : 0' in a structure. */ #define EMPTY_FIELD_BOUNDARY 8 -/* No data type wants to be aligned rounder than this. */ +/* No data type wants to be aligned rounder than this. */ #define BIGGEST_ALIGNMENT 8 @@ -211,7 +211,7 @@ extern int avr_asm_only_p; #define DOUBLE_TYPE_SIZE 32 /* A C expression for the size in bits of the type `double' on the target machine. If you don't define this, the default is two - words. */ + words. */ #define LONG_DOUBLE_TYPE_SIZE 32 @@ -366,7 +366,7 @@ extern int avr_asm_only_p; registers must always be saved and the save-multiple-registers instruction supports only sequences of consecutive registers. On such machines, define `REG_ALLOC_ORDER' to be an initializer that - lists the highest numbered allocatable register first. */ + lists the highest numbered allocatable register first. */ #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc () /* ORDER_REGS_FOR_LOCAL_ALLOC' @@ -1147,7 +1147,7 @@ typedef struct avr_args { contains the name of the function, as a string. LIBNAME is 0 when an ordinary C function call is being processed. Thus, each time this macro is called, either LIBNAME or FNTYPE is nonzero, but - never both of them at once. */ + never both of them at once. */ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ (function_arg_advance (&CUM, MODE, TYPE, NAMED)) @@ -1160,7 +1160,7 @@ typedef struct avr_args { This macro need not do anything if the argument in question was passed on the stack. The compiler knows how to track the amount - of stack space used for arguments without any special help. */ + of stack space used for arguments without any special help. */ #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r) /* A C expression that is nonzero if REGNO is the number of a hard @@ -1644,7 +1644,7 @@ do { \ #define EXTRA_SECTION_FUNCTIONS \ \ void \ -progmem_section () \ +progmem_section (void) \ { \ if (in_section != in_progmem) \ { \ @@ -2482,11 +2482,4 @@ extern int avr_case_values_threshold; /* zero register r1 */ #define ZERO_REGNO 1 -/* Temporary register which used for load immediate values to r0-r15 */ -#define LDI_REG_REGNO 31 - -extern struct rtx_def *tmp_reg_rtx; -extern struct rtx_def *zero_reg_rtx; -extern struct rtx_def *ldi_reg_rtx; - #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index ab7b0ed4783..e253e38a717 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -178,7 +178,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "general_operand" ""))] "" - "/* One of the ops has to be in a register */ + "/* One of the ops has to be in a register. */ if (!register_operand(operand0, QImode) && ! (register_operand(operand1, QImode) || const0_rtx == operand1)) operands[1] = copy_to_mode_reg(QImode, operand1); @@ -226,7 +226,7 @@ "" " { - /* One of the ops has to be in a register */ + /* One of the ops has to be in a register. */ if (!register_operand(operand0, HImode) && !(register_operand(operand1, HImode) || const0_rtx == operands[1])) { diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 7fb5a337b41..9eaa87194d2 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1088,7 +1088,7 @@ c4x_expand_epilogue(void) dont_pop_ar3 = 0; /* If we use ar3, we need to pop it. */ if (size || current_function_args_size) { - /* If we are ommitting the frame pointer, we still have + /* If we are omitting the frame pointer, we still have to make space for it so the offsets are correct unless we don't use anything on the stack at all. */ size += 1; diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md index 5755177454a..e4f240fea4f 100644 --- a/gcc/config/c4x/c4x.md +++ b/gcc/config/c4x/c4x.md @@ -157,7 +157,7 @@ ; a register satisying the 'f' constraint is used as a dst operand, ; the CC gets clobbered (except for LDFcond). -; The ! in front of the 'b' constaint says to GCC to disparage the +; The ! in front of the 'b' constraint says to GCC to disparage the ; use of this constraint. The 'b' constraint applies only to the SP. ; Note that we deal with the condition code CC like some of the RISC @@ -173,7 +173,7 @@ ; delayed branch slots. ; Since the C[34]x has many instructions that set the CC, we pay the -; price of having to explicity define which insns clobber the CC +; price of having to explicitly define which insns clobber the CC ; (rather than using the macro NOTICE_UPDATE_CC). ; Note that many patterns say that the CC is clobbered when in fact @@ -6265,7 +6265,7 @@ ; ; MULF ; -; The C3x MPYF only uses 24 bit precision while the C4x uses 32 bit precison. +; The C3x MPYF only uses 24-bit precision while the C4x uses 32-bit precision. ; (define_expand "mulhf3" [(parallel [(set (match_operand:HF 0 "reg_operand" "=h") @@ -7320,7 +7320,7 @@ "stf\\t%1,*%0++\\n\\tstf\\t%2,*%0++") -; The following two peepholes remove an unecessary load +; The following two peepholes remove an unnecessary load ; often found at the end of a function. These peepholes ; could be generalized to other binary operators. They shouldn't ; be required if we run a post reload mop-up pass. diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 288be199713..69483fae1fd 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -251,13 +251,15 @@ extern const char *cris_elinux_stacksize_str; builtin_define_std ("CRIS"); \ builtin_define_std ("GNU_CRIS"); \ builtin_define ("__CRIS_ABI_version=2"); \ + builtin_assert ("cpu=cris"); \ + builtin_assert ("machine=cris"); \ } \ while (0) /* This needs to be at least 32 bits. */ extern int target_flags; -/* Currently this just affects aligment. FIXME: Redundant with +/* Currently this just affects alignment. FIXME: Redundant with TARGET_ALIGN_BY_32, or put machine stuff here? */ #define TARGET_MASK_SVINTO 1 #define TARGET_SVINTO (target_flags & TARGET_MASK_SVINTO) @@ -848,7 +850,7 @@ enum reg_class {NO_REGS, ALL_REGS, LIM_REG_CLASSES}; /* If we would ever need an exact mapping between canonical register number and dwarf frame register, we would either need to include all - registers in the gcc decription (with some marked fixed of course), or + registers in the gcc description (with some marked fixed of course), or an inverse mapping from dwarf register to gcc register. There is one need in dwarf2out.c:expand_builtin_init_dwarf_reg_sizes. Right now, I don't see that we need exact correspondence between DWARF *frame* diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index ea347fd74fa..8fb07039f04 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -31,7 +31,7 @@ ;; There are several instructions that are orthogonal in size, and seems ;; they could be matched by a single pattern without a specified size ;; for the operand that is orthogonal. However, this did not work on -;; gcc-2.7.2 (and problably not on gcc-2.8.1), relating to that when a +;; gcc-2.7.2 (and probably not on gcc-2.8.1), relating to that when a ;; constant is substituted into an operand, the actual mode must be ;; deduced from the pattern. There is reasonable hope that that has been ;; fixed, so FIXME: try again. @@ -77,7 +77,7 @@ ;; The possible values are "yes", "no" and "has_slot". Yes/no means if ;; the insn is slottable or not. Has_slot means that the insn is a ;; return insn or branch insn (which are not considered slottable since -;; that is generally true). Having the semmingly illogical value +;; that is generally true). Having the seemingly illogical value ;; "has_slot" means we do not have to add another attribute just to say ;; that an insn has a delay-slot, since it also infers that it is not ;; slottable. Better names for the attribute were found to be longer and @@ -1354,7 +1354,7 @@ "movs.b %1,%0" [(set_attr "slottable" "yes,yes,no")]) -;; To do a byte->word exension, extend to dword, exept that the top half +;; To do a byte->word extension, extend to dword, exept that the top half ;; of the register will be clobbered. FIXME: Perhaps this is not needed. (define_insn "extendqihi2" diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h index 288c2856ee6..f842f949d64 100644 --- a/gcc/config/cris/linux.h +++ b/gcc/config/cris/linux.h @@ -48,9 +48,7 @@ Boston, MA 02111-1307, USA. */ #undef CRIS_CPP_SUBTARGET_SPEC #define CRIS_CPP_SUBTARGET_SPEC \ "%{pthread:-D_REENTRANT}\ - %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}\ - %{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix}\ - -Asystem(unix) -Asystem(posix) -Acpu(cris) -Amachine(cris)}}" + %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}" #undef CRIS_CC1_SUBTARGET_SPEC #define CRIS_CC1_SUBTARGET_SPEC \ @@ -103,9 +101,7 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__gnu_linux__"); \ - builtin_define ("__linux__"); \ - builtin_define ("__unix__"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/d30v/d30v-protos.h b/gcc/config/d30v/d30v-protos.h index 7ce90afbfbb..1f93f3b38b8 100644 --- a/gcc/config/d30v/d30v-protos.h +++ b/gcc/config/d30v/d30v-protos.h @@ -21,119 +21,112 @@ Boston, MA 02111-1307, USA. */ /* External functions called. */ -extern void override_options PARAMS ((void)); +extern void override_options (void); #ifdef RTX_CODE -extern int short_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int long_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int d30v_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int single_reg_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int const_addr_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int call_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_operand PARAMS ((rtx, enum machine_mode)); -extern int accum_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_accum_operand PARAMS ((rtx, enum machine_mode)); -extern int cr_operand PARAMS ((rtx, enum machine_mode)); -extern int repeat_operand PARAMS ((rtx, enum machine_mode)); -extern int flag_operand PARAMS ((rtx, enum machine_mode)); -extern int br_flag_operand PARAMS ((rtx, enum machine_mode)); -extern int br_flag_or_constant_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_br_flag_operand PARAMS ((rtx, enum machine_mode)); -extern int f0_operand PARAMS ((rtx, enum machine_mode)); -extern int f1_operand PARAMS ((rtx, enum machine_mode)); -extern int carry_operand PARAMS ((rtx, enum machine_mode)); -extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_signed6_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_unsigned5_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_unsigned6_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_constant_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_dbl_const_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int move_input_operand PARAMS ((rtx, enum machine_mode)); -extern int move_output_operand PARAMS ((rtx, enum machine_mode)); -extern int signed6_operand PARAMS ((rtx, enum machine_mode)); -extern int unsigned5_operand PARAMS ((rtx, enum machine_mode)); -extern int unsigned6_operand PARAMS ((rtx, enum machine_mode)); -extern int bitset_operand PARAMS ((rtx, enum machine_mode)); -extern int condexec_test_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_branch_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_unary_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_addsub_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_binary_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_shiftl_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_extend_operator PARAMS ((rtx, enum machine_mode)); -extern int branch_zero_operator PARAMS ((rtx, enum machine_mode)); -extern int cond_move_dest_operand PARAMS ((rtx, enum machine_mode)); -extern int cond_move_operand PARAMS ((rtx, enum machine_mode)); -extern int cond_exec_operand PARAMS ((rtx, enum machine_mode)); -extern int srelational_si_operator PARAMS ((rtx, enum machine_mode)); -extern int urelational_si_operator PARAMS ((rtx, enum machine_mode)); -extern int relational_di_operator PARAMS ((rtx, enum machine_mode)); +extern int short_memory_operand (rtx, enum machine_mode); +extern int long_memory_operand (rtx, enum machine_mode); +extern int d30v_memory_operand (rtx, enum machine_mode); +extern int single_reg_memory_operand (rtx, enum machine_mode); +extern int const_addr_memory_operand (rtx, enum machine_mode); +extern int call_operand (rtx, enum machine_mode); +extern int gpr_operand (rtx, enum machine_mode); +extern int accum_operand (rtx, enum machine_mode); +extern int gpr_or_accum_operand (rtx, enum machine_mode); +extern int cr_operand (rtx, enum machine_mode); +extern int repeat_operand (rtx, enum machine_mode); +extern int flag_operand (rtx, enum machine_mode); +extern int br_flag_operand (rtx, enum machine_mode); +extern int br_flag_or_constant_operand (rtx, enum machine_mode); +extern int gpr_br_flag_operand (rtx, enum machine_mode); +extern int f0_operand (rtx, enum machine_mode); +extern int f1_operand (rtx, enum machine_mode); +extern int carry_operand (rtx, enum machine_mode); +extern int reg_or_0_operand (rtx, enum machine_mode); +extern int gpr_or_signed6_operand (rtx, enum machine_mode); +extern int gpr_or_unsigned5_operand (rtx, enum machine_mode); +extern int gpr_or_unsigned6_operand (rtx, enum machine_mode); +extern int gpr_or_constant_operand (rtx, enum machine_mode); +extern int gpr_or_dbl_const_operand (rtx, enum machine_mode); +extern int gpr_or_memory_operand (rtx, enum machine_mode); +extern int move_input_operand (rtx, enum machine_mode); +extern int move_output_operand (rtx, enum machine_mode); +extern int signed6_operand (rtx, enum machine_mode); +extern int unsigned5_operand (rtx, enum machine_mode); +extern int unsigned6_operand (rtx, enum machine_mode); +extern int bitset_operand (rtx, enum machine_mode); +extern int condexec_test_operator (rtx, enum machine_mode); +extern int condexec_branch_operator (rtx, enum machine_mode); +extern int condexec_unary_operator (rtx, enum machine_mode); +extern int condexec_addsub_operator (rtx, enum machine_mode); +extern int condexec_binary_operator (rtx, enum machine_mode); +extern int condexec_shiftl_operator (rtx, enum machine_mode); +extern int condexec_extend_operator (rtx, enum machine_mode); +extern int branch_zero_operator (rtx, enum machine_mode); +extern int cond_move_dest_operand (rtx, enum machine_mode); +extern int cond_move_operand (rtx, enum machine_mode); +extern int cond_exec_operand (rtx, enum machine_mode); +extern int srelational_si_operator (rtx, enum machine_mode); +extern int urelational_si_operator (rtx, enum machine_mode); +extern int relational_di_operator (rtx, enum machine_mode); #endif -extern d30v_stack_t *d30v_stack_info PARAMS ((void)); -extern int direct_return PARAMS ((void)); +extern d30v_stack_t *d30v_stack_info (void); +extern int direct_return (void); #ifdef TREE_CODE #ifdef RTX_CODE -extern void d30v_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, - rtx, tree, int)); +extern void d30v_init_cumulative_args (CUMULATIVE_ARGS *, tree, + rtx, tree, int); #endif -extern int d30v_function_arg_boundary PARAMS ((enum machine_mode, tree)); +extern int d30v_function_arg_boundary (enum machine_mode, tree); #ifdef RTX_CODE -extern rtx d30v_function_arg PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int, int)); +extern rtx d30v_function_arg (CUMULATIVE_ARGS *, + enum machine_mode, tree, int, int); #endif -extern int d30v_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int d30v_function_arg_partial_nregs (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); -extern int d30v_function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int d30v_function_arg_pass_by_reference (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); -extern void d30v_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern void d30v_function_arg_advance (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); #endif #ifdef RTX_CODE -extern rtx d30v_expand_builtin_saveregs PARAMS ((void)); +extern rtx d30v_expand_builtin_saveregs (void); #endif #ifdef TREE_CODE -extern void d30v_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int *, int)); -extern tree d30v_build_va_list PARAMS ((void)); +extern void d30v_setup_incoming_varargs (CUMULATIVE_ARGS *, + enum machine_mode, tree, int *, int); #ifdef RTX_CODE -extern void d30v_expand_builtin_va_start PARAMS ((tree, rtx)); -extern rtx d30v_expand_builtin_va_arg PARAMS ((tree, tree)); -#endif /* RTX_CODE */ -#endif /* TREE_CODE */ - -extern void d30v_expand_prologue PARAMS ((void)); -extern void d30v_expand_epilogue PARAMS ((void)); -extern void d30v_function_profiler PARAMS ((FILE *, int)); +extern void d30v_expand_builtin_va_start (tree, rtx); +extern rtx d30v_expand_builtin_va_arg (tree, tree); +#endif /* RTX_CODE */ +#endif /* TREE_CODE */ + +extern void d30v_expand_prologue (void); +extern void d30v_expand_epilogue (void); +extern void d30v_function_profiler (FILE *, int); #ifdef RTX_CODE -extern void d30v_split_double PARAMS ((rtx, rtx *, rtx *)); -extern void d30v_print_operand PARAMS ((FILE *, rtx, int)); -extern void d30v_print_operand_address PARAMS ((FILE *, rtx)); +extern void d30v_split_double (rtx, rtx *, rtx *); +extern void d30v_print_operand (FILE *, rtx, int); +extern void d30v_print_operand_address (FILE *, rtx); #endif -extern int d30v_trampoline_size PARAMS ((void)); +extern int d30v_trampoline_size (void); #ifdef RTX_CODE -extern void d30v_initialize_trampoline PARAMS ((rtx, rtx, rtx)); -extern int d30v_legitimate_address_p PARAMS ((enum machine_mode, rtx, int)); -extern rtx d30v_legitimize_address PARAMS ((rtx, rtx, - enum machine_mode, int)); -extern int d30v_mode_dependent_address_p PARAMS ((rtx)); -extern rtx d30v_emit_comparison PARAMS ((int, rtx, rtx, rtx)); -extern const char *d30v_move_2words PARAMS ((rtx *, rtx)); -extern int d30v_emit_cond_move PARAMS ((rtx, rtx, rtx, rtx)); -extern rtx d30v_return_addr PARAMS ((void)); +extern void d30v_initialize_trampoline (rtx, rtx, rtx); +extern int d30v_legitimate_address_p (enum machine_mode, rtx, int); +extern rtx d30v_legitimize_address (rtx, rtx, enum machine_mode, int); +extern int d30v_mode_dependent_address_p (rtx); +extern rtx d30v_emit_comparison (int, rtx, rtx, rtx); +extern const char *d30v_move_2words (rtx *, rtx); +extern int d30v_emit_cond_move (rtx, rtx, rtx, rtx); +extern rtx d30v_return_addr (void); #endif -extern void d30v_init_expanders PARAMS ((void)); -extern void debug_stack_info PARAMS ((d30v_stack_t *)); - +extern void d30v_init_expanders (void); +extern void debug_stack_info (d30v_stack_t *); + /* External variables referenced */ /* Define the information needed to generate branch and scc insns. This is diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c index 4093ab27abf..5794d0bb64f 100644 --- a/gcc/config/d30v/d30v.c +++ b/gcc/config/d30v/d30v.c @@ -46,15 +46,15 @@ #include "target-def.h" #include "langhooks.h" -static void d30v_print_operand_memory_reference PARAMS ((FILE *, rtx)); -static void d30v_build_long_insn PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, - rtx, rtx)); -static struct machine_function * d30v_init_machine_status PARAMS ((void)); -static void d30v_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void d30v_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static int d30v_adjust_cost PARAMS ((rtx, rtx, rtx, int)); -static int d30v_issue_rate PARAMS ((void)); -static bool d30v_rtx_costs PARAMS ((rtx, int, int, int *)); +static void d30v_print_operand_memory_reference (FILE *, rtx); +static void d30v_build_long_insn (HOST_WIDE_INT, HOST_WIDE_INT, rtx, rtx); +static struct machine_function * d30v_init_machine_status (void); +static void d30v_output_function_prologue (FILE *, HOST_WIDE_INT); +static void d30v_output_function_epilogue (FILE *, HOST_WIDE_INT); +static int d30v_adjust_cost (rtx, rtx, rtx, int); +static int d30v_issue_rate (void); +static bool d30v_rtx_costs (rtx, int, int, int *); +static tree d30v_build_builtin_va_list (void); /* Define the information needed to generate branch and scc insns. This is stored from the compare operation. */ @@ -105,6 +105,9 @@ enum reg_class reg_class_from_letter[256]; #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_0 +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST d30v_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; /* Sometimes certain combinations of command options do not make @@ -2201,8 +2204,8 @@ d30v_setup_incoming_varargs (cum, mode, type, pretend_size, second_time) /* Create the va_list data type. */ -tree -d30v_build_va_list () +static tree +d30v_build_builtin_va_list () { tree f_arg_ptr, f_arg_num, record, type_decl; tree int_type_node; diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h index 59ba9b7ba5f..6c4c0669eb6 100644 --- a/gcc/config/d30v/d30v.h +++ b/gcc/config/d30v/d30v.h @@ -1407,13 +1407,6 @@ typedef struct machine_function GTY(()) d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE, \ &PRETEND_ARGS_SIZE, SECOND_TIME) -/* Build up the stdarg/varargs va_list type tree, assinging it to NODE. If not - defined, it is assumed that va_list is a void * pointer. */ - -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = d30v_build_va_list () - - /* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this is stdarg.h instead of varargs.h. VALIST is the tree of the va_list variable to initialize. NEXTARG is the machine independent notion of the diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h index 69b0b6fcb3e..41bad646ce1 100644 --- a/gcc/config/darwin-protos.h +++ b/gcc/config/darwin-protos.h @@ -118,5 +118,6 @@ extern void machopic_output_stub (FILE *, const char *, const char *); extern void darwin_exception_section (void); extern void darwin_eh_frame_section (void); extern void darwin_globalize_label (FILE *, const char *); +extern void darwin_assemble_visibility (tree, int); extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *, const char *); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index dcb42d5199a..1ac122376de 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ #include "ggc.h" #include "langhooks.h" #include "tm_p.h" +#include "errors.h" static int machopic_data_defined_p (const char *); static void update_non_lazy_ptrs (const char *); @@ -1115,7 +1116,7 @@ machopic_output_possible_stub_label (FILE *file, const char *name) const char *sym_name; sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - if (sym_name[0] == '!' && sym_name[1] == 'T' + if (sym_name[0] == '!' && (sym_name[1] == 'T' || sym_name[1] == 't') && ! strcmp (name+2, sym_name+2)) { ASM_OUTPUT_LABEL (file, IDENTIFIER_POINTER (TREE_PURPOSE (temp))); @@ -1324,6 +1325,29 @@ darwin_globalize_label (FILE *stream, const char *name) default_globalize_label (stream, name); } +/* Emit an assembler directive to set visibility for a symbol. The + only supported visibilities are VISIBILITY_DEFAULT and + VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private + extern". There is no MACH-O equivalent of ELF's + VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */ + +void +darwin_assemble_visibility (tree decl, int vis) +{ + if (vis == VISIBILITY_DEFAULT) + ; + else if (vis == VISIBILITY_HIDDEN) + { + fputs ("\t.private_extern ", asm_out_file); + assemble_name (asm_out_file, + (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)))); + fputs ("\n", asm_out_file); + } + else + warning ("internal and protected visibility attributes not supported" + "in this configuration; ignored"); +} + /* Output a difference of two labels that will be an assembly time constant if the two labels are local. (.long lab1-lab2 will be very different if lab1 is at the boundary between two sections; it diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index ae5201a5eb1..3470f7b8ca1 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -192,7 +192,7 @@ Boston, MA 02111-1307, USA. */ %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \ %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \ %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \ - %{L*} %(link_libgcc) %o %{fprofile-arcs:-lgcov} \ + %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \ %{!nostdlib:%{!nodefaultlibs:%G %L}} \ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} \ %{!--help:%{!no-c++filt|c++filt:| c++filt3 }} }}}}}}}}" @@ -708,6 +708,13 @@ objc_section_init (void) \ #define GLOBAL_ASM_OP ".globl " #define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label +/* Emit an assembler directive to set visibility for a symbol. Used + to support visibility attribute and Darwin's private extern + feature. */ +#undef TARGET_ASM_ASSEMBLE_VISIBILITY +#define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility + + #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)) diff --git a/gcc/config/dsp16xx/dsp16xx-protos.h b/gcc/config/dsp16xx/dsp16xx-protos.h index 7e2683fbb74..802c69b62ec 100644 --- a/gcc/config/dsp16xx/dsp16xx-protos.h +++ b/gcc/config/dsp16xx/dsp16xx-protos.h @@ -20,67 +20,67 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef RTX_CODE -extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx)); -extern int call_address_operand PARAMS ((rtx, enum machine_mode)); -extern int arith_reg_operand PARAMS ((rtx, enum machine_mode)); -extern int symbolic_address_operand PARAMS ((rtx, enum machine_mode)); -extern int Y_address_operand PARAMS ((rtx, enum machine_mode)); -extern int sp_operand PARAMS ((rtx, enum machine_mode)); -extern int sp_operand2 PARAMS ((rtx, enum machine_mode)); -extern int nonmemory_arith_operand PARAMS ((rtx, enum machine_mode)); -extern int dsp16xx_comparison_operator PARAMS ((rtx, enum machine_mode)); -extern int unx_comparison_operator PARAMS ((rtx, enum machine_mode)); -extern int signed_comparison_operator PARAMS ((rtx, enum machine_mode)); +extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx); +extern int call_address_operand (rtx, enum machine_mode); +extern int arith_reg_operand (rtx, enum machine_mode); +extern int symbolic_address_operand (rtx, enum machine_mode); +extern int Y_address_operand (rtx, enum machine_mode); +extern int sp_operand (rtx, enum machine_mode); +extern int sp_operand2 (rtx, enum machine_mode); +extern int nonmemory_arith_operand (rtx, enum machine_mode); +extern int dsp16xx_comparison_operator (rtx, enum machine_mode); +extern int unx_comparison_operator (rtx, enum machine_mode); +extern int signed_comparison_operator (rtx, enum machine_mode); -extern void notice_update_cc PARAMS ((rtx)); -extern void double_reg_from_memory PARAMS ((rtx[])); -extern void double_reg_to_memory PARAMS ((rtx[])); -extern enum rtx_code next_cc_user_code PARAMS ((rtx)); -extern int next_cc_user_unsigned PARAMS ((rtx)); -extern struct rtx_def *gen_tst_reg PARAMS ((rtx)); -extern const char *output_block_move PARAMS ((rtx[])); -extern enum reg_class preferred_reload_class PARAMS ((rtx, enum reg_class)); -extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, - enum machine_mode, rtx)); -extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode)); -extern void print_operand PARAMS ((FILE *, rtx, int)); -extern void print_operand_address PARAMS ((FILE *, rtx)); -extern void output_dsp16xx_float_const PARAMS ((rtx *)); -extern void emit_1600_core_shift PARAMS ((enum rtx_code, rtx *, int)); -extern int symbolic_address_p PARAMS ((rtx)); -extern int uns_comparison_operator PARAMS ((rtx, enum machine_mode)); +extern void notice_update_cc (rtx); +extern void double_reg_from_memory (rtx[]); +extern void double_reg_to_memory (rtx[]); +extern enum rtx_code next_cc_user_code (rtx); +extern int next_cc_user_unsigned (rtx); +extern struct rtx_def *gen_tst_reg (rtx); +extern const char *output_block_move (rtx[]); +extern enum reg_class preferred_reload_class (rtx, enum reg_class); +extern enum reg_class secondary_reload_class (enum reg_class, + enum machine_mode, rtx); +extern int emit_move_sequence (rtx *, enum machine_mode); +extern void print_operand (FILE *, rtx, int); +extern void print_operand_address (FILE *, rtx); +extern void output_dsp16xx_float_const (rtx *); +extern void emit_1600_core_shift (enum rtx_code, rtx *, int); +extern int symbolic_address_p (rtx); +extern int uns_comparison_operator (rtx, enum machine_mode); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern struct rtx_def *dsp16xx_function_arg PARAMS ((CUMULATIVE_ARGS, - enum machine_mode, - tree, int)); -extern void dsp16xx_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern struct rtx_def *dsp16xx_function_arg (CUMULATIVE_ARGS, + enum machine_mode, + tree, int); +extern void dsp16xx_function_arg_advance (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); #endif /* TREE_CODE */ -extern void dsp16xx_invalid_register_for_compare PARAMS ((void)); -extern int class_max_nregs PARAMS ((enum reg_class, enum machine_mode)); -extern enum reg_class limit_reload_class PARAMS ((enum reg_class, enum machine_mode)); -extern int dsp16xx_register_move_cost PARAMS ((enum reg_class, enum reg_class)); -extern int dsp16xx_makes_calls PARAMS ((void)); -extern long compute_frame_size PARAMS ((int)); -extern int dsp16xx_call_saved_register PARAMS ((int)); -extern int dsp16xx_call_saved_register PARAMS ((int)); -extern void init_emulation_routines PARAMS ((void)); -extern int ybase_regs_ever_used PARAMS ((void)); -extern void override_options PARAMS ((void)); -extern int dsp16xx_starting_frame_offset PARAMS ((void)); -extern int initial_frame_pointer_offset PARAMS ((void)); -extern void asm_output_common PARAMS ((FILE *, const char *, int, int)); -extern void asm_output_local PARAMS ((FILE *, const char *, int, int)); -extern void asm_output_float PARAMS ((FILE *, double)); +extern void dsp16xx_invalid_register_for_compare (void); +extern int class_max_nregs (enum reg_class, enum machine_mode); +extern enum reg_class limit_reload_class (enum reg_class, enum machine_mode); +extern int dsp16xx_register_move_cost (enum reg_class, enum reg_class); +extern int dsp16xx_makes_calls (void); +extern long compute_frame_size (int); +extern int dsp16xx_call_saved_register (int); +extern int dsp16xx_call_saved_register (int); +extern void init_emulation_routines (void); +extern int ybase_regs_ever_used (void); +extern void override_options (void); +extern int dsp16xx_starting_frame_offset (void); +extern int initial_frame_pointer_offset (void); +extern void asm_output_common (FILE *, const char *, int, int); +extern void asm_output_local (FILE *, const char *, int, int); +extern void asm_output_float (FILE *, double); extern bool dsp16xx_compare_gen; -extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode)); -extern enum reg_class dsp16xx_reg_class_from_letter PARAMS ((int)); -extern int regno_reg_class PARAMS ((int)); -extern void function_prologue PARAMS ((FILE *, int)); -extern void function_epilogue PARAMS ((FILE *, int)); -extern int num_1600_core_shifts PARAMS ((int)); +extern int hard_regno_mode_ok (int, enum machine_mode); +extern enum reg_class dsp16xx_reg_class_from_letter (int); +extern int regno_reg_class (int); +extern void function_prologue (FILE *, int); +extern void function_epilogue (FILE *, int); +extern int num_1600_core_shifts (int); diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c index dcfbc7e6853..14d9c5e088e 100644 --- a/gcc/config/dsp16xx/dsp16xx.c +++ b/gcc/config/dsp16xx/dsp16xx.c @@ -148,12 +148,12 @@ static const char *const lshift_right_asm_first[] = "%0=%1>>16\n\t%0=%b0&0x0000" }; -static int reg_save_size PARAMS ((void)); -static void dsp16xx_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void dsp16xx_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static void dsp16xx_file_start PARAMS ((void)); -static bool dsp16xx_rtx_costs PARAMS ((rtx, int, int, int *)); -static int dsp16xx_address_cost PARAMS ((rtx)); +static int reg_save_size (void); +static void dsp16xx_output_function_prologue (FILE *, HOST_WIDE_INT); +static void dsp16xx_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void dsp16xx_file_start (void); +static bool dsp16xx_rtx_costs (rtx, int, int, int *); +static int dsp16xx_address_cost (rtx); /* Initialize the GCC target structure. */ diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h index 7e2d5405321..cea995ca104 100644 --- a/gcc/config/dsp16xx/dsp16xx.h +++ b/gcc/config/dsp16xx/dsp16xx.h @@ -293,8 +293,6 @@ extern int target_flags; #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ { \ - flag_gnu_linker = FALSE; \ - \ if (LEVEL >= 2) \ { \ /* The dsp16xx family has so few registers \ diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index 063dce655cf..6a138f9f76f 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -66,10 +66,6 @@ Boston, MA 02111-1307, USA. */ #define HANDLE_SYSV_PRAGMA 1 -/* System V Release 4 uses DWARF debugging info. */ - -#define DWARF_DEBUGGING_INFO 1 - /* All ELF targets can support DWARF-2. */ #define DWARF2_DEBUGGING_INFO 1 diff --git a/gcc/config/fr30/fr30-protos.h b/gcc/config/fr30/fr30-protos.h index c08b6639aa8..a7119042dd5 100644 --- a/gcc/config/fr30/fr30-protos.h +++ b/gcc/config/fr30/fr30-protos.h @@ -18,34 +18,34 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void fr30_expand_prologue PARAMS ((void)); -extern void fr30_expand_epilogue PARAMS ((void)); -extern unsigned int fr30_compute_frame_size PARAMS ((int, int)); +extern void fr30_expand_prologue (void); +extern void fr30_expand_epilogue (void); +extern unsigned int fr30_compute_frame_size (int, int); #ifdef RTX_CODE -extern int fr30_check_multiple_regs PARAMS ((rtx *, int, int)); -extern void fr30_print_operand PARAMS ((FILE *, rtx, int)); -extern void fr30_print_operand_address PARAMS ((FILE *, rtx)); -extern rtx fr30_move_double PARAMS ((rtx *)); +extern int fr30_check_multiple_regs (rtx *, int, int); +extern void fr30_print_operand (FILE *, rtx, int); +extern void fr30_print_operand_address (FILE *, rtx); +extern rtx fr30_move_double (rtx *); #ifdef TREE_CODE -extern rtx fr30_va_arg PARAMS ((tree, tree)); +extern rtx fr30_va_arg (tree, tree); #endif /* TREE_CODE */ #ifdef HAVE_MACHINE_MODES #define Mmode enum machine_mode -extern int stack_add_operand PARAMS ((rtx, Mmode)); -extern int add_immediate_operand PARAMS ((rtx, Mmode)); -extern int high_register_operand PARAMS ((rtx, Mmode)); -extern int low_register_operand PARAMS ((rtx, Mmode)); -extern int call_operand PARAMS ((rtx, Mmode)); -extern int di_operand PARAMS ((rtx, Mmode)); -extern int nonimmediate_di_operand PARAMS ((rtx, Mmode)); -extern int fr30_const_double_is_zero PARAMS ((rtx)); +extern int stack_add_operand (rtx, Mmode); +extern int add_immediate_operand (rtx, Mmode); +extern int high_register_operand (rtx, Mmode); +extern int low_register_operand (rtx, Mmode); +extern int call_operand (rtx, Mmode); +extern int di_operand (rtx, Mmode); +extern int nonimmediate_di_operand (rtx, Mmode); +extern int fr30_const_double_is_zero (rtx); #undef Mmode #endif /* HAVE_MACHINE_MODES */ #endif /* RTX_CODE */ #ifdef TREE_CODE -extern int fr30_num_arg_regs PARAMS ((int, tree)); -extern int fr30_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS, int, tree, int)); -extern void fr30_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS, int, tree, int *)); +extern int fr30_num_arg_regs (int, tree); +extern int fr30_function_arg_partial_nregs (CUMULATIVE_ARGS, int, tree, int); +extern void fr30_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int *); #endif /* TREE_CODE */ diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 15c8b91db78..c702d0bbe28 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -40,6 +40,7 @@ #include "obstack.h" #include "except.h" #include "function.h" +#include "toplev.h" #include "tm_p.h" #include "target.h" #include "target-def.h" @@ -109,7 +110,7 @@ struct fr30_frame_info unsigned int frame_size; /* # Bytes in current frame. */ unsigned int gmask; /* Mask of saved registers. */ unsigned int save_fp; /* Nonzero if frame pointer must be saved. */ - unsigned int save_rp; /* Nonzero if return popinter must be saved. */ + unsigned int save_rp; /* Nonzero if return pointer must be saved. */ int initialised; /* Nonzero if frame size already calculated. */ }; @@ -119,8 +120,8 @@ static struct fr30_frame_info current_frame_info; /* Zero structure to initialize current_frame_info. */ static struct fr30_frame_info zero_frame_info; -static rtx fr30_pass_by_reference PARAMS ((tree, tree)); -static rtx fr30_pass_by_value PARAMS ((tree, tree)); +static rtx fr30_pass_by_reference (tree, tree); +static rtx fr30_pass_by_value (tree, tree); #define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM)) #define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM)) @@ -153,9 +154,7 @@ struct gcc_target targetm = TARGET_INITIALIZER; for the current function. As a side effect it fills in the current_frame_info structure, if the data is available. */ unsigned int -fr30_compute_frame_size (from_reg, to_reg) - int from_reg; - int to_reg; +fr30_compute_frame_size (int from_reg, int to_reg) { int regno; unsigned int return_value; @@ -218,7 +217,7 @@ fr30_compute_frame_size (from_reg, to_reg) insn to prevent such scheduling. */ void -fr30_expand_prologue () +fr30_expand_prologue (void) { int regno; rtx insn; @@ -346,7 +345,7 @@ fr30_expand_prologue () In some cases, it might be necessary to emit a barrier instruction as the first insn to prevent such scheduling. */ void -fr30_expand_epilogue () +fr30_expand_epilogue (void) { int regno; @@ -405,11 +404,10 @@ fr30_expand_epilogue () ARG_REGS_USED_SO_FAR has *not* been updated for the last named argument which has type TYPE and mode MODE, and we rely on this fact. */ void -fr30_setup_incoming_varargs (arg_regs_used_so_far, int_mode, type, pretend_size) - CUMULATIVE_ARGS arg_regs_used_so_far; - int int_mode; - tree type ATTRIBUTE_UNUSED; - int * pretend_size; +fr30_setup_incoming_varargs (CUMULATIVE_ARGS arg_regs_used_so_far, + int int_mode, + tree type ATTRIBUTE_UNUSED, + int *pretend_size) { enum machine_mode mode = (enum machine_mode)int_mode; int size; @@ -439,9 +437,7 @@ fr30_setup_incoming_varargs (arg_regs_used_so_far, int_mode, type, pretend_size) /* Print a memory address as an operand to reference that memory location. */ void -fr30_print_operand_address (stream, address) - FILE * stream; - rtx address; +fr30_print_operand_address (FILE *stream, rtx address) { switch (GET_CODE (address)) { @@ -460,10 +456,7 @@ fr30_print_operand_address (stream, address) /* Print an operand. */ void -fr30_print_operand (file, x, code) - FILE * file; - rtx x; - int code; +fr30_print_operand (FILE *file, rtx x, int code) { rtx x0; @@ -664,9 +657,7 @@ fr30_print_operand (file, x, code) /* Compute the number of word sized registers needed to hold a function argument of mode INT_MODE and tree type TYPE. */ int -fr30_num_arg_regs (int_mode, type) - int int_mode; - tree type; +fr30_num_arg_regs (int int_mode, tree type) { enum machine_mode mode = (enum machine_mode) int_mode; int size; @@ -685,17 +676,14 @@ fr30_num_arg_regs (int_mode, type) /* Implements the FUNCTION_ARG_PARTIAL_NREGS macro. Returns the number of argument registers required to hold *part* of a parameter of machine mode MODE and tree type TYPE (which may be - NULL if the type is not known). If the argument fits entirly in + NULL if the type is not known). If the argument fits entirely in the argument registers, or entirely on the stack, then 0 is returned. CUM is the number of argument registers already used by earlier parameters to the function. */ int -fr30_function_arg_partial_nregs (cum, int_mode, type, named) - CUMULATIVE_ARGS cum; - int int_mode; - tree type; - int named; +fr30_function_arg_partial_nregs (CUMULATIVE_ARGS cum, int int_mode, + tree type, int named) { /* Unnamed arguments, ie those that are prototyped as ... are always passed on the stack. @@ -717,9 +705,7 @@ fr30_function_arg_partial_nregs (cum, int_mode, type, named) } static rtx -fr30_pass_by_reference (valist, type) - tree valist; - tree type; +fr30_pass_by_reference (tree valist, tree type) { tree type_ptr; tree type_ptr_ptr; @@ -738,9 +724,7 @@ fr30_pass_by_reference (valist, type) } static rtx -fr30_pass_by_value (valist, type) - tree valist; - tree type; +fr30_pass_by_value (tree valist, tree type) { HOST_WIDE_INT size = int_size_in_bytes (type); HOST_WIDE_INT rsize; @@ -774,9 +758,7 @@ fr30_pass_by_value (valist, type) /* Implement `va_arg'. */ rtx -fr30_va_arg (valist, type) - tree valist; - tree type; +fr30_va_arg (tree valist, tree type) { HOST_WIDE_INT size; @@ -802,9 +784,7 @@ fr30_va_arg (valist, type) /* Returns true if OPERAND is an integer value suitable for use in an ADDSP instruction. */ int -stack_add_operand (operand, mode) - rtx operand; - Mmode mode ATTRIBUTE_UNUSED; +stack_add_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) { return (GET_CODE (operand) == CONST_INT @@ -816,9 +796,7 @@ stack_add_operand (operand, mode) /* Returns true if OPERAND is an integer value suitable for use in an ADD por ADD2 instruction, or if it is a register. */ int -add_immediate_operand (operand, mode) - rtx operand; - Mmode mode ATTRIBUTE_UNUSED; +add_immediate_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) { return (GET_CODE (operand) == REG @@ -829,9 +807,7 @@ add_immediate_operand (operand, mode) /* Returns true if OPERAND is hard register in the range 8 - 15. */ int -high_register_operand (operand, mode) - rtx operand; - Mmode mode ATTRIBUTE_UNUSED; +high_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) { return (GET_CODE (operand) == REG @@ -841,9 +817,7 @@ high_register_operand (operand, mode) /* Returns true if OPERAND is hard register in the range 0 - 7. */ int -low_register_operand (operand, mode) - rtx operand; - Mmode mode ATTRIBUTE_UNUSED; +low_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) { return (GET_CODE (operand) == REG @@ -852,9 +826,7 @@ low_register_operand (operand, mode) /* Returns true if OPERAND is suitable for use in a CALL insn. */ int -call_operand (operand, mode) - rtx operand; - Mmode mode ATTRIBUTE_UNUSED; +call_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) { return (GET_CODE (operand) == MEM && (GET_CODE (XEXP (operand, 0)) == SYMBOL_REF @@ -863,9 +835,7 @@ call_operand (operand, mode) /* Returns TRUE if OP is a valid operand of a DImode operation. */ int -di_operand (op, mode) - rtx op; - Mmode mode; +di_operand (rtx op, Mmode mode) { if (register_operand (op, mode)) return TRUE; @@ -892,9 +862,7 @@ di_operand (op, mode) /* Returns TRUE if OP is a DImode register or MEM. */ int -nonimmediate_di_operand (op, mode) - rtx op; - Mmode mode; +nonimmediate_di_operand (rtx op, Mmode mode) { if (register_operand (op, mode)) return TRUE; @@ -914,10 +882,7 @@ nonimmediate_di_operand (op, mode) /* Returns true iff all the registers in the operands array are in descending or ascending order. */ int -fr30_check_multiple_regs (operands, num_operands, descending) - rtx * operands; - int num_operands; - int descending; +fr30_check_multiple_regs (rtx *operands, int num_operands, int descending) { if (descending) { @@ -954,8 +919,7 @@ fr30_check_multiple_regs (operands, num_operands, descending) } int -fr30_const_double_is_zero (operand) - rtx operand; +fr30_const_double_is_zero (rtx operand) { REAL_VALUE_TYPE d; @@ -972,14 +936,13 @@ fr30_const_double_is_zero (operand) /* Output a double word move. It must be REG<-REG, REG<-MEM, MEM<-REG or REG<-CONST. - On the FR30 we are contrained by the fact that it does not + On the FR30 we are constrained by the fact that it does not support offsetable addresses, and so we have to load the address of the secnd word into the second destination register before we can use it. */ rtx -fr30_move_double (operands) - rtx * operands; +fr30_move_double (rtx * operands) { rtx src = operands[1]; rtx dest = operands[0]; diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h index f44d6996eb5..845b4f1e111 100644 --- a/gcc/config/fr30/fr30.h +++ b/gcc/config/fr30/fr30.h @@ -926,7 +926,7 @@ enum reg_class jmp @r0 The no-ops are to guarantee that the static chain and final - target are 32 bit ailgned within the trampoline. That allows us to + target are 32 bit aligned within the trampoline. That allows us to initialize those locations with simple SImode stores. The alternative would be to use HImode stores. */ diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md index 048badb45ab..5be9d9ae5ce 100644 --- a/gcc/config/fr30/fr30.md +++ b/gcc/config/fr30/fr30.md @@ -639,7 +639,7 @@ ;; We need some trickery to be able to handle the addition of ;; large (ie outside +/- 16) constants. We need to be able to ;; handle this because reload assumes that it can generate add -;; instructions with arbitary sized constants. +;; instructions with arbitrary sized constants. (define_expand "addsi3" [(set (match_operand:SI 0 "register_operand" "") (plus:SI (match_operand:SI 1 "register_operand" "") diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 1e2eb39dbc0..04774de1b84 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -52,194 +52,187 @@ typedef enum frv_cpu extern frv_cpu_t frv_cpu_type; /* value of -mcpu= */ /* Define functions defined in frv.c */ -extern void frv_expand_prologue PARAMS ((void)); -extern void frv_expand_epilogue PARAMS ((int)); -extern void frv_override_options PARAMS ((void)); -extern void frv_optimization_options PARAMS ((int, int)); -extern void frv_conditional_register_usage PARAMS ((void)); -extern frv_stack_t *frv_stack_info PARAMS ((void)); -extern void frv_debug_stack PARAMS ((frv_stack_t *)); -extern int frv_frame_pointer_required PARAMS ((void)); -extern int frv_initial_elimination_offset PARAMS ((int, int)); +extern void frv_expand_prologue (void); +extern void frv_expand_epilogue (int); +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 *); +extern int frv_frame_pointer_required (void); +extern int frv_initial_elimination_offset (int, int); #ifdef RTX_CODE -extern int frv_legitimate_address_p PARAMS ((enum machine_mode, rtx, - int, int)); -extern rtx frv_legitimize_address PARAMS ((rtx, rtx, - enum machine_mode)); +extern int frv_legitimate_address_p (enum machine_mode, rtx, + int, int); +extern rtx frv_legitimize_address (rtx, rtx, enum machine_mode); #ifdef TREE_CODE -extern void frv_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, - rtx, tree, int)); +extern void frv_init_cumulative_args (CUMULATIVE_ARGS *, tree, + rtx, tree, int); -extern int frv_function_arg_boundary PARAMS ((enum machine_mode, tree)); -extern rtx frv_function_arg PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int, int)); +extern int frv_function_arg_boundary (enum machine_mode, tree); +extern rtx frv_function_arg (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int, int); -extern void frv_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern void frv_function_arg_advance (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); -extern int frv_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); -extern int frv_function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int frv_function_arg_pass_by_reference (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); -extern int frv_function_arg_callee_copies PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int frv_function_arg_callee_copies (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); -extern int frv_function_arg_keep_as_reference PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); +extern int frv_function_arg_keep_as_reference (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); -extern rtx frv_expand_builtin_saveregs PARAMS ((void)); -extern void frv_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int *, int)); +extern rtx frv_expand_builtin_saveregs (void); +extern void frv_setup_incoming_varargs (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int *, int); -extern void frv_expand_builtin_va_start PARAMS ((tree, rtx)); -extern rtx frv_expand_builtin_va_arg PARAMS ((tree, tree)); +extern void frv_expand_builtin_va_start (tree, rtx); +extern rtx frv_expand_builtin_va_arg (tree, tree); #endif /* TREE_CODE */ -extern int frv_expand_block_move PARAMS ((rtx *)); -extern int frv_expand_block_clear PARAMS ((rtx *)); -extern rtx frv_dynamic_chain_address PARAMS ((rtx)); -extern rtx frv_return_addr_rtx PARAMS ((int, rtx)); -extern rtx frv_index_memory PARAMS ((rtx, - enum machine_mode, - int)); +extern int frv_expand_block_move (rtx *); +extern int frv_expand_block_clear (rtx *); +extern rtx frv_dynamic_chain_address (rtx); +extern rtx frv_return_addr_rtx (int, rtx); +extern rtx frv_index_memory (rtx, enum machine_mode, int); extern const char *frv_asm_output_opcode - PARAMS ((FILE *, const char *)); -extern void frv_final_prescan_insn PARAMS ((rtx, rtx *, int)); -extern void frv_print_operand PARAMS ((FILE *, rtx, int)); -extern void frv_print_operand_address PARAMS ((FILE *, rtx)); -extern int frv_emit_movsi PARAMS ((rtx, rtx)); -extern const char *output_move_single PARAMS ((rtx *, rtx)); -extern const char *output_move_double PARAMS ((rtx *, rtx)); + (FILE *, const char *); +extern void frv_final_prescan_insn (rtx, rtx *, int); +extern void frv_print_operand (FILE *, rtx, int); +extern void frv_print_operand_address (FILE *, rtx); +extern int frv_emit_movsi (rtx, rtx); +extern const char *output_move_single (rtx *, rtx); +extern const char *output_move_double (rtx *, rtx); extern const char *output_condmove_single - PARAMS ((rtx *, rtx)); -extern int frv_emit_cond_branch PARAMS ((enum rtx_code, rtx)); -extern int frv_emit_scc PARAMS ((enum rtx_code, rtx)); -extern rtx frv_split_scc PARAMS ((rtx, rtx, rtx, rtx, - HOST_WIDE_INT)); -extern int frv_emit_cond_move PARAMS ((rtx, rtx, rtx, rtx)); -extern rtx frv_split_cond_move PARAMS ((rtx *)); -extern rtx frv_split_minmax PARAMS ((rtx *)); -extern rtx frv_split_abs PARAMS ((rtx *)); -extern void frv_split_double_load PARAMS ((rtx, rtx)); -extern void frv_split_double_store PARAMS ((rtx, rtx)); + (rtx *, rtx); +extern int frv_emit_cond_branch (enum rtx_code, rtx); +extern int frv_emit_scc (enum rtx_code, rtx); +extern rtx frv_split_scc (rtx, rtx, rtx, rtx, HOST_WIDE_INT); +extern int frv_emit_cond_move (rtx, rtx, rtx, rtx); +extern rtx frv_split_cond_move (rtx *); +extern rtx frv_split_minmax (rtx *); +extern rtx frv_split_abs (rtx *); +extern void frv_split_double_load (rtx, rtx); +extern void frv_split_double_store (rtx, rtx); #ifdef BLOCK_HEAD -extern void frv_ifcvt_init_extra_fields PARAMS ((ce_if_block_t *)); -extern void frv_ifcvt_modify_tests PARAMS ((ce_if_block_t *, - rtx *, rtx *)); +extern void frv_ifcvt_init_extra_fields (ce_if_block_t *); +extern void frv_ifcvt_modify_tests (ce_if_block_t *, rtx *, rtx *); extern void frv_ifcvt_modify_multiple_tests - PARAMS ((ce_if_block_t *, - basic_block, - rtx *, rtx *)); -extern rtx frv_ifcvt_modify_insn PARAMS ((ce_if_block_t *, - rtx, rtx)); -extern void frv_ifcvt_modify_final PARAMS ((ce_if_block_t *)); -extern void frv_ifcvt_modify_cancel PARAMS ((ce_if_block_t *)); + (ce_if_block_t *, basic_block, + rtx *, rtx *); +extern rtx frv_ifcvt_modify_insn (ce_if_block_t *, rtx, rtx); +extern void frv_ifcvt_modify_final (ce_if_block_t *); +extern void frv_ifcvt_modify_cancel (ce_if_block_t *); #endif -extern int frv_trampoline_size PARAMS ((void)); -extern void frv_initialize_trampoline PARAMS ((rtx, rtx, rtx)); +extern int frv_trampoline_size (void); +extern void frv_initialize_trampoline (rtx, rtx, rtx); extern enum reg_class frv_secondary_reload_class - PARAMS ((enum reg_class class, - enum machine_mode mode, - rtx x, int)); -extern int frv_class_likely_spilled_p PARAMS ((enum reg_class class)); -extern int frv_hard_regno_mode_ok PARAMS ((int, enum machine_mode)); -extern int frv_hard_regno_nregs PARAMS ((int, enum machine_mode)); -extern int frv_class_max_nregs PARAMS ((enum reg_class class, - enum machine_mode mode)); -extern int frv_legitimate_constant_p PARAMS ((rtx)); + (enum reg_class class, + enum machine_mode mode, + rtx x, int); +extern int frv_class_likely_spilled_p (enum reg_class class); +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 class, + enum machine_mode mode); +extern int frv_legitimate_constant_p (rtx); #endif /* RTX_CODE */ -extern int direct_return_p PARAMS ((void)); -extern int frv_register_move_cost PARAMS ((enum reg_class, enum reg_class)); +extern int direct_return_p (void); +extern int frv_register_move_cost (enum reg_class, enum reg_class); #ifdef TREE_CODE -extern int frv_adjust_field_align PARAMS ((tree, int)); +extern int frv_adjust_field_align (tree, int); #endif -extern void fixup_section PARAMS ((void)); -extern void sdata_section PARAMS ((void)); -extern void sbss_section PARAMS ((void)); -extern void data_section PARAMS ((void)); +extern void fixup_section (void); +extern void sdata_section (void); +extern void sbss_section (void); +extern void data_section (void); #ifdef RTX_CODE -extern int integer_register_operand PARAMS ((rtx, enum machine_mode)); -extern int frv_load_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_fpr_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_no_subreg_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_int6_operand PARAMS ((rtx, enum machine_mode)); -extern int fpr_or_int6_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_int_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_int12_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_fpr_or_int12_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_int10_operand PARAMS ((rtx, enum machine_mode)); -extern int move_source_operand PARAMS ((rtx, enum machine_mode)); -extern int move_destination_operand PARAMS ((rtx, enum machine_mode)); -extern int condexec_source_operand PARAMS ((rtx, enum machine_mode)); -extern int condexec_dest_operand PARAMS ((rtx, enum machine_mode)); -extern int lr_operand PARAMS ((rtx, enum machine_mode)); -extern int gpr_or_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int fpr_or_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode)); -extern int fcc_operand PARAMS ((rtx, enum machine_mode)); -extern int icc_operand PARAMS ((rtx, enum machine_mode)); -extern int cc_operand PARAMS ((rtx, enum machine_mode)); -extern int fcr_operand PARAMS ((rtx, enum machine_mode)); -extern int icr_operand PARAMS ((rtx, enum machine_mode)); -extern int cr_operand PARAMS ((rtx, enum machine_mode)); -extern int call_operand PARAMS ((rtx, enum machine_mode)); -extern int fpr_operand PARAMS ((rtx, enum machine_mode)); -extern int even_reg_operand PARAMS ((rtx, enum machine_mode)); -extern int odd_reg_operand PARAMS ((rtx, enum machine_mode)); -extern int even_gpr_operand PARAMS ((rtx, enum machine_mode)); -extern int odd_gpr_operand PARAMS ((rtx, enum machine_mode)); -extern int quad_fpr_operand PARAMS ((rtx, enum machine_mode)); -extern int even_fpr_operand PARAMS ((rtx, enum machine_mode)); -extern int odd_fpr_operand PARAMS ((rtx, enum machine_mode)); -extern int dbl_memory_one_insn_operand PARAMS ((rtx, enum machine_mode)); -extern int dbl_memory_two_insn_operand PARAMS ((rtx, enum machine_mode)); -extern int int12_operand PARAMS ((rtx, enum machine_mode)); -extern int int6_operand PARAMS ((rtx, enum machine_mode)); -extern int int5_operand PARAMS ((rtx, enum machine_mode)); -extern int uint5_operand PARAMS ((rtx, enum machine_mode)); -extern int uint4_operand PARAMS ((rtx, enum machine_mode)); -extern int uint1_operand PARAMS ((rtx, enum machine_mode)); -extern int int_2word_operand PARAMS ((rtx, enum machine_mode)); -extern int pic_register_operand PARAMS ((rtx, enum machine_mode)); -extern int pic_symbolic_operand PARAMS ((rtx, enum machine_mode)); -extern int small_data_register_operand PARAMS ((rtx, enum machine_mode)); -extern int small_data_symbolic_operand PARAMS ((rtx, enum machine_mode)); -extern int upper_int16_operand PARAMS ((rtx, enum machine_mode)); -extern int uint16_operand PARAMS ((rtx, enum machine_mode)); -extern int relational_operator PARAMS ((rtx, enum machine_mode)); -extern int signed_relational_operator PARAMS ((rtx, enum machine_mode)); -extern int unsigned_relational_operator PARAMS ((rtx, enum machine_mode)); -extern int float_relational_operator PARAMS ((rtx, enum machine_mode)); -extern int ccr_eqne_operator PARAMS ((rtx, enum machine_mode)); -extern int minmax_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_si_binary_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_si_media_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_si_divide_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_si_unary_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_sf_conv_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_sf_add_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int intop_compare_operator PARAMS ((rtx, enum machine_mode)); -extern int condexec_intop_cmp_operator PARAMS ((rtx, enum machine_mode)); -extern int acc_operand PARAMS ((rtx, enum machine_mode)); -extern int even_acc_operand PARAMS ((rtx, enum machine_mode)); -extern int quad_acc_operand PARAMS ((rtx, enum machine_mode)); -extern int accg_operand PARAMS ((rtx, enum machine_mode)); -extern rtx frv_matching_accg_for_acc PARAMS ((rtx)); +extern int integer_register_operand (rtx, enum machine_mode); +extern int frv_load_operand (rtx, enum machine_mode); +extern int gpr_or_fpr_operand (rtx, enum machine_mode); +extern int gpr_no_subreg_operand (rtx, enum machine_mode); +extern int gpr_or_int6_operand (rtx, enum machine_mode); +extern int fpr_or_int6_operand (rtx, enum machine_mode); +extern int gpr_or_int_operand (rtx, enum machine_mode); +extern int gpr_or_int12_operand (rtx, enum machine_mode); +extern int gpr_fpr_or_int12_operand (rtx, enum machine_mode); +extern int gpr_or_int10_operand (rtx, enum machine_mode); +extern int move_source_operand (rtx, enum machine_mode); +extern int move_destination_operand (rtx, enum machine_mode); +extern int condexec_source_operand (rtx, enum machine_mode); +extern int condexec_dest_operand (rtx, enum machine_mode); +extern int lr_operand (rtx, enum machine_mode); +extern int gpr_or_memory_operand (rtx, enum machine_mode); +extern int fpr_or_memory_operand (rtx, enum machine_mode); +extern int reg_or_0_operand (rtx, enum machine_mode); +extern int fcc_operand (rtx, enum machine_mode); +extern int icc_operand (rtx, enum machine_mode); +extern int cc_operand (rtx, enum machine_mode); +extern int fcr_operand (rtx, enum machine_mode); +extern int icr_operand (rtx, enum machine_mode); +extern int cr_operand (rtx, enum machine_mode); +extern int call_operand (rtx, enum machine_mode); +extern int fpr_operand (rtx, enum machine_mode); +extern int even_reg_operand (rtx, enum machine_mode); +extern int odd_reg_operand (rtx, enum machine_mode); +extern int even_gpr_operand (rtx, enum machine_mode); +extern int odd_gpr_operand (rtx, enum machine_mode); +extern int quad_fpr_operand (rtx, enum machine_mode); +extern int even_fpr_operand (rtx, enum machine_mode); +extern int odd_fpr_operand (rtx, enum machine_mode); +extern int dbl_memory_one_insn_operand (rtx, enum machine_mode); +extern int dbl_memory_two_insn_operand (rtx, enum machine_mode); +extern int int12_operand (rtx, enum machine_mode); +extern int int6_operand (rtx, enum machine_mode); +extern int int5_operand (rtx, enum machine_mode); +extern int uint5_operand (rtx, enum machine_mode); +extern int uint4_operand (rtx, enum machine_mode); +extern int uint1_operand (rtx, enum machine_mode); +extern int int_2word_operand (rtx, enum machine_mode); +extern int pic_register_operand (rtx, enum machine_mode); +extern int pic_symbolic_operand (rtx, enum machine_mode); +extern int small_data_register_operand (rtx, enum machine_mode); +extern int small_data_symbolic_operand (rtx, enum machine_mode); +extern int upper_int16_operand (rtx, enum machine_mode); +extern int uint16_operand (rtx, enum machine_mode); +extern int relational_operator (rtx, enum machine_mode); +extern int signed_relational_operator (rtx, enum machine_mode); +extern int unsigned_relational_operator (rtx, enum machine_mode); +extern int float_relational_operator (rtx, enum machine_mode); +extern int ccr_eqne_operator (rtx, enum machine_mode); +extern int minmax_operator (rtx, enum machine_mode); +extern int condexec_si_binary_operator (rtx, enum machine_mode); +extern int condexec_si_media_operator (rtx, enum machine_mode); +extern int condexec_si_divide_operator (rtx, enum machine_mode); +extern int condexec_si_unary_operator (rtx, enum machine_mode); +extern int condexec_sf_conv_operator (rtx, enum machine_mode); +extern int condexec_sf_add_operator (rtx, enum machine_mode); +extern int condexec_memory_operand (rtx, enum machine_mode); +extern int intop_compare_operator (rtx, enum machine_mode); +extern int condexec_intop_cmp_operator (rtx, enum machine_mode); +extern int acc_operand (rtx, enum machine_mode); +extern int even_acc_operand (rtx, enum machine_mode); +extern int quad_acc_operand (rtx, enum machine_mode); +extern int accg_operand (rtx, enum machine_mode); +extern rtx frv_matching_accg_for_acc (rtx); #endif diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index d90ced7c418..6ee41847484 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -151,7 +151,7 @@ typedef struct nested compares can be done. The csubcc and caddcc instructions don't have enough bits to specify both a CC register to be set and a CR register to do the test on, so the same bit number is used for both. Needless to - say, this is rather inconvient for GCC. */ + say, this is rather inconvenient for GCC. */ rtx nested_cc_reg; /* Extra CR registers used for &&, ||. */ @@ -196,96 +196,75 @@ const char *frv_sched_lookahead_str; /* -msched-lookahead=n */ int frv_sched_lookahead = 4; /* -msched-lookahead=n */ /* Forward references */ -static int frv_default_flags_for_cpu PARAMS ((void)); -static int frv_string_begins_with PARAMS ((tree, const char *)); -static FRV_INLINE int const_small_data_p PARAMS ((rtx)); -static FRV_INLINE int plus_small_data_p PARAMS ((rtx, rtx)); +static int frv_default_flags_for_cpu (void); +static int frv_string_begins_with (tree, const char *); +static FRV_INLINE int const_small_data_p (rtx); +static FRV_INLINE int plus_small_data_p (rtx, rtx); static void frv_print_operand_memory_reference_reg - PARAMS ((FILE *, rtx)); -static void frv_print_operand_memory_reference PARAMS ((FILE *, rtx, int)); -static int frv_print_operand_jump_hint PARAMS ((rtx)); -static FRV_INLINE int frv_regno_ok_for_base_p PARAMS ((int, int)); -static rtx single_set_pattern PARAMS ((rtx)); -static int frv_function_contains_far_jump PARAMS ((void)); -static rtx frv_alloc_temp_reg PARAMS ((frv_tmp_reg_t *, - enum reg_class, - enum machine_mode, - int, int)); -static rtx frv_frame_offset_rtx PARAMS ((int)); -static rtx frv_frame_mem PARAMS ((enum machine_mode, - rtx, int)); -static rtx frv_dwarf_store PARAMS ((rtx, int)); -static void frv_frame_insn PARAMS ((rtx, rtx)); -static void frv_frame_access PARAMS ((frv_frame_accessor_t*, - rtx, int)); -static void frv_frame_access_multi PARAMS ((frv_frame_accessor_t*, - frv_stack_t *, int)); -static void frv_frame_access_standard_regs PARAMS ((enum frv_stack_op, - frv_stack_t *)); -static struct machine_function *frv_init_machine_status PARAMS ((void)); -static int frv_legitimate_memory_operand PARAMS ((rtx, - enum machine_mode, - int)); -static rtx frv_int_to_acc PARAMS ((enum insn_code, - int, rtx)); -static enum machine_mode frv_matching_accg_mode PARAMS ((enum machine_mode)); -static rtx frv_read_argument PARAMS ((tree *)); -static int frv_check_constant_argument PARAMS ((enum insn_code, - int, rtx)); -static rtx frv_legitimize_target PARAMS ((enum insn_code, rtx)); -static rtx frv_legitimize_argument PARAMS ((enum insn_code, - int, rtx)); -static rtx frv_expand_set_builtin PARAMS ((enum insn_code, - tree, rtx)); -static rtx frv_expand_unop_builtin PARAMS ((enum insn_code, - tree, rtx)); -static rtx frv_expand_binop_builtin PARAMS ((enum insn_code, - tree, rtx)); -static rtx frv_expand_cut_builtin PARAMS ((enum insn_code, - tree, rtx)); -static rtx frv_expand_binopimm_builtin PARAMS ((enum insn_code, - tree, rtx)); -static rtx frv_expand_voidbinop_builtin PARAMS ((enum insn_code, - tree)); -static rtx frv_expand_voidtriop_builtin PARAMS ((enum insn_code, - tree)); -static rtx frv_expand_voidaccop_builtin PARAMS ((enum insn_code, - tree)); -static rtx frv_expand_mclracc_builtin PARAMS ((tree)); -static rtx frv_expand_mrdacc_builtin PARAMS ((enum insn_code, - tree)); -static rtx frv_expand_mwtacc_builtin PARAMS ((enum insn_code, - tree)); -static rtx frv_expand_noargs_builtin PARAMS ((enum insn_code)); -static rtx frv_emit_comparison PARAMS ((enum rtx_code, rtx, - rtx)); -static int frv_clear_registers_used PARAMS ((rtx *, void *)); -static void frv_ifcvt_add_insn PARAMS ((rtx, rtx, int)); -static rtx frv_ifcvt_rewrite_mem PARAMS ((rtx, - enum machine_mode, - rtx)); -static rtx frv_ifcvt_load_value PARAMS ((rtx, rtx)); -static void frv_registers_update PARAMS ((rtx, unsigned char [], - int [], int *, int)); -static int frv_registers_used_p PARAMS ((rtx, unsigned char [], - int)); -static int frv_registers_set_p PARAMS ((rtx, unsigned char [], - int)); -static int frv_issue_rate PARAMS ((void)); -static int frv_use_dfa_pipeline_interface PARAMS ((void)); -static void frv_pack_insns PARAMS ((void)); -static void frv_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void frv_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static bool frv_assemble_integer PARAMS ((rtx, unsigned, int)); -static void frv_init_builtins PARAMS ((void)); -static rtx frv_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int)); -static void frv_init_libfuncs PARAMS ((void)); -static bool frv_in_small_data_p PARAMS ((tree)); + (FILE *, rtx); +static void frv_print_operand_memory_reference (FILE *, rtx, int); +static int frv_print_operand_jump_hint (rtx); +static FRV_INLINE int frv_regno_ok_for_base_p (int, int); +static rtx single_set_pattern (rtx); +static int frv_function_contains_far_jump (void); +static rtx frv_alloc_temp_reg (frv_tmp_reg_t *, + enum reg_class, + enum machine_mode, + int, int); +static rtx frv_frame_offset_rtx (int); +static rtx frv_frame_mem (enum machine_mode, rtx, int); +static rtx frv_dwarf_store (rtx, int); +static void frv_frame_insn (rtx, rtx); +static void frv_frame_access (frv_frame_accessor_t*, + rtx, int); +static void frv_frame_access_multi (frv_frame_accessor_t*, + frv_stack_t *, int); +static void frv_frame_access_standard_regs (enum frv_stack_op, + frv_stack_t *); +static struct machine_function *frv_init_machine_status (void); +static int frv_legitimate_memory_operand (rtx, enum machine_mode, int); +static rtx frv_int_to_acc (enum insn_code, int, rtx); +static enum machine_mode frv_matching_accg_mode (enum machine_mode); +static rtx frv_read_argument (tree *); +static int frv_check_constant_argument (enum insn_code, int, rtx); +static rtx frv_legitimize_target (enum insn_code, rtx); +static rtx frv_legitimize_argument (enum insn_code, int, rtx); +static rtx frv_expand_set_builtin (enum insn_code, tree, rtx); +static rtx frv_expand_unop_builtin (enum insn_code, tree, rtx); +static rtx frv_expand_binop_builtin (enum insn_code, tree, rtx); +static rtx frv_expand_cut_builtin (enum insn_code, tree, rtx); +static rtx frv_expand_binopimm_builtin (enum insn_code, tree, rtx); +static rtx frv_expand_voidbinop_builtin (enum insn_code, tree); +static rtx frv_expand_voidtriop_builtin (enum insn_code, tree); +static rtx frv_expand_voidaccop_builtin (enum insn_code, tree); +static rtx frv_expand_mclracc_builtin (tree); +static rtx frv_expand_mrdacc_builtin (enum insn_code, tree); +static rtx frv_expand_mwtacc_builtin (enum insn_code, tree); +static rtx frv_expand_noargs_builtin (enum insn_code); +static rtx frv_emit_comparison (enum rtx_code, rtx, rtx); +static int frv_clear_registers_used (rtx *, void *); +static void frv_ifcvt_add_insn (rtx, rtx, int); +static rtx frv_ifcvt_rewrite_mem (rtx, enum machine_mode, rtx); +static rtx frv_ifcvt_load_value (rtx, rtx); +static void frv_registers_update (rtx, unsigned char [], + int [], int *, int); +static int frv_registers_used_p (rtx, unsigned char [], int); +static int frv_registers_set_p (rtx, unsigned char [], int); +static int frv_issue_rate (void); +static int frv_use_dfa_pipeline_interface (void); +static void frv_pack_insns (void); +static void frv_function_prologue (FILE *, HOST_WIDE_INT); +static void frv_function_epilogue (FILE *, HOST_WIDE_INT); +static bool frv_assemble_integer (rtx, unsigned, int); +static void frv_init_builtins (void); +static rtx frv_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static void frv_init_libfuncs (void); +static bool frv_in_small_data_p (tree); static void frv_asm_output_mi_thunk - PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); -static bool frv_rtx_costs PARAMS ((rtx, int, int, int*)); -static void frv_asm_out_constructor PARAMS ((rtx, int)); -static void frv_asm_out_destructor PARAMS ((rtx, int)); + (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); +static bool frv_rtx_costs (rtx, int, int, int*); +static void frv_asm_out_constructor (rtx, int); +static void frv_asm_out_destructor (rtx, int); /* Initialize the GCC target structure. */ #undef TARGET_ASM_FUNCTION_PROLOGUE @@ -324,8 +303,7 @@ struct gcc_target targetm = TARGET_INITIALIZER; /* Given a CONST, return true if the symbol_ref points to small data. */ static FRV_INLINE int -const_small_data_p (x) - rtx x; +const_small_data_p (rtx x) { rtx x0, x1; @@ -347,9 +325,7 @@ const_small_data_p (x) /* Given a PLUS, return true if this is a small data reference. */ static FRV_INLINE int -plus_small_data_p (op0, op1) - rtx op0; - rtx op1; +plus_small_data_p (rtx op0, rtx op1) { if (GET_MODE (op0) == SImode && GET_CODE (op0) == REG @@ -367,7 +343,7 @@ plus_small_data_p (op0, op1) static int -frv_default_flags_for_cpu () +frv_default_flags_for_cpu (void) { switch (frv_cpu_type) { @@ -398,7 +374,7 @@ frv_default_flags_for_cpu () `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ void -frv_override_options () +frv_override_options (void) { int regno, i; @@ -620,9 +596,7 @@ frv_override_options () /* On the FRV, possibly disable VLIW packing which is done by the 2nd scheduling pass at the current time. */ void -frv_optimization_options (level, size) - int level; - int size ATTRIBUTE_UNUSED; +frv_optimization_options (int level, int size ATTRIBUTE_UNUSED) { if (level >= 2) { @@ -639,9 +613,7 @@ frv_optimization_options (level, size) /* Return true if NAME (a STRING_CST node) begins with PREFIX. */ static int -frv_string_begins_with (name, prefix) - tree name; - const char *prefix; +frv_string_begins_with (tree name, const char *prefix) { int prefix_len = strlen (prefix); @@ -671,7 +643,7 @@ frv_string_begins_with (name, prefix) target switches are opposed to them.) */ void -frv_conditional_register_usage () +frv_conditional_register_usage (void) { int i; @@ -878,7 +850,7 @@ frv_conditional_register_usage () */ frv_stack_t * -frv_stack_info () +frv_stack_info (void) { static frv_stack_t info, zero_info; frv_stack_t *info_ptr = &info; @@ -1206,8 +1178,7 @@ frv_stack_info () /* Print the information about the frv stack offsets, etc. when debugging. */ void -frv_debug_stack (info) - frv_stack_t *info; +frv_debug_stack (frv_stack_t *info) { int range; @@ -1273,7 +1244,7 @@ static int frv_insn_packing_flag; /* True if the current function contains a far jump. */ static int -frv_function_contains_far_jump () +frv_function_contains_far_jump (void) { rtx insn = get_insns (); while (insn != NULL @@ -1290,9 +1261,7 @@ frv_function_contains_far_jump () will return correctly. It also does the VLIW packing. */ static void -frv_function_prologue (file, size) - FILE *file; - HOST_WIDE_INT size ATTRIBUTE_UNUSED; +frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* If no frame was created, check whether the function uses a call instruction to implement a far jump. If so, save the link in gr3 and @@ -1339,12 +1308,12 @@ frv_function_prologue (file, size) /* Return the next available temporary register in a given class. */ static rtx -frv_alloc_temp_reg (info, class, mode, mark_as_used, no_abort) - frv_tmp_reg_t *info; /* which registers are available */ - enum reg_class class; /* register class desired */ - enum machine_mode mode; /* mode to allocate register with */ - int mark_as_used; /* register not available after allocation */ - int no_abort; /* return NULL instead of aborting */ +frv_alloc_temp_reg ( + frv_tmp_reg_t *info, /* which registers are available */ + enum reg_class class, /* register class desired */ + enum machine_mode mode, /* mode to allocate register with */ + int mark_as_used, /* register not available after allocation */ + int no_abort) /* return NULL instead of aborting */ { int regno = info->next_reg[ (int)class ]; int orig_regno = regno; @@ -1386,8 +1355,7 @@ frv_alloc_temp_reg (info, class, mode, mark_as_used, no_abort) The function returns a constant rtx if OFFSET is small enough, otherwise it loads the constant into register OFFSET_REGNO and returns that. */ static rtx -frv_frame_offset_rtx (offset) - int offset; +frv_frame_offset_rtx (int offset) { rtx offset_rtx = GEN_INT (offset); if (IN_RANGE_P (offset, -2048, 2047)) @@ -1409,10 +1377,7 @@ frv_frame_offset_rtx (offset) /* Generate (mem:MODE (plus:Pmode BASE (frv_frame_offset OFFSET)))). The prologue and epilogue uses such expressions to access the stack. */ static rtx -frv_frame_mem (mode, base, offset) - enum machine_mode mode; - rtx base; - int offset; +frv_frame_mem (enum machine_mode mode, rtx base, int offset) { return gen_rtx_MEM (mode, gen_rtx_PLUS (Pmode, base, @@ -1429,9 +1394,7 @@ frv_frame_mem (mode, base, offset) or SEQUENCE that has several sets, each set must be individually marked as frame-related. */ static rtx -frv_dwarf_store (reg, offset) - rtx reg; - int offset; +frv_dwarf_store (rtx reg, int offset) { rtx set = gen_rtx_SET (VOIDmode, gen_rtx_MEM (GET_MODE (reg), @@ -1448,9 +1411,7 @@ frv_dwarf_store (reg, offset) frame-related and has a REG_FRAME_RELATED_EXPR note containing DWARF_PATTERN. */ static void -frv_frame_insn (pattern, dwarf_pattern) - rtx pattern; - rtx dwarf_pattern; +frv_frame_insn (rtx pattern, rtx dwarf_pattern) { rtx insn = emit_insn (pattern); RTX_FRAME_RELATED_P (insn) = 1; @@ -1477,10 +1438,7 @@ frv_frame_insn (pattern, dwarf_pattern) The function takes care of the moves to and from SPRs, using TEMP_REGNO as a temporary in such cases. */ static void -frv_frame_access (accessor, reg, stack_offset) - frv_frame_accessor_t *accessor; - rtx reg; - int stack_offset; +frv_frame_access (frv_frame_accessor_t *accessor, rtx reg, int stack_offset) { enum machine_mode mode = GET_MODE (reg); rtx mem = frv_frame_mem (mode, @@ -1531,10 +1489,9 @@ frv_frame_access (accessor, reg, stack_offset) is the stack information generated by frv_stack_info, and REG_SET is the number of the register set to transfer. */ static void -frv_frame_access_multi (accessor, info, reg_set) - frv_frame_accessor_t *accessor; - frv_stack_t *info; - int reg_set; +frv_frame_access_multi (frv_frame_accessor_t *accessor, + frv_stack_t *info, + int reg_set) { frv_stack_regs_t *regs_info; int regno; @@ -1554,9 +1511,7 @@ frv_frame_access_multi (accessor, info, reg_set) them if OP is FRV_LOAD. INFO is the stack information generated by frv_stack_info. */ static void -frv_frame_access_standard_regs (op, info) - enum frv_stack_op op; - frv_stack_t *info; +frv_frame_access_standard_regs (enum frv_stack_op op, frv_stack_t *info) { frv_frame_accessor_t accessor; @@ -1579,7 +1534,7 @@ frv_frame_access_standard_regs (op, info) Also any insns generated here should have RTX_FRAME_RELATED_P(insn) = 1 so that the debug info generation code can handle them properly. */ void -frv_expand_prologue () +frv_expand_prologue (void) { frv_stack_t *info = frv_stack_info (); rtx sp = stack_pointer_rtx; @@ -1689,12 +1644,11 @@ frv_expand_prologue () /* Under frv, all of the work is done via frv_expand_epilogue, but - this function provides a convient place to do cleanup. */ + this function provides a convenient place to do cleanup. */ static void -frv_function_epilogue (file, size) - FILE *file ATTRIBUTE_UNUSED; - HOST_WIDE_INT size ATTRIBUTE_UNUSED; +frv_function_epilogue (FILE *file ATTRIBUTE_UNUSED, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) { frv_stack_cache = (frv_stack_t *)0; @@ -1719,8 +1673,7 @@ frv_function_epilogue (file, size) slots for arguments passed to the current function. */ void -frv_expand_epilogue (sibcall_p) - int sibcall_p; +frv_expand_epilogue (int sibcall_p) { frv_stack_t *info = frv_stack_info (); rtx fp = frame_pointer_rtx; @@ -1821,12 +1774,11 @@ frv_expand_epilogue (sibcall_p) varargs. */ static void -frv_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function) - FILE *file; - tree thunk_fndecl ATTRIBUTE_UNUSED; - HOST_WIDE_INT delta; - HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED; - tree function; +frv_asm_output_mi_thunk (FILE *file, + tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, + HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, + tree function) { const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0); const char *name_arg0 = reg_names[FIRST_ARG_REGNUM]; @@ -1909,7 +1861,7 @@ frv_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function) /* On frv, create a frame whenever we need to create stack */ int -frv_frame_pointer_required () +frv_frame_pointer_required (void) { if (! current_function_is_leaf) return TRUE; @@ -1943,9 +1895,7 @@ frv_frame_pointer_required () /* See frv_stack_info for more details on the frv stack frame. */ int -frv_initial_elimination_offset (from, to) - int from; - int to; +frv_initial_elimination_offset (int from, int to) { frv_stack_t *info = frv_stack_info (); int ret = 0; @@ -1954,7 +1904,7 @@ frv_initial_elimination_offset (from, to) ret = info->total_size - info->pretend_size; else if (to == STACK_POINTER_REGNUM && from == FRAME_POINTER_REGNUM) - ret = - info->reg_offset[FRAME_POINTER_REGNUM]; + ret = info->reg_offset[FRAME_POINTER_REGNUM]; else if (to == FRAME_POINTER_REGNUM && from == ARG_POINTER_REGNUM) ret = (info->total_size @@ -2002,12 +1952,11 @@ frv_initial_elimination_offset (from, to) this case. */ void -frv_setup_incoming_varargs (cum, mode, type, pretend_size, second_time) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int *pretend_size; - int second_time; +frv_setup_incoming_varargs (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + int *pretend_size, + int second_time) { if (TARGET_DEBUG_ARG) fprintf (stderr, @@ -2026,7 +1975,7 @@ frv_setup_incoming_varargs (cum, mode, type, pretend_size, second_time) the library function `__builtin_saveregs'. */ rtx -frv_expand_builtin_saveregs () +frv_expand_builtin_saveregs (void) { int offset = UNITS_PER_WORD * FRV_NUM_ARG_REGS; @@ -2041,9 +1990,7 @@ frv_expand_builtin_saveregs () /* Expand __builtin_va_start to do the va_start macro. */ void -frv_expand_builtin_va_start (valist, nextarg) - tree valist; - rtx nextarg; +frv_expand_builtin_va_start (tree valist, rtx nextarg) { tree t; int num = cfun->args_info - FIRST_ARG_REGNUM - FRV_NUM_ARG_REGS; @@ -2070,9 +2017,7 @@ frv_expand_builtin_va_start (valist, nextarg) /* Expand __builtin_va_arg to do the va_arg macro. */ rtx -frv_expand_builtin_va_arg(valist, type) - tree valist; - tree type; +frv_expand_builtin_va_arg (tree valist, tree type) { rtx addr; rtx mem; @@ -2117,8 +2062,7 @@ frv_expand_builtin_va_arg(valist, type) #endif int -frv_expand_block_move (operands) - rtx operands[]; +frv_expand_block_move (rtx operands[]) { rtx orig_dest = operands[0]; rtx orig_src = operands[1]; @@ -2218,8 +2162,7 @@ frv_expand_block_move (operands) operands[2] is the alignment */ int -frv_expand_block_clear (operands) - rtx operands[]; +frv_expand_block_clear (rtx operands[]) { rtx orig_dest = operands[0]; rtx bytes_rtx = operands[1]; @@ -2291,9 +2234,7 @@ static rtx *frv_insn_operands; if it is necessary. */ const char * -frv_asm_output_opcode (f, ptr) - FILE *f; - const char *ptr; +frv_asm_output_opcode (FILE *f, const char *ptr) { int c; @@ -2328,10 +2269,7 @@ frv_asm_output_opcode (f, ptr) insns. */ void -frv_final_prescan_insn (insn, opvec, noperands) - rtx insn; - rtx *opvec; - int noperands ATTRIBUTE_UNUSED; +frv_final_prescan_insn (rtx insn, rtx *opvec, int noperands ATTRIBUTE_UNUSED) { if (! PACKING_FLAG_USED_P()) return; @@ -2362,7 +2300,7 @@ frv_final_prescan_insn (insn, opvec, noperands) /* Set frv_insn_packing_flag to FALSE if the next instruction should be packed with this one. Set it to TRUE otherwise. If the next - instruction is an asm insntruction, this statement will set the + instruction is an asm instruction, this statement will set the flag to TRUE, and that value will still hold when the asm operands themselves are printed. */ frv_insn_packing_flag = ! (insn && INSN_P (insn) @@ -2381,8 +2319,7 @@ frv_final_prescan_insn (insn, opvec, noperands) /* The default is correct, but we need to make sure the frame gets created. */ rtx -frv_dynamic_chain_address (frame) - rtx frame; +frv_dynamic_chain_address (rtx frame) { cfun->machine->frame_needed = 1; return frame; @@ -2400,9 +2337,7 @@ frv_dynamic_chain_address (frame) address of other frames. */ rtx -frv_return_addr_rtx (count, frame) - int count ATTRIBUTE_UNUSED; - rtx frame; +frv_return_addr_rtx (int count ATTRIBUTE_UNUSED, rtx frame) { cfun->machine->frame_needed = 1; return gen_rtx_MEM (Pmode, plus_constant (frame, 8)); @@ -2417,10 +2352,7 @@ frv_return_addr_rtx (count, frame) GO_IF_LEGITIMATE_ADDRESS forbids register+register addresses, which this function cannot handle. */ rtx -frv_index_memory (memref, mode, index) - rtx memref; - enum machine_mode mode; - int index; +frv_index_memory (rtx memref, enum machine_mode mode, int index) { rtx base = XEXP (memref, 0); if (GET_CODE (base) == PRE_MODIFY) @@ -2432,9 +2364,7 @@ frv_index_memory (memref, mode, index) /* Print a memory address as an operand to reference that memory location. */ void -frv_print_operand_address (stream, x) - FILE * stream; - rtx x; +frv_print_operand_address (FILE * stream, rtx x) { if (GET_CODE (x) == MEM) x = XEXP (x, 0); @@ -2467,9 +2397,7 @@ frv_print_operand_address (stream, x) static void -frv_print_operand_memory_reference_reg (stream, x) - FILE *stream; - rtx x; +frv_print_operand_memory_reference_reg (FILE * stream, rtx x) { int regno = true_regnum (x); if (GPR_P (regno)) @@ -2481,10 +2409,7 @@ frv_print_operand_memory_reference_reg (stream, x) /* Print a memory reference suitable for the ld/st instructions. */ static void -frv_print_operand_memory_reference (stream, x, addr_offset) - FILE *stream; - rtx x; - int addr_offset; +frv_print_operand_memory_reference (FILE * stream, rtx x, int addr_offset) { rtx x0 = NULL_RTX; rtx x1 = NULL_RTX; @@ -2594,8 +2519,7 @@ frv_print_operand_memory_reference (stream, x, addr_offset) #define FRV_JUMP_NOT_LIKELY 0 static int -frv_print_operand_jump_hint (insn) - rtx insn; +frv_print_operand_jump_hint (rtx insn) { rtx note; rtx labelref; @@ -2692,10 +2616,7 @@ frv_print_operand_jump_hint (insn) are valid with the `PRINT_OPERAND_PUNCT_VALID_P' macro. */ void -frv_print_operand (file, x, code) - FILE * file; - rtx x; - int code; +frv_print_operand (FILE * file, rtx x, int code) { HOST_WIDE_INT value; int offset; @@ -3022,12 +2943,11 @@ frv_print_operand (file, x, code) FNTYPE is nonzero, but never both of them at once. */ void -frv_init_cumulative_args (cum, fntype, libname, fndecl, incoming) - CUMULATIVE_ARGS *cum; - tree fntype; - rtx libname; - tree fndecl; - int incoming; +frv_init_cumulative_args (CUMULATIVE_ARGS *cum, + tree fntype, + rtx libname, + tree fndecl, + int incoming) { *cum = FIRST_ARG_REGNUM; @@ -3063,9 +2983,8 @@ frv_init_cumulative_args (cum, fntype, libname, fndecl, incoming) `PARM_BOUNDARY' is used for all arguments. */ int -frv_function_arg_boundary (mode, type) - enum machine_mode mode ATTRIBUTE_UNUSED; - tree type ATTRIBUTE_UNUSED; +frv_function_arg_boundary (enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED) { return BITS_PER_WORD; } @@ -3102,12 +3021,11 @@ frv_function_arg_boundary (mode, type) stack and then loaded into a register. */ rtx -frv_function_arg (cum, mode, type, named, incoming) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int named; - int incoming ATTRIBUTE_UNUSED; +frv_function_arg (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + int named, + int incoming ATTRIBUTE_UNUSED) { enum machine_mode xmode = (mode == BLKmode) ? SImode : mode; int arg_num = *cum; @@ -3152,11 +3070,10 @@ frv_function_arg (cum, mode, type, named, incoming) for arguments without any special help. */ void -frv_function_arg_advance (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int named; +frv_function_arg_advance (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + int named) { enum machine_mode xmode = (mode == BLKmode) ? SImode : mode; int bytes = GET_MODE_SIZE (xmode); @@ -3189,11 +3106,10 @@ frv_function_arg_advance (cum, mode, type, named) the called function. */ int -frv_function_arg_partial_nregs (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int named ATTRIBUTE_UNUSED; +frv_function_arg_partial_nregs (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + int named ATTRIBUTE_UNUSED) { enum machine_mode xmode = (mode == BLKmode) ? SImode : mode; int bytes = GET_MODE_SIZE (xmode); @@ -3226,11 +3142,10 @@ frv_function_arg_partial_nregs (cum, mode, type, named) MUST_PASS_IN_STACK (MODE, TYPE) */ int -frv_function_arg_pass_by_reference (cum, mode, type, named) - CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED; - enum machine_mode mode; - tree type; - int named ATTRIBUTE_UNUSED; +frv_function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode, + tree type, + int named ATTRIBUTE_UNUSED) { return MUST_PASS_IN_STACK (mode, type); } @@ -3245,11 +3160,10 @@ frv_function_arg_pass_by_reference (cum, mode, type, named) otherwise a copy must be made. */ int -frv_function_arg_callee_copies (cum, mode, type, named) - CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; - tree type ATTRIBUTE_UNUSED; - int named ATTRIBUTE_UNUSED; +frv_function_arg_callee_copies (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + int named ATTRIBUTE_UNUSED) { return 0; } @@ -3259,11 +3173,10 @@ frv_function_arg_callee_copies (cum, mode, type, named) copying it to a pseudo register. */ int -frv_function_arg_keep_as_reference (cum, mode, type, named) - CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; - tree type ATTRIBUTE_UNUSED; - int named ATTRIBUTE_UNUSED; +frv_function_arg_keep_as_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + int named ATTRIBUTE_UNUSED) { return 0; } @@ -3272,9 +3185,7 @@ frv_function_arg_keep_as_reference (cum, mode, type, named) /* Return true if a register is ok to use as a base or index register. */ static FRV_INLINE int -frv_regno_ok_for_base_p (regno, strict_p) - int regno; - int strict_p; +frv_regno_ok_for_base_p (int regno, int strict_p) { if (GPR_P (regno)) return TRUE; @@ -3346,11 +3257,10 @@ frv_regno_ok_for_base_p (regno, strict_p) `PRINT_OPERAND_ADDRESS'. */ int -frv_legitimate_address_p (mode, x, strict_p, condexec_p) - enum machine_mode mode; - rtx x; - int strict_p; - int condexec_p; +frv_legitimate_address_p (enum machine_mode mode, + rtx x, + int strict_p, + int condexec_p) { rtx x0, x1; int ret = 0; @@ -3503,10 +3413,9 @@ frv_legitimate_address_p (mode, x, strict_p, condexec_p) can generate better code. */ rtx -frv_legitimize_address (x, oldx, mode) - rtx x; - rtx oldx ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; +frv_legitimize_address (rtx x, + rtx oldx ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED) { rtx ret = NULL_RTX; @@ -3537,10 +3446,7 @@ frv_legitimize_address (x, oldx, mode) the operand is used by a predicated instruction. */ static int -frv_legitimate_memory_operand (op, mode, condexec_p) - rtx op; - enum machine_mode mode; - int condexec_p; +frv_legitimate_memory_operand (rtx op, enum machine_mode mode, int condexec_p) { return ((GET_MODE (op) == mode || mode == VOIDmode) && GET_CODE (op) == MEM @@ -3552,9 +3458,8 @@ frv_legitimate_memory_operand (op, mode, condexec_p) /* Return 1 is OP is a memory operand, or will be turned into one by reload. */ -int frv_load_operand (op, mode) - rtx op; - enum machine_mode mode; +int +frv_load_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; @@ -3575,9 +3480,8 @@ int frv_load_operand (op, mode) /* Return 1 if operand is a GPR register or a FPR register. */ -int gpr_or_fpr_operand (op, mode) - rtx op; - enum machine_mode mode; +int +gpr_or_fpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -3604,9 +3508,8 @@ int gpr_or_fpr_operand (op, mode) /* Return 1 if operand is a GPR register or 12 bit signed immediate. */ -int gpr_or_int12_operand (op, mode) - rtx op; - enum machine_mode mode; +int +gpr_or_int12_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == CONST_INT) return IN_RANGE_P (INTVAL (op), -2048, 2047); @@ -3631,9 +3534,8 @@ int gpr_or_int12_operand (op, mode) /* Return 1 if operand is a GPR register, or a FPR register, or a 12 bit signed immediate. */ -int gpr_fpr_or_int12_operand (op, mode) - rtx op; - enum machine_mode mode; +int +gpr_fpr_or_int12_operand (rtx op, enum machine_mode mode) { int regno; @@ -3663,9 +3565,8 @@ int gpr_fpr_or_int12_operand (op, mode) /* Return 1 if operand is a register or 6 bit signed immediate. */ -int fpr_or_int6_operand (op, mode) - rtx op; - enum machine_mode mode; +int +fpr_or_int6_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == CONST_INT) return IN_RANGE_P (INTVAL (op), -32, 31); @@ -3689,9 +3590,8 @@ int fpr_or_int6_operand (op, mode) /* Return 1 if operand is a register or 10 bit signed immediate. */ -int gpr_or_int10_operand (op, mode) - rtx op; - enum machine_mode mode; +int +gpr_or_int10_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == CONST_INT) return IN_RANGE_P (INTVAL (op), -512, 511); @@ -3715,9 +3615,8 @@ int gpr_or_int10_operand (op, mode) /* Return 1 if operand is a register or an integer immediate. */ -int gpr_or_int_operand (op, mode) - rtx op; - enum machine_mode mode; +int +gpr_or_int_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == CONST_INT) return TRUE; @@ -3741,9 +3640,8 @@ int gpr_or_int_operand (op, mode) /* Return 1 if operand is a 12 bit signed immediate. */ -int int12_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +int12_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return FALSE; @@ -3753,9 +3651,8 @@ int int12_operand (op, mode) /* Return 1 if operand is a 6 bit signed immediate. */ -int int6_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +int6_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return FALSE; @@ -3765,36 +3662,32 @@ int int6_operand (op, mode) /* Return 1 if operand is a 5 bit signed immediate. */ -int int5_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), -16, 15); } /* Return 1 if operand is a 5 bit unsigned immediate. */ -int uint5_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +uint5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 31); } /* Return 1 if operand is a 4 bit unsigned immediate. */ -int uint4_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +uint4_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 15); } /* Return 1 if operand is a 1 bit unsigned immediate (0 or 1). */ -int uint1_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +uint1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 1); } @@ -3802,9 +3695,8 @@ int uint1_operand (op, mode) /* Return 1 if operand is an integer constant that takes 2 instructions to load up and can be split into sethi/setlo instructions.. */ -int int_2word_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +int_2word_operand(rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { HOST_WIDE_INT value; REAL_VALUE_TYPE rv; @@ -3850,9 +3742,7 @@ int int_2word_operand (op, mode) /* Return 1 if operand is the pic address register. */ int -pic_register_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +pic_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (! flag_pic) return FALSE; @@ -3867,11 +3757,10 @@ pic_register_operand (op, mode) } /* Return 1 if operand is a symbolic reference when a PIC option is specified - that takes 3 seperate instructions to form. */ + that takes 3 separate instructions to form. */ -int pic_symbolic_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +pic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (! flag_pic) return FALSE; @@ -3898,9 +3787,7 @@ int pic_symbolic_operand (op, mode) /* Return 1 if operand is the small data register. */ int -small_data_register_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +small_data_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != REG) return FALSE; @@ -3914,9 +3801,8 @@ small_data_register_operand (op, mode) /* Return 1 if operand is a symbolic reference to a small data area static or global object. */ -int small_data_symbolic_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +small_data_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -3935,9 +3821,8 @@ int small_data_symbolic_operand (op, mode) /* Return 1 if operand is a 16 bit unsigned immediate */ -int uint16_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +uint16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return FALSE; @@ -3947,9 +3832,8 @@ int uint16_operand (op, mode) /* Return 1 if operand is an integer constant with the bottom 16 bits clear */ -int upper_int16_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int +upper_int16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return FALSE; @@ -3960,9 +3844,7 @@ int upper_int16_operand (op, mode) /* Return true if operand is a GPR register. */ int -integer_register_operand (op, mode) - rtx op; - enum machine_mode mode; +integer_register_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; @@ -3985,9 +3867,7 @@ integer_register_operand (op, mode) here, in order to prevent a combine bug. */ int -gpr_no_subreg_operand (op, mode) - rtx op; - enum machine_mode mode; +gpr_no_subreg_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; @@ -4001,9 +3881,7 @@ gpr_no_subreg_operand (op, mode) /* Return true if operand is a FPR register. */ int -fpr_operand (op, mode) - rtx op; - enum machine_mode mode; +fpr_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; @@ -4025,9 +3903,7 @@ fpr_operand (op, mode) /* Return true if operand is an even GPR or FPR register. */ int -even_reg_operand (op, mode) - rtx op; - enum machine_mode mode; +even_reg_operand (rtx op, enum machine_mode mode) { int regno; @@ -4061,9 +3937,7 @@ even_reg_operand (op, mode) /* Return true if operand is an odd GPR register. */ int -odd_reg_operand (op, mode) - rtx op; - enum machine_mode mode; +odd_reg_operand (rtx op, enum machine_mode mode) { int regno; @@ -4098,9 +3972,7 @@ odd_reg_operand (op, mode) /* Return true if operand is an even GPR register. */ int -even_gpr_operand (op, mode) - rtx op; - enum machine_mode mode; +even_gpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4131,9 +4003,7 @@ even_gpr_operand (op, mode) /* Return true if operand is an odd GPR register. */ int -odd_gpr_operand (op, mode) - rtx op; - enum machine_mode mode; +odd_gpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4165,9 +4035,7 @@ odd_gpr_operand (op, mode) /* Return true if operand is a quad aligned FPR register. */ int -quad_fpr_operand (op, mode) - rtx op; - enum machine_mode mode; +quad_fpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4198,9 +4066,7 @@ quad_fpr_operand (op, mode) /* Return true if operand is an even FPR register. */ int -even_fpr_operand (op, mode) - rtx op; - enum machine_mode mode; +even_fpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4231,9 +4097,7 @@ even_fpr_operand (op, mode) /* Return true if operand is an odd FPR register. */ int -odd_fpr_operand (op, mode) - rtx op; - enum machine_mode mode; +odd_fpr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4270,9 +4134,7 @@ odd_fpr_operand (op, mode) the stack and the address taken and passed through to another function. */ int -dbl_memory_one_insn_operand (op, mode) - rtx op; - enum machine_mode mode; +dbl_memory_one_insn_operand (rtx op, enum machine_mode mode) { rtx addr; rtx addr_reg; @@ -4323,9 +4185,7 @@ dbl_memory_one_insn_operand (op, mode) use two instructions to load or store. */ int -dbl_memory_two_insn_operand (op, mode) - rtx op; - enum machine_mode mode; +dbl_memory_two_insn_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != MEM) return FALSE; @@ -4343,9 +4203,7 @@ dbl_memory_two_insn_operand (op, mode) operation. */ int -move_destination_operand (op, mode) - rtx op; - enum machine_mode mode; +move_destination_operand (rtx op, enum machine_mode mode) { rtx subreg; enum rtx_code code; @@ -4387,9 +4245,7 @@ move_destination_operand (op, mode) operation. */ int -move_source_operand (op, mode) - rtx op; - enum machine_mode mode; +move_source_operand (rtx op, enum machine_mode mode) { rtx subreg; enum rtx_code code; @@ -4438,9 +4294,7 @@ move_source_operand (op, mode) move operation. */ int -condexec_dest_operand (op, mode) - rtx op; - enum machine_mode mode; +condexec_dest_operand (rtx op, enum machine_mode mode) { rtx subreg; enum rtx_code code; @@ -4482,9 +4336,7 @@ condexec_dest_operand (op, mode) move operation. */ int -condexec_source_operand (op, mode) - rtx op; - enum machine_mode mode; +condexec_source_operand (rtx op, enum machine_mode mode) { rtx subreg; enum rtx_code code; @@ -4530,9 +4382,7 @@ condexec_source_operand (op, mode) appropriate type. */ int -reg_or_0_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_0_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -4557,9 +4407,7 @@ reg_or_0_operand (op, mode) /* Return true if operand is the link register */ int -lr_operand (op, mode) - rtx op; - enum machine_mode mode; +lr_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != REG) return FALSE; @@ -4576,9 +4424,7 @@ lr_operand (op, mode) /* Return true if operand is a gpr register or a valid memory operation. */ int -gpr_or_memory_operand (op, mode) - rtx op; - enum machine_mode mode; +gpr_or_memory_operand (rtx op, enum machine_mode mode) { return (integer_register_operand (op, mode) || frv_legitimate_memory_operand (op, mode, FALSE)); @@ -4587,9 +4433,7 @@ gpr_or_memory_operand (op, mode) /* Return true if operand is a fpr register or a valid memory operation. */ int -fpr_or_memory_operand (op, mode) - rtx op; - enum machine_mode mode; +fpr_or_memory_operand (rtx op, enum machine_mode mode) { return (fpr_operand (op, mode) || frv_legitimate_memory_operand (op, mode, FALSE)); @@ -4598,9 +4442,7 @@ fpr_or_memory_operand (op, mode) /* Return true if operand is an icc register */ int -icc_operand (op, mode) - rtx op; - enum machine_mode mode; +icc_operand (rtx op, enum machine_mode mode) { int regno; @@ -4617,9 +4459,7 @@ icc_operand (op, mode) /* Return true if operand is an fcc register */ int -fcc_operand (op, mode) - rtx op; - enum machine_mode mode; +fcc_operand (rtx op, enum machine_mode mode) { int regno; @@ -4636,9 +4476,7 @@ fcc_operand (op, mode) /* Return true if operand is either an fcc or icc register */ int -cc_operand (op, mode) - rtx op; - enum machine_mode mode; +cc_operand (rtx op, enum machine_mode mode) { int regno; @@ -4658,9 +4496,7 @@ cc_operand (op, mode) /* Return true if operand is an integer CCR register */ int -icr_operand (op, mode) - rtx op; - enum machine_mode mode; +icr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4677,9 +4513,7 @@ icr_operand (op, mode) /* Return true if operand is an fcc register */ int -fcr_operand (op, mode) - rtx op; - enum machine_mode mode; +fcr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4696,9 +4530,7 @@ fcr_operand (op, mode) /* Return true if operand is either an fcc or icc register */ int -cr_operand (op, mode) - rtx op; - enum machine_mode mode; +cr_operand (rtx op, enum machine_mode mode) { int regno; @@ -4718,9 +4550,7 @@ cr_operand (op, mode) /* Return true if operand is a memory reference suitable for a call. */ int -call_operand (op, mode) - rtx op; - enum machine_mode mode; +call_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT) return FALSE; @@ -4738,9 +4568,7 @@ call_operand (op, mode) /* Return true if operator is a kind of relational operator. */ int -relational_operator (op, mode) - rtx op; - enum machine_mode mode; +relational_operator (rtx op, enum machine_mode mode) { rtx op0; rtx op1; @@ -4798,9 +4626,7 @@ relational_operator (op, mode) /* Return true if operator is a signed integer relational operator */ int -signed_relational_operator (op, mode) - rtx op; - enum machine_mode mode; +signed_relational_operator (rtx op, enum machine_mode mode) { rtx op0; rtx op1; @@ -4844,9 +4670,7 @@ signed_relational_operator (op, mode) /* Return true if operator is a signed integer relational operator */ int -unsigned_relational_operator (op, mode) - rtx op; - enum machine_mode mode; +unsigned_relational_operator (rtx op, enum machine_mode mode) { rtx op0; rtx op1; @@ -4888,9 +4712,7 @@ unsigned_relational_operator (op, mode) /* Return true if operator is a floating point relational operator */ int -float_relational_operator (op, mode) - rtx op; - enum machine_mode mode; +float_relational_operator (rtx op, enum machine_mode mode) { rtx op0; rtx op1; @@ -4938,9 +4760,7 @@ float_relational_operator (op, mode) /* Return true if operator is EQ/NE of a conditional execution register. */ int -ccr_eqne_operator (op, mode) - rtx op; - enum machine_mode mode; +ccr_eqne_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); rtx op0; @@ -4979,9 +4799,7 @@ ccr_eqne_operator (op, mode) unsigned). */ int -minmax_operator (op, mode) - rtx op; - enum machine_mode mode; +minmax_operator (rtx op, enum machine_mode mode) { if (mode != VOIDmode && mode != GET_MODE (op)) return FALSE; @@ -5011,9 +4829,7 @@ minmax_operator (op, mode) conditionally and takes 1 cycle. */ int -condexec_si_binary_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_si_binary_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5041,9 +4857,7 @@ condexec_si_binary_operator (op, mode) executed conditionally by a media instruction. */ int -condexec_si_media_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_si_media_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5066,9 +4880,7 @@ condexec_si_media_operator (op, mode) conditionally. */ int -condexec_si_divide_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_si_divide_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5090,9 +4902,7 @@ condexec_si_divide_operator (op, mode) conditionally. */ int -condexec_si_unary_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_si_unary_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5114,9 +4924,7 @@ condexec_si_unary_operator (op, mode) evaluated conditionally by floating-point instructions. */ int -condexec_sf_conv_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_sf_conv_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5139,9 +4947,7 @@ condexec_sf_conv_operator (op, mode) instructions. */ int -condexec_sf_add_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_sf_add_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5163,9 +4969,7 @@ condexec_sf_add_operator (op, mode) executed. */ int -condexec_memory_operand (op, mode) - rtx op; - enum machine_mode mode; +condexec_memory_operand (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); rtx addr; @@ -5202,9 +5006,7 @@ condexec_memory_operand (op, mode) register. */ int -intop_compare_operator (op, mode) - rtx op; - enum machine_mode mode; +intop_compare_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5237,9 +5039,7 @@ intop_compare_operator (op, mode) with a setcc operation inside of a conditional execution. */ int -condexec_intop_cmp_operator (op, mode) - rtx op; - enum machine_mode mode; +condexec_intop_cmp_operator (rtx op, enum machine_mode mode) { enum machine_mode op_mode = GET_MODE (op); @@ -5271,9 +5071,7 @@ condexec_intop_cmp_operator (op, mode) /* Return 1 if operand is a valid ACC register number */ int -acc_operand (op, mode) - rtx op; - enum machine_mode mode; +acc_operand (rtx op, enum machine_mode mode) { int regno; @@ -5298,9 +5096,7 @@ acc_operand (op, mode) /* Return 1 if operand is a valid even ACC register number */ int -even_acc_operand (op, mode) - rtx op; - enum machine_mode mode; +even_acc_operand (rtx op, enum machine_mode mode) { int regno; @@ -5325,9 +5121,7 @@ even_acc_operand (op, mode) /* Return 1 if operand is zero or four */ int -quad_acc_operand (op, mode) - rtx op; - enum machine_mode mode; +quad_acc_operand (rtx op, enum machine_mode mode) { int regno; @@ -5352,9 +5146,7 @@ quad_acc_operand (op, mode) /* Return 1 if operand is a valid ACCG register number */ int -accg_operand (op, mode) - rtx op; - enum machine_mode mode; +accg_operand (rtx op, enum machine_mode mode) { if (GET_MODE (op) != mode && mode != VOIDmode) return FALSE; @@ -5378,7 +5170,7 @@ accg_operand (op, mode) epilog code. For frv, we only do it if there was no stack allocation. */ int -direct_return_p () +direct_return_p (void) { frv_stack_t *info; @@ -5395,9 +5187,7 @@ direct_return_p () instructions are emitted. */ int -frv_emit_movsi (dest, src) - rtx dest; - rtx src; +frv_emit_movsi (rtx dest, rtx src) { int base_regno = -1; @@ -5468,9 +5258,7 @@ frv_emit_movsi (dest, src) /* Return a string to output a single word move. */ const char * -output_move_single (operands, insn) - rtx operands[]; - rtx insn; +output_move_single (rtx operands[], rtx insn) { rtx dest = operands[0]; rtx src = operands[1]; @@ -5688,9 +5476,7 @@ output_move_single (operands, insn) /* Return a string to output a double word move. */ const char * -output_move_double (operands, insn) - rtx operands[]; - rtx insn; +output_move_double (rtx operands[], rtx insn) { rtx dest = operands[0]; rtx src = operands[1]; @@ -5821,9 +5607,7 @@ output_move_double (operands, insn) Operand3 -- source */ const char * -output_condmove_single (operands, insn) - rtx operands[]; - rtx insn; +output_condmove_single (rtx operands[], rtx insn) { rtx dest = operands[2]; rtx src = operands[3]; @@ -5962,10 +5746,7 @@ output_condmove_single (operands, insn) comparison was done it. */ static rtx -frv_emit_comparison (test, op0, op1) - enum rtx_code test; - rtx op0; - rtx op1; +frv_emit_comparison (enum rtx_code test, rtx op0, rtx op1) { enum machine_mode cc_mode; rtx cc_reg; @@ -5996,9 +5777,7 @@ frv_emit_comparison (test, op0, op1) conditional execution, but that confuses the rest of the compiler. */ int -frv_emit_cond_branch (test, label) - enum rtx_code test; - rtx label; +frv_emit_cond_branch (enum rtx_code test, rtx label) { rtx test_rtx; rtx label_ref; @@ -6023,9 +5802,7 @@ frv_emit_cond_branch (test, label) operands were previously stored in frv_compare_op0 and frv_compare_op1. */ int -frv_emit_scc (test, target) - enum rtx_code test; - rtx target; +frv_emit_scc (enum rtx_code test, rtx target) { rtx set; rtx test_rtx; @@ -6053,15 +5830,10 @@ frv_emit_scc (test, target) /* Split a SCC instruction into component parts, returning a SEQUENCE to hold - the seperate insns. */ + the separate insns. */ rtx -frv_split_scc (dest, test, cc_reg, cr_reg, value) - rtx dest; - rtx test; - rtx cc_reg; - rtx cr_reg; - HOST_WIDE_INT value; +frv_split_scc (rtx dest, rtx test, rtx cc_reg, rtx cr_reg, HOST_WIDE_INT value) { rtx ret; @@ -6096,11 +5868,7 @@ frv_split_scc (dest, test, cc_reg, cr_reg, value) move. */ int -frv_emit_cond_move (dest, test_rtx, src1, src2) - rtx dest; - rtx test_rtx; - rtx src1; - rtx src2; +frv_emit_cond_move (rtx dest, rtx test_rtx, rtx src1, rtx src2) { rtx set; rtx clobber_cc; @@ -6173,12 +5941,11 @@ frv_emit_cond_move (dest, test_rtx, src1, src2) } -/* Split a conditonal move into constituent parts, returning a SEQUENCE +/* Split a conditional move into constituent parts, returning a SEQUENCE containing all of the insns. */ rtx -frv_split_cond_move (operands) - rtx operands[]; +frv_split_cond_move (rtx operands[]) { rtx dest = operands[0]; rtx test = operands[1]; @@ -6273,9 +6040,7 @@ frv_split_cond_move (operands) /* Split (set DEST SOURCE), where DEST is a double register and SOURCE is a memory location that is not known to be dword-aligned. */ void -frv_split_double_load (dest, source) - rtx dest; - rtx source; +frv_split_double_load (rtx dest, rtx source) { int regno = REGNO (dest); rtx dest1 = gen_highpart (SImode, dest); @@ -6311,9 +6076,7 @@ frv_split_double_load (dest, source) /* Split (set DEST SOURCE), where DEST refers to a dword memory location and SOURCE is either a double register or the constant zero. */ void -frv_split_double_store (dest, source) - rtx dest; - rtx source; +frv_split_double_store (rtx dest, rtx source) { rtx dest1 = change_address (dest, SImode, NULL); rtx dest2 = frv_index_memory (dest, SImode, 1); @@ -6334,8 +6097,7 @@ frv_split_double_store (dest, source) insns. */ rtx -frv_split_minmax (operands) - rtx operands[]; +frv_split_minmax (rtx operands[]) { rtx dest = operands[0]; rtx minmax = operands[1]; @@ -6415,8 +6177,7 @@ frv_split_minmax (operands) insns. */ rtx -frv_split_abs (operands) - rtx operands[]; +frv_split_abs (rtx operands[]) { rtx dest = operands[0]; rtx src = operands[1]; @@ -6458,9 +6219,7 @@ frv_split_abs (operands) register used in an insn. */ static int -frv_clear_registers_used (ptr, data) - rtx *ptr; - void *data; +frv_clear_registers_used (rtx *ptr, void *data) { if (GET_CODE (*ptr) == REG) { @@ -6488,8 +6247,7 @@ frv_clear_registers_used (ptr, data) /* On the FR-V, we don't have any extra fields per se, but it is useful hook to initialize the static storage. */ void -frv_ifcvt_init_extra_fields (ce_info) - ce_if_block_t *ce_info ATTRIBUTE_UNUSED; +frv_ifcvt_init_extra_fields (ce_if_block_t *ce_info ATTRIBUTE_UNUSED) { frv_ifcvt.added_insns_list = NULL_RTX; frv_ifcvt.cur_scratch_regs = 0; @@ -6506,10 +6264,7 @@ frv_ifcvt_init_extra_fields (ce_info) if the conditional execution conversion is successful. */ static void -frv_ifcvt_add_insn (pattern, insn, before_p) - rtx pattern; - rtx insn; - int before_p; +frv_ifcvt_add_insn (rtx pattern, rtx insn, int before_p) { rtx link = alloc_EXPR_LIST (VOIDmode, pattern, insn); @@ -6536,10 +6291,7 @@ frv_ifcvt_add_insn (pattern, insn, before_p) tests cannot be converted. */ void -frv_ifcvt_modify_tests (ce_info, p_true, p_false) - ce_if_block_t *ce_info; - rtx *p_true; - rtx *p_false; +frv_ifcvt_modify_tests (ce_if_block_t *ce_info, rtx *p_true, rtx *p_false) { basic_block test_bb = ce_info->test_bb; /* test basic block */ basic_block then_bb = ce_info->then_bb; /* THEN */ @@ -6650,16 +6402,16 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false) /* Scan all of the blocks for registers that must not be allocated. */ for (j = 0; j < num_bb; j++) { - rtx last_insn = bb[j]->end; - rtx insn = bb[j]->head; + rtx last_insn = BB_END (bb[j]); + rtx insn = BB_HEAD (bb[j]); int regno; if (rtl_dump_file) fprintf (rtl_dump_file, "Scanning %s block %d, start %d, end %d\n", (bb[j] == else_bb) ? "else" : ((bb[j] == then_bb) ? "then" : "test"), (int) bb[j]->index, - (int) INSN_UID (bb[j]->head), - (int) INSN_UID (bb[j]->end)); + (int) INSN_UID (BB_HEAD (bb[j])), + (int) INSN_UID (BB_END (bb[j]))); /* Anything live at the beginning of the block is obviously unavailable for allocation. */ @@ -6859,7 +6611,7 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false) gen_rtx_fmt_ee (code, CC_CCRmode, cc, const0_rtx)); /* Record the check insn to be inserted later. */ - frv_ifcvt_add_insn (check_insn, test_bb->end, TRUE); + frv_ifcvt_add_insn (check_insn, BB_END (test_bb), TRUE); /* Update the tests. */ frv_ifcvt.cr_reg = cr; @@ -6893,11 +6645,10 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false) (const_int 0))) */ void -frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false) - ce_if_block_t *ce_info; - basic_block bb; - rtx *p_true; - rtx *p_false; +frv_ifcvt_modify_multiple_tests (ce_if_block_t *ce_info, + basic_block bb, + rtx *p_true, + rtx *p_false) { rtx old_true = XEXP (*p_true, 0); rtx old_false = XEXP (*p_false, 0); @@ -6978,7 +6729,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false) /* First add the andcr/andncr/orcr/orncr, which will be added after the conditional check instruction, due to frv_ifcvt_add_insn being a LIFO stack. */ - frv_ifcvt_add_insn ((*logical_func) (cr, cr, new_cr), bb->end, TRUE); + frv_ifcvt_add_insn ((*logical_func) (cr, cr, new_cr), BB_END (bb), TRUE); /* Now add the conditional check insn. */ cc = XEXP (test_expr, 0); @@ -6989,7 +6740,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false) /* add the new check insn to the list of check insns that need to be inserted. */ - frv_ifcvt_add_insn (check_insn, bb->end, TRUE); + frv_ifcvt_add_insn (check_insn, BB_END (bb), TRUE); if (TARGET_DEBUG_COND_EXEC) { @@ -7026,9 +6777,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false) that use constants to ones that just use registers. */ static rtx -frv_ifcvt_load_value (value, insn) - rtx value; - rtx insn ATTRIBUTE_UNUSED; +frv_ifcvt_load_value (rtx value, rtx insn ATTRIBUTE_UNUSED) { int num_alloc = frv_ifcvt.cur_scratch_regs; int i; @@ -7098,10 +6847,7 @@ frv_ifcvt_load_value (value, insn) into a temporary register, or the new MEM if we were successful. */ static rtx -frv_ifcvt_rewrite_mem (mem, mode, insn) - rtx mem; - enum machine_mode mode; - rtx insn; +frv_ifcvt_rewrite_mem (rtx mem, enum machine_mode mode, rtx insn) { rtx addr = XEXP (mem, 0); @@ -7149,8 +6895,7 @@ frv_ifcvt_rewrite_mem (mem, mode, insn) SET, possibly conditionally executed. It may also have CLOBBERs, USEs. */ static rtx -single_set_pattern (pattern) - rtx pattern; +single_set_pattern (rtx pattern) { rtx set; int i; @@ -7197,10 +6942,9 @@ single_set_pattern (pattern) insn cannot be converted to be executed conditionally. */ rtx -frv_ifcvt_modify_insn (ce_info, pattern, insn) - ce_if_block_t *ce_info ATTRIBUTE_UNUSED; - rtx pattern; - rtx insn; +frv_ifcvt_modify_insn (ce_if_block_t *ce_info, + rtx pattern, + rtx insn) { rtx orig_ce_pattern = pattern; rtx set; @@ -7324,7 +7068,16 @@ frv_ifcvt_modify_insn (ce_info, pattern, insn) other registers. */ else if (frv_ifcvt.scratch_insns_bitmap && bitmap_bit_p (frv_ifcvt.scratch_insns_bitmap, - INSN_UID (insn))) + INSN_UID (insn)) + /* We must not unconditionally set a reg set used as + scratch in the THEN branch if the same reg is live + in the ELSE branch. */ + && REG_P (SET_DEST (set)) + && (! ce_info->else_bb + || BLOCK_FOR_INSN (insn) == ce_info->else_bb + || ! (REGNO_REG_SET_P + (ce_info->else_bb->global_live_at_start, + REGNO (SET_DEST (set)))))) pattern = set; else if (mode == QImode || mode == HImode || mode == SImode @@ -7452,8 +7205,7 @@ frv_ifcvt_modify_insn (ce_info, pattern, insn) conditional if information CE_INFO. */ void -frv_ifcvt_modify_final (ce_info) - ce_if_block_t *ce_info ATTRIBUTE_UNUSED; +frv_ifcvt_modify_final (ce_if_block_t *ce_info ATTRIBUTE_UNUSED) { rtx existing_insn; rtx check_insn; @@ -7509,8 +7261,7 @@ frv_ifcvt_modify_final (ce_info) information CE_INFO. */ void -frv_ifcvt_modify_cancel (ce_info) - ce_if_block_t *ce_info ATTRIBUTE_UNUSED; +frv_ifcvt_modify_cancel (ce_if_block_t *ce_info ATTRIBUTE_UNUSED) { int i; rtx p = frv_ifcvt.added_insns_list; @@ -7545,7 +7296,7 @@ frv_ifcvt_modify_cancel (ce_info) jmpl @(gr0,) */ int -frv_trampoline_size () +frv_trampoline_size (void) { return 5 /* instructions */ * 4 /* instruction size */; } @@ -7565,10 +7316,7 @@ frv_trampoline_size () jmpl @(gr0,) */ void -frv_initialize_trampoline (addr, fnaddr, static_chain) - rtx addr; - rtx fnaddr; - rtx static_chain; +frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) { rtx sc_reg = force_reg (Pmode, static_chain); @@ -7634,11 +7382,10 @@ frv_initialize_trampoline (addr, fnaddr, static_chain) This case often occurs between floating-point and general registers. */ enum reg_class -frv_secondary_reload_class (class, mode, x, in_p) - enum reg_class class; - enum machine_mode mode ATTRIBUTE_UNUSED; - rtx x; - int in_p ATTRIBUTE_UNUSED; +frv_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x, + int in_p ATTRIBUTE_UNUSED) { enum reg_class ret; @@ -7714,8 +7461,7 @@ frv_secondary_reload_class (class, mode, x, in_p) register allocation. */ int -frv_class_likely_spilled_p (class) - enum reg_class class; +frv_class_likely_spilled_p (enum reg_class class) { switch (class) { @@ -7790,13 +7536,8 @@ frv_class_likely_spilled_p (class) */ int -frv_adjust_field_align (field, computed) - tree field; - int computed; +frv_adjust_field_align (tree field, int computed) { - - tree type = TREE_TYPE (field); - /* Make sure that the bitfield is not wider than the type. */ if (DECL_BIT_FIELD (field) && !DECL_ARTIFICIAL (field)) @@ -7889,9 +7630,7 @@ frv_adjust_field_align (field, computed) pattern's constraint asks for one. */ int -frv_hard_regno_mode_ok (regno, mode) - int regno; - enum machine_mode mode; +frv_hard_regno_mode_ok (int regno, enum machine_mode mode) { int base; int mask; @@ -7973,9 +7712,7 @@ frv_hard_regno_mode_ok (regno, mode) for each byte. */ int -frv_hard_regno_nregs (regno, mode) - int regno; - enum machine_mode mode; +frv_hard_regno_nregs (int regno, enum machine_mode mode) { if (ACCG_P (regno)) return GET_MODE_SIZE (mode); @@ -7997,9 +7734,7 @@ frv_hard_regno_nregs (regno, mode) This declaration is required. */ int -frv_class_max_nregs (class, mode) - enum reg_class class; - enum machine_mode mode; +frv_class_max_nregs (enum reg_class class, enum machine_mode mode) { if (class == ACCG_REGS) /* An N-byte value requires N accumulator guards. */ @@ -8015,8 +7750,7 @@ frv_class_max_nregs (class, mode) definition for this macro on machines where anything `CONSTANT_P' is valid. */ int -frv_legitimate_constant_p (x) - rtx x; +frv_legitimate_constant_p (rtx x) { enum machine_mode mode = GET_MODE (x); @@ -8065,9 +7799,7 @@ frv_legitimate_constant_p (x) #define LOW_COST 1 int -frv_register_move_cost (from, to) - enum reg_class from; - enum reg_class to; +frv_register_move_cost (enum reg_class from, enum reg_class to) { switch (from) { @@ -8156,10 +7888,7 @@ frv_register_move_cost (from, to) need a fixup entry for aligned (non-debugging) code. */ static bool -frv_assemble_integer (value, size, aligned_p) - rtx value; - unsigned int size; - int aligned_p; +frv_assemble_integer (rtx value, unsigned int size, int aligned_p) { if (flag_pic && size == UNITS_PER_WORD) { @@ -8198,7 +7927,7 @@ frv_assemble_integer (value, size, aligned_p) /* Function to set up the backend function structure. */ static struct machine_function * -frv_init_machine_status () +frv_init_machine_status (void) { return ggc_alloc_cleared (sizeof (struct machine_function)); } @@ -8241,12 +7970,11 @@ frv_use_dfa_pipeline_interface (void) or clobbered. */ static void -frv_registers_update (x, reg_state, modified, p_num_mod, flag) - rtx x; - unsigned char reg_state[]; - int modified[]; - int *p_num_mod; - int flag; +frv_registers_update (rtx x, + unsigned char reg_state[], + int modified[], + int *p_num_mod, + int flag) { int regno, reg_max; rtx reg; @@ -8389,10 +8117,7 @@ frv_registers_update (x, reg_state, modified, p_num_mod, flag) /* Return if any registers in a hard register set were used an insn. */ static int -frv_registers_used_p (x, reg_state, flag) - rtx x; - unsigned char reg_state[]; - int flag; +frv_registers_used_p (rtx x, unsigned char reg_state[], int flag) { int regno, reg_max; rtx reg; @@ -8549,10 +8274,7 @@ frv_registers_used_p (x, reg_state, flag) /* Return if any registers in a hard register set were set in an insn. */ static int -frv_registers_set_p (x, reg_state, modify_p) - rtx x; - unsigned char reg_state[]; - int modify_p; +frv_registers_set_p (rtx x, unsigned char reg_state[], int modify_p) { int regno, reg_max; rtx reg; @@ -8663,7 +8385,7 @@ frv_registers_set_p (x, reg_state, modify_p) information in a reasonable state. */ static void -frv_pack_insns () +frv_pack_insns (void) { state_t frv_state; /* frv state machine */ int cur_start_vliw_p; /* current insn starts a VLIW insn */ @@ -8731,7 +8453,7 @@ frv_pack_insns () } /* Clear the VLIW start flag on random USE and CLOBBER insns, which is - set on the USE insn that preceeds the return, and potentially on + set on the USE insn that precedes the return, and potentially on CLOBBERs for setting multiword variables. Also skip the ADDR_VEC holding the case table labels. */ pattern_code = GET_CODE (PATTERN (insn)); @@ -8970,7 +8692,7 @@ static struct builtin_description bdesc_voidacc[] = /* Initialize media builtins. */ static void -frv_init_builtins () +frv_init_builtins (void) { tree endlink = void_list_node; tree accumulator = integer_type_node; @@ -9159,9 +8881,9 @@ frv_init_libfuncs (void) set_conv_libfunc (sfix_optab, DImode, DFmode, "__dtoll"); set_conv_libfunc (ufix_optab, SImode, SFmode, "__ftoui"); - set_conv_libfunc (ufix_optab, SImode, SFmode, "__ftoull"); - set_conv_libfunc (ufix_optab, SImode, SFmode, "__dtoui"); - set_conv_libfunc (ufix_optab, SImode, SFmode, "__dtoull"); + set_conv_libfunc (ufix_optab, DImode, SFmode, "__ftoull"); + set_conv_libfunc (ufix_optab, SImode, DFmode, "__dtoui"); + set_conv_libfunc (ufix_optab, DImode, DFmode, "__dtoull"); set_conv_libfunc (sfloat_optab, SFmode, SImode, "__itof"); set_conv_libfunc (sfloat_optab, SFmode, DImode, "__lltof"); @@ -9176,10 +8898,7 @@ frv_init_libfuncs (void) instruction. */ static rtx -frv_int_to_acc (icode, opnum, opval) - enum insn_code icode; - int opnum; - rtx opval; +frv_int_to_acc (enum insn_code icode, int opnum, rtx opval) { rtx reg; @@ -9211,8 +8930,7 @@ frv_int_to_acc (icode, opnum, opval) should have. */ static enum machine_mode -frv_matching_accg_mode (mode) - enum machine_mode mode; +frv_matching_accg_mode (enum machine_mode mode) { switch (mode) { @@ -9235,8 +8953,7 @@ frv_matching_accg_mode (mode) class as ACC, but is four times smaller. */ rtx -frv_matching_accg_for_acc (acc) - rtx acc; +frv_matching_accg_for_acc (rtx acc) { return gen_rtx_REG (frv_matching_accg_mode (GET_MODE (acc)), REGNO (acc) - ACC_FIRST + ACCG_FIRST); @@ -9247,8 +8964,7 @@ frv_matching_accg_for_acc (acc) list. */ static rtx -frv_read_argument (arglistptr) - tree *arglistptr; +frv_read_argument (tree *arglistptr) { tree next = TREE_VALUE (*arglistptr); *arglistptr = TREE_CHAIN (*arglistptr); @@ -9260,10 +8976,7 @@ frv_read_argument (arglistptr) function prints an error if OPVAL is not valid. */ static int -frv_check_constant_argument (icode, opnum, opval) - enum insn_code icode; - int opnum; - rtx opval; +frv_check_constant_argument (enum insn_code icode, int opnum, rtx opval) { if (GET_CODE (opval) != CONST_INT) { @@ -9283,9 +8996,7 @@ frv_check_constant_argument (icode, opnum, opval) predicate. */ static rtx -frv_legitimize_target (icode, target) - enum insn_code icode; - rtx target; +frv_legitimize_target (enum insn_code icode, rtx target) { enum machine_mode mode = insn_data[icode].operand[0].mode; @@ -9298,15 +9009,12 @@ frv_legitimize_target (icode, target) } /* Given that ARG is being passed as operand OPNUM to instruction ICODE, - check whether ARG satisfies the operand's contraints. If it doesn't, + check whether ARG satisfies the operand's constraints. If it doesn't, copy ARG to a temporary register and return that. Otherwise return ARG itself. */ static rtx -frv_legitimize_argument (icode, opnum, arg) - enum insn_code icode; - int opnum; - rtx arg; +frv_legitimize_argument (enum insn_code icode, int opnum, rtx arg) { enum machine_mode mode = insn_data[icode].operand[opnum].mode; @@ -9320,10 +9028,7 @@ frv_legitimize_argument (icode, opnum, arg) only MHDSETS falls into this category. */ static rtx -frv_expand_set_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +frv_expand_set_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9343,10 +9048,7 @@ frv_expand_set_builtin (icode, arglist, target) /* Expand builtins that take one operand. */ static rtx -frv_expand_unop_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +frv_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9364,10 +9066,7 @@ frv_expand_unop_builtin (icode, arglist, target) /* Expand builtins that take two operands. */ static rtx -frv_expand_binop_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +frv_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9388,10 +9087,7 @@ frv_expand_binop_builtin (icode, arglist, target) one. */ static rtx -frv_expand_cut_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +frv_expand_cut_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9423,10 +9119,7 @@ frv_expand_cut_builtin (icode, arglist, target) /* Expand builtins that take two operands and the second is immediate. */ static rtx -frv_expand_binopimm_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +frv_expand_binopimm_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9449,9 +9142,7 @@ frv_expand_binopimm_builtin (icode, arglist, target) ints and return void. */ static rtx -frv_expand_voidbinop_builtin (icode, arglist) - enum insn_code icode; - tree arglist; +frv_expand_voidbinop_builtin (enum insn_code icode, tree arglist) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9492,9 +9183,7 @@ frv_expand_voidbinop_builtin (icode, arglist) corresponds to the accumulator. */ static rtx -frv_expand_voidtriop_builtin (icode, arglist) - enum insn_code icode; - tree arglist; +frv_expand_voidtriop_builtin (enum insn_code icode, tree arglist) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9522,9 +9211,7 @@ frv_expand_voidtriop_builtin (icode, arglist) void. */ static rtx -frv_expand_voidaccop_builtin (icode, arglist) - enum insn_code icode; - tree arglist; +frv_expand_voidaccop_builtin (enum insn_code icode, tree arglist) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9554,8 +9241,7 @@ frv_expand_voidaccop_builtin (icode, arglist) number as argument. */ static rtx -frv_expand_mclracc_builtin (arglist) - tree arglist; +frv_expand_mclracc_builtin (tree arglist) { enum insn_code icode = CODE_FOR_mclracc; rtx pat; @@ -9575,8 +9261,7 @@ frv_expand_mclracc_builtin (arglist) /* Expand builtins that take no arguments. */ static rtx -frv_expand_noargs_builtin (icode) - enum insn_code icode; +frv_expand_noargs_builtin (enum insn_code icode) { rtx pat = GEN_FCN (icode) (GEN_INT (0)); if (pat) @@ -9589,9 +9274,7 @@ frv_expand_noargs_builtin (icode) number or accumulator guard number as argument and return an SI integer. */ static rtx -frv_expand_mrdacc_builtin (icode, arglist) - enum insn_code icode; - tree arglist; +frv_expand_mrdacc_builtin (enum insn_code icode, tree arglist) { rtx pat; rtx target = gen_reg_rtx (SImode); @@ -9614,9 +9297,7 @@ frv_expand_mrdacc_builtin (icode, arglist) second. */ static rtx -frv_expand_mwtacc_builtin (icode, arglist) - enum insn_code icode; - tree arglist; +frv_expand_mwtacc_builtin (enum insn_code icode, tree arglist) { rtx pat; rtx op0 = frv_read_argument (&arglist); @@ -9637,12 +9318,11 @@ frv_expand_mwtacc_builtin (icode, arglist) /* Expand builtins. */ static rtx -frv_expand_builtin (exp, target, subtarget, mode, ignore) - tree exp; - rtx target; - rtx subtarget ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; - int ignore ATTRIBUTE_UNUSED; +frv_expand_builtin (tree exp, + rtx target, + rtx subtarget ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + int ignore ATTRIBUTE_UNUSED) { tree arglist = TREE_OPERAND (exp, 1); tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); @@ -9771,8 +9451,7 @@ frv_expand_builtin (exp, target, subtarget, mode, ignore) } static bool -frv_in_small_data_p (decl) - tree decl; +frv_in_small_data_p (tree decl) { HOST_WIDE_INT size; tree section_name; @@ -9784,10 +9463,6 @@ frv_in_small_data_p (decl) if (TREE_CODE (decl) != VAR_DECL || DECL_ARTIFICIAL (decl)) return false; - size = int_size_in_bytes (TREE_TYPE (decl)); - if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value) - return true; - /* If we already know which section the decl should be in, see if it's a small data section. */ section_name = DECL_SECTION_NAME (decl); @@ -9799,16 +9474,21 @@ frv_in_small_data_p (decl) return true; if (frv_string_begins_with (section_name, ".sbss")) return true; + return false; } + size = int_size_in_bytes (TREE_TYPE (decl)); + if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value) + return true; + return false; } static bool -frv_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code ATTRIBUTE_UNUSED; - int *total; +frv_rtx_costs (rtx x, + int code ATTRIBUTE_UNUSED, + int outer_code ATTRIBUTE_UNUSED, + int *total) { switch (code) { @@ -9867,9 +9547,7 @@ frv_rtx_costs (x, code, outer_code, total) } static void -frv_asm_out_constructor (symbol, priority) - rtx symbol; - int priority ATTRIBUTE_UNUSED; +frv_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) { ctors_section (); assemble_align (POINTER_SIZE); @@ -9877,9 +9555,7 @@ frv_asm_out_constructor (symbol, priority) } static void -frv_asm_out_destructor (symbol, priority) - rtx symbol; - int priority ATTRIBUTE_UNUSED; +frv_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED) { dtors_section (); assemble_align (POINTER_SIZE); diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 2f958da582b..efb655a9684 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -1885,7 +1885,7 @@ struct machine_function GTY(()) #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ frv_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) -/* extern int frv_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS, int, Tree, int)); */ +/* extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS, int, Tree, int); */ /* A C expression that indicates when an argument must be passed by reference. If nonzero for an argument, a copy of that argument is made in memory and a @@ -2180,11 +2180,7 @@ struct machine_function GTY(()) extern int _write (int, const void *, unsigned); \ \ void \ -__trampoline_setup (addr, size, fnaddr, sc) \ - short * addr; \ - int size; \ - int fnaddr; \ - int sc; \ +__trampoline_setup (short * addr, int size, int fnaddr, int sc) \ { \ extern short __trampoline_template[]; \ short * to = addr; \ @@ -2565,7 +2561,7 @@ __asm__("\n" \ #define SDATA_SECTION_FUNCTION \ void \ -sdata_section () \ +sdata_section (void) \ { \ if (in_section != in_sdata) \ { \ @@ -2576,7 +2572,7 @@ sdata_section () \ #define FIXUP_SECTION_FUNCTION \ void \ -fixup_section () \ +fixup_section (void) \ { \ if (in_section != in_fixup) \ { \ @@ -2970,6 +2966,9 @@ do { \ #define ASM_OUTPUT_ALIGN(STREAM, POWER) \ fprintf ((STREAM), "\t.p2align %d\n", (POWER)) +/* Inside the text section, align with unpacked nops rather than zeros. */ +#define ASM_OUTPUT_ALIGN_WITH_NOP(STREAM, POWER) \ + fprintf ((STREAM), "\t.p2alignl %d,0x80880000\n", (POWER)) /* Macros Affecting all Debug Formats. */ diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index ce5ce8bac25..9d06fbbdfdb 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/config/frv/frv.md @@ -463,7 +463,7 @@ first regular expression *and* the reservation described by the second regular expression *and* etc. - 4. "*" is used for convinience and simply means sequence in + 4. "*" is used for convenience and simply means sequence in which the regular expression are repeated NUMBER times with cycle advancing (see ","). @@ -1118,7 +1118,7 @@ ;; Note - it is the backend's responsibility to fill any unfilled delay slots ;; at assembler generation time. This is usually done by adding a special print -;; operand to the delayed insrtuction, and then in the PRINT_OPERAND function +;; operand to the delayed instruction, and then in the PRINT_OPERAND function ;; calling dbr_sequence_length() to determine how many delay slots were filled. ;; For example: ;; @@ -1364,7 +1364,7 @@ ;; Note - it is best to only have one movsi pattern and to handle ;; all the various contingencies by the use of alternatives. This -;; allows reload the greatest amount of flexability (since reload will +;; allows reload the greatest amount of flexibility (since reload will ;; only choose amoungst alternatives for a selected insn, it will not ;; replace the insn with another one). @@ -1374,7 +1374,7 @@ ;; constants into memory when the destination is a floating-point register. ;; That may make a function use a PIC pointer when it didn't before, and we ;; cannot change PIC usage (and hence stack layout) so late in the game. -;; The resulting sequences for loading cosntants into FPRs are preferable +;; The resulting sequences for loading constants into FPRs are preferable ;; even when we're not generating PIC code. (define_insn "*movsi_load" @@ -2754,22 +2754,11 @@ ;; Subtraction No need to worry about constants, since the compiler ;; canonicalizes them into adddi3's. -(define_expand "subdi3" - [(parallel [(set (match_operand:DI 0 "integer_register_operand" "") - (minus:DI (match_operand:DI 1 "integer_register_operand" "") - (match_operand:DI 2 "integer_register_operand" ""))) - (clobber (match_dup 3))])] - "" - " -{ - operands[3] = gen_reg_rtx (CCmode); -}") - -(define_insn_and_split "*subdi3_internal" +(define_insn_and_split "subdi3" [(set (match_operand:DI 0 "integer_register_operand" "=&e,e,e") (minus:DI (match_operand:DI 1 "integer_register_operand" "e,0,e") (match_operand:DI 2 "integer_register_operand" "e,e,0"))) - (clobber (match_operand:CC 3 "icc_operand" "=t,t,t"))] + (clobber (match_scratch:CC 3 "=t,t,t"))] "" "#" "reload_completed" @@ -2842,6 +2831,31 @@ [(set_attr "length" "4") (set_attr "type" "int")]) +(define_insn_and_split "negdi2" + [(set (match_operand:DI 0 "integer_register_operand" "=&e,e") + (neg:DI (match_operand:DI 1 "integer_register_operand" "e,0"))) + (clobber (match_scratch:CC 2 "=t,t"))] + "" + "#" + "reload_completed" + [(match_dup 3) + (match_dup 4)] + " +{ + rtx op0_high = gen_highpart (SImode, operands[0]); + rtx op1_high = gen_rtx_REG (SImode, GPR_FIRST); + rtx op2_high = gen_highpart (SImode, operands[1]); + rtx op0_low = gen_lowpart (SImode, operands[0]); + rtx op1_low = op1_high; + rtx op2_low = gen_lowpart (SImode, operands[1]); + rtx op3 = operands[2]; + + operands[3] = gen_subdi3_lower (op0_low, op1_low, op2_low, op3); + operands[4] = gen_subdi3_upper (op0_high, op1_high, op2_high, op3); +}" + [(set_attr "length" "8") + (set_attr "type" "multi")]) + ;; Multiplication (same size) ;; (define_insn "muldi3" ;; [(set (match_operand:DI 0 "register_operand" "=r") @@ -3314,7 +3328,7 @@ ;; "anddi3 %0,%1,%2" ;; [(set_attr "length" "4")]) -;; Includive OR, 64 bit integers +;; Inclusive OR, 64 bit integers ;; (define_insn "iordi3" ;; [(set (match_operand:DI 0 "register_operand" "=r") ;; (ior:DI (match_operand:DI 1 "register_operand" "%r") @@ -7379,7 +7393,7 @@ [(set_attr "length" "4") (set_attr "type" "mqsath")]) -;; Set hi/lo instrctions: type "mset" +;; Set hi/lo instructions: type "mset" (define_insn "mhsetlos" [(set (match_operand:SI 0 "fpr_operand" "=f") diff --git a/gcc/config/frv/frvbegin.c b/gcc/config/frv/frvbegin.c index 81040f3543a..82f9500eab2 100644 --- a/gcc/config/frv/frvbegin.c +++ b/gcc/config/frv/frvbegin.c @@ -81,7 +81,7 @@ extern void __frv_deregister_eh(void) __attribute__((__destructor__)); extern func_ptr __EH_FRAME_BEGIN__[]; -/* Register the exeception handling table as the first constructor */ +/* Register the exception handling table as the first constructor */ void __frv_register_eh (void) { @@ -93,7 +93,7 @@ __frv_register_eh (void) /* Note, do not declare __{,de}register_frame_info weak as it seems to interfere with the pic support. */ -/* Unregister the exeception handling table as a deconstructor */ +/* Unregister the exception handling table as a deconstructor */ void __frv_deregister_eh (void) { @@ -110,7 +110,7 @@ __frv_deregister_eh (void) /* Run the global destructors */ void -__do_global_dtors () +__do_global_dtors (void) { static func_ptr *p = __DTOR_LIST__ + 1; while (*p) @@ -122,7 +122,7 @@ __do_global_dtors () /* Run the global constructors */ void -__do_global_ctors () +__do_global_ctors (void) { unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; unsigned i; @@ -145,7 +145,7 @@ __do_global_ctors () to run __do_global_ctors, so we need not do anything here. */ void -__main () +__main (void) { /* Support recursive calls to `main': run initializers just once. */ static int initialized; diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h index f5f4184e8d3..23a8a730ec9 100644 --- a/gcc/config/gnu.h +++ b/gcc/config/gnu.h @@ -18,3 +18,15 @@ /* The system headers under GNU are C++-aware. */ #define NO_IMPLICIT_EXTERN_C + +#define HURD_TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__gnu_hurd__"); \ + builtin_define ("__GNU__"); \ + builtin_define_std ("unix"); \ + builtin_define_std ("MACH"); \ + builtin_assert ("system=gnu"); \ + builtin_assert ("system=mach"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } while (0) diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index e36ae4b719c..a7987d06a83 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -79,6 +79,7 @@ extern int h8300_eightbit_constant_address_p (rtx); extern int h8300_tiny_constant_address_p (rtx); extern int byte_accesses_mergeable_p (rtx, rtx); extern int same_cmp_preceding_p (rtx); +extern int same_cmp_following_p (rtx); /* Used in builtins.c */ extern rtx h8300_return_addr_rtx (int, rtx); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 88e9a63a6dd..ed3cc08c51d 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -365,9 +365,7 @@ byte_reg (rtx x, int b) SIZE to adjust the stack pointer. */ static void -dosize (sign, size) - int sign; - unsigned int size; +dosize (int sign, unsigned int size) { /* H8/300 cannot add/subtract a large constant with a single instruction. If a temporary register is available, load the @@ -436,8 +434,10 @@ push (int rn) if (TARGET_H8300) x = gen_push_h8300 (reg); + else if (!TARGET_NORMAL_MODE) + x = gen_push_h8300hs_advanced (reg); else - x = gen_push_h8300hs (reg); + x = gen_push_h8300hs_normal (reg); x = emit_insn (x); REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0); } @@ -452,8 +452,10 @@ pop (int rn) if (TARGET_H8300) x = gen_pop_h8300 (reg); + else if (!TARGET_NORMAL_MODE) + x = gen_pop_h8300hs_advanced (reg); else - x = gen_pop_h8300hs (reg); + x = gen_pop_h8300hs_normal (reg); x = emit_insn (x); REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0); } @@ -1979,7 +1981,7 @@ compute_mov_length (rtx *operands) if (val == (val & 0x00ff) || val == (val & 0xff00)) return 4; - + switch (val & 0xffffffff) { case 0xffffffff: @@ -4514,6 +4516,26 @@ same_cmp_preceding_p (rtx i3) && any_condjump_p (i2) && onlyjump_p (i2)); } +/* Return nonzero if we have the same comparison insn as I1 two insns + after I1. I1 is assumed to be a comparison insn. */ + +int +same_cmp_following_p (rtx i1) +{ + rtx i2, i3; + + /* Make sure we have a sequence of three insns. */ + i2 = next_nonnote_insn (i1); + if (i2 == NULL_RTX) + return 0; + i3 = next_nonnote_insn (i2); + if (i3 == NULL_RTX) + return 0; + + return (INSN_P (i3) && rtx_equal_p (PATTERN (i1), PATTERN (i3)) + && any_condjump_p (i2) && onlyjump_p (i2)); +} + /* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ int @@ -4528,7 +4550,7 @@ h8300_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED, && !regs_ever_live[new_reg]) return 0; - return 1; + return 1; } /* Perform target dependent optabs initialization. */ diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 055a32542e1..b60fc52af49 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -224,9 +224,7 @@ extern int target_flags; #define BYTES_BIG_ENDIAN 1 /* Define this if most significant word of a multiword number is lowest - numbered. - This is true on an H8/300 (actually we can make it up, but we choose to - be consistent). */ + numbered. */ #define WORDS_BIG_ENDIAN 1 #define MAX_BITS_PER_WORD 32 @@ -570,10 +568,12 @@ enum reg_class { followed by "to". Eliminations of the same "from" register are listed in order of preference. - We have two registers that can be eliminated on the h8300. 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; it is replaced with either the stack or frame pointer. */ + We have three registers that can be eliminated on the h8300. + First, the frame pointer register can often be eliminated in favor + of the stack pointer register. Secondly, the argument pointer + register and the return address pointer register are always + eliminated; they are replaced with either the stack or frame + pointer. */ #define ELIMINABLE_REGS \ {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ @@ -607,7 +607,7 @@ enum reg_class { On the H8 the return value is in R0/R1. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx_REG (TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), R0_REG) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ @@ -615,12 +615,12 @@ enum reg_class { /* On the H8 the return value is in R0/R1. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx_REG (MODE, 0) + gen_rtx_REG (MODE, R0_REG) /* 1 if N is a possible register number for a function value. On the H8, R0 is the only register thus used. */ -#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) +#define FUNCTION_VALUE_REGNO_P(N) ((N) == R0_REG) /* Define this if PCC uses the nonreentrant convention for returning structure and union values. */ @@ -735,7 +735,7 @@ struct cum_arg /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE ((TARGET_H8300 || TARGET_NORMAL_MODE) ? 8 : 12) +#define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12) /* Emit RTL insns to build a trampoline. FNADDR is an RTX for the address of the function's pure code. @@ -1054,10 +1054,9 @@ struct cum_arg #undef DO_GLOBAL_CTORS_BODY #define DO_GLOBAL_CTORS_BODY \ { \ - typedef (*pfunc)(); \ - extern pfunc __ctors[]; \ - extern pfunc __ctors_end[]; \ - pfunc *p; \ + extern func_ptr __ctors[]; \ + extern func_ptr __ctors_end[]; \ + func_ptr *p; \ for (p = __ctors_end; p > __ctors; ) \ { \ (*--p)(); \ @@ -1067,10 +1066,9 @@ struct cum_arg #undef DO_GLOBAL_DTORS_BODY #define DO_GLOBAL_DTORS_BODY \ { \ - typedef (*pfunc)(); \ - extern pfunc __dtors[]; \ - extern pfunc __dtors_end[]; \ - pfunc *p; \ + extern func_ptr __dtors[]; \ + extern func_ptr __dtors_end[]; \ + func_ptr *p; \ for (p = __dtors; p < __dtors_end; p++) \ { \ (*p)(); \ diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 0daa45c2f11..80683d56876 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -53,7 +53,8 @@ (UNSPEC_MONITOR 1)]) (define_constants - [(SC_REG 3) + [(R0_REG 0) + (SC_REG 3) (FP_REG 6) (SP_REG 7) (MAC_REG 8) @@ -124,7 +125,7 @@ (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -1))) (match_operand:QI 0 "register_operand" "r"))])] "TARGET_H8300 - && REGNO (operands[0]) != SP_REG" + && operands[0] != stack_pointer_rtx" "mov.w\\t%T0,@-r7" [(set_attr "length" "2") (set_attr "cc" "clobber")]) @@ -135,7 +136,18 @@ (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int -3))) (match_operand:QI 0 "register_operand" "r"))])] "(TARGET_H8300H || TARGET_H8300S) - && REGNO (operands[0]) != SP_REG" + && operands[0] != stack_pointer_rtx" + "mov.l\\t%S0,@-er7" + [(set_attr "length" "4") + (set_attr "cc" "clobber")]) + +(define_insn "pushqi1_h8300hs_normal" + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -4))) + (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3))) + (match_operand:QI 0 "register_operand" "r"))])] + "(TARGET_H8300H || TARGET_H8300S) + && operands[0] != stack_pointer_rtx" "mov.l\\t%S0,@-er7" [(set_attr "length" "4") (set_attr "cc" "clobber")]) @@ -147,8 +159,10 @@ { if (TARGET_H8300) emit_insn (gen_pushqi1_h8300 (operands[0])); - else + else if (!TARGET_NORMAL_MODE) emit_insn (gen_pushqi1_h8300hs (operands[0])); + else + emit_insn (gen_pushqi1_h8300hs_normal (operands[0])); DONE; }") @@ -218,7 +232,7 @@ [(set (mem:HI (pre_dec:HI (reg:HI SP_REG))) (match_operand:HI 0 "register_operand" ""))] "TARGET_H8300 - && REGNO (operands[0]) != SP_REG" + && operands[0] != stack_pointer_rtx" "") (define_insn "pushhi1_h8300hs" @@ -227,7 +241,18 @@ (set (mem:HI (plus:SI (reg:SI SP_REG) (const_int -2))) (match_operand:HI 0 "register_operand" "r"))])] "(TARGET_H8300H || TARGET_H8300S) - && REGNO (operands[0]) != SP_REG" + && operands[0] != stack_pointer_rtx" + "mov.l\\t%S0,@-er7" + [(set_attr "length" "4") + (set_attr "cc" "clobber")]) + +(define_insn "pushhi1_h8300hs_normal" + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -4))) + (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2))) + (match_operand:HI 0 "register_operand" "r"))])] + "(TARGET_H8300H || TARGET_H8300S) + && operands[0] != stack_pointer_rtx" "mov.l\\t%S0,@-er7" [(set_attr "length" "4") (set_attr "cc" "clobber")]) @@ -239,8 +264,10 @@ { if (TARGET_H8300) emit_insn (gen_pushhi1_h8300 (operands[0])); - else + else if (!TARGET_NORMAL_MODE) emit_insn (gen_pushhi1_h8300hs (operands[0])); + else + emit_insn (gen_pushhi1_h8300hs_normal (operands[0])); DONE; }") @@ -561,7 +588,7 @@ (symbol_ref "compute_mov_length (operands)")) (set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")]) -(define_insn "*movsf_h8300h" +(define_insn "*movsf_h8300hs" [(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,m,<,r") (match_operand:SF 1 "general_operand_src" "G,r,im,r,r,>"))] "(TARGET_H8300H || TARGET_H8300S) @@ -704,7 +731,7 @@ [(set_attr "length" "2") (set_attr "cc" "set_znv")]) -(define_insn "" +(define_insn "*tsthi_upper" [(set (cc0) (and:HI (match_operand:HI 0 "register_operand" "r") (const_int -256)))] @@ -720,7 +747,7 @@ [(set_attr "length" "2") (set_attr "cc" "set_znv")]) -(define_insn "" +(define_insn "*tstsi_upper" [(set (cc0) (and:SI (match_operand:SI 0 "register_operand" "r") (const_int -65536)))] @@ -882,7 +909,7 @@ "" "") -(define_insn "addsi_h8300" +(define_insn "*addsi_h8300" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "%0,0") (match_operand:SI 2 "nonmemory_operand" "n,r")))] @@ -893,7 +920,7 @@ (set (attr "cc") (symbol_ref "compute_plussi_cc (operands)"))]) -(define_insn "addsi_h8300h" +(define_insn "*addsi_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "%0,0") (match_operand:SI 2 "nonmemory_operand" "i,r")))] @@ -944,8 +971,8 @@ "" "") -(define_insn "" - [(set (match_operand:HI 0 "register_operand" "=r,&r") +(define_insn "*subhi3_h8300" + [(set (match_operand:HI 0 "register_operand" "=r,r") (minus:HI (match_operand:HI 1 "general_operand" "0,0") (match_operand:HI 2 "nonmemory_operand" "r,n")))] "TARGET_H8300" @@ -955,8 +982,8 @@ [(set_attr "length" "2,4") (set_attr "cc" "set_zn,clobber")]) -(define_insn "" - [(set (match_operand:HI 0 "register_operand" "=r,&r") +(define_insn "*subhi3_h8300hs" + [(set (match_operand:HI 0 "register_operand" "=r,r") (minus:HI (match_operand:HI 1 "general_operand" "0,0") (match_operand:HI 2 "nonmemory_operand" "r,n")))] "TARGET_H8300H || TARGET_H8300S" @@ -973,7 +1000,7 @@ "" "") -(define_insn "subsi3_h8300" +(define_insn "*subsi3_h8300" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "register_operand" "r")))] @@ -982,7 +1009,7 @@ [(set_attr "length" "6") (set_attr "cc" "clobber")]) -(define_insn "subsi3_h8300h" +(define_insn "*subsi3_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r,r") (minus:SI (match_operand:SI 1 "general_operand" "0,0") (match_operand:SI 2 "nonmemory_operand" "r,i")))] @@ -1163,7 +1190,7 @@ ;; AND INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "" +(define_insn "*andqi3_1" [(set (match_operand:QI 0 "bit_operand" "=r,U") (and:QI (match_operand:QI 1 "bit_operand" "%0,0") (match_operand:QI 2 "nonmemory_operand" "rn,n")))] @@ -1263,7 +1290,7 @@ ;; OR INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "" +(define_insn "*iorqi3_1" [(set (match_operand:QI 0 "bit_operand" "=r,U") (ior:QI (match_operand:QI 1 "bit_operand" "%0,0") (match_operand:QI 2 "nonmemory_operand" "rn,n")))] @@ -1304,7 +1331,7 @@ ;; XOR INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "" +(define_insn "*xorqi3_1" [(set (match_operand:QI 0 "bit_operand" "=r,U") (xor:QI (match_operand:QI 1 "bit_operand" "%0,0") (match_operand:QI 2 "nonmemory_operand" "rn,n")))] @@ -1345,7 +1372,7 @@ ;; {AND,IOR,XOR}{HI3,SI3} PATTERNS ;; ---------------------------------------------------------------------- -(define_insn "" +(define_insn "*logicalhi3" [(set (match_operand:HI 0 "register_operand" "=r") (match_operator:HI 3 "bit_operator" [(match_operand:HI 1 "register_operand" "%0") @@ -1357,7 +1384,7 @@ (set (attr "cc") (symbol_ref "compute_logical_op_cc (HImode, operands)"))]) -(define_insn "" +(define_insn "*logicalsi3" [(set (match_operand:SI 0 "register_operand" "=r") (match_operator:SI 3 "bit_operator" [(match_operand:SI 1 "register_operand" "%0") @@ -1403,7 +1430,7 @@ "" "operands[2] = gen_reg_rtx (HImode);") -(define_insn "neghi2_h8300h" +(define_insn "*neghi2_h8300hs" [(set (match_operand:HI 0 "register_operand" "=r") (neg:HI (match_operand:HI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -1433,7 +1460,7 @@ "" "operands[2] = gen_reg_rtx (SImode);") -(define_insn "negsi2_h8300h" +(define_insn "*negsi2_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operand:SI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -1507,7 +1534,7 @@ "" "") -(define_insn "" +(define_insn "*one_cmplhi2_h8300" [(set (match_operand:HI 0 "register_operand" "=r") (not:HI (match_operand:HI 1 "register_operand" "0")))] "TARGET_H8300" @@ -1515,7 +1542,7 @@ [(set_attr "cc" "clobber") (set_attr "length" "4")]) -(define_insn "" +(define_insn "*one_cmplhi2_h8300hs" [(set (match_operand:HI 0 "register_operand" "=r") (not:HI (match_operand:HI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -1529,7 +1556,7 @@ "" "") -(define_insn "" +(define_insn "*one_complsi2_h8300" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "register_operand" "0")))] "TARGET_H8300" @@ -1537,7 +1564,7 @@ [(set_attr "cc" "clobber") (set_attr "length" "8")]) -(define_insn "" +(define_insn "*one_complsi2_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -1725,7 +1752,7 @@ "" "") -(define_insn "tablejump_h8300" +(define_insn "*tablejump_h8300" [(set (pc) (match_operand:HI 0 "register_operand" "r")) (use (label_ref (match_operand 1 "" "")))] "TARGET_H8300" @@ -1733,21 +1760,21 @@ [(set_attr "cc" "none") (set_attr "length" "2")]) -(define_insn "tablejump_h8300h" +(define_insn "*tablejump_h8300hs_advanced" [(set (pc) (match_operand:SI 0 "register_operand" "r")) (use (label_ref (match_operand 1 "" "")))] - "TARGET_H8300H || TARGET_H8300S" + "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE" "jmp @%0" [(set_attr "cc" "none") (set_attr "length" "2")]) -(define_insn "tablejump_normal_mode" - [(set (pc) (match_operand:HI 0 "register_operand" "r")) - (use (label_ref (match_operand 1 "" "")))] - "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE" - "jmp @%S0" - [(set_attr "cc" "none") - (set_attr "length" "2")]) +(define_insn "*tablejump_h8300hs_normal" + [(set (pc) (match_operand:HI 0 "register_operand" "r")) + (use (label_ref (match_operand 1 "" "")))] + "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE" + "jmp @%S0" + [(set_attr "cc" "none") + (set_attr "length" "2")]) ;; This is a define expand, because pointers may be either 16 or 32 bits. @@ -1756,21 +1783,21 @@ "" "") -(define_insn "indirect_jump_h8300" +(define_insn "*indirect_jump_h8300" [(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))] "TARGET_H8300" "jmp @%0" [(set_attr "cc" "none") (set_attr "length" "2")]) -(define_insn "indirect_jump_h8300h" +(define_insn "*indirect_jump_h8300hs_advanced" [(set (pc) (match_operand:SI 0 "jump_address_operand" "Vr"))] - "TARGET_H8300H || TARGET_H8300S" + "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE" "jmp @%0" [(set_attr "cc" "none") (set_attr "length" "2")]) -(define_insn "indirect_jump_normal_mode" +(define_insn "*indirect_jump_h8300hs_normal" [(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))] "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE" "jmp @%S0" @@ -1836,30 +1863,41 @@ (define_expand "push_h8300" [(set (mem:HI (pre_dec:HI (reg:HI SP_REG))) - (match_operand:HI 0 "register_operand" "=r"))] - + (match_operand:HI 0 "register_operand" ""))] "TARGET_H8300" "") -(define_expand "push_h8300hs" +(define_expand "push_h8300hs_advanced" [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) - (match_operand:SI 0 "register_operand" "=r"))] - "TARGET_H8300H && TARGET_H8300S" + (match_operand:SI 0 "register_operand" ""))] + "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE" + "") + +(define_expand "push_h8300hs_normal" + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 0 "register_operand" ""))] + "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE" "") (define_expand "pop_h8300" - [(set (match_operand:HI 0 "register_operand" "=r") + [(set (match_operand:HI 0 "register_operand" "") (mem:HI (post_inc:HI (reg:HI SP_REG))))] "TARGET_H8300" "") -(define_expand "pop_h8300hs" - [(set (match_operand:SI 0 "register_operand" "=r") +(define_expand "pop_h8300hs_advanced" + [(set (match_operand:SI 0 "register_operand" "") (mem:SI (post_inc:SI (reg:SI SP_REG))))] - "TARGET_H8300H && TARGET_H8300S" + "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE" "") -(define_insn "stm_h8300s_2" +(define_expand "pop_h8300hs_normal" + [(set (match_operand:SI 0 "register_operand" "") + (mem:SI (post_inc:HI (reg:HI SP_REG))))] + "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE" + "") + +(define_insn "stm_h8300s_2_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) @@ -1867,7 +1905,7 @@ (match_operand:SI 0 "register_operand" "")) (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -8))) (match_operand:SI 1 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" @@ -1875,7 +1913,39 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) -(define_insn "stm_h8300s_3" +(define_insn "stm_h8300s_2_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -8))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_operand:SI 1 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) + || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) + || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" + "stm.l\\t%S0-%S1,@-er7" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_expand "stm_h8300s_2" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" ""))] + "TARGET_H8300S + && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) + || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) + || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_stm_h8300s_2_advanced (operands[0], operands[1])); + else + emit_insn (gen_stm_h8300s_2_normal (operands[0], operands[1])); + DONE; +}") + +(define_insn "stm_h8300s_3_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -12))) @@ -1885,7 +1955,28 @@ (match_operand:SI 1 "register_operand" "")) (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -12))) (match_operand:SI 2 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2) + || (REGNO (operands[0]) == 4 + && REGNO (operands[1]) == 5 + && REGNO (operands[2]) == 6))" + "stm.l\\t%S0-%S2,@-er7" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_insn "stm_h8300s_3_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -12))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12))) + (match_operand:SI 2 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2) @@ -1896,7 +1987,29 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) -(define_insn "stm_h8300s_4" +(define_expand "stm_h8300s_3" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" "")) + (use (match_operand:SI 2 "register_operand" ""))] + "TARGET_H8300S + && ((REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2) + || (REGNO (operands[0]) == 4 + && REGNO (operands[1]) == 5 + && REGNO (operands[2]) == 6))" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_stm_h8300s_3_advanced (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_stm_h8300s_3_normal (operands[0], operands[1], + operands[2])); + DONE; +}") + +(define_insn "stm_h8300s_4_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -16))) @@ -1908,7 +2021,7 @@ (match_operand:SI 2 "register_operand" "")) (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -16))) (match_operand:SI 3 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2 @@ -1917,7 +2030,49 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) -(define_insn "ldm_h8300s_2" +(define_insn "stm_h8300s_4_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -16))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12))) + (match_operand:SI 2 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -16))) + (match_operand:SI 3 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE + && REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2 + && REGNO (operands[3]) == 3" + "stm.l\\t%S0-%S3,@-er7" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_expand "stm_h8300s_4" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" "")) + (use (match_operand:SI 2 "register_operand" "")) + (use (match_operand:SI 3 "register_operand" ""))] + "TARGET_H8300S + && REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2 + && REGNO (operands[3]) == 3" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_stm_h8300s_4_advanced (operands[0], operands[1], + operands[2], operands[3])); + else + emit_insn (gen_stm_h8300s_4_normal (operands[0], operands[1], + operands[2], operands[3])); + DONE; +}") + +(define_insn "ldm_h8300s_2_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) @@ -1925,7 +2080,7 @@ (match_operand:SI 0 "register_operand" "")) (set (mem:SI (reg:SI SP_REG)) (match_operand:SI 1 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" @@ -1933,7 +2088,39 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) -(define_insn "ldm_h8300s_3" +(define_insn "ldm_h8300s_2_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int 8))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (reg:HI SP_REG)) + (match_operand:SI 1 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) + || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) + || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" + "ldm.l\\t@er7+,%S0-%S1" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_expand "ldm_h8300s_2" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" ""))] + "TARGET_H8300S + && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) + || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) + || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_ldm_h8300s_2_advanced (operands[0], operands[1])); + else + emit_insn (gen_ldm_h8300s_2_normal (operands[0], operands[1])); + DONE; +}") + +(define_insn "ldm_h8300s_3_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 12))) @@ -1943,7 +2130,7 @@ (match_operand:SI 1 "register_operand" "")) (set (mem:SI (reg:SI SP_REG)) (match_operand:SI 2 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2) @@ -1954,7 +2141,50 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) -(define_insn "ldm_h8300s_4" +(define_insn "ldm_h8300s_3_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int 12))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 8))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (reg:HI SP_REG)) + (match_operand:SI 2 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2) + || (REGNO (operands[0]) == 4 + && REGNO (operands[1]) == 5 + && REGNO (operands[2]) == 6))" + "ldm.l\\t@er7+,%S0-%S2" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_expand "ldm_h8300s_3" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" "")) + (use (match_operand:SI 2 "register_operand" ""))] + "TARGET_H8300S + && ((REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2) + || (REGNO (operands[0]) == 4 + && REGNO (operands[1]) == 5 + && REGNO (operands[2]) == 6))" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_ldm_h8300s_3_advanced (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_ldm_h8300s_3_normal (operands[0], operands[1], + operands[2])); + DONE; +}") + +(define_insn "ldm_h8300s_4_advanced" [(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 16))) @@ -1966,7 +2196,7 @@ (match_operand:SI 2 "register_operand" "")) (set (mem:SI (reg:SI SP_REG)) (match_operand:SI 3 "register_operand" ""))])] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2 @@ -1975,6 +2205,48 @@ [(set_attr "cc" "none") (set_attr "length" "4")]) +(define_insn "ldm_h8300s_4_normal" + [(parallel + [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int 16))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 12))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 8))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4))) + (match_operand:SI 2 "register_operand" "")) + (set (mem:SI (reg:HI SP_REG)) + (match_operand:SI 3 "register_operand" ""))])] + "TARGET_H8300S && !TARGET_NORMAL_MODE + && REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2 + && REGNO (operands[3]) == 3" + "ldm.l\\t@er7+,%S0-%S3" + [(set_attr "cc" "none") + (set_attr "length" "4")]) + +(define_expand "ldm_h8300s_4" + [(use (match_operand:SI 0 "register_operand" "")) + (use (match_operand:SI 1 "register_operand" "")) + (use (match_operand:SI 2 "register_operand" "")) + (use (match_operand:SI 3 "register_operand" ""))] + "TARGET_H8300S && !TARGET_NORMAL_MODE + && REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2 + && REGNO (operands[3]) == 3" + " +{ + if (!TARGET_NORMAL_MODE) + emit_insn (gen_ldm_h8300s_4_advanced (operands[0], operands[1], + operands[2], operands[3])); + else + emit_insn (gen_ldm_h8300s_4_normal (operands[0], operands[1], + operands[2], operands[3])); + DONE; +}") + (define_expand "return" [(return)] "h8300_can_use_return_insn_p ()" @@ -2131,7 +2403,7 @@ [(set_attr "length" "2,4,6") (set_attr "cc" "clobber,clobber,clobber")]) -(define_insn "" +(define_insn "*zero_extendhisi2_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -2145,7 +2417,7 @@ "" "") -(define_insn "" +(define_insn "*extendqihi2_h8300" [(set (match_operand:HI 0 "register_operand" "=r,r") (sign_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>")))] "TARGET_H8300" @@ -2155,7 +2427,7 @@ [(set_attr "length" "4,8") (set_attr "cc" "clobber,clobber")]) -(define_insn "" +(define_insn "*extendqihi2_h8300hs" [(set (match_operand:HI 0 "register_operand" "=r") (sign_extend:HI (match_operand:QI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -2164,7 +2436,7 @@ (set_attr "cc" "set_znv")]) (define_expand "extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=r,r") + [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:QI 1 "register_operand" "")))] "" "") @@ -2211,7 +2483,7 @@ [(set_attr "length" "6,10") (set_attr "cc" "clobber,clobber")]) -(define_insn "" +(define_insn "*extendhisi2_h8300hs" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (match_operand:HI 1 "register_operand" "0")))] "TARGET_H8300H || TARGET_H8300S" @@ -2261,7 +2533,7 @@ "" "expand_a_shift (QImode, LSHIFTRT, operands); DONE;") -(define_insn "" +(define_insn "*shiftqi" [(set (match_operand:QI 0 "register_operand" "=r,r") (match_operator:QI 3 "nshift_operator" [ (match_operand:QI 1 "register_operand" "0,0") @@ -2297,7 +2569,7 @@ "" "expand_a_shift (HImode, ASHIFTRT, operands); DONE;") -(define_insn "" +(define_insn "*shifthi" [(set (match_operand:HI 0 "register_operand" "=r,r") (match_operator:HI 3 "nshift_operator" [ (match_operand:HI 1 "register_operand" "0,0") @@ -2333,7 +2605,7 @@ "" "expand_a_shift (SImode, ASHIFTRT, operands); DONE;") -(define_insn "" +(define_insn "*shiftsi" [(set (match_operand:SI 0 "register_operand" "=r,r") (match_operator:SI 3 "nshift_operator" [ (match_operand:SI 1 "register_operand" "0,0") @@ -3584,11 +3856,21 @@ (plus:SI (reg:SI SP_REG) (const_int -4))) (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int -3))) (match_operand:QI 0 "register_operand" ""))])] - "TARGET_H8300S" + "TARGET_H8300S && !TARGET_NORMAL_MODE" [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))] "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));") +(define_peephole2 + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -4))) + (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3))) + (match_operand:QI 0 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE" + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_dup 0))] + "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));") + ;; Convert a HImode push into an SImode push so that the ;; define_peephole2 below can cram multiple pushes into one stm.l. @@ -3597,11 +3879,21 @@ (plus:SI (reg:SI SP_REG) (const_int -4))) (set (mem:HI (plus:SI (reg:SI SP_REG) (const_int -2))) (match_operand:HI 0 "register_operand" ""))])] - "TARGET_H8300S" + "TARGET_H8300S && !TARGET_NORMAL_MODE" [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))] "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));") +(define_peephole2 + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) (const_int -4))) + (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2))) + (match_operand:HI 0 "register_operand" ""))])] + "TARGET_H8300S && TARGET_NORMAL_MODE" + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_dup 0))] + "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));") + ;; Cram four pushes into stm.l. (define_peephole2 @@ -3613,7 +3905,7 @@ (match_operand:SI 2 "register_operand" "")) (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_operand:SI 3 "register_operand" ""))] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2 @@ -3631,6 +3923,33 @@ (match_dup 3))])] "") +(define_peephole2 + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 2 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 3 "register_operand" ""))] + "TARGET_H8300S && TARGET_NORMAL_MODE + && REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2 + && REGNO (operands[3]) == 3" + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) + (const_int -16))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_dup 0)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_dup 1)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12))) + (match_dup 2)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -16))) + (match_dup 3))])] + "") + ;; Cram three pushes into stm.l. (define_peephole2 @@ -3640,7 +3959,7 @@ (match_operand:SI 1 "register_operand" "")) (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_operand:SI 2 "register_operand" ""))] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2) @@ -3658,6 +3977,31 @@ (match_dup 2))])] "") +(define_peephole2 + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 1 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 2 "register_operand" ""))] + "TARGET_H8300S && TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 + && REGNO (operands[1]) == 1 + && REGNO (operands[2]) == 2) + || (REGNO (operands[0]) == 4 + && REGNO (operands[1]) == 5 + && REGNO (operands[2]) == 6))" + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) + (const_int -12))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_dup 0)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_dup 1)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12))) + (match_dup 2))])] + "") + ;; Cram two pushes into stm.l. (define_peephole2 @@ -3665,7 +4009,7 @@ (match_operand:SI 0 "register_operand" "")) (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_operand:SI 1 "register_operand" ""))] - "TARGET_H8300S + "TARGET_H8300S && !TARGET_NORMAL_MODE && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" @@ -3678,6 +4022,24 @@ (match_dup 1))])] "") +(define_peephole2 + [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 0 "register_operand" "")) + (set (mem:SI (pre_dec:HI (reg:HI SP_REG))) + (match_operand:SI 1 "register_operand" ""))] + "TARGET_H8300S && TARGET_NORMAL_MODE + && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1) + || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3) + || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))" + [(parallel [(set (reg:HI SP_REG) + (plus:HI (reg:HI SP_REG) + (const_int -8))) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4))) + (match_dup 0)) + (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8))) + (match_dup 1))])] + "") + ;; Turn ;; ;; mov.w #2,r0 @@ -4138,7 +4500,7 @@ ;; dead 127 geu/ltu and.b and test ;; dead 255 geu/ltu and.b and test ;; -;; dead 65535 geu/ltu mov.w +;; ---- 65535 geu/ltu mov.w ;; For a small constant, it is cheaper to actually do the subtraction ;; and then test the register. @@ -4262,7 +4624,7 @@ (pc)))] "(TARGET_H8300H || TARGET_H8300S) && peep2_reg_dead_p (1, operands[0]) - && (INTVAL (operands[1]) == -2147483648 + && (INTVAL (operands[1]) == -2147483647 - 1 || (TARGET_H8300S && INTVAL (operands[1]) == 1073741824))" [(set (match_dup 0) (rotate:SI (match_dup 0) @@ -4277,7 +4639,7 @@ (if_then_else (match_op_dup 3 [(cc0) (const_int 0)]) (label_ref (match_dup 2)) (pc)))] - "operands[4] = GEN_INT (INTVAL (operands[1]) == -2147483648 ? 1 : 2);") + "operands[4] = GEN_INT (INTVAL (operands[1]) == -2147483647 - 1 ? 1 : 2);") ;; Transform ;; @@ -4482,8 +4844,7 @@ (pc)))] "(TARGET_H8300H || TARGET_H8300S) && !peep2_reg_dead_p (1, operands[0]) - && !rtx_equal_p (PATTERN (insn), - PATTERN (next_nonnote_insn (next_nonnote_insn (insn))))" + && !same_cmp_following_p (insn)" [(set (match_dup 4) (match_dup 0)) (set (match_dup 4) diff --git a/gcc/config/h8300/lib1funcs.asm b/gcc/config/h8300/lib1funcs.asm index dc22e54d60e..3793a4bf522 100644 --- a/gcc/config/h8300/lib1funcs.asm +++ b/gcc/config/h8300/lib1funcs.asm @@ -59,9 +59,6 @@ Boston, MA 02111-1307, USA. */ #define S2H r6h #ifdef __H8300__ -#define MOVP mov.w /* pointers are 16 bits */ -#define ADDP add.w -#define CMPP cmp.w #define PUSHP push #define POPP pop @@ -75,9 +72,6 @@ Boston, MA 02111-1307, USA. */ #endif #if defined (__H8300H__) || defined (__H8300S__) -#define MOVP mov.l /* pointers are 32 bits */ -#define ADDP add.l -#define CMPP cmp.l #define PUSHP push.l #define POPP pop.l @@ -323,8 +317,8 @@ setbit: inc A0L ; do insert bit #ifdef __H8300__ divnorm: - mov.b #0,S2L ; keep the sign in S2 mov.b A0H,A0H ; is the numerator -ve + stc ccr,S2L ; keep the sign in bit 3 of S2L bge postive ; negate arg @@ -337,8 +331,6 @@ divnorm: addx #0,A1H addx #0,A0L addx #0,A0H - - mov.b #1,S2L ; the sign will be -ve postive: mov.b A2H,A2H ; is the denominator -ve bge postive2 @@ -350,15 +342,15 @@ postive: addx #0,A3H addx #0,A2L addx #0,A2H - xor #1,S2L ; toggle result sign + xor.b #0x08,S2L ; toggle the result sign postive2: rts ;; Basically the same, except that the sign of the divisor determines ;; the sign. modnorm: - mov.b #0,S2L ; keep the sign in S2 mov.b A0H,A0H ; is the numerator -ve + stc ccr,S2L ; keep the sign in bit 3 of S2L bge mpostive ; negate arg @@ -371,8 +363,6 @@ modnorm: addx #0,A1H addx #0,A0L addx #0,A0H - - mov.b #1,S2L ; the sign will be -ve mpostive: mov.b A2H,A2H ; is the denominator -ve bge mpostive2 @@ -390,19 +380,18 @@ mpostive2: #else /* __H8300H__ */ divnorm: - mov.b #0,S2L ; keep the sign in S2 mov.l A0P,A0P ; is the numerator -ve + stc ccr,S2L ; keep the sign in bit 3 of S2L bge postive neg.l A0P ; negate arg - mov.b #1,S2L ; the sign will be -ve postive: mov.l A1P,A1P ; is the denominator -ve bge postive2 neg.l A1P ; negate arg - xor.b #1,S2L ; toggle result sign + xor.b #0x08,S2L ; toggle the result sign postive2: rts @@ -410,12 +399,11 @@ postive2: ;; Basically the same, except that the sign of the divisor determines ;; the sign. modnorm: - mov.b #0,S2L ; keep the sign in S2 mov.l A0P,A0P ; is the numerator -ve + stc ccr,S2L ; keep the sign in bit 3 of S2L bge mpostive neg.l A0P ; negate arg - mov.b #1,S2L ; the sign will be -ve mpostive: mov.l A1P,A1P ; is the denominator -ve @@ -432,58 +420,68 @@ mpostive2: ; denominator in A2/A3 .global ___modsi3 ___modsi3: +#ifdef __H8300__ PUSHP S2P PUSHP S0P PUSHP S1P - bsr modnorm bsr divmodsi4 -#ifdef __H8300__ mov S0,A0 mov S1,A1 + bra exitdiv #else - mov.l S0P,A0P -#endif + PUSHP S2P + bsr modnorm + bsr ___udivsi3 + mov.l er3,er0 bra exitdiv +#endif + ;; H8/300H and H8S version of ___udivsi3 is defined later in + ;; the file. +#ifdef __H8300__ .global ___udivsi3 ___udivsi3: PUSHP S2P PUSHP S0P PUSHP S1P - mov.b #0,S2L ; keep sign low bsr divmodsi4 - bra exitdiv + bra reti +#endif .global ___umodsi3 ___umodsi3: +#ifdef __H8300__ PUSHP S2P PUSHP S0P PUSHP S1P - mov.b #0,S2L ; keep sign low bsr divmodsi4 -#ifdef __H8300__ mov S0,A0 mov S1,A1 + bra reti #else - mov.l S0P,A0P + bsr ___udivsi3 + mov.l er3,er0 + rts #endif - bra exitdiv .global ___divsi3 ___divsi3: +#ifdef __H8300__ PUSHP S2P PUSHP S0P PUSHP S1P jsr divnorm jsr divmodsi4 +#else + PUSHP S2P + jsr divnorm + bsr ___udivsi3 +#endif ; examine what the sign should be exitdiv: - POPP S1P - POPP S0P - - or S2L,S2L + btst #3,S2L beq reti ; should be -ve @@ -502,6 +500,10 @@ exitdiv: #endif reti: +#ifdef __H8300__ + POPP S1P + POPP S0P +#endif POPP S2P rts @@ -509,7 +511,7 @@ reti: ; A2/A3 denominator (A1P for H8/300H) ; returns A0/A1 quotient (A0P for H8/300H) ; S0/S1 remainder (S0P for H8/300H) - ; trashes S2 + ; trashes S2H #ifdef __H8300__ @@ -519,7 +521,7 @@ divmodsi4: mov.b A2H,S2H or A2L,S2H or A3H,S2H - bne DenHighZero + bne DenHighNonZero mov.b A0H,A0H bne NumByte0Zero mov.b A0L,A0L @@ -549,7 +551,7 @@ NumByte3Zero: rts ; have to do the divide by shift and test -DenHighZero: +DenHighNonZero: mov.b A0H,S1L mov.b A0L,A0H mov.b A1H,A0L @@ -588,10 +590,11 @@ setone: #else /* __H8300H__ */ -divmodsi4: - sub.l S0P,S0P ; zero play area + ;; This function also computes the remainder and stores it in er3. + .global ___udivsi3 +___udivsi3: mov.w A1E,A1E ; denominator top word 0? - bne DenHighZero + bne DenHighNonZero ; do it the easy way, see page 107 in manual mov.w A0E,A2 @@ -599,36 +602,65 @@ divmodsi4: divxu.w A1,A2P mov.w A2E,A0E divxu.w A1,A0P - mov.w A0E,S0 - mov.w A2,A0E - extu.l S0P - rts - -DenHighZero: - mov.w A0E,A2 - mov.b A2H,S0L - mov.b A2L,A2H - mov.b A0H,A2L + mov.w A0E,A3 mov.w A2,A0E - mov.b A0L,A0H - mov.b #0,A0L - mov.b #24,S2H ; only do 24 iterations - -nextbit: - shll.l A0P ; double the answer guess - rotxl.l S0P ; double remainder - sub.l A1P,S0P ; does it all fit? - bhs setone - - add.l A1P,S0P ; no, restore mistake - dec S2H - bne nextbit + extu.l A3P rts -setone: - inc A0L - dec S2H - bne nextbit + ; er0 = er0 / er1 + ; er3 = er0 % er1 + ; trashes er1 er2 + ; expects er1 >= 2^16 +DenHighNonZero: + mov.l er0,er3 + mov.l er1,er2 +#ifdef __H8300H__ +divmod_L21: + shlr.l er0 + shlr.l er2 ; make divisor < 2^16 + mov.w e2,e2 + bne divmod_L21 +#else + shlr.l #2,er2 ; make divisor < 2^16 + mov.w e2,e2 + beq divmod_L22A +divmod_L21: + shlr.l #2,er0 +divmod_L22: + shlr.l #2,er2 ; make divisor < 2^16 + mov.w e2,e2 + bne divmod_L21 +divmod_L22A: + rotxl.w r2 + bcs divmod_L23 + shlr.l er0 + bra divmod_L24 +divmod_L23: + rotxr.w r2 + shlr.l #2,er0 +divmod_L24: +#endif + ;; At this point, + ;; er0 contains shifted dividend + ;; er1 contains divisor + ;; er2 contains shifted divisor + ;; er3 contains dividend, later remainder + divxu.w r2,er0 ; r0 now contains the approximate quotient (AQ) + extu.l er0 + beq divmod_L25 + subs #1,er0 ; er0 = AQ - 1 + mov.w e1,r2 + mulxu.w r0,er2 ; er2 = upper (AQ - 1) * divisor + sub.w r2,e3 ; dividend - 65536 * er2 + mov.w r1,r2 + mulxu.w r0,er2 ; compute er3 = remainder (tentative) + sub.l er2,er3 ; er3 = dividend - (AQ - 1) * divisor +divmod_L25: + cmp.l er1,er3 ; is divisor < remainder? + blo divmod_L26 + adds #1,er0 + sub.l er1,er3 ; correct the remainder +divmod_L26: rts #endif @@ -698,7 +730,6 @@ ___mulhi3: ___mulsi3: PUSHP S0P PUSHP S1P - PUSHP S2P sub.w S0,S0 sub.w S1,S1 @@ -731,7 +762,6 @@ _nobit: _done: mov.w S0,A0 mov.w S1,A1 - POPP S2P POPP S1P POPP S0P rts diff --git a/gcc/config/h8300/t-h8300 b/gcc/config/h8300/t-h8300 index a8b2981e397..28ea2cf71bd 100644 --- a/gcc/config/h8300/t-h8300 +++ b/gcc/config/h8300/t-h8300 @@ -1,6 +1,3 @@ -# The three first floating point functions listed in LIB1ASMFUNCS (_fixsfdi, -# _floatdisf, and _fixunssfdi) are used to disable the inclusion of those -# from libgcc2.c. They do not actually exist in lib1funcs.asm. LIB1ASMSRC = h8300/lib1funcs.asm LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \ _fixunssfsi_asm diff --git a/gcc/config/i370/i370-protos.h b/gcc/config/i370/i370-protos.h index be2c01c463d..666db0b7aa6 100644 --- a/gcc/config/i370/i370-protos.h +++ b/gcc/config/i370/i370-protos.h @@ -24,32 +24,32 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_I370_PROTOS_H #define GCC_I370_PROTOS_H -extern void override_options PARAMS ((void)); +extern void override_options (void); #ifdef RTX_CODE -extern int i370_branch_dest PARAMS ((rtx)); -extern int i370_branch_length PARAMS ((rtx)); -extern int i370_short_branch PARAMS ((rtx)); -extern int s_operand PARAMS ((rtx, enum machine_mode)); -extern int r_or_s_operand PARAMS ((rtx, enum machine_mode)); -extern int unsigned_jump_follows_p PARAMS ((rtx)); +extern int i370_branch_dest (rtx); +extern int i370_branch_length (rtx); +extern int i370_short_branch (rtx); +extern int s_operand (rtx, enum machine_mode); +extern int r_or_s_operand (rtx, enum machine_mode); +extern int unsigned_jump_follows_p (rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern int handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *)); +extern int handle_pragma (int (*)(void), void (*)(int), const char *); #endif /* TREE_CODE */ -extern void mvs_add_label PARAMS ((int)); -extern int mvs_check_label PARAMS ((int)); -extern int mvs_check_page PARAMS ((FILE *, int, int)); -extern int mvs_function_check PARAMS ((const char *)); -extern void mvs_add_alias PARAMS ((const char *, const char *, int)); -extern int mvs_need_alias PARAMS ((const char *)); -extern int mvs_get_alias PARAMS ((const char *, char *)); -extern int mvs_check_alias PARAMS ((const char *, char *)); -extern void check_label_emit PARAMS ((void)); -extern void mvs_free_label_list PARAMS ((void)); - -extern void i370_pr_map PARAMS ((struct cpp_reader *)); +extern void mvs_add_label (int); +extern int mvs_check_label (int); +extern int mvs_check_page (FILE *, int, int); +extern int mvs_function_check (const char *); +extern void mvs_add_alias (const char *, const char *, int); +extern int mvs_need_alias (const char *); +extern int mvs_get_alias (const char *, char *); +extern int mvs_check_alias (const char *, char *); +extern void check_label_emit (void); +extern void mvs_free_label_list (void); + +extern void i370_pr_map (struct cpp_reader *); #endif /* ! GCC_I370_PROTOS_H */ diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c index 0dfa3c4559b..2cfe4fe3269 100644 --- a/gcc/config/i370/i370.c +++ b/gcc/config/i370/i370.c @@ -99,22 +99,22 @@ static label_node_t *free_anchor = 0; /* Assembler source file descriptor. */ static FILE *assembler_source = 0; -static label_node_t * mvs_get_label PARAMS ((int)); -static void i370_label_scan PARAMS ((void)); +static label_node_t * mvs_get_label (int); +static void i370_label_scan (void); #ifdef TARGET_HLASM -static bool i370_hlasm_assemble_integer PARAMS ((rtx, unsigned int, int)); -static void i370_globalize_label PARAMS ((FILE *, const char *)); +static bool i370_hlasm_assemble_integer (rtx, unsigned int, int); +static void i370_globalize_label (FILE *, const char *); #endif -static void i370_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static void i370_file_start PARAMS ((void)); -static void i370_file_end PARAMS ((void)); +static void i370_output_function_prologue (FILE *, HOST_WIDE_INT); +static void i370_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void i370_file_start (void); +static void i370_file_end (void); #ifdef LONGEXTERNAL -static int mvs_hash_alias PARAMS ((const char *)); +static int mvs_hash_alias (const char *); #endif -static void i370_internal_label PARAMS ((FILE *, const char *, unsigned long)); -static bool i370_rtx_costs PARAMS ((rtx, int, int, int *)); +static void i370_internal_label (FILE *, const char *, unsigned long); +static bool i370_rtx_costs (rtx, int, int, int *); /* ===================================================== */ /* defines and functions specific to the HLASM assembler */ diff --git a/gcc/config/i370/linux.h b/gcc/config/i370/linux.h index adc1959c4d0..f402fbde9f3 100644 --- a/gcc/config/i370/linux.h +++ b/gcc/config/i370/linux.h @@ -29,13 +29,7 @@ Boston, MA 02111-1307, USA. */ #define TARGET_ELF_ABI /* Target OS preprocessor built-ins. */ -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=posix"); \ - } while (0) +#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() /* Options for this target machine. */ diff --git a/gcc/config/i386/athlon.md b/gcc/config/i386/athlon.md index b90ae22c06d..4ce9a3812d8 100644 --- a/gcc/config/i386/athlon.md +++ b/gcc/config/i386/athlon.md @@ -220,7 +220,7 @@ (and (eq_attr "type" "idiv") (eq_attr "memory" "load,both"))) "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))") -;; The paralelism of string instructions is not documented. Model it same way +;; The parallelism of string instructions is not documented. Model it same way ;; as idiv to create smaller automata. This probably does not matter much. (define_insn_reservation "athlon_str" 6 (and (eq_attr "cpu" "athlon,k8") @@ -831,7 +831,7 @@ (and (eq_attr "cpu" "k8") (eq_attr "type" "ssemul")) "athlon-double,athlon-fpsched,(athlon-fmul*2)") -;; divsd timmings. divss is faster +;; divsd timings. divss is faster (define_insn_reservation "athlon_ssediv_load" 20 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssediv") diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index 8ed30443bc8..99b037233da 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -376,6 +376,9 @@ extern int i386_pe_dllimport_name_p (const char *); alias = XSTR (rtlname, 0); \ else \ abort (); \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + i386_pe_declare_function_type (STREAM, alias, \ + TREE_PUBLIC (DECL)); \ ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \ } while (0) @@ -384,4 +387,3 @@ extern int i386_pe_dllimport_name_p (const char *); #ifndef BUFSIZ # undef FILE #endif - diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index ff0ff254bac..cc9994bcaed 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -7,14 +7,7 @@ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("MACH"); \ - builtin_define_std ("unix"); \ - builtin_define ("__GNU__"); \ - builtin_define ("__gnu_hurd__"); \ - builtin_assert ("system=gnu"); \ - builtin_assert ("system=mach"); \ - builtin_assert ("system=posix"); \ - builtin_assert ("system=unix"); \ + HURD_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index 9e20b31dbf6..4f21789c99d 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -145,13 +145,13 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \ do \ { \ - register const unsigned char *_limited_str = \ + const unsigned char *_limited_str = \ (const unsigned char *) (STR); \ - register unsigned ch; \ + unsigned ch; \ fprintf ((FILE), "%s\"", STRING_ASM_OP); \ for (; (ch = *_limited_str); _limited_str++) \ { \ - register int escape = ESCAPES[ch]; \ + int escape = ESCAPES[ch]; \ switch (escape) \ { \ case 0: \ @@ -181,13 +181,13 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + unsigned bytes_in_chunk = 0; \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ if (bytes_in_chunk >= 64) \ { \ fputc ('\n', (FILE)); \ diff --git a/gcc/config/i386/i386-modes.def b/gcc/config/i386/i386-modes.def index ddfc5cfcf52..89c83c44187 100644 --- a/gcc/config/i386/i386-modes.def +++ b/gcc/config/i386/i386-modes.def @@ -18,11 +18,21 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* By default our XFmode is the 80-bit extended format. If we use - TFmode instead, it's also the 80-bit format, but with padding. */ +/* x86_64 ABI specifies both XF and TF modes. + XFmode is __float80 is IEEE extended; TFmode is __float128 + is IEEE quad. + + IEEE extended is 128 bits wide, except in ILP32 mode, but we + have to say it's 12 bytes so that the bitsize and wider_mode + tables are correctly set up. We correct its size below. */ FLOAT_MODE (XF, 12, ieee_extended_intel_96_format); -FLOAT_MODE (TF, 16, ieee_extended_intel_128_format); +ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE + ? &ieee_extended_intel_128_format + : &ieee_extended_intel_96_format)); +ADJUST_BYTESIZE (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 12); +ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4); +FLOAT_MODE (TF, 16, ieee_quad_format); /* Add any extra modes needed to represent the condition code. diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 33469ccd3ef..60880b805e2 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -203,7 +203,6 @@ extern rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int); #ifdef TREE_CODE extern int ix86_return_pops_args (tree, tree, int); -extern tree ix86_build_va_list (void); extern int ix86_data_alignment (tree, int); extern int ix86_local_alignment (tree, int); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8fdf24dad46..d4653ace834 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -830,7 +830,8 @@ static void x86_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, static bool x86_can_output_mi_thunk (tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static void x86_file_start (void); static void ix86_reorg (void); -bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*); +static bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*); +static tree ix86_build_builtin_va_list (void); struct ix86_address { @@ -1012,6 +1013,9 @@ static void init_ext_80387_constants (void); #undef TARGET_MACHINE_DEPENDENT_REORG #define TARGET_MACHINE_DEPENDENT_REORG ix86_reorg +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; /* The svr4 ABI for the i386 says that records and unions are returned @@ -1662,7 +1666,7 @@ ix86_comp_type_attributes (tree type1, tree type2) /* Return the regparm value for a fuctio with the indicated TYPE and DECL. DECL may be NULL when calling function indirectly - or considerling a libcall. */ + or considering a libcall. */ static int ix86_function_regparm (tree type, tree decl) @@ -1930,7 +1934,7 @@ static int classify_argument (enum machine_mode mode, tree type, enum x86_64_reg_class classes[MAX_CLASSES], int bit_offset) { - int bytes = + HOST_WIDE_INT bytes = (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); int words = (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD; @@ -2193,11 +2197,14 @@ classify_argument (enum machine_mode mode, tree type, case DFmode: classes[0] = X86_64_SSEDF_CLASS; return 1; - case TFmode: + case XFmode: classes[0] = X86_64_X87_CLASS; classes[1] = X86_64_X87UP_CLASS; return 2; + case TFmode: case TCmode: + return 0; + case XCmode: classes[0] = X86_64_X87_CLASS; classes[1] = X86_64_X87UP_CLASS; classes[2] = X86_64_X87_CLASS; @@ -2334,16 +2341,16 @@ construct_container (enum machine_mode mode, tree type, int in_return, return gen_rtx_REG (mode, SSE_REGNO (sse_regno)); if (n == 2 && class[0] == X86_64_X87_CLASS && class[1] == X86_64_X87UP_CLASS) - return gen_rtx_REG (TFmode, FIRST_STACK_REG); + return gen_rtx_REG (XFmode, FIRST_STACK_REG); if (n == 2 && class[0] == X86_64_INTEGER_CLASS && class[1] == X86_64_INTEGER_CLASS - && (mode == CDImode || mode == TImode) + && (mode == CDImode || mode == TImode || mode == TFmode) && intreg[0] + 1 == intreg[1]) return gen_rtx_REG (mode, intreg[0]); if (n == 4 && class[0] == X86_64_X87_CLASS && class[1] == X86_64_X87UP_CLASS && class[2] == X86_64_X87_CLASS && class[3] == X86_64_X87UP_CLASS) - return gen_rtx_REG (TCmode, FIRST_STACK_REG); + return gen_rtx_REG (XCmode, FIRST_STACK_REG); /* Otherwise figure out the entries of the PARALLEL. */ for (i = 0; i < n; i++) @@ -2775,8 +2782,9 @@ ix86_return_in_memory (tree type) } } - if (mode == TFmode) + if (mode == XFmode) return 0; + if (size > 12) return 1; return 0; @@ -2791,20 +2799,23 @@ ix86_libcall_value (enum machine_mode mode) { switch (mode) { - case SFmode: - case SCmode: - case DFmode: - case DCmode: - return gen_rtx_REG (mode, FIRST_SSE_REG); - case TFmode: - case TCmode: - return gen_rtx_REG (mode, FIRST_FLOAT_REG); - default: - return gen_rtx_REG (mode, 0); + case SFmode: + case SCmode: + case DFmode: + case DCmode: + return gen_rtx_REG (mode, FIRST_SSE_REG); + case XFmode: + case XCmode: + return gen_rtx_REG (mode, FIRST_FLOAT_REG); + case TFmode: + case TCmode: + return NULL; + default: + return gen_rtx_REG (mode, 0); } } else - return gen_rtx_REG (mode, ix86_value_regno (mode)); + return gen_rtx_REG (mode, ix86_value_regno (mode)); } /* Given a mode, return the register to use for a return value. */ @@ -2825,8 +2836,8 @@ ix86_value_regno (enum machine_mode mode) /* Create the va_list data type. */ -tree -ix86_build_va_list (void) +static tree +ix86_build_builtin_va_list (void) { tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl; @@ -3430,7 +3441,7 @@ const_int_1_31_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) reference and a constant. */ int -symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -3474,7 +3485,7 @@ symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) /* Return true if the operand contains a @GOT or @GOTOFF reference. */ int -pic_symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +pic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST) return 0; @@ -3537,7 +3548,7 @@ local_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) /* Test for various thread-local symbols. */ int -tls_symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +tls_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != SYMBOL_REF) return 0; @@ -3553,29 +3564,27 @@ tls_symbolic_operand_1 (rtx op, enum tls_model kind) } int -global_dynamic_symbolic_operand (register rtx op, +global_dynamic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return tls_symbolic_operand_1 (op, TLS_MODEL_GLOBAL_DYNAMIC); } int -local_dynamic_symbolic_operand (register rtx op, +local_dynamic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_DYNAMIC); } int -initial_exec_symbolic_operand (register rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) +initial_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return tls_symbolic_operand_1 (op, TLS_MODEL_INITIAL_EXEC); } int -local_exec_symbolic_operand (register rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) +local_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_EXEC); } @@ -3646,13 +3655,13 @@ constant_call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) /* Match exactly zero and one. */ int -const0_operand (register rtx op, enum machine_mode mode) +const0_operand (rtx op, enum machine_mode mode) { return op == CONST0_RTX (mode); } int -const1_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return op == const1_rtx; } @@ -3660,33 +3669,32 @@ const1_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) /* Match 2, 4, or 8. Used for leal multiplicands. */ int -const248_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +const248_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && (INTVAL (op) == 2 || INTVAL (op) == 4 || INTVAL (op) == 8)); } int -const_0_to_3_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +const_0_to_3_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 4); } int -const_0_to_7_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +const_0_to_7_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 8); } int -const_0_to_15_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +const_0_to_15_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 16); } int -const_0_to_255_operand (register rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) +const_0_to_255_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 256); } @@ -3695,7 +3703,7 @@ const_0_to_255_operand (register rtx op, /* True if this is a constant appropriate for an increment or decrement. */ int -incdec_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +incdec_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { /* On Pentium4, the inc and dec operations causes extra dependency on flag registers, since carry flag is not set. */ @@ -3724,7 +3732,7 @@ shiftdi_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) Which would only happen in pathological cases. */ int -reg_no_sp_operand (register rtx op, enum machine_mode mode) +reg_no_sp_operand (rtx op, enum machine_mode mode) { rtx t = op; if (GET_CODE (t) == SUBREG) @@ -3736,7 +3744,7 @@ reg_no_sp_operand (register rtx op, enum machine_mode mode) } int -mmx_reg_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +mmx_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return MMX_REG_P (op); } @@ -3745,7 +3753,7 @@ mmx_reg_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) general_operand. */ int -general_no_elim_operand (register rtx op, enum machine_mode mode) +general_no_elim_operand (rtx op, enum machine_mode mode) { rtx t = op; if (GET_CODE (t) == SUBREG) @@ -3766,7 +3774,7 @@ general_no_elim_operand (register rtx op, enum machine_mode mode) register_operand or const_int. */ int -nonmemory_no_elim_operand (register rtx op, enum machine_mode mode) +nonmemory_no_elim_operand (rtx op, enum machine_mode mode) { rtx t = op; if (GET_CODE (t) == SUBREG) @@ -3783,7 +3791,7 @@ nonmemory_no_elim_operand (register rtx op, enum machine_mode mode) otherwise work like register_operand. */ int -index_register_operand (register rtx op, enum machine_mode mode) +index_register_operand (rtx op, enum machine_mode mode) { rtx t = op; if (GET_CODE (t) == SUBREG) @@ -3804,7 +3812,7 @@ index_register_operand (register rtx op, enum machine_mode mode) /* Return true if op is a Q_REGS class register. */ int -q_regs_operand (register rtx op, enum machine_mode mode) +q_regs_operand (rtx op, enum machine_mode mode) { if (mode != VOIDmode && GET_MODE (op) != mode) return 0; @@ -3816,7 +3824,7 @@ q_regs_operand (register rtx op, enum machine_mode mode) /* Return true if op is an flags register. */ int -flags_reg_operand (register rtx op, enum machine_mode mode) +flags_reg_operand (rtx op, enum machine_mode mode) { if (mode != VOIDmode && GET_MODE (op) != mode) return 0; @@ -3826,7 +3834,7 @@ flags_reg_operand (register rtx op, enum machine_mode mode) /* Return true if op is a NON_Q_REGS class register. */ int -non_q_regs_operand (register rtx op, enum machine_mode mode) +non_q_regs_operand (rtx op, enum machine_mode mode) { if (mode != VOIDmode && GET_MODE (op) != mode) return 0; @@ -3874,7 +3882,7 @@ vector_move_operand (rtx op, enum machine_mode mode) a segment override. */ int -no_seg_address_operand (register rtx op, enum machine_mode mode) +no_seg_address_operand (rtx op, enum machine_mode mode) { struct ix86_address parts; @@ -3919,7 +3927,7 @@ sse_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) } /* Return 1 if OP is a valid comparison operator in valid mode. */ int -ix86_comparison_operator (register rtx op, enum machine_mode mode) +ix86_comparison_operator (rtx op, enum machine_mode mode) { enum machine_mode inmode; enum rtx_code code = GET_CODE (op); @@ -3960,7 +3968,7 @@ ix86_comparison_operator (register rtx op, enum machine_mode mode) /* Return 1 if OP is a valid comparison operator testing carry flag to be set. */ int -ix86_carry_flag_operator (register rtx op, enum machine_mode mode) +ix86_carry_flag_operator (rtx op, enum machine_mode mode) { enum machine_mode inmode; enum rtx_code code = GET_CODE (op); @@ -3992,7 +4000,7 @@ ix86_carry_flag_operator (register rtx op, enum machine_mode mode) /* Return 1 if OP is a comparison operator that can be issued by fcmov. */ int -fcmov_comparison_operator (register rtx op, enum machine_mode mode) +fcmov_comparison_operator (rtx op, enum machine_mode mode) { enum machine_mode inmode; enum rtx_code code = GET_CODE (op); @@ -4029,8 +4037,7 @@ fcmov_comparison_operator (register rtx op, enum machine_mode mode) /* Return 1 if OP is a binary operator that can be promoted to wider mode. */ int -promotable_binary_operator (register rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) +promotable_binary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -4054,7 +4061,7 @@ promotable_binary_operator (register rtx op, into registers. */ int -cmp_fp_expander_operand (register rtx op, enum machine_mode mode) +cmp_fp_expander_operand (rtx op, enum machine_mode mode) { if (mode != VOIDmode && mode != GET_MODE (op)) return 0; @@ -4066,7 +4073,7 @@ cmp_fp_expander_operand (register rtx op, enum machine_mode mode) /* Match an SI or HImode register for a zero_extract. */ int -ext_register_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +ext_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { int regno; if ((!TARGET_64BIT || GET_MODE (op) != DImode) @@ -4085,7 +4092,7 @@ ext_register_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) OP is the expression matched, and MODE is its mode. */ int -binary_fp_operator (register rtx op, enum machine_mode mode) +binary_fp_operator (rtx op, enum machine_mode mode) { if (mode != VOIDmode && mode != GET_MODE (op)) return 0; @@ -4104,13 +4111,13 @@ binary_fp_operator (register rtx op, enum machine_mode mode) } int -mult_operator (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +mult_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == MULT; } int -div_operator (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +div_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == DIV; } @@ -4126,7 +4133,7 @@ arith_or_logical_operator (rtx op, enum machine_mode mode) /* Returns 1 if OP is memory operand with a displacement. */ int -memory_displacement_operand (register rtx op, enum machine_mode mode) +memory_displacement_operand (rtx op, enum machine_mode mode) { struct ix86_address parts; @@ -4168,7 +4175,7 @@ cmpsi_operand (rtx op, enum machine_mode mode) modRM array. */ int -long_memory_operand (register rtx op, enum machine_mode mode) +long_memory_operand (rtx op, enum machine_mode mode) { if (! memory_operand (op, mode)) return 0; @@ -4253,8 +4260,7 @@ init_ext_80387_constants (void) real_from_string (&ext_80387_constants_table[i], cst[i]); /* Ensure each constant is rounded to XFmode precision. */ real_convert (&ext_80387_constants_table[i], - TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode, - &ext_80387_constants_table[i]); + XFmode, &ext_80387_constants_table[i]); } ext_80387_constants_init = 1; @@ -4276,7 +4282,7 @@ standard_80387_constant_p (rtx x) /* For XFmode constants, try to find a special 80387 instruction on those CPUs that benefit from them. */ - if ((GET_MODE (x) == XFmode || GET_MODE (x) == TFmode) + if (GET_MODE (x) == XFmode && x86_ext_80387_constants & TUNEMASK) { REAL_VALUE_TYPE r; @@ -4347,7 +4353,7 @@ standard_80387_constant_rtx (int idx) } return CONST_DOUBLE_FROM_REAL_VALUE (ext_80387_constants_table[i], - TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode); + XFmode); } /* Return 1 if X is FP constant we can load to SSE register w/o using memory. @@ -4365,8 +4371,8 @@ standard_sse_constant_p (rtx x) int symbolic_reference_mentioned_p (rtx op) { - register const char *fmt; - register int i; + const char *fmt; + int i; if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) return 1; @@ -4376,7 +4382,7 @@ symbolic_reference_mentioned_p (rtx op) { if (fmt[i] == 'E') { - register int j; + int j; for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) @@ -4449,6 +4455,9 @@ x86_64_sign_extended_value (rtx value) library. Don't count TLS SYMBOL_REFs here, since they should fit only if inside of UNSPEC handled below. */ case SYMBOL_REF: + /* TLS symbols are not constant. */ + if (tls_symbolic_operand (value, Pmode)) + return false; return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL); /* For certain code models, the code is near as well. */ @@ -4554,6 +4563,9 @@ x86_64_zero_extended_value (rtx value) /* For certain code models, the symbolic references are known to fit. */ case SYMBOL_REF: + /* TLS symbols are not constant. */ + if (tls_symbolic_operand (value, Pmode)) + return false; return ix86_cmodel == CM_SMALL; /* For certain code models, the code is near as well. */ @@ -4882,7 +4894,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) { HOST_WIDE_INT total_size; int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT; - int offset; + HOST_WIDE_INT offset; int preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT; HOST_WIDE_INT size = get_frame_size (); @@ -4998,7 +5010,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame) (size + frame->padding1 + frame->padding2 + frame->outgoing_arguments_size + frame->va_arg_size); - if (!frame->to_allocate && frame->nregs <= 1) + if ((!frame->to_allocate && frame->nregs <= 1) + || (TARGET_64BIT && frame->to_allocate >= (HOST_WIDE_INT) 0x80000000)) frame->save_regs_using_mov = false; if (TARGET_RED_ZONE && current_function_sp_is_unchanging @@ -5035,7 +5048,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) static void ix86_emit_save_regs (void) { - register int regno; + int regno; rtx insn; for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--) @@ -5065,6 +5078,41 @@ ix86_emit_save_regs_using_mov (rtx pointer, HOST_WIDE_INT offset) } } +/* Expand prologue or epilogue stack adjustment. + The pattern exist to put a dependency on all ebp-based memory accesses. + STYLE should be negative if instructions should be marked as frame related, + zero if %r11 register is live and cannot be freely used and positive + otherwise. */ + +static void +pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style) +{ + rtx insn; + + if (! TARGET_64BIT) + insn = emit_insn (gen_pro_epilogue_adjust_stack_1 (dest, src, offset)); + else if (x86_64_immediate_operand (offset, DImode)) + insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64 (dest, src, offset)); + else + { + rtx r11; + /* r11 is used by indirect sibcall return as well, set before the + epilogue and used after the epilogue. ATM indirect sibcall + shouldn't be used together with huge frame sizes in one + function because of the frame_size check in sibcall.c. */ + if (style == 0) + abort (); + r11 = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 3 /* R11 */); + insn = emit_insn (gen_rtx_SET (DImode, r11, offset)); + if (style < 0) + RTX_FRAME_RELATED_P (insn) = 1; + insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64_2 (dest, src, r11, + offset)); + } + if (style < 0) + RTX_FRAME_RELATED_P (insn) = 1; +} + /* Expand the prologue into a bunch of separate insns. */ void @@ -5106,12 +5154,8 @@ ix86_expand_prologue (void) if (allocate == 0) ; else if (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT) - { - insn = emit_insn (gen_pro_epilogue_adjust_stack - (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-allocate))); - RTX_FRAME_RELATED_P (insn) = 1; - } + pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (-allocate), -1); else { /* Only valid for Win32. */ @@ -5266,8 +5310,8 @@ ix86_expand_epilogue (int style) tmp = gen_rtx_MEM (Pmode, hard_frame_pointer_rtx); emit_move_insn (hard_frame_pointer_rtx, tmp); - emit_insn (gen_pro_epilogue_adjust_stack - (stack_pointer_rtx, sa, const0_rtx)); + pro_epilogue_adjust_stack (stack_pointer_rtx, sa, + const0_rtx, style); } else { @@ -5278,19 +5322,19 @@ ix86_expand_epilogue (int style) } } else if (!frame_pointer_needed) - emit_insn (gen_pro_epilogue_adjust_stack - (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (frame.to_allocate - + frame.nregs * UNITS_PER_WORD))); + pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (frame.to_allocate + + frame.nregs * UNITS_PER_WORD), + style); /* If not an i386, mov & pop is faster than "leave". */ else if (TARGET_USE_LEAVE || optimize_size || !cfun->machine->use_fast_prologue_epilogue) emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ()); else { - emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx, - hard_frame_pointer_rtx, - const0_rtx)); + pro_epilogue_adjust_stack (stack_pointer_rtx, + hard_frame_pointer_rtx, + const0_rtx, style); if (TARGET_64BIT) emit_insn (gen_popdi1 (hard_frame_pointer_rtx)); else @@ -5305,14 +5349,13 @@ ix86_expand_epilogue (int style) { if (!frame_pointer_needed) abort (); - emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx, - hard_frame_pointer_rtx, - GEN_INT (offset))); + pro_epilogue_adjust_stack (stack_pointer_rtx, + hard_frame_pointer_rtx, + GEN_INT (offset), style); } else if (frame.to_allocate) - emit_insn (gen_pro_epilogue_adjust_stack - (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (frame.to_allocate))); + pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (frame.to_allocate), style); for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (ix86_save_reg (regno, false)) @@ -5351,7 +5394,7 @@ ix86_expand_epilogue (int style) { rtx ecx = gen_rtx_REG (SImode, 2); - /* There are is no "pascal" calling convention in 64bit ABI. */ + /* There is no "pascal" calling convention in 64bit ABI. */ if (TARGET_64BIT) abort (); @@ -5382,7 +5425,7 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, strictly valid, but still used for computing length of lea instruction. */ static int -ix86_decompose_address (register rtx addr, struct ix86_address *out) +ix86_decompose_address (rtx addr, struct ix86_address *out) { rtx base = NULL_RTX; rtx index = NULL_RTX; @@ -5744,7 +5787,7 @@ legitimate_pic_operand_p (rtx x) in PIC mode. */ int -legitimate_pic_address_disp_p (register rtx disp) +legitimate_pic_address_disp_p (rtx disp) { bool saw_plus; @@ -5858,7 +5901,7 @@ legitimate_pic_address_disp_p (register rtx disp) be recognized. */ int -legitimate_address_p (enum machine_mode mode, register rtx addr, int strict) +legitimate_address_p (enum machine_mode mode, rtx addr, int strict) { struct ix86_address parts; rtx base, index, disp; @@ -6426,8 +6469,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) See comments by legitimize_pic_address in i386.c for details. */ rtx -legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, - enum machine_mode mode) +legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) { int changed = 0; unsigned log; @@ -6567,8 +6609,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, if (GET_CODE (XEXP (x, 0)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 1), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 1), temp); if (val != temp) emit_move_insn (temp, val); @@ -6578,8 +6620,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, else if (GET_CODE (XEXP (x, 1)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 0), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 0), temp); if (val != temp) emit_move_insn (temp, val); @@ -6937,11 +6979,14 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, void print_reg (rtx x, int code, FILE *file) { - if ((REGNO (x) == ARG_POINTER_REGNUM - || REGNO (x) == FRAME_POINTER_REGNUM - || REGNO (x) == FLAGS_REG - || REGNO (x) == FPSR_REG) - && file == asm_out_file) + /* Code -1 indicates we are called from print_rtx, and it is not + an error for a virtual register to appear here. */ + if (code == -1) + code = 0; + else if (REGNO (x) == ARG_POINTER_REGNUM + || REGNO (x) == FRAME_POINTER_REGNUM + || REGNO (x) == FLAGS_REG + || REGNO (x) == FPSR_REG) abort (); if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0) @@ -7008,12 +7053,17 @@ print_reg (rtx x, int code, FILE *file) /* FALLTHRU */ case 16: case 2: + normal: fputs (hi_reg_name[REGNO (x)], file); break; case 1: + if (REGNO (x) >= ARRAY_SIZE (qi_reg_name)) + goto normal; fputs (qi_reg_name[REGNO (x)], file); break; case 0: + if (REGNO (x) >= ARRAY_SIZE (qi_high_reg_name)) + goto normal; fputs (qi_high_reg_name[REGNO (x)], file); break; default: @@ -7402,7 +7452,7 @@ print_operand (FILE *file, rtx x, int code) if (ASSEMBLER_DIALECT == ASM_ATT) putc ('$', file); - fprintf (file, "0x%lx", l); + fprintf (file, "0x%08lx", l); } /* These float cases don't actually occur as immediate operands. */ @@ -7415,7 +7465,7 @@ print_operand (FILE *file, rtx x, int code) } else if (GET_CODE (x) == CONST_DOUBLE - && (GET_MODE (x) == XFmode || GET_MODE (x) == TFmode)) + && GET_MODE (x) == XFmode) { char dstr[30]; @@ -7453,7 +7503,7 @@ print_operand (FILE *file, rtx x, int code) /* Print a memory operand whose address is ADDR. */ void -print_operand_address (FILE *file, register rtx addr) +print_operand_address (FILE *file, rtx addr) { struct ix86_address parts; rtx base, index, disp; @@ -8655,7 +8705,6 @@ ix86_prepare_fp_compare_args (enum rtx_code code, rtx *pop0, rtx *pop1) if (!is_sse && (fpcmp_mode == CCFPUmode || op_mode == XFmode - || op_mode == TFmode || ix86_use_fcomi_compare (code))) { op0 = force_reg (op_mode, op0); @@ -9130,7 +9179,6 @@ ix86_expand_branch (enum rtx_code code, rtx label) case SFmode: case DFmode: case XFmode: - case TFmode: { rtvec vec; int use_fcomi; @@ -9423,9 +9471,9 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) return 1; /* DONE */ } -/* Expand comparison setting or clearing carry flag. Return true when successful - and set pop for the operation. */ -bool +/* Expand comparison setting or clearing carry flag. Return true when + successful and set pop for the operation. */ +static bool ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) { enum machine_mode mode = @@ -10321,7 +10369,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) int size; if (!TARGET_64BIT) - size = mode == TFmode ? 3 : (GET_MODE_SIZE (mode) / 4); + size = mode==XFmode ? 3 : GET_MODE_SIZE (mode) / 4; else size = (GET_MODE_SIZE (mode) + 4) / 8; @@ -10381,7 +10429,6 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) switch (mode) { case XFmode: - case TFmode: REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l); parts[2] = gen_int_mode (l[2], SImode); break; @@ -10404,18 +10451,19 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) split_ti (&operand, 1, &parts[0], &parts[1]); if (mode == XFmode || mode == TFmode) { + enum machine_mode upper_mode = mode==XFmode ? SImode : DImode; if (REG_P (operand)) { if (!reload_completed) abort (); parts[0] = gen_rtx_REG (DImode, REGNO (operand) + 0); - parts[1] = gen_rtx_REG (SImode, REGNO (operand) + 1); + parts[1] = gen_rtx_REG (upper_mode, REGNO (operand) + 1); } else if (offsettable_memref_p (operand)) { operand = adjust_address (operand, DImode, 0); parts[0] = operand; - parts[1] = adjust_address (operand, SImode, 8); + parts[1] = adjust_address (operand, upper_mode, 8); } else if (GET_CODE (operand) == CONST_DOUBLE) { @@ -10433,7 +10481,16 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) DImode); else parts[0] = immed_double_const (l[0], l[1], DImode); - parts[1] = gen_int_mode (l[2], SImode); + if (upper_mode == SImode) + parts[1] = gen_int_mode (l[2], SImode); + else if (HOST_BITS_PER_WIDE_INT >= 64) + parts[1] + = gen_int_mode + ((l[2] & (((HOST_WIDE_INT) 2 << 31) - 1)) + + ((((HOST_WIDE_INT) l[3]) << 31) << 1), + DImode); + else + parts[1] = immed_double_const (l[2], l[3], DImode); } else abort (); @@ -10554,12 +10611,8 @@ ix86_split_long_move (rtx operands[]) { if (nparts == 3) { - /* We use only first 12 bytes of TFmode value, but for pushing we - are required to adjust stack as if we were pushing real 16byte - value. */ - if (mode == TFmode && !TARGET_64BIT) - emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-4))); + if (TARGET_128BIT_LONG_DOUBLE && mode == XFmode) + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (-4))); emit_move_insn (part[0][2], part[1][2]); } } @@ -11556,7 +11609,8 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx align_rtx) } void -ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx callarg2, +ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, + rtx callarg2 ATTRIBUTE_UNUSED, rtx pop, int sibcall) { rtx use = NULL, call; @@ -11594,7 +11648,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx callarg2, { rtx addr; addr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0)); - fnaddr = gen_rtx_REG (Pmode, 40); + fnaddr = gen_rtx_REG (Pmode, FIRST_REX_INT_REG + 3 /* R11 */); emit_move_insn (fnaddr, addr); fnaddr = gen_rtx_MEM (QImode, fnaddr); } @@ -13270,6 +13324,27 @@ ix86_init_mmx_sse_builtins (void) tree v2di_ftype_v2di = build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE); + tree float80_type; + tree float128_type; + + /* The __float80 type. */ + if (TYPE_MODE (long_double_type_node) == XFmode) + (*lang_hooks.types.register_builtin_type) (long_double_type_node, + "__float80"); + else + { + /* The __float80 type. */ + float80_type = make_node (REAL_TYPE); + TYPE_PRECISION (float80_type) = 96; + layout_type (float80_type); + (*lang_hooks.types.register_builtin_type) (float80_type, "__float80"); + } + + float128_type = make_node (REAL_TYPE); + TYPE_PRECISION (float128_type) = 128; + layout_type (float128_type); + (*lang_hooks.types.register_builtin_type) (float128_type, "__float128"); + /* Add all builtins that are more or less simple operations on two operands. */ for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) @@ -14710,7 +14785,6 @@ ix86_memory_move_cost (enum machine_mode mode, enum reg_class class, int in) index = 1; break; case XFmode: - case TFmode: index = 2; break; default: @@ -15384,7 +15458,7 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED, #if TARGET_MACHO if (TARGET_MACHO) { - char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function)); + const char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function)); tmp = gen_rtx_SYMBOL_REF (Pmode, machopic_stub_name (ip)); tmp = gen_rtx_MEM (QImode, tmp); xops[0] = tmp; @@ -15595,7 +15669,7 @@ ix86_reorg (void) for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) { basic_block bb = e->src; - rtx ret = bb->end; + rtx ret = BB_END (bb); rtx prev; bool replace = false; diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 53f9bcba6b2..08424a4caac 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -546,12 +546,11 @@ extern int x86_prefetch_sse; if (TARGET_64BIT) \ { \ builtin_assert ("cpu=x86_64"); \ + builtin_assert ("machine=x86_64"); \ builtin_define ("__amd64"); \ builtin_define ("__amd64__"); \ builtin_define ("__x86_64"); \ builtin_define ("__x86_64__"); \ - builtin_define ("__amd64"); \ - builtin_define ("__amd64__"); \ } \ else \ { \ @@ -721,16 +720,7 @@ extern int x86_prefetch_sse; /* target machine storage layout */ -/* Define for XFmode or TFmode extended real floating point support. - The XFmode is specified by i386 ABI, while TFmode may be faster - due to alignment and simplifications in the address calculations. */ -#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96) -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 -#ifdef __x86_64__ -#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 -#else -#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96 -#endif +#define LONG_DOUBLE_TYPE_SIZE 96 /* Set the value of FLT_EVAL_METHOD in float.h. When using only the FPU, assume that the fpcw is set to extended precision; when using @@ -900,8 +890,7 @@ extern int x86_prefetch_sse; #define STACK_REGS #define IS_STACK_MODE(MODE) \ - ((MODE) == DFmode || (MODE) == SFmode || (MODE) == XFmode \ - || (MODE) == TFmode) + ((MODE) == DFmode || (MODE) == SFmode || (MODE) == XFmode) \ /* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler @@ -1049,9 +1038,9 @@ do { \ #define HARD_REGNO_NREGS(REGNO, MODE) \ (FP_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \ ? (COMPLEX_MODE_P (MODE) ? 2 : 1) \ - : ((MODE) == TFmode \ + : ((MODE) == XFmode \ ? (TARGET_64BIT ? 2 : 3) \ - : (MODE) == TCmode \ + : (MODE) == XCmode \ ? (TARGET_64BIT ? 4 : 6) \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))) @@ -1061,7 +1050,7 @@ do { \ #define VALID_SSE_REG_MODE(MODE) \ ((MODE) == TImode || (MODE) == V4SFmode || (MODE) == V4SImode \ - || (MODE) == SFmode \ + || (MODE) == SFmode || (MODE) == TFmode \ /* Always accept SSE2 modes so that xmmintrin.h compiles. */ \ || VALID_SSE2_REG_MODE (MODE) \ || (TARGET_SSE2 && ((MODE) == DFmode || VALID_MMX_REG_MODE (MODE)))) @@ -1079,21 +1068,20 @@ do { \ : VALID_MMX_REG_MODE_3DNOW (MODE) && TARGET_3DNOW ? 1 : 0) #define VALID_FP_MODE_P(MODE) \ - ((MODE) == SFmode || (MODE) == DFmode || (MODE) == TFmode \ - || (!TARGET_64BIT && (MODE) == XFmode) \ - || (MODE) == SCmode || (MODE) == DCmode || (MODE) == TCmode \ - || (!TARGET_64BIT && (MODE) == XCmode)) + ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \ + || (MODE) == SCmode || (MODE) == DCmode || (MODE) == XCmode) \ #define VALID_INT_MODE_P(MODE) \ ((MODE) == QImode || (MODE) == HImode || (MODE) == SImode \ || (MODE) == DImode \ || (MODE) == CQImode || (MODE) == CHImode || (MODE) == CSImode \ || (MODE) == CDImode \ - || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode))) + || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode \ + || (MODE) == TFmode || (MODE) == TCmode))) /* Return true for modes passed in SSE registers. */ #define SSE_REG_MODE_P(MODE) \ - ((MODE) == TImode || (MODE) == V16QImode \ + ((MODE) == TImode || (MODE) == V16QImode || (MODE) == TFmode \ || (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode \ || (MODE) == V4SFmode || (MODE) == V4SImode) @@ -1438,11 +1426,6 @@ enum reg_class #define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X))) #define CC_REGNO_P(X) ((X) == FLAGS_REG || (X) == FPSR_REG) -/* Indicate whether hard register numbered REG_NO should be converted - to SSA form. */ -#define CONVERT_HARD_REGISTER_TO_SSA_P(REG_NO) \ - ((REG_NO) == FLAGS_REG || (REG_NO) == ARG_POINTER_REGNUM) - /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS INDEX_REGS @@ -1568,15 +1551,12 @@ enum reg_class /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */ /* On the 80386, this is the size of MODE in words, - except in the FP regs, where a single reg is always enough. - The TFmodes are really just 80bit values, so we use only 3 registers - to hold them, instead of 4, as the size would suggest. - */ + except in the FP regs, where a single reg is always enough. */ #define CLASS_MAX_NREGS(CLASS, MODE) \ (!MAYBE_INTEGER_CLASS_P (CLASS) \ ? (COMPLEX_MODE_P (MODE) ? 2 : 1) \ - : ((GET_MODE_SIZE ((MODE) == TFmode ? XFmode : (MODE)) \ - + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) + : (((((MODE) == XFmode ? 12 : GET_MODE_SIZE (MODE))) \ + + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) /* A C expression whose value is nonzero if pseudos that have been assigned to registers of class CLASS would likely be spilled @@ -1601,7 +1581,9 @@ enum reg_class || ((CLASS) == BREG) \ || ((CLASS) == AD_REGS) \ || ((CLASS) == SIREG) \ - || ((CLASS) == DIREG)) + || ((CLASS) == DIREG) \ + || ((CLASS) == FP_TOP_REG) \ + || ((CLASS) == FP_SECOND_REG)) /* Return a class of registers that cannot change FROM mode to TO mode. @@ -1828,10 +1810,6 @@ typedef struct ix86_args { ix86_setup_incoming_varargs (&(CUM), (MODE), (TYPE), &(PRETEND_SIZE), \ (NO_RTL)) -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - ((VALIST) = ix86_build_va_list ()) - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \ ix86_va_start (VALIST, NEXTARG) @@ -2900,7 +2878,8 @@ do { \ If CODE is 'k', pretend the mode is SImode. If CODE is 'q', pretend the mode is DImode. If CODE is 'h', pretend the reg is the `high' byte register. - If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */ + If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. + If CODE is -1, it is not an error for X to be a virtual register. */ #define PRINT_REG(X, CODE, FILE) \ print_reg ((X), (CODE), (FILE)) @@ -2917,70 +2896,6 @@ do { \ goto FAIL; \ } while (0); -/* Print the name of a register for based on its machine mode and number. - This macro is used to print debugging output. - This macro is different from PRINT_REG in that it may be used in - programs that are not linked with aux-output.o. */ - -#define DEBUG_PRINT_REG(X, CODE, FILE) \ - do { static const char * const hi_name[] = HI_REGISTER_NAMES; \ - static const char * const qi_name[] = QI_REGISTER_NAMES; \ - fprintf ((FILE), "%d ", REGNO (X)); \ - if (REGNO (X) == FLAGS_REG) \ - { fputs ("flags", (FILE)); break; } \ - if (REGNO (X) == DIRFLAG_REG) \ - { fputs ("dirflag", (FILE)); break; } \ - if (REGNO (X) == FPSR_REG) \ - { fputs ("fpsr", (FILE)); break; } \ - if (REGNO (X) == ARG_POINTER_REGNUM) \ - { fputs ("argp", (FILE)); break; } \ - if (REGNO (X) == FRAME_POINTER_REGNUM) \ - { fputs ("frame", (FILE)); break; } \ - if (STACK_TOP_P (X)) \ - { fputs ("st(0)", (FILE)); break; } \ - if (FP_REG_P (X)) \ - { fputs (hi_name[REGNO(X)], (FILE)); break; } \ - if (REX_INT_REG_P (X)) \ - { \ - switch (GET_MODE_SIZE (GET_MODE (X))) \ - { \ - default: \ - case 8: \ - fprintf ((FILE), "r%i", REGNO (X) \ - - FIRST_REX_INT_REG + 8); \ - break; \ - case 4: \ - fprintf ((FILE), "r%id", REGNO (X) \ - - FIRST_REX_INT_REG + 8); \ - break; \ - case 2: \ - fprintf ((FILE), "r%iw", REGNO (X) \ - - FIRST_REX_INT_REG + 8); \ - break; \ - case 1: \ - fprintf ((FILE), "r%ib", REGNO (X) \ - - FIRST_REX_INT_REG + 8); \ - break; \ - } \ - break; \ - } \ - switch (GET_MODE_SIZE (GET_MODE (X))) \ - { \ - case 8: \ - fputs ("r", (FILE)); \ - fputs (hi_name[REGNO (X)], (FILE)); \ - break; \ - default: \ - fputs ("e", (FILE)); \ - case 2: \ - fputs (hi_name[REGNO (X)], (FILE)); \ - break; \ - case 1: \ - fputs (qi_name[REGNO (X)], (FILE)); \ - break; \ - } \ - } while (0) - /* a letter which is not needed by the normal asm syntax, which we can use for operand syntax in the extended asm */ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 835480d3a47..8b32c5e014c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -716,17 +716,6 @@ [(set (reg:CC 17) (compare:CC (match_operand:XF 0 "cmp_fp_expander_operand" "") (match_operand:XF 1 "cmp_fp_expander_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" -{ - ix86_compare_op0 = operands[0]; - ix86_compare_op1 = operands[1]; - DONE; -}) - -(define_expand "cmptf" - [(set (reg:CC 17) - (compare:CC (match_operand:TF 0 "cmp_fp_expander_operand" "") - (match_operand:TF 1 "cmp_fp_expander_operand" "")))] "TARGET_80387" { ix86_compare_op0 = operands[0]; @@ -850,16 +839,6 @@ (compare:CCFP (match_operand:XF 0 "register_operand" "f") (match_operand:XF 1 "register_operand" "f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "* return output_fp_compare (insn, operands, 0, 0);" - [(set_attr "type" "fcmp") - (set_attr "mode" "XF")]) - -(define_insn "*cmpfp_2_tf" - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand:TF 0 "register_operand" "f") - (match_operand:TF 1 "register_operand" "f")))] "TARGET_80387" "* return output_fp_compare (insn, operands, 0, 0);" [(set_attr "type" "fcmp") @@ -872,18 +851,6 @@ (match_operand:XF 1 "register_operand" "f") (match_operand:XF 2 "register_operand" "f"))] UNSPEC_FNSTSW))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "* return output_fp_compare (insn, operands, 2, 0);" - [(set_attr "type" "multi") - (set_attr "mode" "XF")]) - -(define_insn "*cmpfp_2_tf_1" - [(set (match_operand:HI 0 "register_operand" "=a") - (unspec:HI - [(compare:CCFP - (match_operand:TF 1 "register_operand" "f") - (match_operand:TF 2 "register_operand" "f"))] - UNSPEC_FNSTSW))] "TARGET_80387" "* return output_fp_compare (insn, operands, 2, 0);" [(set_attr "type" "multi") @@ -2166,7 +2133,7 @@ return "push{l}\t%1"; default: - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } } @@ -2184,7 +2151,7 @@ return "push{q}\t%q1"; default: - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } } @@ -2442,7 +2409,7 @@ (match_operand:DF 1 "general_no_elim_operand" "f#Y,Fo#fY,*r#fY,Y#f"))] "!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES" { - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } [(set_attr "type" "multi") @@ -2453,7 +2420,7 @@ (match_operand:DF 1 "general_no_elim_operand" "f#rY,rFo#fY,Y#rf"))] "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES" { - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } [(set_attr "type" "multi") @@ -2744,14 +2711,8 @@ (define_expand "movxf" [(set (match_operand:XF 0 "nonimmediate_operand" "") (match_operand:XF 1 "general_operand" ""))] - "!TARGET_128BIT_LONG_DOUBLE" - "ix86_expand_move (XFmode, operands); DONE;") - -(define_expand "movtf" - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "general_operand" ""))] "" - "ix86_expand_move (TFmode, operands); DONE;") + "ix86_expand_move (XFmode, operands); DONE;") ;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size. ;; Size of pushdf using integer instructions is 3+3*memory operand size @@ -2763,20 +2724,9 @@ (define_insn "*pushxf_nointeger" [(set (match_operand:XF 0 "push_operand" "=X,X,X") (match_operand:XF 1 "general_no_elim_operand" "f,Fo,*r"))] - "!TARGET_128BIT_LONG_DOUBLE && optimize_size" -{ - /* This insn should be already splitted before reg-stack. */ - abort (); -} - [(set_attr "type" "multi") - (set_attr "mode" "XF,SI,SI")]) - -(define_insn "*pushtf_nointeger" - [(set (match_operand:TF 0 "push_operand" "=<,<,<") - (match_operand:TF 1 "general_no_elim_operand" "f,Fo,*r"))] "optimize_size" { - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } [(set_attr "type" "multi") @@ -2785,20 +2735,9 @@ (define_insn "*pushxf_integer" [(set (match_operand:XF 0 "push_operand" "=<,<") (match_operand:XF 1 "general_no_elim_operand" "f#r,ro#f"))] - "!TARGET_128BIT_LONG_DOUBLE && !optimize_size" -{ - /* This insn should be already splitted before reg-stack. */ - abort (); -} - [(set_attr "type" "multi") - (set_attr "mode" "XF,SI")]) - -(define_insn "*pushtf_integer" - [(set (match_operand:TF 0 "push_operand" "=<,<") - (match_operand:TF 1 "general_no_elim_operand" "f#r,rFo#f"))] "!optimize_size" { - /* This insn should be already splitted before reg-stack. */ + /* This insn should be already split before reg-stack. */ abort (); } [(set_attr "type" "multi") @@ -2809,7 +2748,6 @@ (match_operand 1 "general_operand" ""))] "reload_completed && (GET_MODE (operands[0]) == XFmode - || GET_MODE (operands[0]) == TFmode || GET_MODE (operands[0]) == DFmode) && !ANY_FP_REG_P (operands[1])" [(const_int 0)] @@ -2818,30 +2756,24 @@ (define_split [(set (match_operand:XF 0 "push_operand" "") (match_operand:XF 1 "any_fp_register_operand" ""))] - "!TARGET_128BIT_LONG_DOUBLE" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12))) - (set (mem:XF (reg:SI 7)) (match_dup 1))]) - -(define_split - [(set (match_operand:TF 0 "push_operand" "") - (match_operand:TF 1 "any_fp_register_operand" ""))] "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16))) - (set (mem:TF (reg:SI 7)) (match_dup 1))]) + [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) + (set (mem:XF (reg:SI 7)) (match_dup 1))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split - [(set (match_operand:TF 0 "push_operand" "") - (match_operand:TF 1 "any_fp_register_operand" ""))] + [(set (match_operand:XF 0 "push_operand" "") + (match_operand:XF 1 "any_fp_register_operand" ""))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16))) - (set (mem:TF (reg:DI 7)) (match_dup 1))]) + [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) + (set (mem:XF (reg:DI 7)) (match_dup 1))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") ;; Do not use integer registers when optimizing for size (define_insn "*movxf_nointeger" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,*r,o") (match_operand:XF 1 "general_operand" "fm,f,G,*roF,F*r"))] - "!TARGET_128BIT_LONG_DOUBLE - && optimize_size + "optimize_size && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE @@ -2882,56 +2814,10 @@ [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) -(define_insn "*movtf_nointeger" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m,f,*r,o") - (match_operand:TF 1 "general_operand" "fm,f,G,*roF,F*r"))] - "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && optimize_size - && (reload_in_progress || reload_completed - || GET_CODE (operands[1]) != CONST_DOUBLE - || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || memory_operand (operands[0], TFmode))" -{ - switch (which_alternative) - { - case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; - - case 1: - /* There is no non-popping store to memory for XFmode. So if - we need one, follow the store with a load. */ - if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0\;fld%z0\t%y0"; - else - return "fstp%z0\t%y0"; - - case 2: - return standard_80387_constant_opcode (operands[1]); - - case 3: case 4: - return "#"; - } - abort(); -} - [(set_attr "type" "fmov,fmov,fmov,multi,multi") - (set_attr "mode" "XF,XF,XF,SI,SI")]) - (define_insn "*movxf_integer" [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,m,f#r,r#f,o") (match_operand:XF 1 "general_operand" "fm#r,f#r,G,roF#f,Fr#f"))] - "!TARGET_128BIT_LONG_DOUBLE - && !optimize_size + "!optimize_size && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE @@ -2972,57 +2858,12 @@ [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) -(define_insn "*movtf_integer" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,m,f#r,r#f,o") - (match_operand:TF 1 "general_operand" "fm#r,f#r,G,roF#f,Fr#f"))] - "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && !optimize_size - && (reload_in_progress || reload_completed - || GET_CODE (operands[1]) != CONST_DOUBLE - || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || memory_operand (operands[0], TFmode))" -{ - switch (which_alternative) - { - case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; - - case 1: - /* There is no non-popping store to memory for XFmode. So if - we need one, follow the store with a load. */ - if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0\;fld%z0\t%y0"; - else - return "fstp%z0\t%y0"; - - case 2: - return standard_80387_constant_opcode (operands[1]); - - case 3: case 4: - return "#"; - } - abort(); -} - [(set_attr "type" "fmov,fmov,fmov,multi,multi") - (set_attr "mode" "XF,XF,XF,SI,SI")]) - (define_split [(set (match_operand 0 "nonimmediate_operand" "") (match_operand 1 "general_operand" ""))] "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode) + && GET_MODE (operands[0]) == XFmode && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) @@ -3037,7 +2878,7 @@ (match_operand 1 "memory_operand" ""))] "reload_completed && GET_CODE (operands[1]) == MEM - && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode + && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode) && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0)) @@ -3067,21 +2908,6 @@ } [(set_attr "type" "fxch") (set_attr "mode" "XF")]) - -(define_insn "swaptf" - [(set (match_operand:TF 0 "register_operand" "+f") - (match_operand:TF 1 "register_operand" "+f")) - (set (match_dup 1) - (match_dup 0))] - "" -{ - if (STACK_TOP_P (operands[0])) - return "fxch\t%1"; - else - return "fxch\t%0"; -} - [(set_attr "type" "fxch") - (set_attr "mode" "XF")]) ;; Zero extension instructions @@ -3632,62 +3458,34 @@ (define_split [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12))) - (set (mem:XF (reg:SI 7)) (float_extend:XF (match_dup 1)))]) - -(define_insn "*dummy_extendsftf2" - [(set (match_operand:TF 0 "push_operand" "=<") - (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "f")))] - "0" - "#") - -(define_split - [(set (match_operand:TF 0 "push_operand" "") - (float_extend:TF (match_operand:SF 1 "fp_register_operand" "")))] - "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16))) - (set (mem:TF (reg:SI 7)) (float_extend:TF (match_dup 1)))]) + "" + [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) + (set (mem:XF (reg:SI 7)) (float_extend:XF (match_dup 1)))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split - [(set (match_operand:TF 0 "push_operand" "") - (float_extend:TF (match_operand:SF 1 "fp_register_operand" "")))] + [(set (match_operand:XF 0 "push_operand" "") + (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16))) - (set (mem:DF (reg:DI 7)) (float_extend:TF (match_dup 1)))]) - -(define_insn "*dummy_extenddfxf2" - [(set (match_operand:XF 0 "push_operand" "=<") - (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "f")))] - "0" - "#") + [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) + (set (mem:DF (reg:DI 7)) (float_extend:XF (match_dup 1)))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12))) - (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))]) - -(define_insn "*dummy_extenddftf2" - [(set (match_operand:TF 0 "push_operand" "=<") - (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "f")))] - "0" - "#") - -(define_split - [(set (match_operand:TF 0 "push_operand" "") - (float_extend:TF (match_operand:DF 1 "fp_register_operand" "")))] - "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16))) - (set (mem:TF (reg:SI 7)) (float_extend:XF (match_dup 1)))]) + "" + [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) + (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split - [(set (match_operand:TF 0 "push_operand" "") - (float_extend:TF (match_operand:DF 1 "fp_register_operand" "")))] + [(set (match_operand:XF 0 "push_operand" "") + (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16))) - (set (mem:TF (reg:DI 7)) (float_extend:TF (match_dup 1)))]) + [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) + (set (mem:XF (reg:DI 7)) (float_extend:XF (match_dup 1)))] + "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_expand "extendsfdf2" [(set (match_operand:DF 0 "nonimmediate_operand" "") @@ -3747,7 +3545,7 @@ (define_expand "extendsfxf2" [(set (match_operand:XF 0 "nonimmediate_operand" "") (float_extend:XF (match_operand:SF 1 "general_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" { /* ??? Needed for compress_float_constant since all fp constants are LEGITIMATE_CONSTANT_P. */ @@ -3760,51 +3558,6 @@ (define_insn "*extendsfxf2_1" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; - - case 1: - /* There is no non-popping store to memory for XFmode. So if - we need one, follow the store with a load. */ - if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0\n\tfld%z0\t%y0"; - else - return "fstp%z0\t%y0"; - - default: - abort (); - } -} - [(set_attr "type" "fmov") - (set_attr "mode" "SF,XF")]) - -(define_expand "extendsftf2" - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (float_extend:TF (match_operand:SF 1 "general_operand" "")))] - "TARGET_80387" -{ - /* ??? Needed for compress_float_constant since all fp constants - are LEGITIMATE_CONSTANT_P. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = validize_mem (force_const_mem (SFmode, operands[1])); - if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) - operands[1] = force_reg (SFmode, operands[1]); -}) - -(define_insn "*extendsftf2_1" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m") - (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] "TARGET_80387 && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" { @@ -3837,7 +3590,7 @@ (define_expand "extenddfxf2" [(set (match_operand:XF 0 "nonimmediate_operand" "") (float_extend:XF (match_operand:DF 1 "general_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" { /* ??? Needed for compress_float_constant since all fp constants are LEGITIMATE_CONSTANT_P. */ @@ -3850,51 +3603,6 @@ (define_insn "*extenddfxf2_1" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; - - case 1: - /* There is no non-popping store to memory for XFmode. So if - we need one, follow the store with a load. */ - if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0\n\tfld%z0\t%y0"; - else - return "fstp%z0\t%y0"; - - default: - abort (); - } -} - [(set_attr "type" "fmov") - (set_attr "mode" "DF,XF")]) - -(define_expand "extenddftf2" - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (float_extend:TF (match_operand:DF 1 "general_operand" "")))] - "TARGET_80387" -{ - /* ??? Needed for compress_float_constant since all fp constants - are LEGITIMATE_CONSTANT_P. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = validize_mem (force_const_mem (DFmode, operands[1])); - if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) - operands[1] = force_reg (DFmode, operands[1]); -}) - -(define_insn "*extenddftf2_1" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m") - (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))] "TARGET_80387 && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" { @@ -4169,140 +3877,15 @@ (float_truncate:SF (match_operand:XF 1 "register_operand" ""))) (clobber (match_dup 2))])] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "operands[2] = assign_386_stack_local (SFmode, 0);") - -(define_insn "*truncxfsf2_1" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf") - (float_truncate:SF - (match_operand:XF 1 "register_operand" "f,f,f,f"))) - (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" -{ - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } -} - [(set_attr "type" "fmov,multi,multi,multi") - (set_attr "mode" "SF")]) - -(define_insn "*truncxfsf2_2" - [(set (match_operand:SF 0 "memory_operand" "=m") - (float_truncate:SF - (match_operand:XF 1 "register_operand" "f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" -{ - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; -} - [(set_attr "type" "fmov") - (set_attr "mode" "SF")]) - -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (float_truncate:SF - (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387" - [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float_truncate:SF - (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387 && reload_completed" - [(set (match_dup 2) (float_truncate:SF (match_dup 1))) - (set (match_dup 0) (match_dup 2))] - "") - -(define_expand "trunctfsf2" - [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") - (float_truncate:SF - (match_operand:TF 1 "register_operand" ""))) - (clobber (match_dup 2))])] "TARGET_80387" "operands[2] = assign_386_stack_local (SFmode, 0);") -(define_insn "*trunctfsf2_1" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf") - (float_truncate:SF - (match_operand:TF 1 "register_operand" "f,f,f,f"))) - (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] - "TARGET_80387" -{ - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } -} - [(set_attr "type" "fmov,multi,multi,multi") - (set_attr "mode" "SF")]) - -(define_insn "*trunctfsf2_2" - [(set (match_operand:SF 0 "memory_operand" "=m") - (float_truncate:SF - (match_operand:TF 1 "register_operand" "f")))] - "TARGET_80387" -{ - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; -} - [(set_attr "type" "fmov") - (set_attr "mode" "SF")]) - -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (float_truncate:SF - (match_operand:TF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387" - [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float_truncate:SF - (match_operand:TF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387 && reload_completed" - [(set (match_dup 2) (float_truncate:SF (match_dup 1))) - (set (match_dup 0) (match_dup 2))] - "") - - -(define_expand "truncxfdf2" - [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") - (float_truncate:DF - (match_operand:XF 1 "register_operand" ""))) - (clobber (match_dup 2))])] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "operands[2] = assign_386_stack_local (DFmode, 0);") - -(define_insn "*truncxfdf2_1" - [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f#rY,?r#fY,?Y#rf") - (float_truncate:DF +(define_insn "*truncxfsf2_1" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf") + (float_truncate:SF (match_operand:XF 1 "register_operand" "f,f,f,f"))) - (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] + "TARGET_80387" { switch (which_alternative) { @@ -4314,16 +3897,15 @@ default: abort(); } - abort (); } [(set_attr "type" "fmov,multi,multi,multi") - (set_attr "mode" "DF")]) + (set_attr "mode" "SF")]) -(define_insn "*truncxfdf2_2" - [(set (match_operand:DF 0 "memory_operand" "=m") - (float_truncate:DF - (match_operand:XF 1 "register_operand" "f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" +(define_insn "*truncxfsf2_2" + [(set (match_operand:SF 0 "memory_operand" "=m") + (float_truncate:SF + (match_operand:XF 1 "register_operand" "f")))] + "TARGET_80387" { if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) return "fstp%z0\t%y0"; @@ -4331,39 +3913,39 @@ return "fst%z0\t%y0"; } [(set_attr "type" "fmov") - (set_attr "mode" "DF")]) + (set_attr "mode" "SF")]) (define_split - [(set (match_operand:DF 0 "memory_operand" "") - (float_truncate:DF + [(set (match_operand:SF 0 "memory_operand" "") + (float_truncate:SF (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:DF 2 "memory_operand" ""))] + (clobber (match_operand:SF 2 "memory_operand" ""))] "TARGET_80387" - [(set (match_dup 0) (float_truncate:DF (match_dup 1)))] + [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] "") (define_split - [(set (match_operand:DF 0 "register_operand" "") - (float_truncate:DF + [(set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:DF 2 "memory_operand" ""))] + (clobber (match_operand:SF 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" - [(set (match_dup 2) (float_truncate:DF (match_dup 1))) + [(set (match_dup 2) (float_truncate:SF (match_dup 1))) (set (match_dup 0) (match_dup 2))] "") -(define_expand "trunctfdf2" +(define_expand "truncxfdf2" [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") (float_truncate:DF - (match_operand:TF 1 "register_operand" ""))) + (match_operand:XF 1 "register_operand" ""))) (clobber (match_dup 2))])] "TARGET_80387" "operands[2] = assign_386_stack_local (DFmode, 0);") -(define_insn "*trunctfdf2_1" +(define_insn "*truncxfdf2_1" [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f#rY,?r#fY,?Y#rf") (float_truncate:DF - (match_operand:TF 1 "register_operand" "f,f,f,f"))) + (match_operand:XF 1 "register_operand" "f,f,f,f"))) (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))] "TARGET_80387" { @@ -4382,10 +3964,10 @@ [(set_attr "type" "fmov,multi,multi,multi") (set_attr "mode" "DF")]) - (define_insn "*trunctfdf2_2" +(define_insn "*truncxfdf2_2" [(set (match_operand:DF 0 "memory_operand" "=m") (float_truncate:DF - (match_operand:TF 1 "register_operand" "f")))] + (match_operand:XF 1 "register_operand" "f")))] "TARGET_80387" { if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) @@ -4399,7 +3981,7 @@ (define_split [(set (match_operand:DF 0 "memory_operand" "") (float_truncate:DF - (match_operand:TF 1 "register_operand" ""))) + (match_operand:XF 1 "register_operand" ""))) (clobber (match_operand:DF 2 "memory_operand" ""))] "TARGET_80387" [(set (match_dup 0) (float_truncate:DF (match_dup 1)))] @@ -4408,7 +3990,7 @@ (define_split [(set (match_operand:DF 0 "register_operand" "") (float_truncate:DF - (match_operand:TF 1 "register_operand" ""))) + (match_operand:XF 1 "register_operand" ""))) (clobber (match_operand:DF 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (float_truncate:DF (match_dup 1))) @@ -4423,12 +4005,6 @@ (define_expand "fix_truncxfdi2" [(set (match_operand:DI 0 "nonimmediate_operand" "") (fix:DI (match_operand:XF 1 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "fix_trunctfdi2" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (fix:DI (match_operand:TF 1 "register_operand" "")))] "TARGET_80387" "") @@ -4590,12 +4166,6 @@ (define_expand "fix_truncxfsi2" [(set (match_operand:SI 0 "nonimmediate_operand" "") (fix:SI (match_operand:XF 1 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "fix_trunctfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (fix:SI (match_operand:TF 1 "register_operand" "")))] "TARGET_80387" "") @@ -4751,12 +4321,6 @@ (define_expand "fix_truncxfhi2" [(set (match_operand:HI 0 "nonimmediate_operand" "") (fix:HI (match_operand:XF 1 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "fix_trunctfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (fix:HI (match_operand:TF 1 "register_operand" "")))] "TARGET_80387" "") @@ -5103,17 +4667,6 @@ (define_insn "floathixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") (float:XF (match_operand:HI 1 "nonimmediate_operand" "m,r")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "@ - fild%z1\t%1 - #" - [(set_attr "type" "fmov,multi") - (set_attr "mode" "XF") - (set_attr "fp_int_src" "true")]) - -(define_insn "floathitf2" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (float:TF (match_operand:HI 1 "nonimmediate_operand" "m,r")))] "TARGET_80387" "@ fild%z1\t%1 @@ -5125,17 +4678,6 @@ (define_insn "floatsixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") (float:XF (match_operand:SI 1 "nonimmediate_operand" "m,r")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "@ - fild%z1\t%1 - #" - [(set_attr "type" "fmov,multi") - (set_attr "mode" "XF") - (set_attr "fp_int_src" "true")]) - -(define_insn "floatsitf2" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (float:TF (match_operand:SI 1 "nonimmediate_operand" "m,r")))] "TARGET_80387" "@ fild%z1\t%1 @@ -5147,17 +4689,6 @@ (define_insn "floatdixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") (float:XF (match_operand:DI 1 "nonimmediate_operand" "m,r")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "@ - fild%z1\t%1 - #" - [(set_attr "type" "fmov,multi") - (set_attr "mode" "XF") - (set_attr "fp_int_src" "true")]) - -(define_insn "floatditf2" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (float:TF (match_operand:DI 1 "nonimmediate_operand" "m,r")))] "TARGET_80387" "@ fild%z1\t%1 @@ -5265,10 +4796,10 @@ (set_attr "mode" "DI")]) (define_insn "addqi3_carry" - [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,r") + [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q") (plus:QI (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "") (match_operand:QI 1 "nonimmediate_operand" "%0,0")) - (match_operand:QI 2 "general_operand" "ri,rm"))) + (match_operand:QI 2 "general_operand" "qi,qm"))) (clobber (reg:CC 17))] "ix86_binary_operator_ok (PLUS, QImode, operands)" "adc{b}\t{%2, %0|%0, %2}" @@ -6858,13 +6389,6 @@ [(set (match_operand:XF 0 "register_operand" "") (plus:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "addtf3" - [(set (match_operand:TF 0 "register_operand" "") - (plus:TF (match_operand:TF 1 "register_operand" "") - (match_operand:TF 2 "register_operand" "")))] "TARGET_80387" "") @@ -6969,10 +6493,10 @@ (set_attr "mode" "DI")]) (define_insn "subqi3_carry" - [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,r") + [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q") (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "") - (match_operand:QI 2 "general_operand" "ri,rm")))) + (match_operand:QI 2 "general_operand" "qi,qm")))) (clobber (reg:CC 17))] "ix86_binary_operator_ok (MINUS, QImode, operands)" "sbb{b}\t{%2, %0|%0, %2}" @@ -7211,13 +6735,6 @@ [(set (match_operand:XF 0 "register_operand" "") (minus:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "subtf3" - [(set (match_operand:TF 0 "register_operand" "") - (minus:TF (match_operand:TF 1 "register_operand" "") - (match_operand:TF 2 "register_operand" "")))] "TARGET_80387" "") @@ -7729,13 +7246,6 @@ [(set (match_operand:XF 0 "register_operand" "") (mult:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "multf3" - [(set (match_operand:TF 0 "register_operand" "") - (mult:TF (match_operand:TF 1 "register_operand" "") - (match_operand:TF 2 "register_operand" "")))] "TARGET_80387" "") @@ -7783,13 +7293,6 @@ [(set (match_operand:XF 0 "register_operand" "") (div:XF (match_operand:XF 1 "register_operand" "") (match_operand:XF 2 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "") - -(define_expand "divtf3" - [(set (match_operand:TF 0 "register_operand" "") - (div:TF (match_operand:TF 1 "register_operand" "") - (match_operand:TF 2 "register_operand" "")))] "TARGET_80387" "") @@ -10018,8 +9521,7 @@ { int size = GET_MODE_SIZE (GET_MODE (operands[1])); - /* XFmode's size is 12, TFmode 16, but only 10 bytes are used. */ - if (size >= 12) + if (GET_MODE (operands[1]) == XFmode) size = 10; operands[0] = adjust_address (operands[0], QImode, size - 1); operands[1] = gen_int_mode (0x80, QImode); @@ -10196,15 +9698,8 @@ [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") (neg:XF (match_operand:XF 1 "nonimmediate_operand" ""))) (clobber (reg:CC 17))])] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;") - -(define_expand "negtf2" - [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "") - (neg:TF (match_operand:TF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] "TARGET_80387" - "ix86_expand_unary_operator (NEG, TFmode, operands); DONE;") + "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;") ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems ;; because of secondary memory needed to reload from class FLOAT_INT_REGS @@ -10213,7 +9708,7 @@ [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f") (neg:XF (match_operand:XF 1 "nonimmediate_operand" "0,0"))) (clobber (reg:CC 17))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 + "TARGET_80387 && ix86_unary_operator_ok (NEG, XFmode, operands)" "#") @@ -10237,36 +9732,6 @@ operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*negtf2_if" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,rm#f") - (neg:TF (match_operand:TF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 && ix86_unary_operator_ok (NEG, TFmode, operands)" - "#") - -(define_split - [(set (match_operand:TF 0 "fp_register_operand" "") - (neg:TF (match_operand:TF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (neg:TF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:TF 0 "register_and_not_fp_reg_operand" "") - (neg:TF (match_operand:TF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (xor:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = GEN_INT (0x8000); - operands[0] = gen_rtx_REG (SImode, - true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") - ;; Conditionalize these after reload. If they matches before reload, we ;; lose the clobber and ability to use integer instructions. @@ -10301,7 +9766,7 @@ (define_insn "*negxf2_1" [(set (match_operand:XF 0 "register_operand" "=f") (neg:XF (match_operand:XF 1 "register_operand" "0")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && reload_completed" + "TARGET_80387 && reload_completed" "fchs" [(set_attr "type" "fsgn") (set_attr "mode" "XF") @@ -10311,7 +9776,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (neg:XF (float_extend:XF (match_operand:DF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" "fchs" [(set_attr "type" "fsgn") (set_attr "mode" "XF") @@ -10321,35 +9786,6 @@ [(set (match_operand:XF 0 "register_operand" "=f") (neg:XF (float_extend:XF (match_operand:SF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "fchs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) - -(define_insn "*negtf2_1" - [(set (match_operand:TF 0 "register_operand" "=f") - (neg:TF (match_operand:TF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" - "fchs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) - -(define_insn "*negextenddftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (neg:TF (float_extend:TF - (match_operand:DF 1 "register_operand" "0"))))] - "TARGET_80387" - "fchs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) - -(define_insn "*negextendsftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (neg:TF (float_extend:TF - (match_operand:SF 1 "register_operand" "0"))))] "TARGET_80387" "fchs" [(set_attr "type" "fsgn") @@ -10491,8 +9927,7 @@ { int size = GET_MODE_SIZE (GET_MODE (operands[1])); - /* XFmode's size is 12, TFmode 16, but only 10 bytes are used. */ - if (size >= 12) + if (GET_MODE (operands[1]) == XFmode) size = 10; operands[0] = adjust_address (operands[0], QImode, size - 1); operands[1] = gen_int_mode (~0x80, QImode); @@ -10658,15 +10093,8 @@ [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") (neg:XF (match_operand:XF 1 "nonimmediate_operand" ""))) (clobber (reg:CC 17))])] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;") - -(define_expand "abstf2" - [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "") - (neg:TF (match_operand:TF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] "TARGET_80387" - "ix86_expand_unary_operator (ABS, TFmode, operands); DONE;") + "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;") ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems ;; because of secondary memory needed to reload from class FLOAT_INT_REGS @@ -10675,7 +10103,7 @@ [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f") (abs:XF (match_operand:XF 1 "nonimmediate_operand" "0,0"))) (clobber (reg:CC 17))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 + "TARGET_80387 && ix86_unary_operator_ok (ABS, XFmode, operands)" "#") @@ -10699,33 +10127,6 @@ operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") -(define_insn "*abstf2_if" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,rm#f") - (abs:TF (match_operand:TF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 && ix86_unary_operator_ok (ABS, TFmode, operands)" - "#") - -(define_split - [(set (match_operand:TF 0 "fp_register_operand" "") - (abs:TF (match_operand:TF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (abs:TF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:TF 0 "register_and_not_any_fp_reg_operand" "") - (abs:TF (match_operand:TF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = GEN_INT (~0x8000); - operands[0] = gen_rtx_REG (SImode, - true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") - (define_insn "*abssf2_1" [(set (match_operand:SF 0 "register_operand" "=f") (abs:SF (match_operand:SF 1 "register_operand" "0")))] @@ -10754,7 +10155,7 @@ (define_insn "*absxf2_1" [(set (match_operand:XF 0 "register_operand" "=f") (abs:XF (match_operand:XF 1 "register_operand" "0")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && reload_completed" + "TARGET_80387 && reload_completed" "fabs" [(set_attr "type" "fsgn") (set_attr "mode" "DF")]) @@ -10763,7 +10164,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (abs:XF (float_extend:XF (match_operand:DF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" "fabs" [(set_attr "type" "fsgn") (set_attr "mode" "XF")]) @@ -10772,32 +10173,6 @@ [(set (match_operand:XF 0 "register_operand" "=f") (abs:XF (float_extend:XF (match_operand:SF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF")]) - -(define_insn "*abstf2_1" - [(set (match_operand:TF 0 "register_operand" "=f") - (abs:TF (match_operand:TF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "DF")]) - -(define_insn "*absextenddftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (abs:TF (float_extend:TF - (match_operand:DF 1 "register_operand" "0"))))] - "TARGET_80387" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF")]) - -(define_insn "*absextendsftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (abs:TF (float_extend:TF - (match_operand:SF 1 "register_operand" "0"))))] "TARGET_80387" "fabs" [(set_attr "type" "fsgn") @@ -14841,7 +14216,7 @@ (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "%0") (match_operand:XF 2 "register_operand" "f")]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 + "TARGET_80387 && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -14850,19 +14225,6 @@ (const_string "fop"))) (set_attr "mode" "XF")]) -(define_insn "*fop_tf_comm" - [(set (match_operand:TF 0 "register_operand" "=f") - (match_operator:TF 3 "binary_fp_operator" - [(match_operand:TF 1 "register_operand" "%0") - (match_operand:TF 2 "register_operand" "f")]))] - "TARGET_80387 && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (const_string "fop"))) - (set_attr "mode" "XF")]) - (define_insn "*fop_sf_1_nosse" [(set (match_operand:SF 0 "register_operand" "=f,f") (match_operator:SF 3 "binary_fp_operator" @@ -15117,7 +14479,7 @@ (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,f") (match_operand:XF 2 "register_operand" "f,0")]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 + "TARGET_80387 && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -15129,29 +14491,12 @@ (const_string "fop"))) (set_attr "mode" "XF")]) -(define_insn "*fop_tf_1" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(match_operand:TF 1 "register_operand" "0,f") - (match_operand:TF 2 "register_operand" "f,0")]))] - "TARGET_80387 - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "mode" "XF")]) - (define_insn "*fop_xf_2" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(float:XF (match_operand:SI 1 "nonimmediate_operand" "m,?r")) (match_operand:XF 2 "register_operand" "0,0")]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && TARGET_USE_FIOP" + "TARGET_80387 && TARGET_USE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -15164,30 +14509,12 @@ (set_attr "mode" "SI") (set_attr "ppro_uops" "many")]) -(define_insn "*fop_tf_2" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(float:TF (match_operand:SI 1 "nonimmediate_operand" "m,?r")) - (match_operand:TF 2 "register_operand" "0,0")]))] - "TARGET_80387 && TARGET_USE_FIOP" - "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "fp_int_src" "true") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "many")]) - (define_insn "*fop_xf_3" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,0") (float:XF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && TARGET_USE_FIOP" + "TARGET_80387 && TARGET_USE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -15200,30 +14527,12 @@ (set_attr "mode" "SI") (set_attr "ppro_uops" "many")]) -(define_insn "*fop_tf_3" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(match_operand:TF 1 "register_operand" "0,0") - (float:TF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))] - "TARGET_80387 && TARGET_USE_FIOP" - "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "fp_int_src" "true") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "many")]) - (define_insn "*fop_xf_4" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(float_extend:XF (match_operand 1 "nonimmediate_operand" "fm,0")) (match_operand:XF 2 "register_operand" "0,f")]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -15234,29 +14543,13 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_tf_4" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(float_extend:TF (match_operand 1 "nonimmediate_operand" "fm,0")) - (match_operand:TF 2 "register_operand" "0,f")]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "mode" "SF")]) - (define_insn "*fop_xf_5" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,f") (float_extend:XF (match_operand 2 "nonimmediate_operand" "fm,0"))]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -15267,23 +14560,6 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_tf_5" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(match_operand:TF 1 "register_operand" "0,f") - (float_extend:TF - (match_operand 2 "nonimmediate_operand" "fm,0"))]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "mode" "SF")]) - (define_insn "*fop_xf_6" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" @@ -15291,7 +14567,7 @@ (match_operand 1 "register_operand" "0,f")) (float_extend:XF (match_operand 2 "nonimmediate_operand" "fm,0"))]))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387" + "TARGET_80387" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -15302,24 +14578,6 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_tf_6" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (match_operator:TF 3 "binary_fp_operator" - [(float_extend:TF - (match_operand 1 "register_operand" "0,f")) - (float_extend:TF - (match_operand 2 "nonimmediate_operand" "fm,0"))]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:TF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:TF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "mode" "SF")]) - (define_split [(set (match_operand 0 "register_operand" "") (match_operator 3 "binary_fp_operator" @@ -15454,20 +14712,10 @@ (set_attr "mode" "DF") (set_attr "athlon_decode" "direct")]) -(define_insn "sqrtxf2" - [(set (match_operand:XF 0 "register_operand" "=f") - (sqrt:XF (match_operand:XF 1 "register_operand" "0")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387 - && (TARGET_IEEE_FP || flag_unsafe_math_optimizations) " - "fsqrt" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF") - (set_attr "athlon_decode" "direct")]) - -(define_insn "sqrttf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (sqrt:TF (match_operand:TF 1 "register_operand" "0")))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_insn "sqrtxf2" + [(set (match_operand:XF 0 "register_operand" "=f") + (sqrt:XF (match_operand:XF 1 "register_operand" "0")))] + "TARGET_80387 && !TARGET_NO_FANCY_MATH_387 && (TARGET_IEEE_FP || flag_unsafe_math_optimizations) " "fsqrt" [(set_attr "type" "fpspc") @@ -15478,17 +14726,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (sqrt:XF (float_extend:XF (match_operand:DF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387" - "fsqrt" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF") - (set_attr "athlon_decode" "direct")]) - -(define_insn "*sqrtextenddftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (sqrt:TF (float_extend:TF - (match_operand:DF 1 "register_operand" "0"))))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387" + "TARGET_80387 && !TARGET_NO_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "XF") @@ -15498,17 +14736,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (sqrt:XF (float_extend:XF (match_operand:SF 1 "register_operand" "0"))))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387" - "fsqrt" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF") - (set_attr "athlon_decode" "direct")]) - -(define_insn "*sqrtextendsftf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (sqrt:TF (float_extend:TF - (match_operand:SF 1 "register_operand" "0"))))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387" + "TARGET_80387 && !TARGET_NO_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "XF") @@ -15546,16 +14774,7 @@ (define_insn "sinxf2" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_SIN))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "fsin" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "sintf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 1 "register_operand" "0")] UNSPEC_SIN))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_80387 && !TARGET_NO_FANCY_MATH_387 && flag_unsafe_math_optimizations" "fsin" [(set_attr "type" "fpspc") @@ -15593,16 +14812,7 @@ (define_insn "cosxf2" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_COS))] - "!TARGET_128BIT_LONG_DOUBLE && ! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations" - "fcos" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "costf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 1 "register_operand" "0")] UNSPEC_COS))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 && flag_unsafe_math_optimizations" "fcos" [(set_attr "type" "fpspc") @@ -15665,7 +14875,7 @@ UNSPEC_FPATAN)) (clobber (match_scratch:XF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && ! TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" "fpatan" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -15675,7 +14885,7 @@ (use (match_operand:XF 2 "register_operand" "0")) (use (match_operand:XF 1 "register_operand" "u"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && ! TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" { rtx copy = gen_reg_rtx (XFmode); emit_move_insn (copy, operands[1]); @@ -15683,40 +14893,14 @@ DONE; }) -(define_insn "atan2tf3_1" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 2 "register_operand" "0") - (match_operand:TF 1 "register_operand" "u")] - UNSPEC_FPATAN)) - (clobber (match_scratch:TF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" - "fpatan" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_expand "atan2tf3" - [(use (match_operand:TF 0 "register_operand" "=f")) - (use (match_operand:TF 2 "register_operand" "0")) - (use (match_operand:TF 1 "register_operand" "u"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" -{ - rtx copy = gen_reg_rtx (TFmode); - emit_move_insn (copy, operands[1]); - emit_insn (gen_atan2tf3_1 (operands[0], copy, operands[2])); - DONE; -}) - (define_insn "*fyl2x_sfxf3" [(set (match_operand:SF 0 "register_operand" "=f") (unspec:SF [(match_operand:SF 2 "register_operand" "0") - (match_operand 1 "register_operand" "u")] + (match_operand:XF 1 "register_operand" "u")] UNSPEC_FYL2X)) (clobber (match_scratch:SF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations - && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)" + && flag_unsafe_math_optimizations" "fyl2x" [(set_attr "type" "fpspc") (set_attr "mode" "SF")]) @@ -15724,12 +14908,11 @@ (define_insn "*fyl2x_dfxf3" [(set (match_operand:DF 0 "register_operand" "=f") (unspec:DF [(match_operand:DF 2 "register_operand" "0") - (match_operand 1 "register_operand" "u")] + (match_operand:XF 1 "register_operand" "u")] UNSPEC_FYL2X)) (clobber (match_scratch:DF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations - && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)" + && flag_unsafe_math_optimizations" "fyl2x" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) @@ -15741,19 +14924,7 @@ UNSPEC_FYL2X)) (clobber (match_scratch:XF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" - "fyl2x" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*fyl2x_tfxf3" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 2 "register_operand" "0") - (match_operand:TF 1 "register_operand" "u")] - UNSPEC_FYL2X)) - (clobber (match_scratch:TF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" "fyl2x" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -15768,7 +14939,7 @@ { rtx temp; - operands[2] = gen_reg_rtx (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode); + operands[2] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (4); /* fldln2 */ emit_move_insn (operands[2], temp); }) @@ -15783,7 +14954,7 @@ { rtx temp; - operands[2] = gen_reg_rtx (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode); + operands[2] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (4); /* fldln2 */ emit_move_insn (operands[2], temp); }) @@ -15794,7 +14965,7 @@ (match_dup 2)] UNSPEC_FYL2X)) (clobber (match_scratch:XF 3 ""))])] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" { rtx temp; @@ -15803,45 +14974,26 @@ emit_move_insn (operands[2], temp); }) -(define_expand "logtf2" - [(parallel [(set (match_operand:TF 0 "register_operand" "") - (unspec:TF [(match_operand:TF 1 "register_operand" "") - (match_dup 2)] UNSPEC_FYL2X)) - (clobber (match_scratch:TF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" -{ - rtx temp; - - operands[2] = gen_reg_rtx (TFmode); - temp = standard_80387_constant_rtx (4); /* fldln2 */ - emit_move_insn (operands[2], temp); -}) - (define_insn "*fscale_sfxf3" [(set (match_operand:SF 0 "register_operand" "=f") - (unspec:SF [(match_operand 2 "register_operand" "0") - (match_operand 1 "register_operand" "u")] + (unspec:SF [(match_operand:XF 2 "register_operand" "0") + (match_operand:XF 1 "register_operand" "u")] UNSPEC_FSCALE)) (clobber (match_scratch:SF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations - && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode) - && GET_MODE (operands[2]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)" + && flag_unsafe_math_optimizations" "fscale\;fstp\t%y1" [(set_attr "type" "fpspc") (set_attr "mode" "SF")]) (define_insn "*fscale_dfxf3" [(set (match_operand:DF 0 "register_operand" "=f") - (unspec:DF [(match_operand 2 "register_operand" "0") - (match_operand 1 "register_operand" "u")] + (unspec:DF [(match_operand:XF 2 "register_operand" "0") + (match_operand:XF 1 "register_operand" "u")] UNSPEC_FSCALE)) (clobber (match_scratch:DF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations - && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode) - && GET_MODE (operands[2]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)" + && flag_unsafe_math_optimizations" "fscale\;fstp\t%y1" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) @@ -15853,19 +15005,7 @@ UNSPEC_FSCALE)) (clobber (match_scratch:XF 3 "=1"))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" - "fscale\;fstp\t%y1" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*fscale_tf3" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 2 "register_operand" "0") - (match_operand:TF 1 "register_operand" "u")] - UNSPEC_FSCALE)) - (clobber (match_scratch:TF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" "fscale\;fstp\t%y1" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -15875,17 +15015,7 @@ (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_FRNDINT))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" - "frndint" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*frndinttf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 1 "register_operand" "0")] - UNSPEC_FRNDINT))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" "frndint" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -15895,17 +15025,7 @@ (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_F2XM1))] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" - "f2xm1" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*f2xm1tf2" - [(set (match_operand:TF 0 "register_operand" "=f") - (unspec:TF [(match_operand:TF 1 "register_operand" "0")] - UNSPEC_F2XM1))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" "f2xm1" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -15927,12 +15047,6 @@ rtx temp; int i; - if (TARGET_128BIT_LONG_DOUBLE) - { - emit_insn (gen_expsf2_tf (operands[0], operands[1])); - DONE; - } - for (i=2; i<10; i++) operands[i] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (5); /* fldl2e */ @@ -15940,29 +15054,6 @@ emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */ }) -(define_expand "expsf2_tf" - [(set (match_dup 2) - (float_extend:TF (match_operand:SF 1 "register_operand" ""))) - (set (match_dup 4) (mult:TF (match_dup 2) (match_dup 3))) - (set (match_dup 5) (unspec:TF [(match_dup 4)] UNSPEC_FRNDINT)) - (set (match_dup 6) (minus:TF (match_dup 4) (match_dup 5))) - (set (match_dup 7) (unspec:TF [(match_dup 6)] UNSPEC_F2XM1)) - (set (match_dup 9) (plus:TF (match_dup 7) (match_dup 8))) - (parallel [(set (match_operand:SF 0 "register_operand" "") - (unspec:SF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE)) - (clobber (match_scratch:SF 5 ""))])] - "" -{ - rtx temp; - int i; - - for (i=2; i<10; i++) - operands[i] = gen_reg_rtx (TFmode); - temp = standard_80387_constant_rtx (5); /* fldl2e */ - emit_move_insn (operands[3], temp); - emit_move_insn (operands[8], CONST1_RTX (TFmode)); /* fld1 */ -}) - (define_expand "expdf2" [(set (match_dup 2) (float_extend:XF (match_operand:DF 1 "register_operand" ""))) @@ -15980,12 +15071,6 @@ rtx temp; int i; - if (TARGET_128BIT_LONG_DOUBLE) - { - emit_insn (gen_expdf2_tf (operands[0], operands[1])); - DONE; - } - for (i=2; i<10; i++) operands[i] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (5); /* fldl2e */ @@ -15993,30 +15078,6 @@ emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */ }) - -(define_expand "expdf2_tf" - [(set (match_dup 2) - (float_extend:TF (match_operand:DF 1 "register_operand" ""))) - (set (match_dup 4) (mult:TF (match_dup 2) (match_dup 3))) - (set (match_dup 5) (unspec:TF [(match_dup 4)] UNSPEC_FRNDINT)) - (set (match_dup 6) (minus:TF (match_dup 4) (match_dup 5))) - (set (match_dup 7) (unspec:TF [(match_dup 6)] UNSPEC_F2XM1)) - (set (match_dup 9) (plus:TF (match_dup 7) (match_dup 8))) - (parallel [(set (match_operand:DF 0 "register_operand" "") - (unspec:DF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE)) - (clobber (match_scratch:DF 5 ""))])] - "" -{ - rtx temp; - int i; - - for (i=2; i<10; i++) - operands[i] = gen_reg_rtx (TFmode); - temp = standard_80387_constant_rtx (5); /* fldl2e */ - emit_move_insn (operands[3], temp); - emit_move_insn (operands[8], CONST1_RTX (TFmode)); /* fld1 */ -}) - (define_expand "expxf2" [(set (match_dup 3) (mult:XF (match_operand:XF 1 "register_operand" "") (match_dup 2))) @@ -16028,7 +15089,7 @@ (unspec:XF [(match_dup 8) (match_dup 4)] UNSPEC_FSCALE)) (clobber (match_scratch:XF 5 ""))])] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" { rtx temp; int i; @@ -16053,29 +15114,6 @@ emit_move_insn (operands[2], CONST1_RTX (SFmode)); /* fld1 */ }) -(define_expand "exptf2" - [(set (match_dup 3) (mult:TF (match_operand:TF 1 "register_operand" "") - (match_dup 2))) - (set (match_dup 4) (unspec:TF [(match_dup 3)] UNSPEC_FRNDINT)) - (set (match_dup 5) (minus:TF (match_dup 3) (match_dup 4))) - (set (match_dup 6) (unspec:TF [(match_dup 5)] UNSPEC_F2XM1)) - (set (match_dup 8) (plus:TF (match_dup 6) (match_dup 7))) - (parallel [(set (match_operand:TF 0 "register_operand" "") - (unspec:TF [(match_dup 8) (match_dup 4)] UNSPEC_FSCALE)) - (clobber (match_scratch:TF 5 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" -{ - rtx temp; - int i; - - for (i=2; i<9; i++) - operands[i] = gen_reg_rtx (TFmode); - temp = standard_80387_constant_rtx (5); /* fldl2e */ - emit_move_insn (operands[2], temp); - emit_move_insn (operands[7], CONST1_RTX (TFmode)); /* fld1 */ -}) - (define_expand "atandf2" [(parallel [(set (match_operand:DF 0 "register_operand" "") (unspec:DF [(match_dup 2) @@ -16096,24 +15134,11 @@ UNSPEC_FPATAN)) (clobber (match_scratch:XF 3 ""))])] "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE" + && flag_unsafe_math_optimizations" { operands[2] = gen_reg_rtx (XFmode); emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ }) - -(define_expand "atantf2" - [(parallel [(set (match_operand:TF 0 "register_operand" "") - (unspec:TF [(match_dup 2) - (match_operand:TF 1 "register_operand" "")] - UNSPEC_FPATAN)) - (clobber (match_scratch:TF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE" -{ - operands[2] = gen_reg_rtx (TFmode); - emit_move_insn (operands[2], CONST1_RTX (TFmode)); /* fld1 */ -}) ;; Block operation instructions @@ -16848,7 +15873,7 @@ (match_operand:BLK 2 "general_operand" ""))) (use (match_operand 3 "general_operand" "")) (use (match_operand 4 "immediate_operand" ""))] - "! optimize_size" + "! optimize_size || TARGET_INLINE_ALL_STRINGOPS" { rtx addr1, addr2, out, outlow, count, countreg, align; @@ -17364,14 +16389,6 @@ (if_then_else:XF (match_operand 1 "comparison_operator" "") (match_operand:XF 2 "register_operand" "") (match_operand:XF 3 "register_operand" "")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_CMOVE" - "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") - -(define_expand "movtfcc" - [(set (match_operand:TF 0 "register_operand" "") - (if_then_else:TF (match_operand 1 "comparison_operator" "") - (match_operand:TF 2 "register_operand" "") - (match_operand:TF 3 "register_operand" "")))] "TARGET_CMOVE" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") @@ -17381,19 +16398,6 @@ [(reg 17) (const_int 0)]) (match_operand:XF 2 "register_operand" "f,0") (match_operand:XF 3 "register_operand" "0,f")))] - "!TARGET_128BIT_LONG_DOUBLE && TARGET_CMOVE" - "@ - fcmov%F1\t{%2, %0|%0, %2} - fcmov%f1\t{%3, %0|%0, %3}" - [(set_attr "type" "fcmov") - (set_attr "mode" "XF")]) - -(define_insn "*movtfcc_1" - [(set (match_operand:TF 0 "register_operand" "=f,f") - (if_then_else:TF (match_operator 1 "fcmov_comparison_operator" - [(reg 17) (const_int 0)]) - (match_operand:TF 2 "register_operand" "f,0") - (match_operand:TF 3 "register_operand" "0,f")))] "TARGET_CMOVE" "@ fcmov%F1\t{%2, %0|%0, %2} @@ -17582,7 +16586,7 @@ && operands_match_p (operands[2], operands[3])))" [(set (reg:CCFP 17) (compare:CCFP (match_dup 2) - (match_dup 2))) + (match_dup 1))) (set (match_dup 0) (if_then_else:DF (ge (reg:CCFP 17) (const_int 0)) (match_dup 1) @@ -17772,23 +16776,7 @@ ;; [(set (mem (plus (reg ebp) (const_int -160000))) (const_int 0))] ;; ;; in proper program order. -(define_expand "pro_epilogue_adjust_stack" - [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") - (plus:SI (match_operand:SI 1 "register_operand" "0,r") - (match_operand:SI 2 "immediate_operand" "i,i"))) - (clobber (reg:CC 17)) - (clobber (mem:BLK (scratch)))])] - "" -{ - if (TARGET_64BIT) - { - emit_insn (gen_pro_epilogue_adjust_stack_rex64 - (operands[0], operands[1], operands[2])); - DONE; - } -}) - -(define_insn "*pro_epilogue_adjust_stack_1" +(define_insn "pro_epilogue_adjust_stack_1" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "0,r") (match_operand:SI 2 "immediate_operand" "i,i"))) @@ -17844,6 +16832,8 @@ case TYPE_ALU: if (GET_CODE (operands[2]) == CONST_INT + /* Avoid overflows. */ + && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))) && (INTVAL (operands[2]) == 128 || (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) != -128))) @@ -17870,6 +16860,30 @@ (const_string "lea"))) (set_attr "mode" "DI")]) +(define_insn "pro_epilogue_adjust_stack_rex64_2" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (plus:DI (match_operand:DI 1 "register_operand" "0,r") + (match_operand:DI 3 "immediate_operand" "i,i"))) + (use (match_operand:DI 2 "register_operand" "r,r")) + (clobber (reg:CC 17)) + (clobber (mem:BLK (scratch)))] + "TARGET_64BIT" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + return "add{q}\t{%2, %0|%0, %2}"; + + case TYPE_LEA: + operands[2] = gen_rtx_PLUS (DImode, operands[1], operands[2]); + return "lea{q}\t{%a2, %0|%0, %a2}"; + + default: + abort (); + } +} + [(set_attr "type" "alu,lea") + (set_attr "mode" "DI")]) ;; Placeholder for the conditional moves. This one is split either to SSE ;; based moves emulation or to usual cmove sequence. Little bit unfortunate @@ -18154,33 +17168,61 @@ [(match_operand:SI 0 "register_operand" "")] "TARGET_STACK_PROBE" { - if (TARGET_64BIT) - emit_insn (gen_allocate_stack_worker_rex64 (operands[0])); + if (reload_completed) + { + if (TARGET_64BIT) + emit_insn (gen_allocate_stack_worker_rex64_postreload (operands[0])); + else + emit_insn (gen_allocate_stack_worker_postreload (operands[0])); + } else - emit_insn (gen_allocate_stack_worker_1 (operands[0])); + { + if (TARGET_64BIT) + emit_insn (gen_allocate_stack_worker_rex64 (operands[0])); + else + emit_insn (gen_allocate_stack_worker_1 (operands[0])); + } DONE; }) (define_insn "allocate_stack_worker_1" [(unspec:SI [(match_operand:SI 0 "register_operand" "a")] UNSPEC_STACK_PROBE) (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0))) - (clobber (match_dup 0)) + (clobber (match_scratch:SI 1 "=0")) (clobber (reg:CC 17))] "!TARGET_64BIT && TARGET_STACK_PROBE" "call\t__alloca" [(set_attr "type" "multi") (set_attr "length" "5")]) +(define_expand "allocate_stack_worker_postreload" + [(parallel [(unspec:SI [(match_operand:SI 0 "register_operand" "a")] + UNSPEC_STACK_PROBE) + (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0))) + (clobber (match_dup 0)) + (clobber (reg:CC 17))])] + "" + "") + (define_insn "allocate_stack_worker_rex64" [(unspec:DI [(match_operand:DI 0 "register_operand" "a")] UNSPEC_STACK_PROBE) (set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0))) - (clobber (match_dup 0)) + (clobber (match_scratch:DI 1 "=0")) (clobber (reg:CC 17))] "TARGET_64BIT && TARGET_STACK_PROBE" "call\t__alloca" [(set_attr "type" "multi") (set_attr "length" "5")]) +(define_expand "allocate_stack_worker_rex64_postreload" + [(parallel [(unspec:DI [(match_operand:DI 0 "register_operand" "a")] + UNSPEC_STACK_PROBE) + (set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0))) + (clobber (match_dup 0)) + (clobber (reg:CC 17))])] + "" + "") + (define_expand "allocate_stack" [(parallel [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (reg:SI 7) @@ -19524,6 +18566,18 @@ DONE; }) +(define_expand "movtf" + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "nonimmediate_operand" ""))] + "TARGET_64BIT" +{ + if (TARGET_64BIT) + ix86_expand_move (TFmode, operands); + else + ix86_expand_vector_move (TFmode, operands); + DONE; +}) + (define_insn "movv2df_internal" [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m") (match_operand:V2DF 1 "vector_move_operand" "C,xm,x"))] @@ -19909,6 +18963,50 @@ (const_string "TI"))] (const_string "DI")))]) +(define_insn "*movtf_rex64" + [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o,x,x,xm") + (match_operand:TF 1 "general_operand" "riFo,riF,C,xm,x"))] + "TARGET_64BIT + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" +{ + switch (which_alternative) + { + case 0: + case 1: + return "#"; + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "xorps\t%0, %0"; + else + return "pxor\t%0, %0"; + case 3: + case 4: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movdqa\t{%1, %0|%0, %1}"; + default: + abort (); + } +} + [(set_attr "type" "*,*,ssemov,ssemov,ssemov") + (set (attr "mode") + (cond [(eq_attr "alternative" "2,3") + (if_then_else + (ne (symbol_ref "optimize_size") + (const_int 0)) + (const_string "V4SF") + (const_string "TI")) + (eq_attr "alternative" "4") + (if_then_else + (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0)) + (ne (symbol_ref "optimize_size") + (const_int 0))) + (const_string "V4SF") + (const_string "TI"))] + (const_string "DI")))]) + (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") (match_operand:TI 1 "general_operand" ""))] @@ -19917,6 +19015,14 @@ [(const_int 0)] "ix86_split_long_move (operands); DONE;") +(define_split + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "general_operand" ""))] + "reload_completed && !SSE_REG_P (operands[0]) + && !SSE_REG_P (operands[1])" + [(const_int 0)] + "ix86_split_long_move (operands); DONE;") + ;; These two patterns are useful for specifying exactly whether to use ;; movaps or movups (define_expand "sse_movaps" diff --git a/gcc/config/i386/i386elf.h b/gcc/config/i386/i386elf.h index b484126b6af..ed6b41aa9b3 100644 --- a/gcc/config/i386/i386elf.h +++ b/gcc/config/i386/i386elf.h @@ -65,13 +65,13 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + unsigned bytes_in_chunk = 0; \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ if (bytes_in_chunk >= 64) \ { \ fputc ('\n', (FILE)); \ diff --git a/gcc/config/i386/linux-aout.h b/gcc/config/i386/linux-aout.h index b286b800fa6..d7be93c7312 100644 --- a/gcc/config/i386/linux-aout.h +++ b/gcc/config/i386/linux-aout.h @@ -26,10 +26,7 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=posix"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index 493d64f7974..e7d19ec181a 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -73,10 +73,7 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=posix"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 416561733c1..98536c19bd3 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -24,10 +24,7 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=posix"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/i386/ptx4-i.h b/gcc/config/i386/ptx4-i.h index 65beba0711a..5fcd074f48b 100644 --- a/gcc/config/i386/ptx4-i.h +++ b/gcc/config/i386/ptx4-i.h @@ -57,13 +57,13 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + unsigned bytes_in_chunk = 0; \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ if (bytes_in_chunk >= 64) \ { \ fputc ('\n', (FILE)); \ diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index 54c761b1af5..bb872d5ec15 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -60,7 +60,6 @@ Boston, MA 02111-1307, USA. */ #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n] #define DWARF2_DEBUGGING_INFO 1 -#define DWARF_DEBUGGING_INFO 1 #define DBX_DEBUGGING_INFO 1 #undef PREFERRED_DEBUGGING_TYPE @@ -146,7 +145,7 @@ Boston, MA 02111-1307, USA. */ assume that /usr/gnu is the prefix for the GNU tools, because thats where the SCO provided ones go. This is especially important for include and library search path ordering. We want to look in /usr/gnu - first, becuase frequently people are linking against -lintl, and they + first because frequently people are linking against -lintl, and they MEAN to link with gettext. What they get is the SCO intl library. Its a REAL pity that GNU gettext chose that name; perhaps in a future version they can be persuaded to change it to -lgnuintl and have a diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h deleted file mode 100644 index 7da93053256..00000000000 --- a/gcc/config/i386/scodbx.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Definitions for Intel 386 running SCO Unix System V, - using dbx-in-coff encapsulation. - Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "i386/svr3dbx.h" - -/* Overridden defines for SCO systems from sco.h. */ - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - SCO's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for SCO. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" - -/* Library spec, including SCO international language support. */ - -#undef LIB_SPEC -#define LIB_SPEC \ - "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}" - -/* This spec is used for telling cpp whether char is signed or not. */ - -#undef SIGNED_CHAR_SPEC -#if DEFAULT_SIGNED_CHAR -#define SIGNED_CHAR_SPEC \ - "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#else -#define SIGNED_CHAR_SPEC \ - "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#endif - -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ - -/* Handle #pragma pack. */ -#define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h index 18eadf52592..244700637ec 100644 --- a/gcc/config/i386/sysv4.h +++ b/gcc/config/i386/sysv4.h @@ -52,13 +52,13 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + unsigned bytes_in_chunk = 0; \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ if (bytes_in_chunk >= 64) \ { \ fputc ('\n', (FILE)); \ diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index e49086a2328..16b06331b98 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -68,7 +68,6 @@ Boston, MA 02111-1307, USA. */ /* i386 System V Release 4 uses DWARF debugging info. x86-64 ABI specifies DWARF2. */ -#undef DWARF_DEBUGGING_INFO #define DWARF2_DEBUGGING_INFO 1 #define DWARF2_UNWIND_INFO 1 /* Incorrectly autodetected in cross compilation. */ diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h deleted file mode 100644 index 881c5c7be9d..00000000000 --- a/gcc/config/i386/xm-dgux.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Configuration for GCC for Intel i386 running DG/ux */ - -/* looks just like sysv4 for now */ -#include "xm-svr4.h" diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h deleted file mode 100644 index 6c0f0a25630..00000000000 --- a/gcc/config/i386/xm-sun.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0. - Copyright (C) 1988, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define USG diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h deleted file mode 100644 index 9a655443ff5..00000000000 --- a/gcc/config/i386/xm-sysv3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Configuration for GCC for Intel i386 running System V Release 3. */ - -#include "xm-svr3.h" diff --git a/gcc/config/i860/i860-protos.h b/gcc/config/i860/i860-protos.h index e29a5cd4895..74568af66b5 100644 --- a/gcc/config/i860/i860-protos.h +++ b/gcc/config/i860/i860-protos.h @@ -51,9 +51,5 @@ extern rtx i860_va_arg (tree, tree); #endif /* TREE_CODE */ #endif /* RTX_CODE */ -#ifdef TREE_CODE -extern tree i860_build_va_list (void); -#endif /* TREE_CODE */ - extern void tdesc_section (void); diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c index a8585eff404..9946f261c7c 100644 --- a/gcc/config/i860/i860.c +++ b/gcc/config/i860/i860.c @@ -1813,8 +1813,8 @@ i860_saveregs (void) The tree representing the va_list declaration is returned. */ -tree -i860_build_va_list (void) +static tree +i860_build_builtin_va_list (void) { tree f_gpr, f_fpr, f_mem, f_sav, record, type_decl; @@ -2117,5 +2117,7 @@ i860_init_libfuncs (void) #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS i860_init_libfuncs -struct gcc_target targetm = TARGET_INITIALIZER; +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST i860_build_builtin_va_list +struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/i860/i860.h b/gcc/config/i860/i860.h index b5575ec7f1c..c600f0276ec 100644 --- a/gcc/config/i860/i860.h +++ b/gcc/config/i860/i860.h @@ -571,10 +571,6 @@ struct cumulative_args { int ints, floats; }; #define EXPAND_BUILTIN_SAVEREGS() \ i860_saveregs() -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = i860_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ i860_va_start (valist, nextarg) diff --git a/gcc/config/i960/i960-protos.h b/gcc/config/i960/i960-protos.h index 5a46c4a841d..269a40be19c 100644 --- a/gcc/config/i960/i960-protos.h +++ b/gcc/config/i960/i960-protos.h @@ -26,78 +26,77 @@ Boston, MA 02111-1307, USA. */ #define GCC_I960_PROTOS_H #ifdef RTX_CODE -extern struct rtx_def *legitimize_address PARAMS ((rtx, rtx, enum machine_mode)); +extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode); /* Define the function that build the compare insn for scc and bcc. */ -extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx)); +extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx); /* Define functions in i960.c and used in insn-output.c. */ -extern const char *i960_output_ldconst PARAMS ((rtx, rtx)); -extern const char *i960_output_call_insn PARAMS ((rtx, rtx, rtx, rtx)); -extern const char *i960_output_ret_insn PARAMS ((rtx)); -extern const char *i960_output_move_double PARAMS ((rtx, rtx)); -extern const char *i960_output_move_double_zero PARAMS ((rtx)); -extern const char *i960_output_move_quad PARAMS ((rtx, rtx)); -extern const char *i960_output_move_quad_zero PARAMS ((rtx)); +extern const char *i960_output_ldconst (rtx, rtx); +extern const char *i960_output_call_insn (rtx, rtx, rtx, rtx); +extern const char *i960_output_ret_insn (rtx); +extern const char *i960_output_move_double (rtx, rtx); +extern const char *i960_output_move_double_zero (rtx); +extern const char *i960_output_move_quad (rtx, rtx); +extern const char *i960_output_move_quad_zero (rtx); -extern int literal PARAMS ((rtx, enum machine_mode)); -extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode)); -extern int fp_literal PARAMS ((rtx, enum machine_mode)); -extern int signed_literal PARAMS ((rtx, enum machine_mode)); -extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int)); -extern void i960_print_operand PARAMS ((FILE *, rtx, int)); -extern int fpmove_src_operand PARAMS ((rtx, enum machine_mode)); -extern int arith_operand PARAMS ((rtx, enum machine_mode)); -extern int logic_operand PARAMS ((rtx, enum machine_mode)); -extern int fp_arith_operand PARAMS ((rtx, enum machine_mode)); -extern int signed_arith_operand PARAMS ((rtx, enum machine_mode)); -extern int fp_literal_one PARAMS ((rtx, enum machine_mode)); -extern int fp_literal_zero PARAMS ((rtx, enum machine_mode)); -extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int eq_or_neq PARAMS ((rtx, enum machine_mode)); -extern int arith32_operand PARAMS ((rtx, enum machine_mode)); -extern int power2_operand PARAMS ((rtx, enum machine_mode)); -extern int cmplpower2_operand PARAMS ((rtx, enum machine_mode)); -extern enum machine_mode select_cc_mode PARAMS ((RTX_CODE, rtx)); -extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode)); -extern int i960_bypass PARAMS ((rtx, rtx, rtx, int)); -extern void i960_print_operand_addr PARAMS ((FILE *, rtx)); -extern int i960_expr_alignment PARAMS ((rtx, int)); -extern int i960_improve_align PARAMS ((rtx, rtx, int)); -extern int i960_si_ti PARAMS ((rtx, rtx)); -extern int i960_si_di PARAMS ((rtx, rtx)); +extern int literal (rtx, enum machine_mode); +extern int hard_regno_mode_ok (int, enum machine_mode); +extern int fp_literal (rtx, enum machine_mode); +extern int signed_literal (rtx, enum machine_mode); +extern int legitimate_address_p (enum machine_mode, rtx, int); +extern void i960_print_operand (FILE *, rtx, int); +extern int fpmove_src_operand (rtx, enum machine_mode); +extern int arith_operand (rtx, enum machine_mode); +extern int logic_operand (rtx, enum machine_mode); +extern int fp_arith_operand (rtx, enum machine_mode); +extern int signed_arith_operand (rtx, enum machine_mode); +extern int fp_literal_one (rtx, enum machine_mode); +extern int fp_literal_zero (rtx, enum machine_mode); +extern int symbolic_memory_operand (rtx, enum machine_mode); +extern int eq_or_neq (rtx, enum machine_mode); +extern int arith32_operand (rtx, enum machine_mode); +extern int power2_operand (rtx, enum machine_mode); +extern int cmplpower2_operand (rtx, enum machine_mode); +extern enum machine_mode select_cc_mode (RTX_CODE, rtx); +extern int emit_move_sequence (rtx *, enum machine_mode); +extern int i960_bypass (rtx, rtx, rtx, int); +extern void i960_print_operand_addr (FILE *, rtx); +extern int i960_expr_alignment (rtx, int); +extern int i960_improve_align (rtx, rtx, int); +extern int i960_si_ti (rtx, rtx); +extern int i960_si_di (rtx, rtx); #ifdef TREE_CODE -extern struct rtx_def *i960_function_arg PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, - tree, int)); -extern rtx i960_va_arg PARAMS ((tree, tree)); -extern void i960_va_start PARAMS ((tree, rtx)); +extern struct rtx_def *i960_function_arg (CUMULATIVE_ARGS *, + enum machine_mode, + tree, int); +extern rtx i960_va_arg (tree, tree); +extern void i960_va_start (tree, rtx); #endif /* TREE_CODE */ -extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx)); +extern enum reg_class secondary_reload_class (enum reg_class, enum machine_mode, rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern void i960_function_name_declare PARAMS ((FILE *, const char *, tree)); -extern void i960_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int)); -extern int i960_round_align PARAMS ((int, tree)); -extern void i960_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int)); -extern tree i960_build_va_list PARAMS ((void)); -extern int i960_final_reg_parm_stack_space PARAMS ((int, tree)); -extern int i960_reg_parm_stack_space PARAMS ((tree)); +extern void i960_function_name_declare (FILE *, const char *, tree); +extern void i960_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern int i960_round_align (int, tree); +extern void i960_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); +extern int i960_final_reg_parm_stack_space (int, tree); +extern int i960_reg_parm_stack_space (tree); #endif /* TREE_CODE */ -extern int process_pragma PARAMS ((int(*)(void), void(*)(int), const char *)); -extern int i960_object_bytes_bitalign PARAMS ((int)); -extern void i960_initialize PARAMS ((void)); -extern int bitpos PARAMS ((unsigned int)); -extern int is_mask PARAMS ((unsigned int)); -extern int bitstr PARAMS ((unsigned int, int *, int *)); -extern int compute_frame_size PARAMS ((int)); -extern void output_function_profiler PARAMS ((FILE *, int)); -extern void i960_scan_opcode PARAMS ((const char *)); +extern int process_pragma (int(*)(void), void(*)(int), const char *); +extern int i960_object_bytes_bitalign (int); +extern void i960_initialize (void); +extern int bitpos (unsigned int); +extern int is_mask (unsigned int); +extern int bitstr (unsigned int, int *, int *); +extern int compute_frame_size (int); +extern void output_function_profiler (FILE *, int); +extern void i960_scan_opcode (const char *); -extern void i960_pr_align PARAMS ((struct cpp_reader *)); -extern void i960_pr_noalign PARAMS ((struct cpp_reader *)); +extern void i960_pr_align (struct cpp_reader *); +extern void i960_pr_noalign (struct cpp_reader *); #endif /* ! GCC_I960_PROTOS_H */ diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index c1284f48da3..3d976b65fd4 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -46,12 +46,13 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "target-def.h" -static void i960_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void i960_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, - HOST_WIDE_INT, tree)); -static bool i960_rtx_costs PARAMS ((rtx, int, int, int *)); -static int i960_address_cost PARAMS ((rtx)); +static void i960_output_function_prologue (FILE *, HOST_WIDE_INT); +static void i960_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void i960_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, + HOST_WIDE_INT, tree); +static bool i960_rtx_costs (rtx, int, int, int *); +static int i960_address_cost (rtx); +static tree i960_build_builtin_va_list (void); /* Save the operands last given to a compare for use when we generate a scc or bcc insn. */ @@ -114,6 +115,9 @@ static int ret_label = 0; #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST i960_address_cost +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST i960_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; /* Override conflicting target switch options. @@ -1231,10 +1235,10 @@ struct reg_group char length; }; -static int i960_form_reg_groups PARAMS ((int, int, int *, int, struct reg_group *)); -static int i960_reg_group_compare PARAMS ((const void *, const void *)); -static int i960_split_reg_group PARAMS ((struct reg_group *, int, int)); -static void i960_arg_size_and_align PARAMS ((enum machine_mode, tree, int *, int *)); +static int i960_form_reg_groups (int, int, int *, int, struct reg_group *); +static int i960_reg_group_compare (const void *, const void *); +static int i960_split_reg_group (struct reg_group *, int, int); +static void i960_arg_size_and_align (enum machine_mode, tree, int *, int *); /* The following functions forms the biggest as possible register groups with registers in STATE. REGS contain states of the @@ -2600,8 +2604,8 @@ i960_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) /* Define the `__builtin_va_list' type for the ABI. */ -tree -i960_build_va_list () +static tree +i960_build_builtin_va_list () { return build_array_type (unsigned_type_node, build_index_type (size_one_node)); diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index 767efeb7fce..ad86dba003b 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -817,10 +817,6 @@ enum reg_class { NO_REGS, GLOBAL_REGS, LOCAL_REGS, LOCAL_OR_GLOBAL_REGS, #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ i960_setup_incoming_varargs(&CUM,MODE,TYPE,&PRETEND_SIZE,NO_RTL) -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = i960_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ i960_va_start (valist, nextarg) diff --git a/gcc/config/ia64/fde-glibc.c b/gcc/config/ia64/fde-glibc.c index 8c9b55a1b1e..15e19270f03 100644 --- a/gcc/config/ia64/fde-glibc.c +++ b/gcc/config/ia64/fde-glibc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of GCC. @@ -29,7 +29,7 @@ to avoid register/deregister calls at DSO load/unload. */ #ifndef _GNU_SOURCE -#define _GNU_SOURCE +#define _GNU_SOURCE 1 #endif #include "config.h" #include diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h index 382751a7c37..1bd02c35d73 100644 --- a/gcc/config/ia64/hpux.h +++ b/gcc/config/ia64/hpux.h @@ -45,6 +45,8 @@ do { \ builtin_define("_HPUX_SOURCE"); \ builtin_define("__STDC_EXT__"); \ } \ + if (TARGET_ILP32) \ + builtin_define("_ILP32"); \ } while (0) #undef CPP_SPEC @@ -188,6 +190,10 @@ do { \ #undef TARGET_SECTION_TYPE_FLAGS #define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags +/* HP-UX does not support thread-local storage. */ +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS false + /* ia64 HPUX has the float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS 1 diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 7b0069d7fb0..67df9cb2b90 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -344,11 +344,6 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_SCHED_DFA_NEW_CYCLE #define TARGET_SCHED_DFA_NEW_CYCLE ia64_dfa_new_cycle -#ifdef HAVE_AS_TLS -#undef TARGET_HAVE_TLS -#define TARGET_HAVE_TLS true -#endif - #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL ia64_function_ok_for_sibcall @@ -1465,6 +1460,8 @@ spill_xfmode_operand (rtx in, int force) /* Emit comparison instruction if necessary, returning the expression that holds the compare result in the proper mode. */ +static GTY(()) rtx cmptf_libfunc; + rtx ia64_expand_compare (enum rtx_code code, enum machine_mode mode) { @@ -1480,6 +1477,59 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) else abort (); } + /* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a + magic number as its third argument, that indicates what to do. + The return value is an integer to be compared against zero. */ + else if (TARGET_HPUX && GET_MODE (op0) == TFmode) + { + enum qfcmp_magic { + QCMP_INV = 1, /* Raise FP_INVALID on SNaN as a side effect. */ + QCMP_UNORD = 2, + QCMP_EQ = 4, + QCMP_LT = 8, + QCMP_GT = 16 + } magic; + enum rtx_code ncode; + rtx ret, insns; + if (GET_MODE (op1) != TFmode) + abort (); + switch (code) + { + /* 1 = equal, 0 = not equal. Equality operators do + not raise FP_INVALID when given an SNaN operand. */ + case EQ: magic = QCMP_EQ; ncode = NE; break; + case NE: magic = QCMP_EQ; ncode = EQ; break; + /* isunordered() from C99. */ + case UNORDERED: magic = QCMP_UNORD; ncode = NE; break; + /* Relational operators raise FP_INVALID when given + an SNaN operand. */ + case LT: magic = QCMP_LT |QCMP_INV; ncode = NE; break; + case LE: magic = QCMP_LT|QCMP_EQ|QCMP_INV; ncode = NE; break; + case GT: magic = QCMP_GT |QCMP_INV; ncode = NE; break; + case GE: magic = QCMP_GT|QCMP_EQ|QCMP_INV; ncode = NE; break; + /* FUTURE: Implement UNEQ, UNLT, UNLE, UNGT, UNGE, LTGT. + Expanders for buneq etc. weuld have to be added to ia64.md + for this to be useful. */ + default: abort (); + } + + start_sequence (); + + ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, 3, + op0, TFmode, op1, TFmode, + GEN_INT (magic), DImode); + cmp = gen_reg_rtx (BImode); + emit_insn (gen_rtx_SET (VOIDmode, cmp, + gen_rtx_fmt_ee (ncode, BImode, + ret, const0_rtx))); + + insns = get_insns (); + end_sequence (); + + emit_libcall_block (insns, cmp, cmp, + gen_rtx_fmt_ee (code, BImode, op0, op1)); + code = NE; + } else { cmp = gen_reg_rtx (BImode); @@ -3065,13 +3115,13 @@ ia64_hard_regno_rename_ok (int from, int to) static bool ia64_assemble_integer (rtx x, unsigned int size, int aligned_p) { - if (size == (TARGET_ILP32 ? 4 : 8) + if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p && !(TARGET_NO_PIC || TARGET_AUTO_PIC) && GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x)) { - if (TARGET_ILP32) + if (POINTER_SIZE == 32) fputs ("\tdata4\t@fptr(", asm_out_file); else fputs ("\tdata8\t@fptr(", asm_out_file); @@ -3227,7 +3277,8 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) if (!declared_ia64_trampoline) { declared_ia64_trampoline = true; - fputs ("\t.global\t__ia64_trampoline\n", asm_out_file); + (*targetm.asm_out.globalize_label) (asm_out_file, + "__ia64_trampoline"); } } @@ -3471,9 +3522,10 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, ? 1 : GET_MODE_SIZE (gr_mode) / UNITS_PER_WORD; } - /* If we ended up using just one location, just return that one loc. */ + /* If we ended up using just one location, just return that one loc, but + change the mode back to the argument mode. */ if (i == 1) - return XEXP (loc[0], 0); + return gen_rtx_REG (mode, REGNO (XEXP (loc[0], 0))); else return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } @@ -3690,8 +3742,12 @@ ia64_va_arg (tree valist, tree type) /* Variable sized types are passed by reference. */ if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) { - rtx addr = std_expand_builtin_va_arg (valist, build_pointer_type (type)); - return gen_rtx_MEM (ptr_mode, force_reg (Pmode, addr)); + rtx addr = force_reg (ptr_mode, + std_expand_builtin_va_arg (valist, build_pointer_type (type))); +#ifdef POINTERS_EXTEND_UNSIGNED + addr = convert_memory_address (Pmode, addr); +#endif + return gen_rtx_MEM (ptr_mode, addr); } /* Arguments with alignment larger than 8 bytes start at the next even @@ -4350,7 +4406,7 @@ ia64_asm_output_external (FILE *file, tree decl, const char *name) if (TARGET_GNU_AS && (!TARGET_HPUX_LD || TREE_CODE (decl) != FUNCTION_DECL - || strstr(name, "__builtin_") == name)) + || strstr (name, "__builtin_") == name)) return; /* ??? The Intel assembler creates a reference that needs to be satisfied by @@ -4487,6 +4543,18 @@ ia64_override_options (void) target_flags &= ~MASK_INLINE_INT_DIV_THR; } + if (TARGET_INLINE_SQRT_LAT && TARGET_INLINE_SQRT_THR) + { + warning ("cannot optimize square root for both latency and throughput"); + target_flags &= ~MASK_INLINE_SQRT_THR; + } + + if (TARGET_INLINE_SQRT_LAT) + { + warning ("not yet implemented: latency-optimized inline square root"); + target_flags &= ~MASK_INLINE_SQRT_LAT; + } + if (ia64_fixed_range_string) fix_range (ia64_fixed_range_string); @@ -4896,9 +4964,9 @@ set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond) return need_barrier; } -/* Handle an access to rtx X of type FLAGS using predicate register PRED. - Return 1 is this access creates a dependency with an earlier instruction - in the same group. */ +/* Handle an access to rtx X of type FLAGS using predicate register + PRED. Return 1 if this access creates a dependency with an earlier + instruction in the same group. */ static int rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) @@ -5124,7 +5192,9 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) case UNSPEC_FR_SPILL: case UNSPEC_FR_RESTORE: case UNSPEC_GETF_EXP: + case UNSPEC_SETF_EXP: case UNSPEC_ADDP4: + case UNSPEC_FR_SQRT_RECIP_APPROX: need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred); break; @@ -6491,13 +6561,44 @@ get_next_important_insn (rtx insn, rtx tail) return NULL_RTX; } -/* The following function does insn bundling. Bundling algorithm is - based on dynamic programming. It tries to insert different number of - nop insns before/after the real insns. At the end of EBB, it chooses the - best alternative and then, moving back in EBB, inserts templates for - the best alternative. The algorithm is directed by information - (changes of simulated processor cycle) created by the 2nd insn - scheduling. */ +/* The following function does insn bundling. Bundling means + inserting templates and nop insns to fit insn groups into permitted + templates. Instruction scheduling uses NDFA (non-deterministic + finite automata) encoding informations about the templates and the + inserted nops. Nondeterminism of the automata permits follows + all possible insn sequences very fast. + + Unfortunately it is not possible to get information about inserting + nop insns and used templates from the automata states. The + automata only says that we can issue an insn possibly inserting + some nops before it and using some template. Therefore insn + bundling in this function is implemented by using DFA + (deterministic finite automata). We follows all possible insn + sequences by inserting 0-2 nops (that is what the NDFA describe for + insn scheduling) before/after each insn being bundled. We know the + start of simulated processor cycle from insn scheduling (insn + starting a new cycle has TImode). + + Simple implementation of insn bundling would create enormous + number of possible insn sequences satisfying information about new + cycle ticks taken from the insn scheduling. To make the algorithm + practical we use dynamic programming. Each decision (about + inserting nops and implicitly about previous decisions) is described + by structure bundle_state (see above). If we generate the same + bundle state (key is automaton state after issuing the insns and + nops for it), we reuse already generated one. As consequence we + reject some decisions which can not improve the solution and + reduce memory for the algorithm. + + When we reach the end of EBB (extended basic block), we choose the + best sequence and then, moving back in EBB, insert templates for + the best alternative. The templates are taken from querying + automaton state for each insn in chosen bundle states. + + So the algorithm makes two (forward and backward) passes through + EBB. There is an additional forward pass through EBB for Itanium1 + processor. This pass inserts more nops to make dependency between + a producer insn and MMMUL/MMSHF at least 4 cycles long. */ static void bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) @@ -6512,6 +6613,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) enum attr_type type; insn_num = 0; + /* Count insns in the EBB. */ for (insn = NEXT_INSN (prev_head_insn); insn && insn != tail; insn = NEXT_INSN (insn)) @@ -6524,7 +6626,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) initiate_bundle_state_table (); index_to_bundle_states = xmalloc ((insn_num + 2) * sizeof (struct bundle_state *)); - /* First (forward) pass -- generates states. */ + /* First (forward) pass -- generation of bundle states. */ curr_state = get_free_bundle_state (); curr_state->insn = NULL; curr_state->before_nops_num = 0; @@ -6538,6 +6640,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) state_reset (curr_state->dfa_state); index_to_bundle_states [0] = curr_state; insn_num = 0; + /* Shift cycle mark if it is put on insn which could be ignored. */ for (insn = NEXT_INSN (prev_head_insn); insn != tail; insn = NEXT_INSN (insn)) @@ -6560,6 +6663,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) break; } } + /* Froward pass: generation of bundle states. */ for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail); insn != NULL_RTX; insn = next_insn) @@ -6579,19 +6683,25 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) { pos = curr_state->accumulated_insns_num % 3; next_state = curr_state->next; - /* Finish the current bundle in order to start a subsequent - asm insn in a new bundle. */ + /* We must fill up the current bundle in order to start a + subsequent asm insn in a new bundle. Asm insn is always + placed in a separate bundle. */ only_bundle_end_p = (next_insn != NULL_RTX && INSN_CODE (insn) == CODE_FOR_insn_group_barrier && ia64_safe_type (next_insn) == TYPE_UNKNOWN); + /* We may fill up the current bundle if it is the cycle end + without a group barrier. */ bundle_end_p = (only_bundle_end_p || next_insn == NULL_RTX || (GET_MODE (next_insn) == TImode && INSN_CODE (insn) != CODE_FOR_insn_group_barrier)); if (type == TYPE_F || type == TYPE_B || type == TYPE_L || type == TYPE_S - /* We need to insert 2 Nops for cases like M_MII. */ + /* We need to insert 2 nops for cases like M_MII. To + guarantee issuing all insns on the same cycle for + Itanium 1, we need to issue 2 nops after the first M + insn (MnnMII where n is a nop insn). */ || (type == TYPE_M && ia64_tune == PROCESSOR_ITANIUM && !bundle_end_p && pos == 1)) issue_nops_and_insn (curr_state, 2, insn, bundle_end_p, @@ -6608,6 +6718,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) curr_state = curr_state->next) if (verbose >= 2 && dump) { + /* This structure is taken from generated code of the + pipeline hazard recognizer (see file insn-attrtab.c). + Please don't forget to change the structure if a new + automaton is added to .md file. */ struct DFA_chip { unsigned short one_automaton_state; @@ -6632,12 +6746,18 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) } } if (index_to_bundle_states [insn_num] == NULL) + /* We should find a solution because the 2nd insn scheduling has + found one. */ abort (); - /* Finding state with a minimal cost: */ + /* Find a state corresponding to the best insn sequence. */ best_state = NULL; for (curr_state = index_to_bundle_states [insn_num]; curr_state != NULL; curr_state = curr_state->next) + /* We are just looking at the states with fully filled up last + bundle. The first we prefer insn sequences with minimal cost + then with minimal inserted nops and finally with branch insns + placed in the 3rd slots. */ if (curr_state->accumulated_insns_num % 3 == 0 && (best_state == NULL || best_state->cost > curr_state->cost || (best_state->cost == curr_state->cost @@ -6648,7 +6768,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) && curr_state->branch_deviation < best_state->branch_deviation))))) best_state = curr_state; - /* Second (backward) pass: adding nops and templates: */ + /* Second (backward) pass: adding nops and templates. */ insn_num = best_state->before_nops_num; template0 = template1 = -1; for (curr_state = best_state; @@ -6683,9 +6803,17 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) : ((struct DFA_chip *) curr_state->dfa_state)->twob_automaton_state), INSN_UID (insn)); } + /* Find the position in the current bundle window. The window can + contain at most two bundles. Two bundle window means that + the processor will make two bundle rotation. */ max_pos = get_max_pos (curr_state->dfa_state); - if (max_pos == 6 || (max_pos == 3 && template0 < 0)) + if (max_pos == 6 + /* The following (negative template number) means that the + processor did one bundle rotation. */ + || (max_pos == 3 && template0 < 0)) { + /* We are at the end of the window -- find template(s) for + its bundle(s). */ pos = max_pos; if (max_pos == 3) template0 = get_template (curr_state->dfa_state, 3); @@ -6696,6 +6824,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) } } if (max_pos > 3 && template1 < 0) + /* It may happen when we have the stop inside a bundle. */ { if (pos > 3) abort (); @@ -6703,6 +6832,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) pos += 3; } if (!asm_p) + /* Emit nops after the current insn. */ for (i = 0; i < curr_state->after_nops_num; i++) { nop = gen_nop (); @@ -6712,18 +6842,26 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) abort (); if (pos % 3 == 0) { + /* We are at the start of a bundle: emit the template + (it should be defined). */ if (template0 < 0) abort (); b = gen_bundle_selector (GEN_INT (template0)); ia64_emit_insn_before (b, nop); + /* If we have two bundle window, we make one bundle + rotation. Otherwise template0 will be undefined + (negative value). */ template0 = template1; template1 = -1; } } + /* Move the position backward in the window. Group barrier has + no slot. Asm insn takes all bundle. */ if (INSN_CODE (insn) != CODE_FOR_insn_group_barrier && GET_CODE (PATTERN (insn)) != ASM_INPUT && asm_noperands (PATTERN (insn)) < 0) pos--; + /* Long insn takes 2 slots. */ if (ia64_safe_type (insn) == TYPE_L) pos--; if (pos < 0) @@ -6733,15 +6871,20 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) && GET_CODE (PATTERN (insn)) != ASM_INPUT && asm_noperands (PATTERN (insn)) < 0) { + /* The current insn is at the bundle start: emit the + template. */ if (template0 < 0) abort (); b = gen_bundle_selector (GEN_INT (template0)); ia64_emit_insn_before (b, insn); b = PREV_INSN (insn); insn = b; + /* See comment above in analogous place for emiting nops + after the insn. */ template0 = template1; template1 = -1; } + /* Emit nops after the current insn. */ for (i = 0; i < curr_state->before_nops_num; i++) { nop = gen_nop (); @@ -6753,6 +6896,8 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) abort (); if (pos % 3 == 0) { + /* See comment above in analogous place for emiting nops + after the insn. */ if (template0 < 0) abort (); b = gen_bundle_selector (GEN_INT (template0)); @@ -6765,7 +6910,11 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) } } if (ia64_tune == PROCESSOR_ITANIUM) - /* Insert additional cycles for MM-insns: */ + /* Insert additional cycles for MM-insns (MMMUL and MMSHF). + Itanium1 has a strange design, if the distance between an insn + and dependent MM-insn is less 4 then we have a 6 additional + cycles stall. So we make the distance equal to 4 cycles if it + is less. */ for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail); insn != NULL_RTX; insn = next_insn) @@ -6777,11 +6926,16 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) abort (); next_insn = get_next_important_insn (NEXT_INSN (insn), tail); if (INSN_UID (insn) < clocks_length && add_cycles [INSN_UID (insn)]) + /* We found a MM-insn which needs additional cycles. */ { rtx last; int i, j, n; int pred_stop_p; + /* Now we are searching for a template of the bundle in + which the MM-insn is placed and the position of the + insn in the bundle (0, 1, 2). Also we are searching + for that there is a stop before the insn. */ last = prev_active_insn (insn); pred_stop_p = recog_memoized (last) == CODE_FOR_insn_group_barrier; if (pred_stop_p) @@ -6792,17 +6946,27 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) { template0 = XINT (XVECEXP (PATTERN (last), 0, 0), 0); if (template0 == 9) + /* The insn is in MLX bundle. Change the template + onto MFI because we will add nops before the + insn. It simplifies subsequent code a lot. */ PATTERN (last) = gen_bundle_selector (GEN_INT (2)); /* -> MFI */ break; } else if (recog_memoized (last) != CODE_FOR_insn_group_barrier) n++; + /* Some check of correctness: the stop is not at the + bundle start, there are no more 3 insns in the bundle, + and the MM-insn is not at the start of bundle with + template MLX. */ if ((pred_stop_p && n == 0) || n > 2 || (template0 == 9 && n != 0)) abort (); + /* Put nops after the insn in the bundle. */ for (j = 3 - n; j > 0; j --) ia64_emit_insn_before (gen_nop (), insn); + /* It takes into account that we will add more N nops + before the insn lately -- please see code below. */ add_cycles [INSN_UID (insn)]--; if (!pred_stop_p || add_cycles [INSN_UID (insn)]) ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), @@ -6811,13 +6975,15 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) add_cycles [INSN_UID (insn)]--; for (i = add_cycles [INSN_UID (insn)]; i > 0; i--) { - /* Insert .MII bundle. */ + /* Insert "MII;" template. */ ia64_emit_insn_before (gen_bundle_selector (GEN_INT (0)), insn); ia64_emit_insn_before (gen_nop (), insn); ia64_emit_insn_before (gen_nop (), insn); if (i > 1) { + /* To decrease code size, we use "MI;I;" + template. */ ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); i--; @@ -6826,10 +6992,15 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); } + /* Put the MM-insn in the same slot of a bundle with the + same template as the original one. */ ia64_emit_insn_before (gen_bundle_selector (GEN_INT (template0)), insn); + /* To put the insn in the same slot, add necessary number + of nops. */ for (j = n; j > 0; j --) ia64_emit_insn_before (gen_nop (), insn); + /* Put the stop if the original bundle had it. */ if (pred_stop_p) ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); @@ -7074,7 +7245,7 @@ emit_predicate_relation_info (void) FOR_EACH_BB_REVERSE (bb) { int r; - rtx head = bb->head; + rtx head = BB_HEAD (bb); /* We only need such notes at code labels. */ if (GET_CODE (head) != CODE_LABEL) @@ -7088,8 +7259,8 @@ emit_predicate_relation_info (void) { rtx p = gen_rtx_REG (BImode, r); rtx n = emit_insn_after (gen_pred_rel_mutex (p), head); - if (head == bb->end) - bb->end = n; + if (head == BB_END (bb)) + BB_END (bb) = n; head = n; } } @@ -7100,7 +7271,7 @@ emit_predicate_relation_info (void) the call. */ FOR_EACH_BB_REVERSE (bb) { - rtx insn = bb->head; + rtx insn = BB_HEAD (bb); while (1) { @@ -7110,13 +7281,13 @@ emit_predicate_relation_info (void) { rtx b = emit_insn_before (gen_safe_across_calls_all (), insn); rtx a = emit_insn_after (gen_safe_across_calls_normal (), insn); - if (bb->head == insn) - bb->head = b; - if (bb->end == insn) - bb->end = a; + if (BB_HEAD (bb) == insn) + BB_HEAD (bb) = b; + if (BB_END (bb) == insn) + BB_END (bb) = a; } - if (insn == bb->end) + if (insn == BB_END (bb)) break; insn = NEXT_INSN (insn); } @@ -7344,6 +7515,10 @@ ia64_in_small_data_p (tree exp) if (TREE_CODE (exp) == STRING_CST) return false; + /* Functions are never small data. */ + if (TREE_CODE (exp) == FUNCTION_DECL) + return false; + if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp)) { const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp)); @@ -8324,12 +8499,16 @@ ia64_hpux_init_libfuncs (void) set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs"); set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg"); - set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq"); - set_optab_libfunc (ne_optab, TFmode, "_U_Qfne"); - set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt"); - set_optab_libfunc (ge_optab, TFmode, "_U_Qfge"); - set_optab_libfunc (lt_optab, TFmode, "_U_Qflt"); - set_optab_libfunc (le_optab, TFmode, "_U_Qfle"); + /* ia64_expand_compare uses this. */ + cmptf_libfunc = init_one_libfunc ("_U_Qfcmp"); + + /* These should never be used. */ + set_optab_libfunc (eq_optab, TFmode, 0); + set_optab_libfunc (ne_optab, TFmode, 0); + set_optab_libfunc (gt_optab, TFmode, 0); + set_optab_libfunc (ge_optab, TFmode, 0); + set_optab_libfunc (lt_optab, TFmode, 0); + set_optab_libfunc (le_optab, TFmode, 0); set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad"); set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad"); diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 8ccda53bd9b..84e864908c1 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -87,6 +87,10 @@ extern int target_flags; #define MASK_INLINE_INT_DIV_THR 0x00001000 /* inline div, max throughput. */ +#define MASK_INLINE_SQRT_LAT 0x00002000 /* inline sqrt, min latency. */ + +#define MASK_INLINE_SQRT_THR 0x00004000 /* inline sqrt, max throughput. */ + #define MASK_DWARF2_ASM 0x40000000 /* test dwarf2 line info via gas. */ #define MASK_EARLY_STOP_BITS 0x00002000 /* tune stop bits for the model. */ @@ -127,8 +131,24 @@ extern int target_flags; #define TARGET_INLINE_INT_DIV \ (target_flags & (MASK_INLINE_INT_DIV_LAT | MASK_INLINE_INT_DIV_THR)) +#define TARGET_INLINE_SQRT_LAT (target_flags & MASK_INLINE_SQRT_LAT) + +#define TARGET_INLINE_SQRT_THR (target_flags & MASK_INLINE_SQRT_THR) + +#define TARGET_INLINE_SQRT \ + (target_flags & (MASK_INLINE_SQRT_LAT | MASK_INLINE_SQRT_THR)) + #define TARGET_DWARF2_ASM (target_flags & MASK_DWARF2_ASM) +/* If the assembler supports thread-local storage, assume that the + system does as well. If a particular target system has an + assembler that supports TLS -- but the rest of the system does not + support TLS -- that system should explicit define TARGET_HAVE_TLS + to false in its own configuration file. */ +#if !defined(TARGET_HAVE_TLS) && defined(HAVE_AS_TLS) +#define TARGET_HAVE_TLS true +#endif + extern int ia64_tls_size; #define TARGET_TLS14 (ia64_tls_size == 14) #define TARGET_TLS22 (ia64_tls_size == 22) @@ -186,6 +206,10 @@ extern int ia64_tls_size; N_("Generate inline integer division, optimize for latency") }, \ { "inline-int-divide-max-throughput", MASK_INLINE_INT_DIV_THR, \ N_("Generate inline integer division, optimize for throughput") },\ + { "inline-sqrt-min-latency", MASK_INLINE_SQRT_LAT, \ + N_("Generate inline square root, optimize for latency") }, \ + { "inline-sqrt-max-throughput", MASK_INLINE_SQRT_THR, \ + N_("Generate inline square root, optimize for throughput") }, \ { "dwarf2-asm", MASK_DWARF2_ASM, \ N_("Enable Dwarf 2 line debug info via GNU as")}, \ { "no-dwarf2-asm", -MASK_DWARF2_ASM, \ @@ -1304,6 +1328,13 @@ enum reg_class #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ ia64_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) +/* Nonzero if we do not know how to pass TYPE solely in registers. */ + +#define MUST_PASS_IN_STACK(MODE, TYPE) \ + ((TYPE) != 0 \ + && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ + || TREE_ADDRESSABLE (TYPE))) + /* A C type for declaring a variable that is used as the first argument of `FUNCTION_ARG' and other related values. For some target machines, the type `int' suffices and can hold the number of bytes of argument so far. */ @@ -1368,7 +1399,7 @@ do { \ On many machines, no registers can be used for this purpose since all function arguments are pushed on the stack. */ #define FUNCTION_ARG_REGNO_P(REGNO) \ -(((REGNO) >= GR_ARG_FIRST && (REGNO) < (GR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \ +(((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \ || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS))) /* Implement `va_arg'. */ diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 547b7979862..01e4d73839e 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -74,6 +74,8 @@ (UNSPEC_ADDP4 24) (UNSPEC_PROLOGUE_USE 25) (UNSPEC_RET_ADDR 26) + (UNSPEC_SETF_EXP 27) + (UNSPEC_FR_SQRT_RECIP_APPROX 28) ]) (define_constants @@ -2757,6 +2759,155 @@ operands[10] = CONST1_RTX (XFmode); } [(set_attr "predicable" "no")]) + +;; Inline square root. + +(define_insn "*sqrt_approx" + [(set (match_operand:XF 0 "fr_register_operand" "=f") + (div:XF (const_int 1) + (sqrt:XF (match_operand:XF 2 "fr_register_operand" "f")))) + (set (match_operand:BI 1 "register_operand" "=c") + (unspec:BI [(match_dup 2)] UNSPEC_FR_SQRT_RECIP_APPROX)) + (use (match_operand:SI 3 "const_int_operand" "")) ] + "" + "frsqrta.s%3 %0, %1 = %2" + [(set_attr "itanium_class" "fmisc") + (set_attr "predicable" "no")]) + +(define_insn "*setf_exp_xf" + [(set (match_operand:XF 0 "fr_register_operand" "=f") + (unspec:XF [(match_operand:DI 1 "register_operand" "r")] + UNSPEC_SETF_EXP))] + "" + "setf.exp %0 = %1" + [(set_attr "itanium_class" "frfr")]) + +(define_expand "sqrtsf2" + [(set (match_operand:SF 0 "fr_register_operand" "=&f") + (sqrt:SF (match_operand:SF 1 "fr_register_operand" "f")))] + "TARGET_INLINE_SQRT" +{ + rtx insn; + if (TARGET_INLINE_SQRT_LAT) +#if 0 + insn = gen_sqrtsf2_internal_lat (operands[0], operands[1]); +#else + abort (); +#endif + else + insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]); + emit_insn (insn); + DONE; +}) + +;; Latency-optimized square root. +;; FIXME: Implement. + +;; Throughput-optimized square root. + +(define_insn_and_split "sqrtsf2_internal_thr" + [(set (match_operand:SF 0 "fr_register_operand" "=&f") + (sqrt:SF (match_operand:SF 1 "fr_register_operand" "f"))) + ;; Register r2 in optimization guide. + (clobber (match_scratch:DI 2 "=r")) + ;; Register f8 in optimization guide + (clobber (match_scratch:XF 3 "=&f")) + ;; Register f9 in optimization guide + (clobber (match_scratch:XF 4 "=&f")) + ;; Register f10 in optimization guide + (clobber (match_scratch:XF 5 "=&f")) + ;; Register p6 in optimization guide. + (clobber (match_scratch:BI 6 "=c"))] + "TARGET_INLINE_SQRT_THR" + "#" + "&& reload_completed" + [ ;; exponent of +1/2 in r2 + (set (match_dup 2) (const_int 65534)) + ;; +1/2 in f8 + (set (match_dup 3) + (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP)) + ;; Step 1 + ;; y0 = 1/sqrt(a) in f7 + (parallel [(set (match_dup 7) + (div:XF (const_int 1) + (sqrt:XF (match_dup 8)))) + (set (match_dup 6) + (unspec:BI [(match_dup 8)] + UNSPEC_FR_SQRT_RECIP_APPROX)) + (use (const_int 0))]) + ;; Step 2 + ;; H0 = 1/2 * y0 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (mult:XF (match_dup 3) (match_dup 7)) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 3 + ;; S0 = a * y0 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 7) + (plus:XF (mult:XF (match_dup 8) (match_dup 7)) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 4 + ;; d = 1/2 - S0 * H0 in f10 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 5) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 4))) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 5 + ;; d' = d + 1/2 * d in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 3) (match_dup 5)) + (match_dup 5))) + (use (const_int 1))])) + ;; Step 6 + ;; e = d + d * d' in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 5) (match_dup 3)) + (match_dup 5))) + (use (const_int 1))])) + ;; Step 7 + ;; S1 = S0 + e * S0 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 0) + (float_truncate:SF + (plus:XF (mult:XF (match_dup 3) (match_dup 7)) + (match_dup 7)))) + (use (const_int 1))])) + ;; Step 8 + ;; H1 = H0 + e * H0 in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 3) (match_dup 4)) + (match_dup 4))) + (use (const_int 1))])) + ;; Step 9 + ;; d1 = a - S1 * S1 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 10 + ;; S = S1 + d1 * H1 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 0) + (float_truncate:SF + (plus:XF (mult:XF (match_dup 4) (match_dup 3)) + (match_dup 7)))) + (use (const_int 0))]))] +{ + /* Generate 82-bit versions of the input and output operands. */ + operands[7] = gen_rtx_REG (XFmode, REGNO (operands[0])); + operands[8] = gen_rtx_REG (XFmode, REGNO (operands[1])); + /* Generate required floating-point constants. */ + operands[9] = CONST0_RTX (XFmode); +} + [(set_attr "predicable" "no")]) ;; :::::::::::::::::::: ;; :: @@ -3102,6 +3253,155 @@ operands[10] = CONST1_RTX (XFmode); } [(set_attr "predicable" "no")]) + +;; Inline square root. + +(define_expand "sqrtdf2" + [(set (match_operand:DF 0 "fr_register_operand" "=&f") + (sqrt:DF (match_operand:DF 1 "fr_register_operand" "f")))] + "TARGET_INLINE_SQRT" +{ + rtx insn; + if (TARGET_INLINE_SQRT_LAT) +#if 0 + insn = gen_sqrtdf2_internal_lat (operands[0], operands[1]); +#else + abort (); +#endif + else + insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]); + emit_insn (insn); + DONE; +}) + +;; Latency-optimized square root. +;; FIXME: Implement. + +;; Throughput-optimized square root. + +(define_insn_and_split "sqrtdf2_internal_thr" + [(set (match_operand:DF 0 "fr_register_operand" "=&f") + (sqrt:DF (match_operand:DF 1 "fr_register_operand" "f"))) + ;; Register r2 in optimization guide. + (clobber (match_scratch:DI 2 "=r")) + ;; Register f8 in optimization guide + (clobber (match_scratch:XF 3 "=&f")) + ;; Register f9 in optimization guide + (clobber (match_scratch:XF 4 "=&f")) + ;; Register f10 in optimization guide + (clobber (match_scratch:XF 5 "=&f")) + ;; Register p6 in optimization guide. + (clobber (match_scratch:BI 6 "=c"))] + "TARGET_INLINE_SQRT_THR" + "#" + "&& reload_completed" + [ ;; exponent of +1/2 in r2 + (set (match_dup 2) (const_int 65534)) + ;; +1/2 in f10 + (set (match_dup 5) + (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP)) + ;; Step 1 + ;; y0 = 1/sqrt(a) in f7 + (parallel [(set (match_dup 7) + (div:XF (const_int 1) + (sqrt:XF (match_dup 8)))) + (set (match_dup 6) + (unspec:BI [(match_dup 8)] + UNSPEC_FR_SQRT_RECIP_APPROX)) + (use (const_int 0))]) + ;; Step 2 + ;; H0 = 1/2 * y0 in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 5) (match_dup 7)) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 3 + ;; G0 = a * y0 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 7) + (plus:XF (mult:XF (match_dup 8) (match_dup 7)) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 4 + ;; r0 = 1/2 - G0 * H0 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3))) + (match_dup 5))) + (use (const_int 1))])) + ;; Step 5 + ;; H1 = H0 + r0 * H0 in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 4) (match_dup 3)) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 6 + ;; G1 = G0 + r0 * G0 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 7) + (plus:XF (mult:XF (match_dup 4) (match_dup 7)) + (match_dup 7))) + (use (const_int 1))])) + ;; Step 7 + ;; r1 = 1/2 - G1 * H1 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3))) + (match_dup 5))) + (use (const_int 1))])) + ;; Step 8 + ;; H2 = H1 + r1 * H1 in f8 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (mult:XF (match_dup 4) (match_dup 3)) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 9 + ;; G2 = G1 + r1 * G1 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 7) + (plus:XF (mult:XF (match_dup 4) (match_dup 7)) + (match_dup 7))) + (use (const_int 1))])) + ;; Step 10 + ;; d2 = a - G2 * G2 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 11 + ;; G3 = G2 + d2 * H2 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 7) + (plus:XF (mult:XF (match_dup 4) (match_dup 3)) + (match_dup 7))) + (use (const_int 1))])) + ;; Step 12 + ;; d3 = a - G3 * G3 in f9 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 13 + ;; S = G3 + d3 * H2 in f7 + (cond_exec (ne (match_dup 6) (const_int 0)) + (parallel [(set (match_dup 0) + (float_truncate:DF + (plus:XF (mult:XF (match_dup 4) (match_dup 3)) + (match_dup 7)))) + (use (const_int 0))]))] +{ + /* Generate 82-bit versions of the input and output operands. */ + operands[7] = gen_rtx_REG (XFmode, REGNO (operands[0])); + operands[8] = gen_rtx_REG (XFmode, REGNO (operands[1])); + /* Generate required floating-point constants. */ + operands[9] = CONST0_RTX (XFmode); +} + [(set_attr "predicable" "no")]) ;; :::::::::::::::::::: ;; :: @@ -3292,6 +3592,17 @@ "fma.s%4 %0 = %F1, %F2, %F3" [(set_attr "itanium_class" "fmac")]) +(define_insn "*maddxf4_alts_truncsf" + [(set (match_operand:SF 0 "fr_register_operand" "=f") + (float_truncate:SF + (plus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")) + (match_operand:XF 3 "xfreg_or_fp01_operand" "fG")))) + (use (match_operand:SI 4 "const_int_operand" ""))] + "" + "fma.s.s%4 %0 = %F1, %F2, %F3" + [(set_attr "itanium_class" "fmac")]) + (define_insn "*maddxf4_alts_truncdf" [(set (match_operand:DF 0 "fr_register_operand" "=f") (float_truncate:DF @@ -3591,6 +3902,170 @@ "operands[6] = CONST1_RTX (XFmode);" [(set_attr "predicable" "no")]) +;; Inline square root. + +(define_expand "sqrtxf2" + [(set (match_operand:XF 0 "fr_register_operand" "=&f") + (sqrt:XF (match_operand:XF 1 "fr_register_operand" "f")))] + "TARGET_INLINE_SQRT" +{ + rtx insn; + if (TARGET_INLINE_SQRT_LAT) +#if 0 + insn = gen_sqrtxf2_internal_lat (operands[0], operands[1]); +#else + abort (); +#endif + else + insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]); + emit_insn (insn); + DONE; +}) + +;; Latency-optimized square root. +;; FIXME: Implement. + +;; Throughput-optimized square root. + +(define_insn_and_split "sqrtxf2_internal_thr" + [(set (match_operand:XF 0 "fr_register_operand" "=&f") + (sqrt:XF (match_operand:XF 1 "fr_register_operand" "f"))) + ;; Register r2 in optimization guide. + (clobber (match_scratch:DI 2 "=r")) + ;; Register f8 in optimization guide + (clobber (match_scratch:XF 3 "=&f")) + ;; Register f9 in optimization guide + (clobber (match_scratch:XF 4 "=&f")) + ;; Register f10 in optimization guide + (clobber (match_scratch:XF 5 "=&f")) + ;; Register f11 in optimization guide + (clobber (match_scratch:XF 6 "=&f")) + ;; Register p6 in optimization guide. + (clobber (match_scratch:BI 7 "=c"))] + "TARGET_INLINE_SQRT_THR" + "#" + "&& reload_completed" + [ ;; exponent of +1/2 in r2 + (set (match_dup 2) (const_int 65534)) + ;; +1/2 in f8. The Intel manual mistakenly specifies f10. + (set (match_dup 3) + (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP)) + ;; Step 1 + ;; y0 = 1/sqrt(a) in f7 + (parallel [(set (match_dup 8) + (div:XF (const_int 1) + (sqrt:XF (match_dup 9)))) + (set (match_dup 7) + (unspec:BI [(match_dup 9)] + UNSPEC_FR_SQRT_RECIP_APPROX)) + (use (const_int 0))]) + ;; Step 2 + ;; H0 = 1/2 * y0 in f9 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (mult:XF (match_dup 3) (match_dup 8)) + (match_dup 10))) + (use (const_int 1))])) + ;; Step 3 + ;; S0 = a * y0 in f7 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 8) + (plus:XF (mult:XF (match_dup 9) (match_dup 8)) + (match_dup 10))) + (use (const_int 1))])) + ;; Step 4 + ;; d0 = 1/2 - S0 * H0 in f10 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 5) + (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 5 + ;; H1 = H0 + d0 * H0 in f9 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (mult:XF (match_dup 5) (match_dup 4)) + (match_dup 4))) + (use (const_int 1))])) + ;; Step 6 + ;; S1 = S0 + d0 * S0 in f7 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 8) + (plus:XF (mult:XF (match_dup 5) (match_dup 8)) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 7 + ;; d1 = 1/2 - S1 * H1 in f10 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 5) + (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 8 + ;; H2 = H1 + d1 * H1 in f9 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (mult:XF (match_dup 5) (match_dup 4)) + (match_dup 4))) + (use (const_int 1))])) + ;; Step 9 + ;; S2 = S1 + d1 * S1 in f7 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 8) + (plus:XF (mult:XF (match_dup 5) (match_dup 8)) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 10 + ;; d2 = 1/2 - S2 * H2 in f10 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 5) + (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) + (match_dup 3))) + (use (const_int 1))])) + ;; Step 11 + ;; e2 = a - S2 * S2 in f8 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8))) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 12 + ;; S3 = S2 + e2 * H2 in f7 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 8) + (plus:XF (mult:XF (match_dup 3) (match_dup 4)) + (match_dup 8))) + (use (const_int 1))])) + ;; Step 13 + ;; H3 = H2 + d2 * H2 in f9 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 4) + (plus:XF (mult:XF (match_dup 5) (match_dup 4)) + (match_dup 4))) + (use (const_int 1))])) + ;; Step 14 + ;; e3 = a - S3 * S3 in f8 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 3) + (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8))) + (match_dup 9))) + (use (const_int 1))])) + ;; Step 15 + ;; S = S3 + e3 * H3 in f7 + (cond_exec (ne (match_dup 7) (const_int 0)) + (parallel [(set (match_dup 0) + (plus:XF (mult:XF (match_dup 3) (match_dup 4)) + (match_dup 8))) + (use (const_int 0))]))] +{ + /* Generate 82-bit versions of the input and output operands. */ + operands[8] = gen_rtx_REG (XFmode, REGNO (operands[0])); + operands[9] = gen_rtx_REG (XFmode, REGNO (operands[1])); + /* Generate required floating-point constants. */ + operands[10] = CONST0_RTX (XFmode); +} + [(set_attr "predicable" "no")]) + ;; ??? frcpa works like cmp.foo.unc. (define_insn "*recip_approx" @@ -4009,6 +4484,17 @@ DONE; }) +(define_expand "cmptf" + [(set (cc0) + (compare (match_operand:TF 0 "gr_register_operand" "") + (match_operand:TF 1 "gr_register_operand" "")))] + "TARGET_HPUX" +{ + ia64_compare_op0 = operands[0]; + ia64_compare_op1 = operands[1]; + DONE; +}) + (define_insn "*cmpsi_normal" [(set (match_operand:BI 0 "register_operand" "=c") (match_operator:BI 1 "normal_comparison_operator" @@ -5103,7 +5589,7 @@ ;; :: ;; :::::::::::::::::::: -;; ??? Emiting a NOP instruction isn't very useful. This should probably +;; ??? Emitting a NOP instruction isn't very useful. This should probably ;; be emitting ";;" to force a break in the instruction packing. ;; No operation, needed in case the user uses -g but not -O. diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h index c24c70c8d5a..fc7df808188 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -12,10 +12,7 @@ /* Target OS builtins. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ - builtin_assert("system=linux"); \ - builtin_define_std("linux"); \ - builtin_define_std("unix"); \ - builtin_define("__gnu_linux__"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ builtin_define("_LONGLONG"); \ } while (0) @@ -66,7 +63,7 @@ do { \ #include #define IA64_GATE_AREA_START 0xa000000000000100LL -#define IA64_GATE_AREA_END 0xa000000000020000LL +#define IA64_GATE_AREA_END 0xa000000000030000LL #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ if ((CONTEXT)->rp >= IA64_GATE_AREA_START \ @@ -93,11 +90,13 @@ do { \ (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ } \ \ + (CONTEXT)->fpsr_loc = &(sc_->sc_ar_fpsr); \ (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \ (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \ (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \ (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \ - (CONTEXT)->bsp = sc_->sc_ar_bsp; \ + (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \ + (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \ (CONTEXT)->pr = sc_->sc_pr; \ (CONTEXT)->psp = sc_->sc_gr[12]; \ (CONTEXT)->gp = sc_->sc_gr[1]; \ @@ -105,11 +104,26 @@ do { \ other than what we adjust for below. */ \ (FS) -> no_reg_stack_frame = 1; \ \ - /* Don't touch the branch registers o.t. b0. The kernel doesn't \ - pass the preserved branch registers in the sigcontext but \ - leaves them intact, so there's no need to do anything \ - with them here. */ \ + if (sc_->sc_rbs_base) \ + { \ + /* Need to switch from alternate register backing store. */ \ + long ndirty, loadrs = sc_->sc_loadrs >> 16; \ + unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \ + unsigned long bspstore; \ + unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \ \ + ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \ + (unsigned long *) (CONTEXT)->bsp);\ + bspstore = (unsigned long) \ + ia64_rse_skip_regs (ar_bsp, -ndirty); \ + ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \ + sc_->sc_ar_rnat); \ + } \ + \ + /* Don't touch the branch registers o.t. b0, b6 and b7. \ + The kernel doesn't pass the preserved branch registers \ + in the sigcontext but leaves them intact, so there's no \ + need to do anything with them here. */ \ { \ unsigned long sof = sc_->sc_cfm & 0x7f; \ (CONTEXT)->bsp = (unsigned long) \ @@ -123,4 +137,73 @@ do { \ \ goto SUCCESS; \ } + +#define MD_HANDLE_UNWABI(CONTEXT, FS) \ + if ((FS)->unwabi == ((3 << 8) | 's') \ + || (FS)->unwabi == ((0 << 8) | 's')) \ + { \ + struct sigframe { \ + char scratch[16]; \ + unsigned long sig_number; \ + struct siginfo *info; \ + struct sigcontext *sc; \ + } *frame_ = (struct sigframe *)(CONTEXT)->psp; \ + struct sigcontext *sc_ = frame_->sc; \ + \ + /* Restore scratch registers in case the unwinder needs to \ + refer to a value stored in one of them. */ \ + { \ + int i_; \ + \ + for (i_ = 2; i_ < 4; i_++) \ + (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ + for (i_ = 8; i_ < 12; i_++) \ + (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ + for (i_ = 14; i_ < 32; i_++) \ + (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ + } \ + \ + (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \ + (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \ + (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \ + (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \ + (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \ + (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \ + (CONTEXT)->pr = sc_->sc_pr; \ + (CONTEXT)->gp = sc_->sc_gr[1]; \ + /* Signal frame doesn't have an associated reg. stack frame \ + other than what we adjust for below. */ \ + (FS) -> no_reg_stack_frame = 1; \ + \ + if (sc_->sc_rbs_base) \ + { \ + /* Need to switch from alternate register backing store. */ \ + long ndirty, loadrs = sc_->sc_loadrs >> 16; \ + unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \ + unsigned long bspstore; \ + unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \ + \ + ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \ + (unsigned long *) (CONTEXT)->bsp);\ + bspstore = (unsigned long) \ + ia64_rse_skip_regs (ar_bsp, -ndirty); \ + ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \ + sc_->sc_ar_rnat); \ + } \ + \ + /* Don't touch the branch registers o.t. b0, b6 and b7. \ + The kernel doesn't pass the preserved branch registers \ + in the sigcontext but leaves them intact, so there's no \ + need to do anything with them here. */ \ + { \ + unsigned long sof = sc_->sc_cfm & 0x7f; \ + (CONTEXT)->bsp = (unsigned long) \ + ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \ + } \ + \ + /* pfs_loc already set above. Without this pfs_loc would point \ + incorrectly to sc_cfm instead of sc_ar_pfs. */ \ + (FS)->curr.reg[UNW_REG_PFS].where = UNW_WHERE_NONE; \ + } + #endif /* IN_LIBGCC2 */ diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h index 5db10895860..15a57d924cd 100644 --- a/gcc/config/ia64/sysv4.h +++ b/gcc/config/ia64/sysv4.h @@ -133,7 +133,7 @@ do { \ #define SDATA_SECTION_FUNCTION \ void \ -sdata_section () \ +sdata_section (void) \ { \ if (in_section != in_sdata) \ { \ @@ -146,7 +146,7 @@ sdata_section () \ #define SBSS_SECTION_FUNCTION \ void \ -sbss_section () \ +sbss_section (void) \ { \ if (in_section != in_sbss) \ { \ diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64 index 04cfc21592d..21d37a79a92 100644 --- a/gcc/config/ia64/t-ia64 +++ b/gcc/config/ia64/t-ia64 @@ -41,7 +41,7 @@ crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES) $(srcdir)/config/ia64/crtfastmath.c LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \ - $(srcdir)/unwind-c.c + $(srcdir)/unwind-c.c $(srcdir)/gthr-gnat.c ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c index 41f59d10b9d..29c63fa13a7 100644 --- a/gcc/config/ia64/unwind-ia64.c +++ b/gcc/config/ia64/unwind-ia64.c @@ -157,6 +157,7 @@ typedef struct unw_state_record unsigned char gr_save_loc; /* next general register to use for saving */ unsigned char return_link_reg; /* branch register for return link */ + unsigned short unwabi; struct unw_labeled_state *labeled_states; /* list of all labeled states */ struct unw_reg_state curr; /* current state */ @@ -183,7 +184,8 @@ struct _Unwind_Context { /* Initial frame info. */ unsigned long rnat; /* rse nat collection */ - unsigned long regstk_top; /* bsp for first frame */ + unsigned long regstk_top; /* lowest address of rbs stored register + which uses context->rnat collection */ /* Current frame info. */ unsigned long bsp; /* backing store pointer value @@ -221,7 +223,7 @@ struct _Unwind_Context } nat; } ireg[32 - 2]; /* Indexed by - 2 */ - unsigned long *br_loc[7]; + unsigned long *br_loc[8]; void *fr_loc[32 - 2]; /* ??? We initially point pri_unat_loc here. The entire NAT bit @@ -621,11 +623,11 @@ desc_prologue (int body, unw_word rlen, unsigned char mask, */ static inline void -desc_abi (unsigned char abi __attribute__((unused)), - unsigned char context __attribute__((unused)), - struct unw_state_record *sr __attribute__((unused))) +desc_abi (unsigned char abi, + unsigned char context, + struct unw_state_record *sr) { - /* Anything to do? */ + sr->unwabi = (abi << 8) | context; } static inline void @@ -1491,6 +1493,80 @@ ia64_rse_skip_regs (unsigned long *addr, long num_regs) } +/* Copy register backing store from SRC to DST, LEN words + (which include both saved registers and nat collections). + DST_RNAT is a partial nat collection for DST. SRC and DST + don't have to be equal modulo 64 slots, so it cannot be + done with a simple memcpy as the nat collections will be + at different relative offsets and need to be combined together. */ +static void +ia64_copy_rbs (struct _Unwind_Context *info, unsigned long dst, + unsigned long src, long len, unsigned long dst_rnat) +{ + long count; + unsigned long src_rnat; + unsigned long shift1, shift2; + + len <<= 3; + dst_rnat &= (1UL << ((dst >> 3) & 0x3f)) - 1; + src_rnat = src >= info->regstk_top + ? info->rnat : *(unsigned long *) (src | 0x1f8); + src_rnat &= ~((1UL << ((src >> 3) & 0x3f)) - 1); + /* Just to make sure. */ + src_rnat &= ~(1UL << 63); + shift1 = ((dst - src) >> 3) & 0x3f; + if ((dst & 0x1f8) < (src & 0x1f8)) + shift1--; + shift2 = 0x3f - shift1; + if ((dst & 0x1f8) >= (src & 0x1f8)) + { + count = ~dst & 0x1f8; + goto first; + } + count = ~src & 0x1f8; + goto second; + while (len > 0) + { + src_rnat = src >= info->regstk_top + ? info->rnat : *(unsigned long *) (src | 0x1f8); + /* Just to make sure. */ + src_rnat &= ~(1UL << 63); + count = shift2 << 3; +first: + if (count > len) + count = len; + memcpy ((char *) dst, (char *) src, count); + dst += count; + src += count; + len -= count; + dst_rnat |= (src_rnat << shift1) & ~(1UL << 63); + if (len <= 0) + break; + *(long *) dst = dst_rnat; + dst += 8; + dst_rnat = 0; + count = shift1 << 3; +second: + if (count > len) + count = len; + memcpy ((char *) dst, (char *) src, count); + dst += count; + src += count + 8; + len -= count + 8; + dst_rnat |= (src_rnat >> shift2); + } + if ((dst & 0x1f8) == 0x1f8) + { + *(long *) dst = dst_rnat; + dst += 8; + dst_rnat = 0; + } + /* Set info->regstk_top to lowest rbs address which will use + info->rnat collection. */ + info->regstk_top = dst & ~0x1ffUL; + info->rnat = dst_rnat; +} + /* Unwind accessors. */ static void @@ -1550,9 +1626,10 @@ unw_access_gr (struct _Unwind_Context *info, int regnum, break; case UNW_NAT_REGSTK: - nat_addr = ia64_rse_rnat_addr (addr); - if ((unsigned long) nat_addr >= info->regstk_top) + if ((unsigned long) addr >= info->regstk_top) nat_addr = &info->rnat; + else + nat_addr = ia64_rse_rnat_addr (addr); nat_mask = 1UL << ia64_rse_slot_num (addr); break; } @@ -1562,9 +1639,10 @@ unw_access_gr (struct _Unwind_Context *info, int regnum, { /* Access a stacked register. */ addr = ia64_rse_skip_regs ((unsigned long *) info->bsp, regnum - 32); - nat_addr = ia64_rse_rnat_addr (addr); - if ((unsigned long) nat_addr >= info->regstk_top) + if ((unsigned long) addr >= info->regstk_top) nat_addr = &info->rnat; + else + nat_addr = ia64_rse_rnat_addr (addr); nat_mask = 1UL << ia64_rse_slot_num (addr); } @@ -1723,7 +1801,8 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) } context->region_start = ent->start_offset + segment_base; - fs->when_target = (context->rp - context->region_start) / 16 * 3; + fs->when_target = ((context->rp & -16) - context->region_start) / 16 * 3 + + (context->rp & 15); unw = (unsigned long *) (ent->info_offset + segment_base); header = *unw; @@ -1814,9 +1893,9 @@ uw_update_reg_address (struct _Unwind_Context *context, case UNW_WHERE_BR: /* Note that while RVAL can only be 1-5 from normal descriptors, - we can want to look at B0 due to having manually unwound a + we can want to look at B0, B6 and B7 due to having manually unwound a signal frame. */ - if (rval <= 5) + if (rval < 8) addr = context->br_loc[rval]; else abort (); @@ -1930,6 +2009,10 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs) { long i; +#ifdef MD_HANDLE_UNWABI + MD_HANDLE_UNWABI (context, fs); +#endif + context->sp = context->psp; /* First, set PSP. Subsequent instructions may depend on this value. */ @@ -1993,18 +2076,31 @@ uw_init_context_1 (struct _Unwind_Context *context, void *bsp) /* Set psp to the caller's stack pointer. */ void *psp = __builtin_dwarf_cfa () - 16; _Unwind_FrameState fs; - - /* Flush the register stack to memory so that we can access it. */ - __builtin_ia64_flushrs (); + unsigned long rnat, tmp1, tmp2; + + /* Flush the register stack to memory so that we can access it. + Get rse nat collection for the last incomplete rbs chunk of + registers at the same time. For this RSE needs to be turned + into the mandatory only mode. */ + asm ("mov.m %1 = ar.rsc;;\n\t" + "and %2 = 0x1c, %1;;\n\t" + "mov.m ar.rsc = %2;;\n\t" + "flushrs;;\n\t" + "mov.m %0 = ar.rnat;;\n\t" + "mov.m ar.rsc = %1\n\t" + : "=r" (rnat), "=r" (tmp1), "=r" (tmp2)); memset (context, 0, sizeof (struct _Unwind_Context)); - context->bsp = context->regstk_top = (unsigned long) bsp; + context->bsp = (unsigned long) bsp; + /* Set context->regstk_top to lowest rbs address which will use + context->rnat collection. */ + context->regstk_top = context->bsp & ~0x1ffULL; + context->rnat = rnat; context->psp = (unsigned long) psp; context->rp = (unsigned long) rp; asm ("mov %0 = sp" : "=r" (context->sp)); asm ("mov %0 = pr" : "=r" (context->pr)); context->pri_unat_loc = &context->initial_unat; /* ??? */ - /* ??? Get rnat. Don't we have to turn off the rse for that? */ if (uw_frame_state_for (context, &fs) != _URC_NO_REASON) abort (); @@ -2045,6 +2141,9 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), ia64_rse_skip_regs ((unsigned long *)target->bsp, (*target->pfs_loc >> 7) & 0x7f); + if (target->bsp < target->regstk_top) + target->rnat = *ia64_rse_rnat_addr ((unsigned long *) target->bsp); + /* Provide assembly with the offsets into the _Unwind_Context. */ asm volatile ("uc_rnat = %0" : : "i"(offsetof (struct _Unwind_Context, rnat))); @@ -2081,22 +2180,22 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), ";; \n\t" "(p6) ld8.fill r4 = [%1] \n\t" "(p7) ld8.fill r5 = [r20] \n\t" - "add r21 = uc_br_loc + 8, %0 \n\t" + "add r21 = uc_br_loc + 16, %0 \n\t" "adds %1 = 16, %1 \n\t" "adds r20 = 16, r20 \n\t" ";; \n\t" "(p8) ld8.fill r6 = [%1] \n\t" "(p9) ld8.fill r7 = [r20] \n\t" - "add r20 = uc_br_loc, %0 \n\t" + "add r20 = uc_br_loc + 8, %0 \n\t" ";; \n\t" /* Load up call-saved branch registers. */ "ld8 r22 = [r20], 16 \n\t" "ld8 r23 = [r21], 16 \n\t" ";; \n\t" "ld8 r24 = [r20], 16 \n\t" - "ld8 r25 = [r21], uc_fr_loc - (uc_br_loc + 24)\n\t" + "ld8 r25 = [r21], uc_fr_loc - (uc_br_loc + 32)\n\t" ";; \n\t" - "ld8 r26 = [r20], uc_fr_loc + 8 - (uc_br_loc + 32)\n\t" + "ld8 r26 = [r20], uc_fr_loc + 8 - (uc_br_loc + 40)\n\t" "ld8 r27 = [r21], 24 \n\t" "cmp.ne p6, p0 = r0, r22 \n\t" ";; \n\t" @@ -2244,12 +2343,12 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), "(p9) mov.i ar.lc = r29 \n\t" ";; \n\t" "mov.m r25 = ar.rsc \n\t" - "(p6) mov.i ar.fpsr = r30 \n\t" + "(p6) mov.m ar.fpsr = r30 \n\t" ";; \n\t" - "and r25 = 0x1c, r25 \n\t" + "and r29 = 0x1c, r25 \n\t" "mov b0 = r26 \n\t" ";; \n\t" - "mov.m ar.rsc = r25 \n\t" + "mov.m ar.rsc = r29 \n\t" ";; \n\t" /* This must be done before setting AR.BSPSTORE, otherwise AR.BSP will be initialized with a random displacement @@ -2260,7 +2359,6 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), ";; \n\t" "mov.m ar.bspstore = r23 \n\t" ";; \n\t" - "or r25 = 0x3, r25 \n\t" "mov.m ar.rnat = r22 \n\t" ";; \n\t" "mov.m ar.rsc = r25 \n\t" diff --git a/gcc/config/ip2k/ip2k-protos.h b/gcc/config/ip2k/ip2k-protos.h index d1553ac047e..1c4355ff92c 100644 --- a/gcc/config/ip2k/ip2k-protos.h +++ b/gcc/config/ip2k/ip2k-protos.h @@ -18,75 +18,66 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -extern void function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -extern int find_one_set_bit_p PARAMS ((HOST_WIDE_INT)); -extern int find_one_clear_bit_p PARAMS ((HOST_WIDE_INT)); +extern void function_prologue (FILE *, HOST_WIDE_INT); +extern void function_epilogue (FILE *, HOST_WIDE_INT); +extern int find_one_set_bit_p (HOST_WIDE_INT); +extern int find_one_clear_bit_p (HOST_WIDE_INT); #ifdef TREE_CODE -extern void unique_section PARAMS ((tree, int)); -extern void asm_output_section_name PARAMS ((FILE *, tree, const char *, - int)); -extern int valid_machine_type_attribute PARAMS ((tree, tree, tree, tree)); -extern int valid_machine_decl_attribute PARAMS ((tree, tree, tree, tree)); -extern int ip2k_return_pops_args PARAMS ((tree, tree, int)); +extern void unique_section (tree, int); +extern int valid_machine_type_attribute (tree, tree, tree, tree); +extern int valid_machine_decl_attribute (tree, tree, tree, tree); +extern int ip2k_return_pops_args (tree, tree, int); #endif /* TREE_CODE */ #ifdef RTX_CODE -extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int)); -extern int ip2k_extra_constraint PARAMS ((rtx, int)); -extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode, rtx)); -extern int adjust_insn_length PARAMS ((rtx insn, int len)); -extern void asm_output_char PARAMS ((FILE *, rtx)); -extern void asm_output_short PARAMS ((FILE *, rtx)); -extern void asm_output_byte PARAMS ((FILE *, int)); -extern void print_operand PARAMS ((FILE *, rtx, int)); -extern void print_operand_address PARAMS ((FILE *, rtx)); -extern int ip2k_jump_mode PARAMS ((rtx, rtx)); -extern void ip2k_split_words PARAMS ((enum machine_mode, enum machine_mode, - rtx *)); -extern rtx ip2k_get_low_half PARAMS ((rtx, enum machine_mode)); -extern rtx ip2k_get_high_half PARAMS ((rtx, enum machine_mode)); -extern int ip2k_nonptr_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_ptr_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_ip_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_short_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_gen_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_nonsp_reg_operand PARAMS ((rtx, enum machine_mode)); -extern int ip2k_symbol_ref_operand PARAMS ((rtx, enum machine_mode)); -extern const char *ip2k_set_compare PARAMS ((rtx, rtx)); -extern const char *ip2k_gen_sCOND PARAMS ((rtx, enum rtx_code, rtx)); -extern const char *ip2k_gen_signed_comp_branch PARAMS ((rtx, - enum rtx_code, - rtx)); -extern const char *ip2k_gen_unsigned_comp_branch PARAMS ((rtx, - enum rtx_code, - rtx)); -extern int is_regfile_address PARAMS ((rtx)); -extern int ip2k_mode_dependent_address PARAMS ((rtx)); -extern int ip2k_address_uses_reg_p PARAMS ((rtx, unsigned int)); -extern int ip2k_xexp_not_uses_reg_p PARAMS ((rtx, unsigned int, int)); -extern int ip2k_composite_xexp_not_uses_reg_p PARAMS ((rtx, unsigned int, int)); -extern int ip2k_composite_xexp_not_uses_cc0_p PARAMS ((rtx)); -extern int ip2k_signed_comparison_operator PARAMS ((rtx, - enum machine_mode)); -extern int ip2k_unsigned_comparison_operator PARAMS ((rtx, - enum machine_mode)); -extern int ip2k_unary_operator PARAMS ((rtx, enum machine_mode)); -extern int ip2k_binary_operator PARAMS ((rtx, enum machine_mode)); +extern int legitimate_address_p (enum machine_mode, rtx, int); +extern int ip2k_extra_constraint (rtx, int); +extern rtx legitimize_address (rtx, rtx, enum machine_mode, rtx); +extern int adjust_insn_length (rtx insn, int len); +extern void asm_output_char (FILE *, rtx); +extern void asm_output_short (FILE *, rtx); +extern void asm_output_byte (FILE *, int); +extern void print_operand (FILE *, rtx, int); +extern void print_operand_address (FILE *, rtx); +extern int ip2k_jump_mode (rtx, rtx); +extern void ip2k_split_words (enum machine_mode, enum machine_mode, rtx *); +extern rtx ip2k_get_low_half (rtx, enum machine_mode); +extern rtx ip2k_get_high_half (rtx, enum machine_mode); +extern int ip2k_nonptr_operand (rtx, enum machine_mode); +extern int ip2k_ptr_operand (rtx, enum machine_mode); +extern int ip2k_ip_operand (rtx, enum machine_mode); +extern int ip2k_short_operand (rtx, enum machine_mode); +extern int ip2k_gen_operand (rtx, enum machine_mode); +extern int ip2k_nonsp_reg_operand (rtx, enum machine_mode); +extern int ip2k_symbol_ref_operand (rtx, enum machine_mode); +extern const char *ip2k_set_compare (rtx, rtx); +extern const char *ip2k_gen_sCOND (rtx, enum rtx_code, rtx); +extern const char *ip2k_gen_signed_comp_branch (rtx, enum rtx_code, rtx); +extern const char *ip2k_gen_unsigned_comp_branch (rtx, enum rtx_code, rtx); +extern int is_regfile_address (rtx); +extern int ip2k_mode_dependent_address (rtx); +extern int ip2k_address_uses_reg_p (rtx, unsigned int); +extern int ip2k_xexp_not_uses_reg_p (rtx, unsigned int, int); +extern int ip2k_composite_xexp_not_uses_reg_p (rtx, unsigned int, int); +extern int ip2k_composite_xexp_not_uses_cc0_p (rtx); +extern int ip2k_signed_comparison_operator (rtx, enum machine_mode); +extern int ip2k_unsigned_comparison_operator (rtx, enum machine_mode); +extern int ip2k_unary_operator (rtx, enum machine_mode); +extern int ip2k_binary_operator (rtx, enum machine_mode); extern rtx ip2k_compare_operands[3]; #endif /* RTX_CODE */ #ifdef HAVE_MACHINE_MODES -extern int class_max_nregs PARAMS ((enum reg_class, enum machine_mode)); -extern enum reg_class class_likely_spilled_p PARAMS ((int c)); +extern int class_max_nregs (enum reg_class, enum machine_mode); +extern enum reg_class class_likely_spilled_p (int c); #endif /* HAVE_MACHINE_MODES */ #ifdef REAL_VALUE_TYPE -extern void asm_output_float PARAMS ((FILE *, REAL_VALUE_TYPE)); +extern void asm_output_float (FILE *, REAL_VALUE_TYPE); #endif -extern int ip2k_init_elim_offset PARAMS ((int, int)); -extern void ip2k_init_local_alloc PARAMS ((int *)); +extern int ip2k_init_elim_offset (int, int); +extern void ip2k_init_local_alloc (int *); diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c index e31347fd701..cb73b39234b 100644 --- a/gcc/config/ip2k/ip2k.c +++ b/gcc/config/ip2k/ip2k.c @@ -54,35 +54,33 @@ the stack offsets. Isolate the decision process into a simple macro. */ #define CHAIN_FRAMES (frame_pointer_needed || FRAME_POINTER_REQUIRED) -static int ip2k_naked_function_p PARAMS ((tree)); +static int ip2k_naked_function_p (tree); #ifdef IP2K_MD_REORG_PASS -static void mdr_resequence_xy_yx PARAMS ((rtx)); -static void mdr_pres_replace_and_recurse PARAMS ((rtx, rtx, rtx)); -static void mdr_propagate_reg_equivs_sequence PARAMS ((rtx, rtx, rtx)); -static void mdr_propagate_reg_equivs PARAMS ((rtx)); -static int track_dp_reload PARAMS ((rtx , rtx *, int , int)); -static void mdr_try_dp_reload_elim PARAMS ((rtx)); -static void mdr_try_move_dp_reload PARAMS ((rtx)); -static void mdr_try_move_pushes PARAMS ((rtx)); -static void mdr_try_propagate_clr_sequence PARAMS ((rtx, unsigned int)); -static void mdr_try_propagate_clr PARAMS ((rtx)); -static void mdr_try_propagate_move_sequence PARAMS ((rtx, rtx, rtx)); -static void mdr_try_propagate_move PARAMS ((rtx)); -static void mdr_try_remove_redundant_insns PARAMS ((rtx)); -static int track_w_reload PARAMS ((rtx, rtx *, int , int)); -static void mdr_try_wreg_elim PARAMS ((rtx)); +static void mdr_resequence_xy_yx (rtx); +static void mdr_pres_replace_and_recurse (rtx, rtx, rtx); +static void mdr_propagate_reg_equivs_sequence (rtx, rtx, rtx); +static void mdr_propagate_reg_equivs (rtx); +static int track_dp_reload (rtx , rtx *, int , int); +static void mdr_try_dp_reload_elim (rtx); +static void mdr_try_move_dp_reload (rtx); +static void mdr_try_move_pushes (rtx); +static void mdr_try_propagate_clr_sequence (rtx, unsigned int); +static void mdr_try_propagate_clr (rtx); +static void mdr_try_propagate_move_sequence (rtx, rtx, rtx); +static void mdr_try_propagate_move (rtx); +static void mdr_try_remove_redundant_insns (rtx); +static int track_w_reload (rtx, rtx *, int , int); +static void mdr_try_wreg_elim (rtx); #endif /* IP2K_MD_REORG_PASS */ -static void ip2k_reorg PARAMS ((void)); -static int ip2k_check_can_adjust_stack_ref PARAMS ((rtx, int)); -static void ip2k_adjust_stack_ref PARAMS ((rtx *, int)); -static int ip2k_xexp_not_uses_reg_for_mem PARAMS ((rtx, unsigned int)); -static tree ip2k_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, - bool *)); -static tree ip2k_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, - bool *)); -static bool ip2k_rtx_costs PARAMS ((rtx, int, int, int *)); -static int ip2k_address_cost PARAMS ((rtx)); -static void ip2k_init_libfuncs PARAMS ((void)); +static void ip2k_reorg (void); +static int ip2k_check_can_adjust_stack_ref (rtx, int); +static void ip2k_adjust_stack_ref (rtx *, int); +static int ip2k_xexp_not_uses_reg_for_mem (rtx, unsigned int); +static tree ip2k_handle_progmem_attribute (tree *, tree, tree, int, bool *); +static tree ip2k_handle_fndecl_attribute (tree *, tree, tree, int, bool *); +static bool ip2k_rtx_costs (rtx, int, int, int *); +static int ip2k_address_cost (rtx); +static void ip2k_init_libfuncs (void); const struct attribute_spec ip2k_attribute_table[]; @@ -145,8 +143,7 @@ int ip2k_reorg_merge_qimode = 0; /* Set up local allocation order. */ void -ip2k_init_local_alloc (rao) - int * rao; +ip2k_init_local_alloc (int *rao) { static const int alloc_order[] = REG_ALLOC_ORDER; @@ -161,10 +158,7 @@ ip2k_init_local_alloc (rao) SIZE is the number of bytes of arguments passed on the stack. */ int -ip2k_return_pops_args (fundecl, funtype, size) - tree fundecl ATTRIBUTE_UNUSED; - tree funtype; - int size; +ip2k_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, tree funtype, int size) { if (TREE_CODE (funtype) == IDENTIFIER_NODE) return size; @@ -179,8 +173,7 @@ ip2k_return_pops_args (fundecl, funtype, size) /* Return nonzero if FUNC is a naked function. */ static int -ip2k_naked_function_p (func) - tree func; +ip2k_naked_function_p (tree func) { tree a; @@ -193,9 +186,7 @@ ip2k_naked_function_p (func) /* Output function prologue. */ void -function_prologue (file, size) - FILE *file; - HOST_WIDE_INT size; +function_prologue (FILE *file, HOST_WIDE_INT size) { int leaf_func_p; int main_p; @@ -316,9 +307,7 @@ function_prologue (file, size) /* Output function epilogue. */ void -function_epilogue (file, size) - FILE *file; - HOST_WIDE_INT size; +function_epilogue (FILE *file, HOST_WIDE_INT size) { int leaf_func_p; int reg,savelimit; @@ -370,7 +359,7 @@ function_epilogue (file, size) OUT_AS2 (mov, w, %L0); OUT_AS2 (add, spl, w); epilogue_size += 4; - /* fall-thru */ + /* fall-through */ case 0: break; case 1: @@ -385,7 +374,7 @@ function_epilogue (file, size) OUT_AS2 (mov, w, %H0); OUT_AS2 (add, sph, w); epilogue_size += 4; - /* fall-thru */ + /* fall-through */ case 0: break; case 0x100: @@ -500,7 +489,7 @@ function_epilogue (file, size) OUT_AS2 (mov, w, %L0); OUT_AS2 (add, spl, w); epilogue_size += 4; - /* fall-thru */ + /* fall-through */ case 0: break; @@ -517,7 +506,7 @@ function_epilogue (file, size) OUT_AS2 (mov, w, %H0); OUT_AS2 (add, sph, w); epilogue_size += 4; - /* fall-thru */ + /* fall-through */ case 0: break; @@ -552,9 +541,7 @@ function_epilogue (file, size) STACK ALLOCATION <------ SP ($6:$7) */ int -ip2k_init_elim_offset (from, to) - int from; - int to; +ip2k_init_elim_offset (int from, int to) { int leaf_func_p = leaf_function_p (); int no_saved_pc = leaf_func_p @@ -599,10 +586,7 @@ ip2k_init_elim_offset (from, to) machine for a memory operand of mode MODE. */ int -legitimate_address_p (mode, x, strict) - enum machine_mode mode; - rtx x; - int strict; +legitimate_address_p (enum machine_mode mode, rtx x, int strict) { int off; @@ -617,7 +601,7 @@ legitimate_address_p (mode, x, strict) if (REGNO (x) == REG_IP) return (GET_MODE_SIZE (mode) == 1) ? 'R' : 0; - /* We can indirect thru DP or SP register. */ + /* We can indirect through DP or SP register. */ if (strict ? REG_OK_FOR_BASE_STRICT_P (x) : REG_OK_FOR_BASE_NOSTRICT_P (x)) return 'S'; @@ -638,7 +622,7 @@ legitimate_address_p (mode, x, strict) op2 = tmp; } - /* Don't let anything but R+I thru.. */ + /* Don't let anything but R+I through.. */ if (! REG_P (op1) || REG_P (op2) || GET_CODE (op2) != CONST_INT) @@ -691,8 +675,7 @@ legitimate_address_p (mode, x, strict) /* Is ADDR mode dependent? */ int -ip2k_mode_dependent_address (addr) - rtx addr; +ip2k_mode_dependent_address (rtx addr) { switch (GET_CODE (addr)) { @@ -714,11 +697,8 @@ ip2k_mode_dependent_address (addr) memory address for an operand of mode MODE. */ rtx -legitimize_address (x, oldx, mode, scratch) - rtx x; - rtx oldx ATTRIBUTE_UNUSED; - rtx scratch; - enum machine_mode mode ATTRIBUTE_UNUSED; +legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, rtx scratch) { rtx reg; @@ -749,8 +729,7 @@ legitimize_address (x, oldx, mode, scratch) data and stack variables reside in data memory. Only code is believed to be in PRAM or FLASH. */ int -is_regfile_address (x) - rtx x; +is_regfile_address (rtx x) { while (1) switch (GET_CODE (x)) @@ -777,15 +756,13 @@ is_regfile_address (x) /* Output ADDR to FILE as address. */ void -print_operand_address (file, addr) - FILE *file; - rtx addr; +print_operand_address (FILE *file, rtx addr) { switch (GET_CODE (addr)) { case SUBREG: addr = alter_subreg (&addr); - /* fall-thru */ + /* fall-through */ case REG: fprintf (file, "(%s)", @@ -850,10 +827,7 @@ print_operand_address (file, addr) /* Output X as assembler operand to file FILE. */ void -print_operand (file, x, code) - FILE *file; - rtx x; - int code; +print_operand (FILE *file, rtx x, int code) { int abcd = 0; unsigned long value; @@ -908,7 +882,7 @@ print_operand (file, x, code) { case SUBREG: x = alter_subreg (&x); - /* fall-thru */ + /* fall-through */ case REG: fprintf (file, reg_names[true_regnum (x) + abcd]); @@ -1103,9 +1077,7 @@ print_operand (file, x, code) /* Remember the operands for the compare. */ const char * -ip2k_set_compare (x, y) - rtx x; - rtx y; +ip2k_set_compare (rtx x, rtx y) { ip2k_compare_operands[0] = x; ip2k_compare_operands[1] = y; @@ -1114,10 +1086,7 @@ ip2k_set_compare (x, y) /* Emit the code for sCOND instructions. */ const char * -ip2k_gen_sCOND (insn, code, dest) - rtx insn ATTRIBUTE_UNUSED; - enum rtx_code code; - rtx dest; +ip2k_gen_sCOND (rtx insn ATTRIBUTE_UNUSED, enum rtx_code code, rtx dest) { #define operands ip2k_compare_operands enum machine_mode mode; @@ -1328,10 +1297,7 @@ ip2k_gen_sCOND (insn, code, dest) } const char * -ip2k_gen_signed_comp_branch (insn, code, label) - rtx insn; - enum rtx_code code; - rtx label; +ip2k_gen_signed_comp_branch (rtx insn, enum rtx_code code, rtx label) { #define operands ip2k_compare_operands enum machine_mode mode; @@ -1677,10 +1643,7 @@ ip2k_gen_signed_comp_branch (insn, code, label) } const char * -ip2k_gen_unsigned_comp_branch (insn, code, label) - rtx insn; - enum rtx_code code; - rtx label; +ip2k_gen_unsigned_comp_branch (rtx insn, enum rtx_code code, rtx label) { #define operands ip2k_compare_operands enum machine_mode mode; @@ -1759,7 +1722,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) case GTU: code = NE; /* Anything nonzero is GTU. */ - /* fall-thru */ + /* fall-through */ case EQ: case NE: /* Test all the bits, result in @@ -2079,7 +2042,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) case GTU: if (imm_sub) { - /* > 0xffff never suceeds! */ + /* > 0xffff never succeeds! */ if ((INTVAL (operands[1]) & 0xffff) != 0xffff) { operands[3] = GEN_INT (INTVAL (operands[1]) + 1); @@ -2179,7 +2142,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) { if ((INTVAL (operands[1]) & 0xffff) == 0xffff) { - /* <= 0xffff always suceeds. */ + /* <= 0xffff always succeeds. */ OUT_AS1 (page, %2); OUT_AS1 (jmp, %2); } @@ -2308,7 +2271,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) case GTU: if (imm_sub) { - /* > 0xffffffff never suceeds! */ + /* > 0xffffffff never succeeds! */ if ((unsigned HOST_WIDE_INT)(INTVAL (operands[1]) & 0xffffffff) != 0xffffffff) { @@ -2438,7 +2401,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) if ((unsigned HOST_WIDE_INT)(INTVAL (operands[1]) & 0xffffffff) == 0xffffffff) { - /* <= 0xffffffff always suceeds. */ + /* <= 0xffffffff always succeeds. */ OUT_AS1 (page, %2); OUT_AS1 (jmp, %2); } @@ -3045,9 +3008,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label) /* Output rtx VALUE as .byte to file FILE. */ void -asm_output_char(file, value) - FILE *file; - rtx value; +asm_output_char (FILE *file, rtx value) { fprintf (file, "\t.byte "); output_addr_const (file, value); @@ -3058,9 +3019,7 @@ asm_output_char(file, value) /* Output VALUE as .byte to file FILE. */ void -asm_output_byte (file,value) - FILE *file; - int value; +asm_output_byte (FILE *file, int value) { fprintf (file, "\t.byte 0x%x\n",value & 0xff); } @@ -3069,9 +3028,7 @@ asm_output_byte (file,value) /* Output rtx VALUE as .word to file FILE. */ void -asm_output_short (file, value) - FILE *file; - rtx value; +asm_output_short (FILE *file, rtx value) { fprintf (file, "\t.word "); output_addr_const (file, (value)); @@ -3082,9 +3039,7 @@ asm_output_short (file, value) /* Output real N to file FILE. */ void -asm_output_float (file, n) - FILE *file; - REAL_VALUE_TYPE n; +asm_output_float (FILE *file, REAL_VALUE_TYPE n) { long val; char dstr[100]; @@ -3098,9 +3053,7 @@ asm_output_float (file, n) /* Sets section name for declaration DECL. */ void -unique_section (decl, reloc) - tree decl; - int reloc ATTRIBUTE_UNUSED; +unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) { int len; const char *name; @@ -3129,26 +3082,12 @@ unique_section (decl, reloc) } } - -/* Output section name to file FILE. */ - -void -asm_output_section_name(file, decl, name, reloc) - FILE *file; - tree decl ATTRIBUTE_UNUSED; - const char *name; - int reloc ATTRIBUTE_UNUSED; -{ - fprintf (file, ".section %s\n", name); -} - /* Return 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. */ enum reg_class -class_likely_spilled_p(c) - int c; +class_likely_spilled_p (int c) { return (c == IP_REGS || c == IPL_REGS @@ -3178,12 +3117,10 @@ const struct attribute_spec ip2k_attribute_table[] = /* Handle a "progmem" attribute; arguments as in struct attribute_spec.handler. */ static tree -ip2k_handle_progmem_attribute (node, name, args, flags, no_add_attrs) - tree *node; - tree name; - tree args ATTRIBUTE_UNUSED; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +ip2k_handle_progmem_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (DECL_P (*node)) { @@ -3222,12 +3159,10 @@ ip2k_handle_progmem_attribute (node, name, args, flags, no_add_attrs) /* Handle an attribute requiring a FUNCTION_DECL; arguments as in struct attribute_spec.handler. */ static tree -ip2k_handle_fndecl_attribute (node, name, args, flags, no_add_attrs) - tree *node; - tree name; - tree args ATTRIBUTE_UNUSED; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +ip2k_handle_fndecl_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_DECL) { @@ -3246,10 +3181,7 @@ ip2k_handle_fndecl_attribute (node, name, args, flags, no_add_attrs) scanned. In either case, *TOTAL contains the cost result. */ static bool -ip2k_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code; - int *total; +ip2k_rtx_costs (rtx x, int code, int outer_code, int *total) { enum machine_mode mode = GET_MODE (x); int extra_cost = 0; @@ -3382,8 +3314,7 @@ ip2k_rtx_costs (x, code, outer_code, total) /* Calculate the cost of a memory address. */ static int -ip2k_address_cost (x) - rtx x; +ip2k_address_cost (rtx x) { switch (legitimate_address_p (VOIDmode, x, 0)) { @@ -3858,7 +3789,7 @@ track_dp_reload (insn, dp_current, dp_current_ok, modifying) /* As part of the machine-dependent reorg we scan loads and reloads of DP to see where any are redundant. This does happens because we are able to subsequently transform things in interesting ways. Sometimes - gcc also does unecessary reloads too so we try to eliminate these too. */ + gcc also does unnecessary reloads too so we try to eliminate these too. */ static void mdr_try_dp_reload_elim (first_insn) @@ -4019,7 +3950,7 @@ mdr_try_dp_reload_elim (first_insn) } /* When we're looking to see if we've finished we count the number of - paths throught the code labels where we weren't able to definitively + paths through the code labels where we weren't able to definitively track DP. This number is used to see if we're converging on a solution. If this hits zero then we've fully converged, but if this stays the @@ -4162,9 +4093,7 @@ mdr_try_move_dp_reload (first_insn) a fixed constant, offset. If it definitely can then returns nonzero. */ static int -ip2k_check_can_adjust_stack_ref (x, offset) - rtx x; - int offset; +ip2k_check_can_adjust_stack_ref (rtx x, int offset) { if (GET_RTX_CLASS (GET_CODE (x)) == '2' || GET_RTX_CLASS (GET_CODE (x)) == 'c') @@ -4210,9 +4139,7 @@ ip2k_check_can_adjust_stack_ref (x, offset) a fixed offset. */ static void -ip2k_adjust_stack_ref (x, offset) - rtx *x; - int offset; +ip2k_adjust_stack_ref (rtx *x, int offset) { if (GET_RTX_CLASS (GET_CODE (*x)) == '2' || GET_RTX_CLASS (GET_CODE (*x)) == 'c') @@ -4701,9 +4628,7 @@ mdr_try_propagate_clr (first_insn) nonzero if we definitely don't have such a memory ref. */ static int -ip2k_xexp_not_uses_reg_for_mem (x, regno) - rtx x; - unsigned int regno; +ip2k_xexp_not_uses_reg_for_mem (rtx x, unsigned int regno) { if (regno & 1) regno &= 0xfffffffe; @@ -5264,7 +5189,7 @@ mdr_try_wreg_elim (first_insn) } /* When we're looking to see if we've finished we count the number of - paths throught the code labels where we weren't able to definitively + paths through the code labels where we weren't able to definitively track WREG. This number is used to see if we're converging on a solution. If this hits zero then we've fully converged, but if this stays the @@ -5318,7 +5243,7 @@ mdr_try_wreg_elim (first_insn) making the subsequent runs continue to win. */ static void -ip2k_reorg () +ip2k_reorg (void) { #ifdef IP2K_MD_REORG_PASS rtx first_insn, insn, set; @@ -5520,8 +5445,7 @@ ip2k_init_libfuncs (void) /* Returns a bit position if mask contains only a single bit. Returns -1 if there were zero or more than one set bits. */ int -find_one_set_bit_p (mask) - HOST_WIDE_INT mask; +find_one_set_bit_p (HOST_WIDE_INT mask) { int i; unsigned HOST_WIDE_INT n = mask; @@ -5542,8 +5466,7 @@ find_one_set_bit_p (mask) /* Returns a bit position if mask contains only a single clear bit. Returns -1 if there were zero or more than one clear bits. */ int -find_one_clear_bit_p (mask) - HOST_WIDE_INT mask; +find_one_clear_bit_p (HOST_WIDE_INT mask) { int i; unsigned HOST_WIDE_INT n = mask; @@ -5570,10 +5493,8 @@ find_one_clear_bit_p (mask) and OPERANDS[5]. */ void -ip2k_split_words (nmode, omode, operands) - enum machine_mode nmode; - enum machine_mode omode; - rtx *operands; +ip2k_split_words (enum machine_mode nmode, enum machine_mode omode, + rtx *operands) { rtx dl, dh; /* src/dest pieces. */ rtx sl, sh; @@ -5761,9 +5682,7 @@ ip2k_split_words (nmode, omode, operands) /* Get the low half of an operand. */ rtx -ip2k_get_low_half (x, mode) - rtx x; - enum machine_mode mode; +ip2k_get_low_half (rtx x, enum machine_mode mode) { switch (GET_CODE (x)) { @@ -5862,9 +5781,7 @@ ip2k_get_low_half (x, mode) /* Get the high half of an operand. */ rtx -ip2k_get_high_half (x, mode) - rtx x; - enum machine_mode mode; +ip2k_get_high_half (rtx x, enum machine_mode mode) { switch (GET_CODE (x)) { @@ -5964,9 +5881,7 @@ ip2k_get_high_half (x, mode) or REG_FP. */ int -ip2k_address_uses_reg_p (x, r) - rtx x; - unsigned int r; +ip2k_address_uses_reg_p (rtx x, unsigned int r) { if (GET_CODE (x) != MEM) return 0; @@ -6013,10 +5928,7 @@ ip2k_address_uses_reg_p (x, r) that it doesn't then we return TRUE otherwise we assume FALSE. */ int -ip2k_xexp_not_uses_reg_p (x, r, rsz) - rtx x; - unsigned int r; - int rsz; +ip2k_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz) { switch (GET_CODE (x)) { @@ -6049,10 +5961,7 @@ ip2k_xexp_not_uses_reg_p (x, r, rsz) that it doesn't then we return TRUE otherwise we assume FALSE. */ int -ip2k_composite_xexp_not_uses_reg_p (x, r, rsz) - rtx x; - unsigned int r; - int rsz; +ip2k_composite_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz) { if (GET_RTX_CLASS (GET_CODE (x)) == 'b') return (ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz) @@ -6076,8 +5985,7 @@ ip2k_composite_xexp_not_uses_reg_p (x, r, rsz) it doesn't then we return TRUE otherwise we assume FALSE. */ int -ip2k_composite_xexp_not_uses_cc0_p (x) - rtx x; +ip2k_composite_xexp_not_uses_cc0_p (rtx x) { if (GET_RTX_CLASS (GET_CODE (x)) == 'b') return (ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0)) @@ -6098,17 +6006,13 @@ ip2k_composite_xexp_not_uses_cc0_p (x) } int -ip2k_split_dest_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_split_dest_operand (rtx x, enum machine_mode mode) { return nonimmediate_operand (x, mode) || push_operand (x, mode); } int -ip2k_nonptr_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_nonptr_operand (rtx x, enum machine_mode mode) { return register_operand (x, mode) && !ip2k_ptr_operand (x, mode); } @@ -6116,9 +6020,7 @@ ip2k_nonptr_operand (x, mode) /* Is X a reference to IP or DP or SP? */ int -ip2k_ptr_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_ptr_operand (rtx x, enum machine_mode mode) { if (GET_CODE (x) == SUBREG) @@ -6132,18 +6034,14 @@ ip2k_ptr_operand (x, mode) } int -ip2k_sp_operand (x, mode) - rtx x; - enum machine_mode mode ATTRIBUTE_UNUSED; +ip2k_sp_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) { return REG_P (x) && REGNO (x) == REG_SP; } int -ip2k_ip_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_ip_operand (rtx x, enum machine_mode mode) { if (GET_CODE (x) != MEM) @@ -6165,9 +6063,7 @@ ip2k_ip_operand (x, mode) /* Is X a memory address suitable for SP or DP relative addressing? */ int -ip2k_short_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_short_operand (rtx x, enum machine_mode mode) { int r; unsigned int offs = 0; @@ -6193,7 +6089,7 @@ ip2k_short_operand (x, mode) x = XEXP (x, 0); - /* fall thru */ + /* fall through */ case REG: if (IS_PSEUDO_P (x)) @@ -6213,9 +6109,7 @@ ip2k_short_operand (x, mode) } int -ip2k_nonsp_reg_operand (x, mode) - rtx x; - enum machine_mode mode ATTRIBUTE_UNUSED; +ip2k_nonsp_reg_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (x) == SUBREG) x = SUBREG_REG (x); @@ -6224,9 +6118,7 @@ ip2k_nonsp_reg_operand (x, mode) } int -ip2k_gen_operand (x, mode) - rtx x; - enum machine_mode mode; +ip2k_gen_operand (rtx x, enum machine_mode mode) { return ip2k_short_operand (x, mode) || (GET_CODE (x) == SUBREG @@ -6235,9 +6127,7 @@ ip2k_gen_operand (x, mode) } int -ip2k_extra_constraint (x, c) - rtx x; - int c; +ip2k_extra_constraint (rtx x, int c) { switch (c) { @@ -6256,18 +6146,14 @@ ip2k_extra_constraint (x, c) } int -ip2k_unary_operator (op, mode) - rtx op; - enum machine_mode mode; +ip2k_unary_operator (rtx op, enum machine_mode mode) { return ((mode == VOIDmode || GET_MODE (op) == mode) && GET_RTX_CLASS (GET_CODE (op)) == '1'); } int -ip2k_binary_operator (op, mode) - rtx op; - enum machine_mode mode; +ip2k_binary_operator (rtx op, enum machine_mode mode) { return ((mode == VOIDmode || GET_MODE (op) == mode) && (GET_RTX_CLASS (GET_CODE (op)) == 'c' @@ -6275,9 +6161,7 @@ ip2k_binary_operator (op, mode) } int -ip2k_symbol_ref_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +ip2k_symbol_ref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { /* We define an IP2k symbol ref to be either a direct reference or one with a constant offset. */ @@ -6288,18 +6172,14 @@ ip2k_symbol_ref_operand (op, mode) } int -ip2k_signed_comparison_operator (op, mode) - rtx op; - enum machine_mode mode; +ip2k_signed_comparison_operator (rtx op, enum machine_mode mode) { return (comparison_operator (op, mode) && signed_condition (GET_CODE (op)) == GET_CODE (op)); } int -ip2k_unsigned_comparison_operator (op, mode) - rtx op; - enum machine_mode mode; +ip2k_unsigned_comparison_operator (rtx op, enum machine_mode mode) { return (comparison_operator (op, mode) && unsigned_condition (GET_CODE (op)) == GET_CODE (op)); diff --git a/gcc/config/ip2k/ip2k.md b/gcc/config/ip2k/ip2k.md index ddd6fd20a7b..e51db0255ae 100644 --- a/gcc/config/ip2k/ip2k.md +++ b/gcc/config/ip2k/ip2k.md @@ -65,7 +65,7 @@ ;; d - non-pointer registers (not SP, DP, IP) ;; u - non-SP registers (everything except SP) ;; -;; R - Indirect thru IP - Avoid this except for QI mode, since we +;; R - Indirect through IP - Avoid this except for QI mode, since we ;; can't access extra bytes. ;; S - Short (stack/dp address). Pointer with 0..127 displacement ;; Note that 0(SP) has undefined contents due to post-decrement push diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h index 8901fd300b1..2a37f276eb2 100644 --- a/gcc/config/iq2000/iq2000-protos.h +++ b/gcc/config/iq2000/iq2000-protos.h @@ -21,44 +21,40 @@ #ifndef GCC_IQ2000_PROTOS_H #define GCC_IQ2000_PROTOS_H -extern int iq2000_check_split (rtx, enum machine_mode); -extern int iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int); -extern int iq2000_legitimate_address_p (enum machine_mode, rtx, 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 int iq2000_address_cost (rtx); -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); -extern int iq2000_initial_elimination_offset (int, int); -extern void iq2000_expand_prologue (void); -extern void iq2000_expand_epilogue (void); -extern void iq2000_expand_eh_return (rtx); -extern int iq2000_can_use_return_insn (void); -int function_arg_pass_by_reference (CUMULATIVE_ARGS*, enum machine_mode, tree, int); -int iq2000_adjust_insn_length (rtx, int); -char *iq2000_output_conditional_branch (rtx, rtx*, int, int, int, int); -extern void iq2000_init_builtins (void); -extern void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int*, int); -extern void print_operand_address (FILE*, rtx); -extern void print_operand (FILE*, rtx, int); +extern int iq2000_check_split (rtx, enum machine_mode); +extern int iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int); +extern int iq2000_legitimate_address_p (enum machine_mode, rtx, 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); +extern int iq2000_initial_elimination_offset (int, int); +extern void iq2000_expand_prologue (void); +extern void iq2000_expand_epilogue (void); +extern void iq2000_expand_eh_return (rtx); +extern int iq2000_can_use_return_insn (void); +extern int function_arg_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern int iq2000_adjust_insn_length (rtx, int); +extern char * iq2000_output_conditional_branch (rtx, rtx *, int, int, int, int); +extern void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int*, int); +extern void print_operand_address (FILE *, rtx); +extern void print_operand (FILE *, rtx, int); #ifdef RTX_CODE -extern rtx gen_int_relational (enum rtx_code, rtx, rtx, rtx, int*); -extern void gen_conditional_branch (rtx *, enum rtx_code); +extern rtx gen_int_relational (enum rtx_code, rtx, rtx, rtx, int *); +extern void gen_conditional_branch (rtx *, enum rtx_code); #endif #ifdef TREE_CODE -extern void init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx); -extern void function_arg_advance (CUMULATIVE_ARGS*, enum machine_mode, tree, int); -extern struct rtx_def* function_arg (CUMULATIVE_ARGS*, enum machine_mode, tree, int); -extern int function_arg_partial_nregs (CUMULATIVE_ARGS*, enum machine_mode, tree, int); -extern void iq2000_va_start (tree, rtx); -extern rtx iq2000_va_arg (tree, tree); -extern rtx iq2000_function_value (tree, tree); -extern rtx iq2000_expand_builtin (tree, rtx, rtx, - enum machine_mode, int); +extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx); +extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern struct rtx_def * function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern void iq2000_va_start (tree, rtx); +extern rtx iq2000_va_arg (tree, tree); +extern rtx iq2000_function_value (tree, tree); #endif #endif /* ! GCC_IQ2000_PROTOS_H */ diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index f9a62d28189..d895bb3c88d 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -50,7 +50,8 @@ Boston, MA 02111-1307, USA. */ arrays indexed by the test type, and not worry about the order of EQ, NE, etc. */ -enum internal_test { +enum internal_test + { ITEST_EQ, ITEST_NE, ITEST_GT, @@ -66,114 +67,118 @@ enum internal_test { struct constant; -static void iq2000_count_memory_refs (rtx, int); -static enum internal_test map_test_to_internal_test (enum rtx_code); -static rtx iq2000_add_large_offset_to_sp (HOST_WIDE_INT); -static void iq2000_annotate_frame_insn (rtx, rtx); -static void iq2000_emit_frame_related_store (rtx, rtx, - HOST_WIDE_INT); -static struct machine_function * iq2000_init_machine_status (void); -static void save_restore_insns (int); -static void abort_with_insn (rtx, const char *) - ATTRIBUTE_NORETURN; -static int symbolic_expression_p (rtx); -static enum processor_type iq2000_parse_cpu (const char *); -static void iq2000_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT); -static void iq2000_select_section (tree, int, unsigned HOST_WIDE_INT); -static rtx expand_one_builtin (enum insn_code, rtx, tree, enum rtx_code*, - int); /* Structure to be filled in by compute_frame_size with register save masks, and offsets for the current function. */ struct iq2000_frame_info { - long total_size; /* # bytes that the entire frame takes up */ - long var_size; /* # bytes that variables take up */ - long args_size; /* # bytes that outgoing arguments take up */ - long extra_size; /* # bytes of extra gunk */ - int gp_reg_size; /* # bytes needed to store gp regs */ - int fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long gp_save_offset; /* offset from vfp to store gp registers */ - long fp_save_offset; /* offset from vfp to store fp registers */ - long gp_sp_offset; /* offset from new sp to store gp registers */ - long fp_sp_offset; /* offset from new sp to store fp registers */ - int initialized; /* != 0 if frame size already calculated */ - int num_gp; /* number of gp registers saved */ -}; - -struct machine_function + long total_size; /* # bytes that the entire frame takes up. */ + long var_size; /* # bytes that variables take up. */ + long args_size; /* # bytes that outgoing arguments take up. */ + long extra_size; /* # bytes of extra gunk. */ + int gp_reg_size; /* # bytes needed to store gp regs. */ + int fp_reg_size; /* # bytes needed to store fp regs. */ + long mask; /* Mask of saved gp registers. */ + long gp_save_offset; /* Offset from vfp to store gp registers. */ + long fp_save_offset; /* Offset from vfp to store fp registers. */ + long gp_sp_offset; /* Offset from new sp to store gp registers. */ + long fp_sp_offset; /* Offset from new sp to store fp registers. */ + int initialized; /* != 0 if frame size already calculated. */ + int num_gp; /* Number of gp registers saved. */ +} iq2000_frame_info; + +struct machine_function GTY(()) { /* Current frame information, calculated by compute_frame_size. */ - struct iq2000_frame_info frame; + long total_size; /* # bytes that the entire frame takes up. */ + long var_size; /* # bytes that variables take up. */ + long args_size; /* # bytes that outgoing arguments take up. */ + long extra_size; /* # bytes of extra gunk. */ + int gp_reg_size; /* # bytes needed to store gp regs. */ + int fp_reg_size; /* # bytes needed to store fp regs. */ + long mask; /* Mask of saved gp registers. */ + long gp_save_offset; /* Offset from vfp to store gp registers. */ + long fp_save_offset; /* Offset from vfp to store fp registers. */ + long gp_sp_offset; /* Offset from new sp to store gp registers. */ + long fp_sp_offset; /* Offset from new sp to store fp registers. */ + int initialized; /* != 0 if frame size already calculated. */ + int num_gp; /* Number of gp registers saved. */ }; /* Global variables for machine-dependent things. */ -/* Count the number of .file directives, so that .loc is up to date. */ -int num_source_filenames = 0; - -/* Files to separate the text and the data output, so that all of the data - can be emitted before the text, which will mean that the assembler will - generate smaller code, based on the global pointer. */ -FILE *asm_out_data_file; -FILE *asm_out_text_file; - -/* The next branch instruction is a branch likely, not branch normal. */ -int iq2000_branch_likely; - -/* Count of delay slots and how many are filled. */ -int dslots_load_total; -int dslots_load_filled; -int dslots_jump_total; -int dslots_jump_filled; - -/* # of nops needed by previous insn */ -int dslots_number_nops; +/* List of all IQ2000 punctuation characters used by print_operand. */ +char iq2000_print_operand_punct[256]; -/* Number of 1/2/3 word references to data items (ie, not jal's). */ -int num_refs[3]; +/* The target cpu for optimization and scheduling. */ +enum processor_type iq2000_tune; -/* registers to check for load delay */ -rtx iq2000_load_reg, iq2000_load_reg2, iq2000_load_reg3, iq2000_load_reg4; +/* Which instruction set architecture to use. */ +int iq2000_isa; /* Cached operands, and operator to compare for use in set/branch/trap on condition codes. */ rtx branch_cmp[2]; -/* what type of branch to use */ +/* What type of branch to use. */ enum cmp_type branch_type; -/* The target cpu for code generation. */ -enum processor_type iq2000_arch; +/* Strings to hold which cpu and instruction set architecture to use. */ +const char * iq2000_cpu_string; /* For -mcpu=. */ +const char * iq2000_arch_string; /* For -march=. */ -/* The target cpu for optimization and scheduling. */ -enum processor_type iq2000_tune; -/* which instruction set architecture to use. */ -int iq2000_isa; +/* Local variables. */ -/* Strings to hold which cpu and instruction set architecture to use. */ -const char *iq2000_cpu_string; /* for -mcpu= */ -const char *iq2000_arch_string; /* for -march= */ +/* The next branch instruction is a branch likely, not branch normal. */ +static int iq2000_branch_likely; + +/* Count of delay slots and how many are filled. */ +static int dslots_load_total; +static int dslots_load_filled; +static int dslots_jump_total; + +/* # of nops needed by previous insn. */ +static int dslots_number_nops; + +/* Number of 1/2/3 word references to data items (ie, not jal's). */ +static int num_refs[3]; + +/* Registers to check for load delay. */ +static rtx iq2000_load_reg; +static rtx iq2000_load_reg2; +static rtx iq2000_load_reg3; +static rtx iq2000_load_reg4; + +/* The target cpu for code generation. */ +static enum processor_type iq2000_arch; /* Mode used for saving/restoring general purpose registers. */ static enum machine_mode gpr_mode; -/* List of all IQ2000 punctuation characters used by print_operand. */ -char iq2000_print_operand_punct[256]; /* Initialize the GCC target structure. */ -#undef TARGET_INIT_BUILTINS -#define TARGET_INIT_BUILTINS iq2000_init_builtins - -#undef TARGET_EXPAND_BUILTIN -#define TARGET_EXPAND_BUILTIN iq2000_expand_builtin - -#undef TARGET_ASM_SELECT_RTX_SECTION -#define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section +static struct machine_function* iq2000_init_machine_status (void); +static void iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT); +static void iq2000_init_builtins (void); +static rtx iq2000_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static bool iq2000_rtx_costs (rtx, int, int, int *); +static int iq2000_address_cost (rtx); +static void iq2000_select_section (tree, int, unsigned HOST_WIDE_INT); + +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS iq2000_init_builtins +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN iq2000_expand_builtin +#undef TARGET_ASM_SELECT_RTX_SECTION +#define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS iq2000_rtx_costs +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST iq2000_address_cost +#undef TARGET_ASM_SELECT_SECTION +#define TARGET_ASM_SELECT_SECTION iq2000_select_section struct gcc_target targetm = TARGET_INITIALIZER; @@ -189,7 +194,7 @@ uns_arith_operand (rtx op, enum machine_mode mode) return register_operand (op, mode); } -/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */ +/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */ int arith_operand (rtx op, enum machine_mode mode) @@ -200,7 +205,7 @@ arith_operand (rtx op, enum machine_mode mode) return register_operand (op, mode); } -/* Return 1 if OP is a integer which fits in 16 bits */ +/* Return 1 if OP is a integer which fits in 16 bits. */ int small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) @@ -221,15 +226,15 @@ large_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) value = INTVAL (op); - /* ior reg,$r0,value */ + /* IOR reg,$r0,value. */ if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0) return 0; - /* subu reg,$r0,value */ + /* SUBU reg,$r0,value. */ if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767) return 0; - /* lui reg,value>>16 */ + /* LUI reg,value >> 16. */ if ((value & 0x0000ffff) == 0) return 0; @@ -268,11 +273,11 @@ simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { rtx addr, plus0, plus1; - /* Eliminate non-memory operations */ + /* Eliminate non-memory operations. */ if (GET_CODE (op) != MEM) return 0; - /* dword operations really put out 2 instructions, so eliminate them. */ + /* Dword operations really put out 2 instructions, so eliminate them. */ if (GET_MODE_SIZE (GET_MODE (op)) > (unsigned) UNITS_PER_WORD) return 0; @@ -292,12 +297,12 @@ simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) plus1 = XEXP (addr, 1); if (GET_CODE (plus0) == REG && GET_CODE (plus1) == CONST_INT && SMALL_INT (plus1) - && SMALL_INT_UNSIGNED (plus1) /* No negative offsets */) + && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) return 1; else if (GET_CODE (plus1) == REG && GET_CODE (plus0) == CONST_INT && SMALL_INT (plus0) - && SMALL_INT_UNSIGNED (plus1) /* No negative offsets */) + && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) return 1; else @@ -324,7 +329,7 @@ equality_op (rtx op, enum machine_mode mode) return GET_CODE (op) == EQ || GET_CODE (op) == NE; } -/* Return nonzero if the code is a relational operations (EQ, LE, etc.) */ +/* Return nonzero if the code is a relational operations (EQ, LE, etc). */ int cmp_op (rtx op, enum machine_mode mode) @@ -449,8 +454,8 @@ iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict) if (GET_CODE (xinsn) == LO_SUM) { - register rtx xlow0 = XEXP (xinsn, 0); - register rtx xlow1 = XEXP (xinsn, 1); + rtx xlow0 = XEXP (xinsn, 0); + rtx xlow1 = XEXP (xinsn, 1); while (GET_CODE (xlow0) == SUBREG) xlow0 = SUBREG_REG (xlow0); @@ -462,10 +467,10 @@ iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict) if (GET_CODE (xinsn) == PLUS) { - register rtx xplus0 = XEXP (xinsn, 0); - register rtx xplus1 = XEXP (xinsn, 1); - register enum rtx_code code0; - register enum rtx_code code1; + rtx xplus0 = XEXP (xinsn, 0); + rtx xplus1 = XEXP (xinsn, 1); + enum rtx_code code0; + enum rtx_code code1; while (GET_CODE (xplus0) == SUBREG) xplus0 = SUBREG_REG (xplus0); @@ -504,10 +509,10 @@ const char * iq2000_fill_delay_slot (const char *ret, enum delay_type type, rtx operands[], rtx cur_insn) { - register rtx set_reg; - register enum machine_mode mode; - register rtx next_insn = cur_insn ? NEXT_INSN (cur_insn) : NULL_RTX; - register int num_nops; + rtx set_reg; + enum machine_mode mode; + rtx next_insn = cur_insn ? NEXT_INSN (cur_insn) : NULL_RTX; + int num_nops; if (type == DELAY_LOAD || type == DELAY_FCMP) num_nops = 1; @@ -536,6 +541,7 @@ iq2000_fill_delay_slot (const char *ret, enum delay_type type, rtx operands[], iq2000_load_reg2 = 0; iq2000_load_reg3 = 0; iq2000_load_reg4 = 0; + return ret; } @@ -644,7 +650,7 @@ iq2000_count_memory_refs (rtx op, int num) break; case LABEL_REF: - n_words = 2; /* always 2 words */ + n_words = 2; /* Always 2 words. */ break; case CONST: @@ -672,6 +678,16 @@ iq2000_count_memory_refs (rtx op, int num) num_refs[n_words-1] += num; } +/* Abort after printing out a specific insn. */ + +static void +abort_with_insn (rtx insn, const char * reason) +{ + error (reason); + debug_rtx (insn); + abort (); +} + /* Return the appropriate instructions to move one operand to another. */ const char * @@ -904,7 +920,7 @@ iq2000_move_1word (rtx operands[], rtx insn, int unsignedp) /* Provide the costs of an addressing mode that contains ADDR. */ -int +static int iq2000_address_cost (rtx addr) { switch (GET_CODE (addr)) @@ -918,7 +934,8 @@ iq2000_address_cost (rtx addr) case CONST: { rtx offset = const0_rtx; - addr = eliminate_constant_term (XEXP (addr, 0), &offset); + + addr = eliminate_constant_term (XEXP (addr, 0), & offset); if (GET_CODE (addr) == LABEL_REF) return 2; @@ -929,15 +946,15 @@ iq2000_address_cost (rtx addr) return 2; } - /* ... fall through ... */ + /* Fall through. */ case SYMBOL_REF: return SYMBOL_REF_FLAG (addr) ? 1 : 2; case PLUS: { - register rtx plus0 = XEXP (addr, 0); - register rtx plus1 = XEXP (addr, 1); + rtx plus0 = XEXP (addr, 0); + rtx plus1 = XEXP (addr, 1); if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG) plus0 = XEXP (addr, 1), plus1 = XEXP (addr, 0); @@ -994,15 +1011,11 @@ map_test_to_internal_test (enum rtx_code test_code) return test; } -/* Generate the code to compare two integer values. The return value is: +/* Generate the code to do a TEST_CODE comparison on two integer values CMP0 + and CMP1. P_INVERT is NULL or ptr if branch needs to reverse its test. + The return value RESULT is: (reg:SI xx) The pseudo register the comparison is in - 0 No register, generate a simple branch. - - TEST_CODE: relational test (EQ, etc). - RESULT: result to store comp. or 0 if branch. - CMP0: first operand to compare - CMP1: second operand to compare - *P_INVERT: NULL or ptr to hold whether branch needs to reverse its test. */ + 0 No register, generate a simple branch. */ rtx gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, @@ -1010,18 +1023,18 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, { struct cmp_info { - enum rtx_code test_code; /* code to use in instruction (LT vs. LTU) */ - int const_low; /* low bound of constant we can accept */ - int const_high; /* high bound of constant we can accept */ - int const_add; /* constant to add (convert LE -> LT) */ - int reverse_regs; /* reverse registers in test */ - int invert_const; /* != 0 if invert value if cmp1 is constant */ - int invert_reg; /* != 0 if invert value if cmp1 is register */ + enum rtx_code test_code; /* Code to use in instruction (LT vs. LTU). */ + int const_low; /* Low bound of constant we can accept. */ + int const_high; /* High bound of constant we can accept. */ + int const_add; /* Constant to add (convert LE -> LT). */ + int reverse_regs; /* Reverse registers in test. */ + int invert_const; /* != 0 if invert value if cmp1 is constant. */ + int invert_reg; /* != 0 if invert value if cmp1 is register. */ int unsignedp; /* != 0 for unsigned comparisons. */ }; - static struct cmp_info info[ (int)ITEST_MAX ] = { - + static struct cmp_info info[ (int)ITEST_MAX ] = + { { XOR, 0, 65535, 0, 0, 0, 0, 0 }, /* EQ */ { XOR, 0, 65535, 0, 0, 1, 1, 0 }, /* NE */ { LT, -32769, 32766, 1, 1, 1, 0, 0 }, /* GT */ @@ -1054,13 +1067,13 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, if (mode == VOIDmode) mode = GET_MODE (cmp1); - /* Eliminate simple branches */ + /* Eliminate simple branches. */ branch_p = (result == 0); if (branch_p) { if (GET_CODE (cmp0) == REG || GET_CODE (cmp0) == SUBREG) { - /* Comparisons against zero are simple branches */ + /* Comparisons against zero are simple branches. */ if (GET_CODE (cmp1) == CONST_INT && INTVAL (cmp1) == 0) return 0; @@ -1069,7 +1082,7 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, return 0; } - /* allocate a pseudo to calculate the value in. */ + /* Allocate a pseudo to calculate the value in. */ result = gen_reg_rtx (mode); } @@ -1205,7 +1218,7 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code) case CMP_DF: reg = gen_reg_rtx (CCmode); - /* For cmp0 != cmp1, build cmp0 == cmp1, and test for result == 0 */ + /* For cmp0 != cmp1, build cmp0 == cmp1, and test for result == 0. */ emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx (test_code == NE ? EQ : test_code, CCmode, cmp0, cmp1))); @@ -1222,7 +1235,6 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code) } /* Generate the branch. */ - label1 = gen_rtx_LABEL_REF (VOIDmode, operands[0]); label2 = pc_rtx; @@ -1239,19 +1251,20 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code) label1, label2))); } -/* Initialize CUMULATIVE_ARGS for a function. */ +/* Initialize CUM for a function FNTYPE. */ void init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname ATTRIBUTE_UNUSED) { static CUMULATIVE_ARGS zero_cum; - tree param, next_param; + tree param; + tree next_param; if (TARGET_DEBUG_D_MODE) { fprintf (stderr, - "\ninit_cumulative_args, fntype = 0x%.8lx", (long)fntype); + "\ninit_cumulative_args, fntype = 0x%.8lx", (long) fntype); if (!fntype) fputc ('\n', stderr); @@ -1259,6 +1272,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, else { tree ret_type = TREE_TYPE (fntype); + fprintf (stderr, ", fntype code = %s, ret code = %s\n", tree_code_name[(int)TREE_CODE (fntype)], tree_code_name[(int)TREE_CODE (ret_type)]); @@ -1281,7 +1295,8 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, } } -/* Advance the argument to the next argument position. */ +/* Advance the argument of type TYPE and mode MODE to the next argument + position in CUM. */ void function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, @@ -1320,7 +1335,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, break; case SFmode: - cum->arg_words++; + cum->arg_words ++; if (! cum->gp_reg_found && cum->arg_number <= 2) cum->fp_code += 1 << ((cum->arg_number - 1) * 2); break; @@ -1340,13 +1355,13 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, case HImode: case SImode: cum->gp_reg_found = 1; - cum->arg_words++; + cum->arg_words ++; break; } } -/* Return an RTL expression containing the register for the given mode, - or 0 if the argument is to be passed on the stack. */ +/* Return an RTL expression containing the register for the given mode MODE + and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */ struct rtx_def * function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, @@ -1450,13 +1465,12 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, /* ??? If this is a packed structure, then the last hunk won't be 64 bits. */ - chunks = tree_low_cst (TYPE_SIZE_UNIT (type), 1) / UNITS_PER_WORD; if (chunks + *arg_words + bias > (unsigned) MAX_ARGS_IN_REGISTERS) chunks = MAX_ARGS_IN_REGISTERS - *arg_words - bias; - /* assign_parms checks the mode of ENTRY_PARM, so we must + /* Assign_parms checks the mode of ENTRY_PARM, so we must use the actual mode here. */ ret = gen_rtx_PARALLEL (mode, rtvec_alloc (chunks)); @@ -1532,21 +1546,20 @@ void iq2000_va_start (tree valist, rtx nextarg) { int int_arg_words; - - /* Find out how many non-float named formals */ + /* Find out how many non-float named formals. */ int gpr_save_area_size; - /* Note UNITS_PER_WORD is 4 bytes */ + /* Note UNITS_PER_WORD is 4 bytes. */ int_arg_words = current_function_args_info.arg_words; + if (int_arg_words < 8 ) - /* Adjust for the prologue's economy measure */ + /* Adjust for the prologue's economy measure. */ gpr_save_area_size = (8 - int_arg_words) * UNITS_PER_WORD; else gpr_save_area_size = 0; /* Everything is in the GPR save area, or in the overflow area which is contiguous with it. */ - - nextarg = plus_constant (nextarg, -gpr_save_area_size); + nextarg = plus_constant (nextarg, - gpr_save_area_size); std_expand_builtin_va_start (valist, nextarg); } @@ -1558,7 +1571,6 @@ iq2000_va_arg (tree valist, tree type) HOST_WIDE_INT size, rsize; rtx addr_rtx; tree t; - int indirect; rtx r, lab_over = NULL_RTX, lab_false; tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff; @@ -1579,8 +1591,8 @@ iq2000_va_arg (tree valist, tree type) { /* Case of all args in a merged stack. No need to check bounds, just advance valist along the stack. */ - tree gpr = valist; + if (! indirect && TYPE_ALIGN (type) > (unsigned) BITS_PER_WORD) { @@ -1616,7 +1628,6 @@ iq2000_va_arg (tree valist, tree type) } /* Not a simple merged stack. Need ptrs and indexes left by va_start. */ - f_ovfl = TYPE_FIELDS (va_list_type_node); f_gtop = TREE_CHAIN (f_ovfl); f_ftop = TREE_CHAIN (f_gtop); @@ -1634,26 +1645,25 @@ iq2000_va_arg (tree valist, tree type) if (TREE_CODE (type) == REAL_TYPE) { - /* Emit code to branch if foff == 0. */ r = expand_expr (foff, NULL_RTX, TYPE_MODE (TREE_TYPE (foff)), EXPAND_NORMAL); emit_cmp_and_jump_insns (r, const0_rtx, EQ, const1_rtx, GET_MODE (r), 1, lab_false); - /* Emit code for addr_rtx = ftop - foff */ + /* Emit code for addr_rtx = ftop - foff. */ t = build (MINUS_EXPR, TREE_TYPE (ftop), ftop, foff ); r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); if (r != addr_rtx) emit_move_insn (addr_rtx, r); /* Emit code for foff-=8. - Advances the offset up FPR save area by one double */ + Advances the offset up FPR save area by one double. */ t = build (MINUS_EXPR, TREE_TYPE (foff), foff, build_int_2 (8, 0)); t = build (MODIFY_EXPR, TREE_TYPE (foff), foff, t); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - emit_queue(); + emit_queue (); emit_jump (lab_over); emit_barrier (); emit_label (lab_false); @@ -1681,7 +1691,7 @@ iq2000_va_arg (tree valist, tree type) } else { - /* not REAL_TYPE */ + /* Not REAL_TYPE. */ int step_size; if (TREE_CODE (type) == INTEGER_TYPE @@ -1726,7 +1736,7 @@ iq2000_va_arg (tree valist, tree type) emit_barrier (); emit_label (lab_false); - /* Emit code for addr_rtx -> overflow area, postinc by step_size */ + /* Emit code for addr_rtx -> overflow area, postinc by step_size. */ t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl, size_int (step_size)); r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); @@ -1751,22 +1761,46 @@ iq2000_va_arg (tree valist, tree type) } } -/* Abort after printing out a specific insn. */ +/* Allocate a chunk of memory for per-function machine-dependent data. */ -static void -abort_with_insn (rtx insn, const char *reason) +static struct machine_function * +iq2000_init_machine_status (void) { - error (reason); - debug_rtx (insn); - abort (); + struct machine_function *f; + + f = ggc_alloc_cleared (sizeof (struct machine_function)); + + return f; } - + +static enum processor_type +iq2000_parse_cpu (const char * cpu_string) +{ + const char *p = cpu_string; + enum processor_type cpu; + + cpu = PROCESSOR_DEFAULT; + switch (p[2]) + { + case '1': + if (!strcmp (p, "iq10")) + cpu = PROCESSOR_IQ10; + break; + case '2': + if (!strcmp (p, "iq2000")) + cpu = PROCESSOR_IQ2000; + break; + } + + return cpu; +} + /* Detect any conflicts in the switches. */ void override_options (void) { - register enum processor_type iq2000_cpu; + enum processor_type iq2000_cpu; target_flags &= ~MASK_GPOPT; @@ -1838,16 +1872,7 @@ override_options (void) gpr_mode = SImode; /* Function to allocate machine-dependent function status. */ - init_machine_status = &iq2000_init_machine_status; -} - -/* Allocate a chunk of memory for per-function machine-dependent data. */ - -static struct machine_function * -iq2000_init_machine_status (void) -{ - return ((struct machine_function *) - ggc_alloc_cleared (sizeof (struct machine_function))); + init_machine_status = iq2000_init_machine_status; } /* The arg pointer (which is eliminated) points to the virtual frame pointer, @@ -1858,7 +1883,7 @@ HOST_WIDE_INT iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset) { rtx offset2 = const0_rtx; - rtx reg = eliminate_constant_term (addr, &offset2); + rtx reg = eliminate_constant_term (addr, & offset2); if (offset == 0) offset = INTVAL (offset2); @@ -1866,9 +1891,9 @@ iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset) if (reg == stack_pointer_rtx || reg == frame_pointer_rtx || reg == hard_frame_pointer_rtx) { - HOST_WIDE_INT frame_size = (!cfun->machine->frame.initialized) + HOST_WIDE_INT frame_size = (!cfun->machine->initialized) ? compute_frame_size (get_frame_size ()) - : cfun->machine->frame.total_size; + : cfun->machine->total_size; offset = offset - frame_size; } @@ -1898,7 +1923,7 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED, rtx pattern = PATTERN (insn); int length = get_attr_length (insn); - /* Do we need to emit a NOP? */ + /* Do we need to emit a NOP? */ if (length == 0 || (iq2000_load_reg != 0 && reg_mentioned_p (iq2000_load_reg, pattern)) || (iq2000_load_reg2 != 0 && reg_mentioned_p (iq2000_load_reg2, pattern)) @@ -1908,7 +1933,7 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED, fputs ("\tnop\n", asm_out_file); else - dslots_load_filled++; + dslots_load_filled ++; while (--dslots_number_nops > 0) fputs ("\tnop\n", asm_out_file); @@ -1919,22 +1944,23 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED, iq2000_load_reg4 = 0; } - if ((GET_CODE (insn) == JUMP_INSN + if ( (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == CALL_INSN || (GET_CODE (PATTERN (insn)) == RETURN)) && NEXT_INSN (PREV_INSN (insn)) == insn) { rtx nop_insn = emit_insn_after (gen_nop (), insn); + INSN_ADDRESSES_NEW (nop_insn, -1); } if (TARGET_STATS && (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == CALL_INSN)) - dslots_jump_total++; + dslots_jump_total ++; } /* Return the bytes needed to compute the frame pointer from the current - stack pointer. + stack pointer where SIZE is the # of var. bytes allocated. IQ2000 stack frames look like: @@ -1982,24 +2008,22 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED, | arguments passed | | in registers, even | low SP->| if not passed. | - memory +-----------------------+ - -*/ + memory +-----------------------+ */ HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT size) { int regno; - HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */ - HOST_WIDE_INT var_size; /* # bytes that variables take up */ - HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */ - HOST_WIDE_INT extra_size; /* # extra bytes */ - HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */ - HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ - HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - int fp_inc; /* 1 or 2 depending on the size of fp regs */ - long fp_bits; /* bitmask to use for each fp register */ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */ + HOST_WIDE_INT var_size; /* # bytes that variables take up. */ + HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up. */ + HOST_WIDE_INT extra_size; /* # extra bytes. */ + HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding. */ + HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs. */ + HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs. */ + long mask; /* mask of saved gp registers. */ + int fp_inc; /* 1 or 2 depending on the size of fp regs. */ + long fp_bits; /* bitmask to use for each fp register. */ gp_reg_size = 0; fp_reg_size = 0; @@ -2009,8 +2033,7 @@ compute_frame_size (HOST_WIDE_INT size) args_size = IQ2000_STACK_ALIGN (current_function_outgoing_args_size); /* If a function dynamically allocates the stack and - has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space */ - + has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */ if (args_size == 0 && current_function_calls_alloca) args_size = 4 * UNITS_PER_WORD; @@ -2029,11 +2052,12 @@ compute_frame_size (HOST_WIDE_INT size) /* We need to restore these for the handler. */ if (current_function_calls_eh_return) { - int i; + unsigned int i; + for (i = 0; ; ++i) { regno = EH_RETURN_DATA_REGNO (i); - if (regno == (signed int) INVALID_REGNUM) + if (regno == (int) INVALID_REGNUM) break; gp_reg_size += GET_MODE_SIZE (gpr_mode); mask |= 1L << (regno - GP_REG_FIRST); @@ -2054,15 +2078,15 @@ compute_frame_size (HOST_WIDE_INT size) total_size += IQ2000_STACK_ALIGN (current_function_pretend_args_size); /* Save other computed information. */ - cfun->machine->frame.total_size = total_size; - cfun->machine->frame.var_size = var_size; - cfun->machine->frame.args_size = args_size; - cfun->machine->frame.extra_size = extra_size; - cfun->machine->frame.gp_reg_size = gp_reg_size; - cfun->machine->frame.fp_reg_size = fp_reg_size; - cfun->machine->frame.mask = mask; - cfun->machine->frame.initialized = reload_completed; - cfun->machine->frame.num_gp = gp_reg_size / UNITS_PER_WORD; + cfun->machine->total_size = total_size; + cfun->machine->var_size = var_size; + cfun->machine->args_size = args_size; + cfun->machine->extra_size = extra_size; + cfun->machine->gp_reg_size = gp_reg_size; + cfun->machine->fp_reg_size = fp_reg_size; + cfun->machine->mask = mask; + cfun->machine->initialized = reload_completed; + cfun->machine->num_gp = gp_reg_size / UNITS_PER_WORD; if (mask) { @@ -2071,17 +2095,17 @@ compute_frame_size (HOST_WIDE_INT size) offset = (args_size + extra_size + var_size + gp_reg_size - GET_MODE_SIZE (gpr_mode)); - cfun->machine->frame.gp_sp_offset = offset; - cfun->machine->frame.gp_save_offset = offset - total_size; + cfun->machine->gp_sp_offset = offset; + cfun->machine->gp_save_offset = offset - total_size; } else { - cfun->machine->frame.gp_sp_offset = 0; - cfun->machine->frame.gp_save_offset = 0; + cfun->machine->gp_sp_offset = 0; + cfun->machine->gp_save_offset = 0; } - cfun->machine->frame.fp_sp_offset = 0; - cfun->machine->frame.fp_save_offset = 0; + cfun->machine->fp_sp_offset = 0; + cfun->machine->fp_save_offset = 0; /* Ok, we're done. */ return total_size; @@ -2100,15 +2124,15 @@ iq2000_initial_elimination_offset (int from, int to ATTRIBUTE_UNUSED) if ((from) == FRAME_POINTER_REGNUM) (offset) = 0; else if ((from) == ARG_POINTER_REGNUM) - (offset) = (cfun->machine->frame.total_size); + (offset) = (cfun->machine->total_size); else if ((from) == RETURN_ADDRESS_POINTER_REGNUM) - { - if (leaf_function_p ()) - (offset) = 0; - else (offset) = cfun->machine->frame.gp_sp_offset - + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT)) - * (BYTES_BIG_ENDIAN != 0)); - } + { + if (leaf_function_p ()) + (offset) = 0; + else (offset) = cfun->machine->gp_sp_offset + + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT)) + * (BYTES_BIG_ENDIAN != 0)); + } return offset; } @@ -2164,10 +2188,12 @@ iq2000_emit_frame_related_store (rtx mem, rtx reg, HOST_WIDE_INT offset) gen_rtx_SET (GET_MODE (reg), dwarf_mem, reg)); } +/* Emit instructions to save/restore registers, as determined by STORE_P. */ + static void save_restore_insns (int store_p) { - long mask = cfun->machine->frame.mask; + long mask = cfun->machine->mask; int regno; rtx base_reg_rtx; HOST_WIDE_INT base_offset; @@ -2196,9 +2222,9 @@ save_restore_insns (int store_p) the constant created in the prologue/epilogue to adjust the stack frame. */ - gp_offset = cfun->machine->frame.gp_sp_offset; + gp_offset = cfun->machine->gp_sp_offset; end_offset - = gp_offset - (cfun->machine->frame.gp_reg_size + = gp_offset - (cfun->machine->gp_reg_size - GET_MODE_SIZE (gpr_mode)); if (gp_offset < 0 || end_offset < 0) @@ -2212,6 +2238,7 @@ save_restore_insns (int store_p) { int regno; int reg_save_count = 0; + for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--) if (BITSET_P (mask, regno - GP_REG_FIRST)) reg_save_count += 1; base_offset = gp_offset - ((reg_save_count - 1) * 4); @@ -2263,9 +2290,9 @@ iq2000_expand_prologue (void) int store_args_on_stack = (iq2000_can_use_return_insn ()); /* If struct value address is treated as the first argument. */ - if (aggregate_value_p (DECL_RESULT (fndecl)) + if (aggregate_value_p (DECL_RESULT (fndecl), fndecl) && ! current_function_returns_pcc_struct - && struct_value_incoming_rtx == 0) + && targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0) { tree type = build_pointer_type (fntype); tree function_result_decl = build_decl (PARM_DECL, NULL_TREE, type); @@ -2282,7 +2309,6 @@ iq2000_expand_prologue (void) variable arguments. This is only needed if store_args_on_stack is true. */ - INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0); regno = GP_ARG_FIRST; @@ -2343,7 +2369,6 @@ iq2000_expand_prologue (void) Function_arg has encoded a PARALLEL rtx, holding a vector of adjustments to be made as the next_arg_reg variable, so we split up the insns, and emit them separately. */ - next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1); if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL) { @@ -2438,7 +2463,7 @@ iq2000_expand_prologue (void) void iq2000_expand_epilogue (void) { - HOST_WIDE_INT tsize = cfun->machine->frame.total_size; + HOST_WIDE_INT tsize = cfun->machine->total_size; rtx tsize_rtx = GEN_INT (tsize); rtx tmp_rtx = (rtx)0; @@ -2499,7 +2524,7 @@ iq2000_expand_epilogue (void) void iq2000_expand_eh_return (rtx address) { - HOST_WIDE_INT gp_offset = cfun->machine->frame.gp_sp_offset; + HOST_WIDE_INT gp_offset = cfun->machine->gp_sp_offset; rtx scratch; scratch = plus_constant (stack_pointer_rtx, gp_offset); @@ -2519,8 +2544,8 @@ iq2000_can_use_return_insn (void) if (regs_ever_live[31] || profile_flag) return 0; - if (cfun->machine->frame.initialized) - return cfun->machine->frame.total_size == 0; + if (cfun->machine->initialized) + return cfun->machine->total_size == 0; return compute_frame_size (get_frame_size ()) == 0; } @@ -2576,7 +2601,6 @@ iq2000_select_section (tree decl, int reloc ATTRIBUTE_UNUSED, { /* For embedded applications, always put an object in read-only data if possible, in order to reduce RAM usage. */ - if (((TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) && DECL_INITIAL (decl) @@ -2594,7 +2618,6 @@ iq2000_select_section (tree decl, int reloc ATTRIBUTE_UNUSED, { /* For hosted applications, always put an object in small data if possible, as this gives the best performance. */ - if (((TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) && DECL_INITIAL (decl) @@ -2639,13 +2662,13 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, /* We must pass by reference if we would be both passing in registers and the stack. This is because any subsequent partial arg would be handled incorrectly in this case. */ - if (cum && MUST_PASS_IN_STACK (mode, type)) { /* Don't pass the actual CUM to FUNCTION_ARG, because we would get double copies of any offsets generated for small structs passed in registers. */ CUMULATIVE_ARGS temp; + temp = *cum; if (FUNCTION_ARG (temp, mode, type, named) != 0) return 1; @@ -2665,10 +2688,10 @@ int iq2000_adjust_insn_length (rtx insn, int length) { /* A unconditional jump has an unfilled delay slot if it is not part - of a sequence. A conditional jump normally has a delay slot */ + of a sequence. A conditional jump normally has a delay slot. */ if (simplejump_p (insn) - || ((GET_CODE (insn) == JUMP_INSN - || GET_CODE (insn) == CALL_INSN))) + || ( (GET_CODE (insn) == JUMP_INSN + || GET_CODE (insn) == CALL_INSN))) length += 4; return length; @@ -2690,13 +2713,13 @@ iq2000_adjust_insn_length (rtx insn, int length) reversed conditional branch around a `jr' instruction. */ char * -iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, +iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p, int float_p, int inverted_p, int length) { static char buffer[200]; /* The kind of comparison we are doing. */ enum rtx_code code = GET_CODE (operands[0]); - /* Nonzero if the opcode for the comparison needs a `z' indicating + /* nonzero if the opcode for the comparison needs a `z' indicating that it is a comparison against zero. */ int need_z_p; /* A string to use in the assembly output to represent the first @@ -2711,7 +2734,7 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, /* The operand-printing string for the inverted comparison. */ const char *inverted_comp = (float_p ? "%W0" : "%N0"); - /* likely variants of each branch instruction annul the instruction + /* Likely variants of each branch instruction annul the instruction in the delay slot if the branch is not taken. */ iq2000_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn)); @@ -2813,7 +2836,7 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, char *c; c = strchr (buffer, '\0'); - /* Generate the reversed comparison. This takes four + /* Generate the reversed comparision. This takes four bytes. */ if (float_p) sprintf (c, "b%s\t%%Z2%s", @@ -2843,32 +2866,10 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, return 0; } -static enum processor_type -iq2000_parse_cpu (const char *cpu_string) -{ - const char *p = cpu_string; - enum processor_type cpu; - - cpu = PROCESSOR_DEFAULT; - switch (p[2]) - { - case '1': - if (!strcmp (p, "iq10")) - cpu = PROCESSOR_IQ10; - break; - case '2': - if (!strcmp (p, "iq2000")) - cpu = PROCESSOR_IQ2000; - break; - } - - return cpu; -} - #define def_builtin(NAME, TYPE, CODE) \ builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE) -void +static void iq2000_init_builtins (void) { tree endlink = void_list_node; @@ -2999,7 +3000,7 @@ void_ftype_int_int_int } /* Builtin for ICODE having ARGCOUNT args in ARGLIST where each arg - has an rtx CODE */ + has an rtx CODE. */ static rtx expand_one_builtin (enum insn_code icode, rtx target, tree arglist, @@ -3079,7 +3080,7 @@ expand_one_builtin (enum insn_code icode, rtx target, tree arglist, SUBTARGET may be used as the target for computing one of EXP's operands. IGNORE is nonzero if the value is to be ignored. */ -rtx +static rtx iq2000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED) @@ -3263,11 +3264,12 @@ iq2000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS cum, int mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, int *pretend_size, - int no_rtl) + tree type ATTRIBUTE_UNUSED, int * pretend_size, + int no_rtl) { unsigned int iq2000_off = (! (cum).last_arg_fp); unsigned int iq2000_fp_off = ((cum).last_arg_fp); + if (((cum).arg_words < MAX_ARGS_IN_REGISTERS - iq2000_off)) { int iq2000_save_gp_regs @@ -3303,11 +3305,10 @@ iq2000_setup_incoming_varargs (CUMULATIVE_ARGS cum, int mode ATTRIBUTE_UNUSED, /* A C compound statement to output to stdio stream STREAM the assembler syntax for an instruction operand that is a memory - reference whose address is ADDR. ADDR is an RTL expression. -*/ + reference whose address is ADDR. ADDR is an RTL expression. */ void -print_operand_address (FILE *file, rtx addr) +print_operand_address (FILE * file, rtx addr) { if (!addr) error ("PRINT_OPERAND_ADDRESS, null pointer"); @@ -3324,8 +3325,8 @@ print_operand_address (FILE *file, rtx addr) case LO_SUM: { - register rtx arg0 = XEXP (addr, 0); - register rtx arg1 = XEXP (addr, 1); + rtx arg0 = XEXP (addr, 0); + rtx arg1 = XEXP (addr, 1); if (GET_CODE (arg0) != REG) abort_with_insn (addr, @@ -3339,10 +3340,10 @@ print_operand_address (FILE *file, rtx addr) case PLUS: { - register rtx reg = 0; - register rtx offset = 0; - register rtx arg0 = XEXP (addr, 0); - register rtx arg1 = XEXP (addr, 1); + rtx reg = 0; + rtx offset = 0; + rtx arg0 = XEXP (addr, 0); + rtx arg1 = XEXP (addr, 1); if (GET_CODE (arg0) == REG) { @@ -3388,25 +3389,24 @@ print_operand_address (FILE *file, rtx addr) } } -/* A C compound statement to output to stdio stream STREAM the - assembler syntax for an instruction operand X. X is an RTL - expression. +/* A C compound statement to output to stdio stream FILE the + assembler syntax for an instruction operand OP. - CODE is a value that can be used to specify one of several ways + LETTER is a value that can be used to specify one of several ways of printing the operand. It is used when identical operands - must be printed differently depending on the context. CODE + must be printed differently depending on the context. LETTER comes from the `%' specification that was used to request printing of the operand. If the specification was just `%DIGIT' - then CODE is 0; if the specification was `%LTR DIGIT' then CODE + then LETTER is 0; if the specification was `%LTR DIGIT' then LETTER is the ASCII code for LTR. - If X is a register, this macro should print the register's name. + If OP is a register, this macro should print the register's name. The names can be found in an array `reg_names' whose type is `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'. When the machine description has a specification `%PUNCT' (a `%' followed by a punctuation character), this macro is called with - a null pointer for X and the punctuation character for CODE. + a null pointer for X and the punctuation character for LETTER. The IQ2000 specific codes are: @@ -3438,7 +3438,7 @@ print_operand_address (FILE *file, rtx addr) void print_operand (FILE *file, rtx op, int letter) { - register enum rtx_code code; + enum rtx_code code; if (PRINT_OPERAND_PUNCT_VALID_P (letter)) { @@ -3558,7 +3558,7 @@ print_operand (FILE *file, rtx op, int letter) else if (letter == 'Z') { - register int regnum; + int regnum; if (code != REG) abort (); @@ -3571,7 +3571,7 @@ print_operand (FILE *file, rtx op, int letter) else if (code == REG || code == SUBREG) { - register int regnum; + int regnum; if (code == REG) regnum = REGNO (op); @@ -3635,3 +3635,143 @@ print_operand (FILE *file, rtx op, int letter) else output_addr_const (file, op); } + +static bool +iq2000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int * total) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case MEM: + { + int num_words = (GET_MODE_SIZE (mode) > UNITS_PER_WORD) ? 2 : 1; + + if (simple_memory_operand (x, mode)) + return COSTS_N_INSNS (num_words); + + * total = COSTS_N_INSNS (2 * num_words); + break; + } + + case FFS: + * total = COSTS_N_INSNS (6); + break; + + case AND: + case IOR: + case XOR: + case NOT: + * total = COSTS_N_INSNS (mode == DImode ? 2 : 1); + break; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + if (mode == DImode) + * total = COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT) ? 4 : 12); + else + * total = COSTS_N_INSNS (1); + break; + + case ABS: + if (mode == SFmode || mode == DFmode) + * total = COSTS_N_INSNS (1); + else + * total = COSTS_N_INSNS (4); + break; + + case PLUS: + case MINUS: + if (mode == SFmode || mode == DFmode) + * total = COSTS_N_INSNS (6); + else if (mode == DImode) + * total = COSTS_N_INSNS (4); + else + * total = COSTS_N_INSNS (1); + break; + + case NEG: + * total = (mode == DImode) ? 4 : 1; + break; + + case MULT: + if (mode == SFmode) + * total = COSTS_N_INSNS (7); + else if (mode == DFmode) + * total = COSTS_N_INSNS (8); + else + * total = COSTS_N_INSNS (10); + break; + + case DIV: + case MOD: + if (mode == SFmode) + * total = COSTS_N_INSNS (23); + else if (mode == DFmode) + * total = COSTS_N_INSNS (36); + else + * total = COSTS_N_INSNS (69); + break; + + case UDIV: + case UMOD: + * total = COSTS_N_INSNS (69); + break; + + case SIGN_EXTEND: + * total = COSTS_N_INSNS (2); + break; + + case ZERO_EXTEND: + * total = COSTS_N_INSNS (1); + break; + + case CONST_INT: + * total = 0; + break; + + case LABEL_REF: + * total = COSTS_N_INSNS (2); + break; + + case CONST: + { + rtx offset = const0_rtx; + rtx symref = eliminate_constant_term (XEXP (x, 0), & offset); + + if (GET_CODE (symref) == LABEL_REF) + * total = COSTS_N_INSNS (2); + else if (GET_CODE (symref) != SYMBOL_REF) + * total = COSTS_N_INSNS (4); + /* let's be paranoid.... */ + else if (INTVAL (offset) < -32768 || INTVAL (offset) > 32767) + * total = COSTS_N_INSNS (2); + else + * total = COSTS_N_INSNS (SYMBOL_REF_FLAG (symref) ? 1 : 2); + break; + } + + case SYMBOL_REF: + * total = COSTS_N_INSNS (SYMBOL_REF_FLAG (x) ? 1 : 2); + break; + + case CONST_DOUBLE: + { + rtx high, low; + + split_double (x, & high, & low); + + * total = COSTS_N_INSNS ( (high == CONST0_RTX (GET_MODE (high)) + || low == CONST0_RTX (GET_MODE (low))) + ? 2 : 4); + break; + } + + default: + return false; + } + return true; +} + +#include "gt-iq2000.h" diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index f32d0c388c9..a54856a402b 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -21,7 +21,7 @@ /* Driver configuration. */ -#undef SWITCH_TAKES_ARG +#undef SWITCH_TAKES_ARG #define SWITCH_TAKES_ARG(CHAR) \ (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') @@ -38,28 +38,26 @@ #define TARGET_CPU_CPP_BUILTINS() \ do \ { \ - builtin_define ("__iq2000__"); \ - builtin_assert ("cpu=iq2000"); \ - builtin_assert ("machine=iq2000"); \ + builtin_define ("__iq2000__"); \ + builtin_assert ("cpu=iq2000"); \ + builtin_assert ("machine=iq2000"); \ } \ while (0) - extern int target_flags; -#define MASK_GPOPT 0x00000008 /* Optimize for global pointer */ -#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code */ +#define MASK_GPOPT 0x00000008 /* Optimize for global pointer. */ +#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code. */ #define MASK_UNINIT_CONST_IN_RODATA \ 0x00800000 /* Store uninitialized - consts in rodata */ + consts in rodata. */ /* Macros used in the machine description to test the flags. */ #define TARGET_STATS 0 - /* for embedded systems, optimize for - reduced RAM space instead of for - fastest code. */ +/* For embedded systems, optimize for reduced RAM space instead of for + fastest code. */ #define TARGET_EMBEDDED_DATA (target_flags & MASK_EMBEDDED_DATA) #define TARGET_DEBUG_MODE (target_flags & 0) @@ -134,23 +132,15 @@ extern int target_flags; /* Storage Layout. */ -#define BITS_BIG_ENDIAN 0 - -#define BYTES_BIG_ENDIAN 1 - -#define WORDS_BIG_ENDIAN 1 - -#define LIBGCC2_WORDS_BIG_ENDIAN 1 - -#define BITS_PER_WORD 32 - -#define MAX_BITS_PER_WORD 64 - -#define UNITS_PER_WORD 4 - -#define MIN_UNITS_PER_WORD 4 - -#define POINTER_SIZE 32 +#define BITS_BIG_ENDIAN 0 +#define BYTES_BIG_ENDIAN 1 +#define WORDS_BIG_ENDIAN 1 +#define LIBGCC2_WORDS_BIG_ENDIAN 1 +#define BITS_PER_WORD 32 +#define MAX_BITS_PER_WORD 64 +#define UNITS_PER_WORD 4 +#define MIN_UNITS_PER_WORD 4 +#define POINTER_SIZE 32 /* Define this macro if it is advisable to hold scalars in registers in a wider mode than that declared by the program. In such cases, @@ -177,7 +167,7 @@ extern int target_flags; #define BIGGEST_ALIGNMENT 64 -#undef DATA_ALIGNMENT +#undef DATA_ALIGNMENT #define DATA_ALIGNMENT(TYPE, ALIGN) \ ((((ALIGN) < BITS_PER_WORD) \ && (TREE_CODE (TYPE) == ARRAY_TYPE \ @@ -201,27 +191,16 @@ extern int target_flags; /* Layout of Source Language Data Types. */ -#define INT_TYPE_SIZE 32 - -#define MAX_INT_TYPE_SIZE 32 - -#define SHORT_TYPE_SIZE 16 - -#define LONG_TYPE_SIZE 32 - -#define LONG_LONG_TYPE_SIZE 64 - -#define CHAR_TYPE_SIZE BITS_PER_UNIT - -#define FLOAT_TYPE_SIZE 32 - -#define DOUBLE_TYPE_SIZE 64 - -#define LONG_DOUBLE_TYPE_SIZE 64 - -#define DEFAULT_SIGNED_CHAR 1 - -#define MAX_WCHAR_TYPE_SIZE MAX_INT_TYPE_SIZE +#define INT_TYPE_SIZE 32 +#define SHORT_TYPE_SIZE 16 +#define LONG_TYPE_SIZE 32 +#define LONG_LONG_TYPE_SIZE 64 +#define CHAR_TYPE_SIZE BITS_PER_UNIT +#define FLOAT_TYPE_SIZE 32 +#define DOUBLE_TYPE_SIZE 64 +#define LONG_DOUBLE_TYPE_SIZE 64 +#define DEFAULT_SIGNED_CHAR 1 +#define MAX_WCHAR_TYPE_SIZE 32 /* Register Basics. */ @@ -255,15 +234,15 @@ extern int target_flags; #define HARD_REGNO_NREGS(REGNO, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) -#define HARD_REGNO_MODE_OK(REGNO, MODE) \ - ((REGNO_REG_CLASS (REGNO) == GR_REGS) \ - ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \ +#define HARD_REGNO_MODE_OK(REGNO, MODE) \ + ((REGNO_REG_CLASS (REGNO) == GR_REGS) \ + ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \ : ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) == 4) -#define MODES_TIEABLE_P(MODE1, MODE2) \ - ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \ - GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ - == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \ +#define MODES_TIEABLE_P(MODE1, MODE2) \ + ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \ + GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ + == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \ GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT)) #define AVOID_CCMODE_COPIES @@ -273,28 +252,28 @@ extern int target_flags; enum reg_class { - NO_REGS, /* no registers in set */ - GR_REGS, /* integer registers */ - ALL_REGS, /* all registers */ - LIM_REG_CLASSES /* max value + 1 */ + NO_REGS, /* No registers in set. */ + GR_REGS, /* Integer registers. */ + ALL_REGS, /* All registers. */ + LIM_REG_CLASSES /* Max value + 1. */ }; #define GENERAL_REGS GR_REGS #define N_REG_CLASSES (int) LIM_REG_CLASSES -#define REG_CLASS_NAMES \ -{ \ - "NO_REGS", \ - "GR_REGS", \ - "ALL_REGS" \ +#define REG_CLASS_NAMES \ +{ \ + "NO_REGS", \ + "GR_REGS", \ + "ALL_REGS" \ } -#define REG_CLASS_CONTENTS \ -{ \ - { 0x00000000, 0x00000000 }, /* no registers */ \ - { 0xffffffff, 0x00000000 }, /* integer registers */ \ - { 0xffffffff, 0x00000001 } /* all registers */ \ +#define REG_CLASS_CONTENTS \ +{ \ + { 0x00000000, 0x00000000 }, /* No registers, */ \ + { 0xffffffff, 0x00000000 }, /* Integer registers. */ \ + { 0xffffffff, 0x00000001 } /* All registers. */ \ } #define REGNO_REG_CLASS(REGNO) \ @@ -305,22 +284,22 @@ enum reg_class #define INDEX_REG_CLASS NO_REGS #define REG_CLASS_FROM_LETTER(C) \ - ((C) == 'd' ? GR_REGS : \ - (C) == 'b' ? ALL_REGS : \ - (C) == 'y' ? GR_REGS : \ + ((C) == 'd' ? GR_REGS : \ + (C) == 'b' ? ALL_REGS : \ + (C) == 'y' ? GR_REGS : \ NO_REGS) #define REGNO_OK_FOR_INDEX_P(regno) 0 -#define PREFERRED_RELOAD_CLASS(X,CLASS) \ - ((CLASS) != ALL_REGS \ - ? (CLASS) \ - : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ - || GET_MODE_CLASS (GET_MODE (X)) == MODE_COMPLEX_FLOAT) \ - ? (GR_REGS) \ - : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ - || GET_MODE (X) == VOIDmode) \ - ? (GR_REGS) \ +#define PREFERRED_RELOAD_CLASS(X,CLASS) \ + ((CLASS) != ALL_REGS \ + ? (CLASS) \ + : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + || GET_MODE_CLASS (GET_MODE (X)) == MODE_COMPLEX_FLOAT) \ + ? (GR_REGS) \ + : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ + || GET_MODE (X) == VOIDmode) \ + ? (GR_REGS) \ : (CLASS)))) #define SMALL_REGISTER_CLASSES 0 @@ -346,8 +325,7 @@ enum reg_class `N' is used for constants 0xffffnnnn or 0xnnnnffff - `O' is a 5 bit zero-extended integer. -*/ + `O' is a 5 bit zero-extended integer. */ #define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000) \ @@ -412,18 +390,12 @@ enum reg_class /* Register That Address the Stack Frame. */ -#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29) - -#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 1) - -#define HARD_FRAME_POINTER_REGNUM \ - (GP_REG_FIRST + 27) - -#define ARG_POINTER_REGNUM GP_REG_FIRST - -#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG_NUM - -#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2) +#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29) +#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 1) +#define HARD_FRAME_POINTER_REGNUM (GP_REG_FIRST + 27) +#define ARG_POINTER_REGNUM GP_REG_FIRST +#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG_NUM +#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2) /* Eliminating the Frame Pointer and the Arg Pointer. */ @@ -471,39 +443,40 @@ enum reg_class /* Function Arguments in Registers. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - function_arg( &CUM, MODE, TYPE, NAMED) + function_arg (& CUM, MODE, TYPE, NAMED) #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ - function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) + function_arg_partial_nregs (& CUM, MODE, TYPE, NAMED) #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) + function_arg_pass_by_reference (& CUM, MODE, TYPE, NAMED) #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \ ((NAMED) && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)) #define MAX_ARGS_IN_REGISTERS 8 -typedef struct iq2000_args { - int gp_reg_found; /* whether a gp register was found yet */ - unsigned int arg_number; /* argument number */ - unsigned int arg_words; /* # total words the arguments take */ - unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only) */ - int last_arg_fp; /* nonzero if last arg was FP (EABI only) */ - int fp_code; /* Mode of FP arguments */ - unsigned int num_adjusts; /* number of adjustments made */ +typedef struct iq2000_args +{ + int gp_reg_found; /* Whether a gp register was found yet. */ + unsigned int arg_number; /* Argument number. */ + unsigned int arg_words; /* # total words the arguments take. */ + unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only). */ + int last_arg_fp; /* Nonzero if last arg was FP (EABI only). */ + int fp_code; /* Mode of FP arguments. */ + unsigned int num_adjusts; /* Number of adjustments made. */ /* Adjustments made to args pass in regs. */ - struct rtx_def *adjust[MAX_ARGS_IN_REGISTERS*2]; + struct rtx_def * adjust[MAX_ARGS_IN_REGISTERS * 2]; } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ - init_cumulative_args (&CUM, FNTYPE, LIBNAME) \ + init_cumulative_args (& CUM, FNTYPE, LIBNAME) \ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - function_arg_advance (&CUM, MODE, TYPE, NAMED) + function_arg_advance (& CUM, MODE, TYPE, NAMED) #define FUNCTION_ARG_PADDING(MODE, TYPE) \ (! BYTES_BIG_ENDIAN \ @@ -589,9 +562,6 @@ typedef struct iq2000_args { #define STRICT_ARGUMENT_NAMING 1 -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = ptr_type_node - #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ iq2000_va_start (valist, nextarg) @@ -644,24 +614,24 @@ typedef struct iq2000_args { /* Addressing Modes. */ #define CONSTANT_ADDRESS_P(X) \ - ((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ + ( (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \ || (GET_CODE (X) == CONST))) #define MAX_REGS_PER_ADDRESS 1 #ifdef REG_OK_STRICT -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ -{ \ - if (iq2000_legitimate_address_p (MODE, X, 1)) \ - goto ADDR; \ -} +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ + { \ + if (iq2000_legitimate_address_p (MODE, X, 1)) \ + goto ADDR; \ + } #else -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ -{ \ - if (iq2000_legitimate_address_p (MODE, X, 0)) \ - goto ADDR; \ -} +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ + { \ + if (iq2000_legitimate_address_p (MODE, X, 0)) \ + goto ADDR; \ + } #endif #define REG_OK_FOR_INDEX_P(X) 0 @@ -678,7 +648,7 @@ typedef struct iq2000_args { #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ { \ - register rtx xinsn = (X); \ + rtx xinsn = (X); \ \ if (TARGET_DEBUG_B_MODE) \ { \ @@ -697,10 +667,10 @@ typedef struct iq2000_args { \ if (GET_CODE (xinsn) == PLUS) \ { \ - register rtx xplus0 = XEXP (xinsn, 0); \ - register rtx xplus1 = XEXP (xinsn, 1); \ - register enum rtx_code code0 = GET_CODE (xplus0); \ - register enum rtx_code code1 = GET_CODE (xplus1); \ + rtx xplus0 = XEXP (xinsn, 0); \ + rtx xplus1 = XEXP (xinsn, 1); \ + enum rtx_code code0 = GET_CODE (xplus0); \ + enum rtx_code code1 = GET_CODE (xplus1); \ \ if (code0 != REG && code1 == REG) \ { \ @@ -739,149 +709,6 @@ typedef struct iq2000_args { /* Describing Relative Costs of Operations. */ -#define CONST_COSTS(X,CODE,OUTER_CODE) \ - case CONST_INT: \ - return 0; \ - \ - case LABEL_REF: \ - return COSTS_N_INSNS (2); \ - \ - case CONST: \ - { \ - rtx offset = const0_rtx; \ - rtx symref = eliminate_constant_term (XEXP (X, 0), &offset); \ - \ - if (GET_CODE (symref) == LABEL_REF) \ - return COSTS_N_INSNS (2); \ - \ - if (GET_CODE (symref) != SYMBOL_REF) \ - return COSTS_N_INSNS (4); \ - \ - /* let's be paranoid.... */ \ - if (INTVAL (offset) < -32768 || INTVAL (offset) > 32767) \ - return COSTS_N_INSNS (2); \ - \ - return COSTS_N_INSNS (SYMBOL_REF_FLAG (symref) ? 1 : 2); \ - } \ - \ - case SYMBOL_REF: \ - return COSTS_N_INSNS (SYMBOL_REF_FLAG (X) ? 1 : 2); \ - \ - case CONST_DOUBLE: \ - { \ - rtx high, low; \ - split_double (X, &high, &low); \ - return COSTS_N_INSNS ((high == CONST0_RTX (GET_MODE (high)) \ - || low == CONST0_RTX (GET_MODE (low))) \ - ? 2 : 4); \ - } - -#define RTX_COSTS(X,CODE,OUTER_CODE) \ - case MEM: \ - { \ - int num_words = (GET_MODE_SIZE (GET_MODE (X)) > UNITS_PER_WORD) ? 2 : 1; \ - if (simple_memory_operand (X, GET_MODE (X))) \ - return COSTS_N_INSNS (num_words); \ - \ - return COSTS_N_INSNS (2*num_words); \ - } \ - \ - case FFS: \ - return COSTS_N_INSNS (6); \ - \ - case NOT: \ - return COSTS_N_INSNS (GET_MODE (X) == DImode && 2); \ - \ - case AND: \ - case IOR: \ - case XOR: \ - if (GET_MODE (X) == DImode) \ - return COSTS_N_INSNS (2); \ - \ - break; \ - \ - case ASHIFT: \ - case ASHIFTRT: \ - case LSHIFTRT: \ - if (GET_MODE (X) == DImode) \ - return COSTS_N_INSNS ((GET_CODE (XEXP (X, 1)) == CONST_INT) ? 4 : 12); \ - \ - break; \ - \ - case ABS: \ - { \ - enum machine_mode xmode = GET_MODE (X); \ - if (xmode == SFmode || xmode == DFmode) \ - return COSTS_N_INSNS (1); \ - \ - return COSTS_N_INSNS (4); \ - } \ - \ - case PLUS: \ - case MINUS: \ - { \ - enum machine_mode xmode = GET_MODE (X); \ - if (xmode == SFmode || xmode == DFmode) \ - { \ - return COSTS_N_INSNS (6); \ - } \ - \ - if (xmode == DImode) \ - return COSTS_N_INSNS (4); \ - \ - break; \ - } \ - \ - case NEG: \ - if (GET_MODE (X) == DImode) \ - return 4; \ - \ - break; \ - \ - case MULT: \ - { \ - enum machine_mode xmode = GET_MODE (X); \ - if (xmode == SFmode) \ - { \ - return COSTS_N_INSNS (7); \ - } \ - \ - if (xmode == DFmode) \ - { \ - return COSTS_N_INSNS (8); \ - } \ - \ - return COSTS_N_INSNS (10); \ - } \ - \ - case DIV: \ - case MOD: \ - { \ - enum machine_mode xmode = GET_MODE (X); \ - if (xmode == SFmode) \ - { \ - return COSTS_N_INSNS (23); \ - } \ - \ - if (xmode == DFmode) \ - { \ - return COSTS_N_INSNS (36); \ - } \ - } \ - /* fall through */ \ - \ - case UDIV: \ - case UMOD: \ - return COSTS_N_INSNS (69); \ - \ - case SIGN_EXTEND: \ - return COSTS_N_INSNS (2); \ - \ - case ZERO_EXTEND: \ - return COSTS_N_INSNS (1); - -#define ADDRESS_COST(ADDR) (REG_P (ADDR) ? 1 : iq2000_address_cost (ADDR)) - #define REGISTER_MOVE_COST(MODE, FROM, TO) 2 #define MEMORY_MOVE_COST(MODE,CLASS,TO_P) \ @@ -902,9 +729,9 @@ typedef struct iq2000_args { /* Dividing the output into sections. */ -#define TEXT_SECTION_ASM_OP "\t.text" /* instructions */ +#define TEXT_SECTION_ASM_OP "\t.text" /* Instructions. */ -#define DATA_SECTION_ASM_OP "\t.data" /* large data */ +#define DATA_SECTION_ASM_OP "\t.data" /* Large data. */ /* The Overall Framework of an Assembler File. */ @@ -918,13 +745,9 @@ typedef struct iq2000_args { /* Output and Generation of Labels. */ -#undef ASM_OUTPUT_INTERNAL_LABEL -#define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM) \ - fprintf (STREAM, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM) - #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ - sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM)) + sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long) (NUM)) #define GLOBAL_ASM_OP "\t.globl\t" @@ -992,7 +815,6 @@ typedef struct iq2000_args { #define DBR_OUTPUT_SEQEND(STREAM) \ do \ { \ - dslots_jump_filled++; \ fputs ("\n", STREAM); \ } \ while (0) @@ -1005,11 +827,13 @@ while (0) /* Output of dispatch tables. */ #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ -do { \ - fprintf (STREAM, "\t%s\t%sL%d\n", \ - Pmode == DImode ? ".dword" : ".word", \ - LOCAL_LABEL_PREFIX, VALUE); \ -} while (0) + do \ + { \ + fprintf (STREAM, "\t%s\t%sL%d\n", \ + Pmode == DImode ? ".dword" : ".word", \ + LOCAL_LABEL_PREFIX, VALUE); \ + } \ + while (0) #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ fprintf (STREAM, "\t%s\t%sL%d\n", \ @@ -1092,19 +916,19 @@ extern char call_used_regs[]; /* Comparison type. */ enum cmp_type { - CMP_SI, /* compare four byte integers */ - CMP_DI, /* compare eight byte integers */ - CMP_SF, /* compare single precision floats */ - CMP_DF, /* compare double precision floats */ - CMP_MAX /* max comparison type */ + CMP_SI, /* Compare four byte integers. */ + CMP_DI, /* Compare eight byte integers. */ + CMP_SF, /* Compare single precision floats. */ + CMP_DF, /* Compare double precision floats. */ + CMP_MAX /* Max comparison type. */ }; /* Types of delay slot. */ enum delay_type { - DELAY_NONE, /* no delay slot */ - DELAY_LOAD, /* load from memory delay */ - DELAY_FCMP /* delay after doing c..{d,s} */ + DELAY_NONE, /* No delay slot. */ + DELAY_LOAD, /* Load from memory delay. */ + DELAY_FCMP /* Delay after doing c..{d,s}. */ }; /* Which processor to schedule for. */ @@ -1117,36 +941,15 @@ enum processor_type }; /* Recast the cpu class to be the cpu attribute. */ -#define iq2000_cpu_attr ((enum attr_cpu)iq2000_tune) - -extern char iq2000_print_operand_punct[]; /* print_operand punctuation chars */ -extern int num_source_filenames; /* current .file # */ -extern int iq2000_branch_likely; /* emit 'l' after br (branch likely) */ -extern struct rtx_def *branch_cmp[2]; /* operands for compare */ -extern enum cmp_type branch_type; /* what type of branch to use */ -extern enum processor_type iq2000_arch; /* which cpu to codegen for */ -extern enum processor_type iq2000_tune; /* which cpu to schedule for */ -extern int iq2000_isa; /* architectural level */ -extern const char *iq2000_cpu_string; /* for -mcpu= */ -extern const char *iq2000_arch_string; /* for -march= */ -extern int dslots_load_total; /* total # load related delay slots */ -extern int dslots_load_filled; /* # filled load delay slots */ -extern int dslots_jump_total; /* total # jump related delay slots */ -extern int dslots_jump_filled; /* # filled jump delay slots */ -extern int dslots_number_nops; /* # of nops needed by previous insn */ -extern int num_refs[3]; /* # 1/2/3 word references */ -extern struct rtx_def *iq2000_load_reg; /* register to check for load delay */ -extern struct rtx_def *iq2000_load_reg2; /* 2nd reg to check for load delay */ -extern struct rtx_def *iq2000_load_reg3; /* 3rd reg to check for load delay */ -extern struct rtx_def *iq2000_load_reg4; /* 4th reg to check for load delay */ +#define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune) /* Functions to change what output section we are using. */ extern void rdata_section (void); extern void sdata_section (void); -extern void sbss_section (void); +extern void sbss_section (void); -#define BITMASK_UPPER16 ((unsigned long)0xffff << 16) /* 0xffff0000 */ -#define BITMASK_LOWER16 ((unsigned long)0xffff) /* 0x0000ffff */ +#define BITMASK_UPPER16 ((unsigned long) 0xffff << 16) /* 0xffff0000 */ +#define BITMASK_LOWER16 ((unsigned long) 0xffff) /* 0x0000ffff */ #define GENERATE_BRANCHLIKELY (ISA_HAS_BRANCHLIKELY) @@ -1265,10 +1068,10 @@ extern void sbss_section (void); #ifndef STACK_ARGS_ADJUST #define STACK_ARGS_ADJUST(SIZE) \ -{ \ - if (SIZE.constant < 4 * UNITS_PER_WORD) \ - SIZE.constant = 4 * UNITS_PER_WORD; \ -} + { \ + if (SIZE.constant < 4 * UNITS_PER_WORD) \ + SIZE.constant = 4 * UNITS_PER_WORD; \ + } #endif @@ -1336,9 +1139,9 @@ extern void sbss_section (void); #endif #if 1 -#define GO_PRINTF(x) fprintf(stderr, (x)) -#define GO_PRINTF2(x,y) fprintf(stderr, (x), (y)) -#define GO_DEBUG_RTX(x) debug_rtx(x) +#define GO_PRINTF(x) fprintf (stderr, (x)) +#define GO_PRINTF2(x,y) fprintf (stderr, (x), (y)) +#define GO_DEBUG_RTX(x) debug_rtx (x) #else #define GO_PRINTF(x) @@ -1346,15 +1149,6 @@ extern void sbss_section (void); #define GO_DEBUG_RTX(x) #endif -/* Specify the tree operation to be used to convert reals to integers. */ -#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR - -/* This is the kind of divide that is easiest to do in the general case. */ -#define EASY_DIV_EXPR TRUNC_DIV_EXPR - -/* Define this if zero-extension is slow (more than one real instruction). */ -#define SLOW_ZERO_EXTEND - /* If defined, modifies the length assigned to instruction INSN as a function of the context in which it is used. LENGTH is an lvalue that contains the initially computed length of the insn and should @@ -1375,7 +1169,7 @@ extern void sbss_section (void); /* How to tell the debugger about changes of source files. */ #ifndef SET_FILE_NUMBER -#define SET_FILE_NUMBER() ++num_source_filenames +#define SET_FILE_NUMBER() ++ num_source_filenames #endif /* This is how to output a note the debugger telling it the line number @@ -1385,28 +1179,41 @@ extern void sbss_section (void); #define LABEL_AFTER_LOC(STREAM) #endif -/* Handle certain cpp directives used in header files on sysV. */ -#define SCCS_DIRECTIVE - /* Default to -G 8 */ #ifndef IQ2000_DEFAULT_GVALUE #define IQ2000_DEFAULT_GVALUE 8 #endif -#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */ - -/* Given a decl node or constant node, choose the section to output it in - and select that section. */ +#define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */ -#undef TARGET_ASM_SELECT_SECTION -#define TARGET_ASM_SELECT_SECTION iq2000_select_section /* See iq2000_expand_prologue's use of loadgp for when this should be true. */ #define DONT_ACCESS_GBLS_AFTER_EPILOGUE 0 +/* List of all IQ2000 punctuation characters used by print_operand. */ +extern char iq2000_print_operand_punct[256]; + +/* The target cpu for optimization and scheduling. */ +extern enum processor_type iq2000_tune; + +/* Which instruction set architecture to use. */ +extern int iq2000_isa; + +/* Cached operands, and operator to compare for use in set/branch/trap + on condition codes. */ +extern rtx branch_cmp[2]; + +/* What type of branch to use. */ +extern enum cmp_type branch_type; + +/* Strings to hold which cpu and instruction set architecture to use. */ +extern const char * iq2000_cpu_string; /* For -mcpu=. */ +extern const char * iq2000_arch_string; /* For -march=. */ + + enum iq2000_builtins { diff --git a/gcc/config/kfreebsdgnu.h b/gcc/config/kfreebsdgnu.h index 59a68295c2a..ad8d68c3f21 100644 --- a/gcc/config/kfreebsdgnu.h +++ b/gcc/config/kfreebsdgnu.h @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */ #define WCHAR_TYPE "int" #undef TARGET_OS_CPP_BUILTINS -#define TARET_OS_CPP_BUILTINS() \ +#define TARGET_OS_CPP_BUILTINS() \ builtin_define ("__GNU_KFreeBSD__=0"); \ builtin_define ("__gnu_kfreebsd__=0"); \ builtin_define ("__FreeBSD_kernel__=5"); \ diff --git a/gcc/config/linux.h b/gcc/config/linux.h index 2c85148c685..0f7ba1777e8 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -97,6 +97,16 @@ Boston, MA 02111-1307, USA. */ %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}" #endif +#define LINUX_TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__gnu_linux__"); \ + builtin_define_std ("linux"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } while (0) + #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR) #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h index ef7ba37d2b5..cdd9db3296a 100644 --- a/gcc/config/m32r/m32r-protos.h +++ b/gcc/config/m32r/m32r-protos.h @@ -22,77 +22,76 @@ Boston, MA 02111-1307, USA. */ complications. */ #define Mmode enum machine_mode -extern void sbss_section PARAMS ((void)); -extern void sdata_section PARAMS ((void)); -extern void m32r_init PARAMS ((void)); -extern void m32r_init_expanders PARAMS ((void)); -extern unsigned m32r_compute_frame_size PARAMS ((int)); -extern int m32r_first_insn_address PARAMS ((void)); -extern void m32r_expand_prologue PARAMS ((void)); -extern void m32r_finalize_pic PARAMS ((void)); -extern int direct_return PARAMS ((void)); +extern void sbss_section (void); +extern void sdata_section (void); +extern void m32r_init (void); +extern void m32r_init_expanders (void); +extern unsigned m32r_compute_frame_size (int); +extern int m32r_first_insn_address (void); +extern void m32r_expand_prologue (void); +extern void m32r_finalize_pic (void); +extern int direct_return (void); #ifdef TREE_CODE -extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree)); +extern enum m32r_function_type m32r_compute_function_type (tree); #ifdef HAVE_MACHINE_MODES -extern void m32r_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int *, int)); -extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int)); +extern void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, Mmode, tree, int *, int); +extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, Mmode, tree, int); #endif #endif /* TREE_CODE */ #ifdef RTX_CODE -extern int easy_di_const PARAMS ((rtx)); -extern int easy_df_const PARAMS ((rtx)); -extern rtx gen_compare PARAMS ((enum rtx_code, rtx, rtx, int)); -extern rtx gen_split_move_double PARAMS ((rtx *)); -extern int m32r_address_code PARAMS ((rtx)); -extern void m32r_initialize_trampoline PARAMS ((rtx, rtx, rtx)); -extern int zero_and_one PARAMS ((rtx, rtx)); -extern char * emit_cond_move PARAMS ((rtx *, rtx)); -extern void m32r_output_block_move PARAMS ((rtx, rtx *)); -extern void m32r_expand_block_move PARAMS ((rtx *)); -extern void m32r_print_operand PARAMS ((FILE *, rtx, int)); -extern void m32r_print_operand_address PARAMS ((FILE *, rtx)); -extern int m32r_not_same_reg PARAMS ((rtx, rtx)); -extern int m32r_hard_regno_rename_ok PARAMS ((unsigned int, - unsigned int)); +extern int easy_di_const (rtx); +extern int easy_df_const (rtx); +extern rtx gen_compare (enum rtx_code, rtx, rtx, int); +extern rtx gen_split_move_double (rtx *); +extern int m32r_address_code (rtx); +extern void m32r_initialize_trampoline (rtx, rtx, rtx); +extern int zero_and_one (rtx, rtx); +extern char * emit_cond_move (rtx *, rtx); +extern void m32r_output_block_move (rtx, rtx *); +extern void m32r_expand_block_move (rtx *); +extern void m32r_print_operand (FILE *, rtx, int); +extern void m32r_print_operand_address (FILE *, rtx); +extern int m32r_not_same_reg (rtx, rtx); +extern int m32r_hard_regno_rename_ok (unsigned int, unsigned int); #ifdef HAVE_MACHINE_MODES -extern int call_address_operand PARAMS ((rtx, Mmode)); -extern int call_operand PARAMS ((rtx, Mmode)); -extern int symbolic_operand PARAMS ((rtx, Mmode)); -extern int small_data_operand PARAMS ((rtx, Mmode)); -extern int addr24_operand PARAMS ((rtx, Mmode)); -extern int addr32_operand PARAMS ((rtx, Mmode)); -extern int call26_operand PARAMS ((rtx, Mmode)); -extern int seth_add3_operand PARAMS ((rtx, Mmode)); -extern int cmp_int16_operand PARAMS ((rtx, Mmode)); -extern int uint16_operand PARAMS ((rtx, Mmode)); -extern int reg_or_int16_operand PARAMS ((rtx, Mmode)); -extern int reg_or_uint16_operand PARAMS ((rtx, Mmode)); -extern int reg_or_cmp_int16_operand PARAMS ((rtx, Mmode)); -extern int two_insn_const_operand PARAMS ((rtx, Mmode)); -extern int move_src_operand PARAMS ((rtx, Mmode)); -extern int move_double_src_operand PARAMS ((rtx, Mmode)); -extern int move_dest_operand PARAMS ((rtx, Mmode)); -extern int eqne_comparison_operator PARAMS ((rtx, Mmode)); -extern int signed_comparison_operator PARAMS ((rtx, Mmode)); -extern int memreg_operand PARAMS ((rtx, Mmode)); -extern int small_insn_p PARAMS ((rtx, Mmode)); -extern int large_insn_p PARAMS ((rtx, Mmode)); -extern int conditional_move_operand PARAMS ((rtx, Mmode)); -extern int carry_compare_operand PARAMS ((rtx, Mmode)); -extern int m32r_block_immediate_operand PARAMS ((rtx, Mmode)); -extern int extend_operand PARAMS ((rtx, Mmode)); -extern int reg_or_eq_int16_operand PARAMS ((rtx, Mmode)); -extern int int8_operand PARAMS ((rtx, Mmode)); -extern int reg_or_zero_operand PARAMS ((rtx, Mmode)); +extern int call_address_operand (rtx, Mmode); +extern int call_operand (rtx, Mmode); +extern int symbolic_operand (rtx, Mmode); +extern int small_data_operand (rtx, Mmode); +extern int addr24_operand (rtx, Mmode); +extern int addr32_operand (rtx, Mmode); +extern int call26_operand (rtx, Mmode); +extern int seth_add3_operand (rtx, Mmode); +extern int cmp_int16_operand (rtx, Mmode); +extern int uint16_operand (rtx, Mmode); +extern int reg_or_int16_operand (rtx, Mmode); +extern int reg_or_uint16_operand (rtx, Mmode); +extern int reg_or_cmp_int16_operand (rtx, Mmode); +extern int two_insn_const_operand (rtx, Mmode); +extern int move_src_operand (rtx, Mmode); +extern int move_double_src_operand (rtx, Mmode); +extern int move_dest_operand (rtx, Mmode); +extern int eqne_comparison_operator (rtx, Mmode); +extern int signed_comparison_operator (rtx, Mmode); +extern int memreg_operand (rtx, Mmode); +extern int small_insn_p (rtx, Mmode); +extern int large_insn_p (rtx, Mmode); +extern int conditional_move_operand (rtx, Mmode); +extern int carry_compare_operand (rtx, Mmode); +extern int m32r_block_immediate_operand (rtx, Mmode); +extern int extend_operand (rtx, Mmode); +extern int reg_or_eq_int16_operand (rtx, Mmode); +extern int int8_operand (rtx, Mmode); +extern int reg_or_zero_operand (rtx, Mmode); #endif /* HAVE_MACHINE_MODES */ #ifdef TREE_CODE -extern struct rtx_def * m32r_va_arg PARAMS ((tree, tree)); -extern int m32r_pass_by_reference PARAMS ((tree)); +extern struct rtx_def * m32r_va_arg (tree, tree); +extern int m32r_pass_by_reference (tree); #endif /* TREE_CODE */ #endif /* RTX_CODE */ diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index dfea2fc74be..a5a2b26cf09 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1,23 +1,23 @@ -/* Subroutines used for code generation on the Mitsubishi M32R cpu. +/* Subroutines used for code generation on the Renesas M32R cpu. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -This file is part of GCC. + 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 2, or (at your option) -any later version. + 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 2, 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. + 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 COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" @@ -69,66 +69,66 @@ static int m32r_sched_odd_word_p; #define LIT_NAME_P(NAME) ((NAME)[0] == '*' && (NAME)[1] == '.') /* Forward declaration. */ -static void init_reg_tables PARAMS ((void)); -static void block_move_call PARAMS ((rtx, rtx, rtx)); -static int m32r_is_insn PARAMS ((rtx)); +static void init_reg_tables (void); +static void block_move_call (rtx, rtx, rtx); +static int m32r_is_insn (rtx); const struct attribute_spec m32r_attribute_table[]; -static tree m32r_handle_model_attribute PARAMS ((tree *, tree, tree, int, bool *)); -static void m32r_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void m32r_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); - -static void m32r_file_start PARAMS ((void)); - -static int m32r_adjust_cost PARAMS ((rtx, rtx, rtx, int)); -static int m32r_adjust_priority PARAMS ((rtx, int)); -static void m32r_sched_init PARAMS ((FILE *, int, int)); -static int m32r_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int)); -static int m32r_variable_issue PARAMS ((FILE *, int, rtx, int)); -static int m32r_issue_rate PARAMS ((void)); - -static void m32r_encode_section_info PARAMS ((tree, rtx, int)); -static bool m32r_in_small_data_p PARAMS ((tree)); -static void init_idents PARAMS ((void)); -static bool m32r_rtx_costs PARAMS ((rtx, int, int, int *)); +static tree m32r_handle_model_attribute (tree *, tree, tree, int, bool *); +static void m32r_output_function_prologue (FILE *, HOST_WIDE_INT); +static void m32r_output_function_epilogue (FILE *, HOST_WIDE_INT); + +static void m32r_file_start (void); + +static int m32r_adjust_cost (rtx, rtx, rtx, int); +static int m32r_adjust_priority (rtx, int); +static void m32r_sched_init (FILE *, int, int); +static int m32r_sched_reorder (FILE *, int, rtx *, int *, int); +static int m32r_variable_issue (FILE *, int, rtx, int); +static int m32r_issue_rate (void); + +static void m32r_encode_section_info (tree, rtx, int); +static bool m32r_in_small_data_p (tree); +static void init_idents (void); +static bool m32r_rtx_costs (rtx, int, int, int *); /* Initialize the GCC target structure. */ -#undef TARGET_ATTRIBUTE_TABLE +#undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE m32r_attribute_table -#undef TARGET_ASM_ALIGNED_HI_OP +#undef TARGET_ASM_ALIGNED_HI_OP #define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t" -#undef TARGET_ASM_ALIGNED_SI_OP +#undef TARGET_ASM_ALIGNED_SI_OP #define TARGET_ASM_ALIGNED_SI_OP "\t.word\t" -#undef TARGET_ASM_FUNCTION_PROLOGUE +#undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE m32r_output_function_prologue -#undef TARGET_ASM_FUNCTION_EPILOGUE +#undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE m32r_output_function_epilogue -#undef TARGET_ASM_FILE_START +#undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START m32r_file_start -#undef TARGET_SCHED_ADJUST_COST +#undef TARGET_SCHED_ADJUST_COST #define TARGET_SCHED_ADJUST_COST m32r_adjust_cost -#undef TARGET_SCHED_ADJUST_PRIORITY +#undef TARGET_SCHED_ADJUST_PRIORITY #define TARGET_SCHED_ADJUST_PRIORITY m32r_adjust_priority -#undef TARGET_SCHED_ISSUE_RATE +#undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE m32r_issue_rate -#undef TARGET_SCHED_VARIABLE_ISSUE +#undef TARGET_SCHED_VARIABLE_ISSUE #define TARGET_SCHED_VARIABLE_ISSUE m32r_variable_issue -#undef TARGET_SCHED_INIT +#undef TARGET_SCHED_INIT #define TARGET_SCHED_INIT m32r_sched_init -#undef TARGET_SCHED_REORDER +#undef TARGET_SCHED_REORDER #define TARGET_SCHED_REORDER m32r_sched_reorder -#undef TARGET_ENCODE_SECTION_INFO +#undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info -#undef TARGET_IN_SMALL_DATA_P +#undef TARGET_IN_SMALL_DATA_P #define TARGET_IN_SMALL_DATA_P m32r_in_small_data_p -#undef TARGET_RTX_COSTS +#undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m32r_rtx_costs -#undef TARGET_ADDRESS_COST +#undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_0 struct gcc_target targetm = TARGET_INITIALIZER; @@ -136,7 +136,7 @@ struct gcc_target targetm = TARGET_INITIALIZER; /* Called by OVERRIDE_OPTIONS to initialize various things. */ void -m32r_init () +m32r_init (void) { init_reg_tables (); @@ -213,7 +213,7 @@ unsigned int m32r_mode_class [NUM_MACHINE_MODES]; enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; static void -init_reg_tables () +init_reg_tables (void) { int i; @@ -278,8 +278,7 @@ init_reg_tables () medium: addresses use 32 bits, use bl to make calls large: addresses use 32 bits, use seth/add3/jl to make calls - Grep for MODEL in m32r.h for more info. -*/ + Grep for MODEL in m32r.h for more info. */ static tree small_ident1; static tree small_ident2; @@ -289,7 +288,7 @@ static tree large_ident1; static tree large_ident2; static void -init_idents () +init_idents (void) { if (small_ident1 == 0) { @@ -314,12 +313,9 @@ const struct attribute_spec m32r_attribute_table[] = /* Handle an "model" attribute; arguments as in struct attribute_spec.handler. */ static tree -m32r_handle_model_attribute (node, name, args, flags, no_add_attrs) - tree *node ATTRIBUTE_UNUSED; - tree name; - tree args; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +m32r_handle_model_attribute (tree *node ATTRIBUTE_UNUSED, tree name, + tree args, int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { tree arg; @@ -351,10 +347,7 @@ m32r_handle_model_attribute (node, name, args, flags, no_add_attrs) */ static void -m32r_encode_section_info (decl, rtl, first) - tree decl; - rtx rtl; - int first; +m32r_encode_section_info (tree decl, rtx rtl, int first) { int extra_flags = 0; tree model_attr; @@ -411,8 +404,7 @@ m32r_encode_section_info (decl, rtl, first) the object doesn't fit the linker will give an error. */ static bool -m32r_in_small_data_p (decl) - tree decl; +m32r_in_small_data_p (tree decl) { tree section; @@ -446,7 +438,7 @@ m32r_in_small_data_p (decl) /* Do anything needed before RTL is emitted for each function. */ void -m32r_init_expanders () +m32r_init_expanders (void) { /* ??? At one point there was code here. The function is left in to make it easy to experiment. */ @@ -455,9 +447,7 @@ m32r_init_expanders () /* Acceptable arguments to the call insn. */ int -call_address_operand (op, mode) - rtx op; - enum machine_mode mode; +call_address_operand (rtx op, enum machine_mode mode) { return symbolic_operand (op, mode); @@ -466,9 +456,7 @@ call_address_operand (op, mode) } int -call_operand (op, mode) - rtx op; - enum machine_mode mode; +call_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != MEM) return 0; @@ -479,9 +467,7 @@ call_operand (op, mode) /* Returns 1 if OP is a symbol reference. */ int -symbolic_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -498,9 +484,7 @@ symbolic_operand (op, mode) /* Return 1 if OP is a reference to an object in .sdata/.sbss. */ int -small_data_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +small_data_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (! TARGET_SDATA_USE) return 0; @@ -521,9 +505,7 @@ small_data_operand (op, mode) /* Return 1 if OP is a symbol that can use 24 bit addressing. */ int -addr24_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +addr24_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { rtx sym; @@ -555,9 +537,7 @@ addr24_operand (op, mode) /* Return 1 if OP is a symbol that needs 32 bit addressing. */ int -addr32_operand (op, mode) - rtx op; - enum machine_mode mode; +addr32_operand (rtx op, enum machine_mode mode) { rtx sym; @@ -581,9 +561,7 @@ addr32_operand (op, mode) /* Return 1 if OP is a function that can be called with the `bl' insn. */ int -call26_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +call26_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) == SYMBOL_REF) return SYMBOL_REF_MODEL (op) != M32R_MODEL_LARGE; @@ -594,9 +572,7 @@ call26_operand (op, mode) /* Returns 1 if OP is an acceptable operand for seth/add3. */ int -seth_add3_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +seth_add3_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) @@ -615,9 +591,7 @@ seth_add3_operand (op, mode) /* Return true if OP is a signed 8 bit immediate value. */ int -int8_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +int8_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return 0; @@ -628,9 +602,7 @@ int8_operand (op, mode) useful in comparisons. */ int -cmp_int16_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +cmp_int16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return 0; @@ -640,9 +612,7 @@ cmp_int16_operand (op, mode) /* Return true if OP is an unsigned 16 bit immediate value. */ int -uint16_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +uint16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return 0; @@ -652,9 +622,7 @@ uint16_operand (op, mode) /* Return true if OP is a register or signed 16 bit value. */ int -reg_or_int16_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_int16_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) return register_operand (op, mode); @@ -666,9 +634,7 @@ reg_or_int16_operand (op, mode) /* Return true if OP is a register or an unsigned 16 bit value. */ int -reg_or_uint16_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_uint16_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) return register_operand (op, mode); @@ -683,9 +649,7 @@ reg_or_uint16_operand (op, mode) because that is special cased. */ int -reg_or_eq_int16_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_eq_int16_operand (rtx op, enum machine_mode mode) { HOST_WIDE_INT value; @@ -702,9 +666,7 @@ reg_or_eq_int16_operand (op, mode) /* Return true if OP is a register or signed 16 bit value for compares. */ int -reg_or_cmp_int16_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_cmp_int16_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) return register_operand (op, mode); @@ -716,9 +678,7 @@ reg_or_cmp_int16_operand (op, mode) /* Return true if OP is a register or the constant 0. */ int -reg_or_zero_operand (op, mode) - rtx op; - enum machine_mode mode; +reg_or_zero_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) return register_operand (op, mode); @@ -732,9 +692,7 @@ reg_or_zero_operand (op, mode) /* Return true if OP is a const_int requiring two instructions to load. */ int -two_insn_const_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +two_insn_const_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT) return 0; @@ -749,9 +707,7 @@ two_insn_const_operand (op, mode) move source. */ int -move_src_operand (op, mode) - rtx op; - enum machine_mode mode; +move_src_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -809,9 +765,7 @@ move_src_operand (op, mode) move source. */ int -move_double_src_operand (op, mode) - rtx op; - enum machine_mode mode; +move_double_src_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -841,9 +795,7 @@ move_double_src_operand (op, mode) /* Return true if OP is an acceptable argument for a move destination. */ int -move_dest_operand (op, mode) - rtx op; - enum machine_mode mode; +move_dest_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -870,8 +822,7 @@ move_dest_operand (op, mode) It is used by the 'G' CONST_DOUBLE_OK_FOR_LETTER. */ int -easy_di_const (op) - rtx op; +easy_di_const (rtx op) { rtx high_rtx, low_rtx; HOST_WIDE_INT high, low; @@ -891,8 +842,7 @@ easy_di_const (op) It is used by the 'H' CONST_DOUBLE_OK_FOR_LETTER. */ int -easy_df_const (op) - rtx op; +easy_df_const (rtx op) { REAL_VALUE_TYPE r; long l[2]; @@ -909,9 +859,7 @@ easy_df_const (op) /* Return 1 if OP is an EQ or NE comparison operator. */ int -eqne_comparison_operator (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +eqne_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { enum rtx_code code = GET_CODE (op); @@ -923,9 +871,7 @@ eqne_comparison_operator (op, mode) /* Return 1 if OP is a signed comparison operator. */ int -signed_comparison_operator (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +signed_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { enum rtx_code code = GET_CODE (op); @@ -939,9 +885,7 @@ signed_comparison_operator (op, mode) This is used in insn length calcs. */ int -memreg_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +memreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG; } @@ -950,9 +894,7 @@ memreg_operand (op, mode) operation. */ int -extend_operand (op, mode) - rtx op; - enum machine_mode mode; +extend_operand (rtx op, enum machine_mode mode) { rtx addr; @@ -978,9 +920,7 @@ extend_operand (op, mode) Allow const_int 0 as well, which is a placeholder for NOP slots. */ int -small_insn_p (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +small_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) return 1; @@ -994,9 +934,7 @@ small_insn_p (op, mode) /* Return nonzero if the operand is an insn that is a large insn. */ int -large_insn_p (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +large_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (! INSN_P (op)) return 0; @@ -1009,8 +947,7 @@ large_insn_p (op, mode) in this function. */ int -m32r_pass_by_reference (type) - tree type; +m32r_pass_by_reference (tree type) { int size = int_size_in_bytes (type); @@ -1028,12 +965,10 @@ m32r_pass_by_reference (type) than being subsumed into the following branch instruction. */ rtx -gen_compare (code, x, y, need_compare) - enum rtx_code code; - rtx x, y; - int need_compare; +gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) { - enum rtx_code compare_code, branch_code; + enum rtx_code compare_code; + enum rtx_code branch_code; rtx cc_reg = gen_rtx_REG (CCmode, CARRY_REGNUM); int must_swap = 0; @@ -1060,23 +995,23 @@ gen_compare (code, x, y, need_compare) { case EQ: if (GET_CODE (y) == CONST_INT - && CMP_INT16_P (INTVAL (y)) /* reg equal to small const. */ + && CMP_INT16_P (INTVAL (y)) /* Reg equal to small const. */ && y != const0_rtx) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_cmp_ne_small_const_insn (tmp, x, y)); + emit_insn (gen_addsi3 (tmp, x, GEN_INT (-INTVAL (y)))); x = tmp; y = const0_rtx; } - else if (CONSTANT_P (y)) /* reg equal to const. */ + else if (CONSTANT_P (y)) /* Reg equal to const. */ { rtx tmp = force_reg (GET_MODE (x), y); y = tmp; } - if (register_operand (y, SImode) /* reg equal to reg. */ - || y == const0_rtx) /* req equal to zero. */ + if (register_operand (y, SImode) /* Reg equal to reg. */ + || y == const0_rtx) /* Reg equal to zero. */ { emit_insn (gen_cmp_eqsi_insn (x, y)); @@ -1088,7 +1023,7 @@ gen_compare (code, x, y, need_compare) if (register_operand (y, SImode) || (GET_CODE (y) == CONST_INT && CMP_INT16_P (INTVAL (y)))) { - rtx tmp = gen_reg_rtx (SImode); /* reg compared to reg. */ + rtx tmp = gen_reg_rtx (SImode); /* Reg compared to reg. */ switch (code) { @@ -1100,7 +1035,7 @@ gen_compare (code, x, y, need_compare) if (y == const0_rtx) tmp = const1_rtx; else - emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx)); + emit_insn (gen_addsi3 (tmp, y, constm1_rtx)); emit_insn (gen_cmp_ltsi_insn (x, tmp)); code = EQ; break; @@ -1108,7 +1043,7 @@ gen_compare (code, x, y, need_compare) if (GET_CODE (y) == CONST_INT) tmp = gen_rtx (PLUS, SImode, y, const1_rtx); else - emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx)); + emit_insn (gen_addsi3 (tmp, y, constm1_rtx)); emit_insn (gen_cmp_ltsi_insn (x, tmp)); code = NE; break; @@ -1128,7 +1063,7 @@ gen_compare (code, x, y, need_compare) if (register_operand (y, SImode) || (GET_CODE (y) == CONST_INT && CMP_INT16_P (INTVAL (y)))) { - rtx tmp = gen_reg_rtx (SImode); /* reg (unsigned) compared to reg. */ + rtx tmp = gen_reg_rtx (SImode); /* Reg (unsigned) compared to reg. */ switch (code) { @@ -1140,7 +1075,7 @@ gen_compare (code, x, y, need_compare) if (y == const0_rtx) tmp = const1_rtx; else - emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx)); + emit_insn (gen_addsi3 (tmp, y, constm1_rtx)); emit_insn (gen_cmp_ltusi_insn (x, tmp)); code = EQ; break; @@ -1148,7 +1083,7 @@ gen_compare (code, x, y, need_compare) if (GET_CODE (y) == CONST_INT) tmp = gen_rtx (PLUS, SImode, y, const1_rtx); else - emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx)); + emit_insn (gen_addsi3 (tmp, y, constm1_rtx)); emit_insn (gen_cmp_ltusi_insn (x, tmp)); code = NE; break; @@ -1170,31 +1105,33 @@ gen_compare (code, x, y, need_compare) } else { - /* reg/reg equal comparison */ + /* Reg/reg equal comparison. */ if (compare_code == EQ && register_operand (y, SImode)) return gen_rtx (code, CCmode, x, y); - /* reg/zero signed comparison */ + /* Reg/zero signed comparison. */ if ((compare_code == EQ || compare_code == LT) && y == const0_rtx) return gen_rtx (code, CCmode, x, y); - /* reg/smallconst equal comparison */ + /* Reg/smallconst equal comparison. */ if (compare_code == EQ && GET_CODE (y) == CONST_INT && CMP_INT16_P (INTVAL (y))) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_cmp_ne_small_const_insn (tmp, x, y)); + + emit_insn (gen_addsi3 (tmp, x, GEN_INT (-INTVAL (y)))); return gen_rtx (code, CCmode, tmp, const0_rtx); } - /* reg/const equal comparison */ + /* Reg/const equal comparison. */ if (compare_code == EQ && CONSTANT_P (y)) { rtx tmp = force_reg (GET_MODE (x), y); + return gen_rtx (code, CCmode, x, tmp); } } @@ -1237,8 +1174,7 @@ gen_compare (code, x, y, need_compare) /* Split a 2 word move (DI or DF) into component parts. */ rtx -gen_split_move_double (operands) - rtx operands[]; +gen_split_move_double (rtx operands[]) { enum machine_mode mode = GET_MODE (operands[0]); rtx dest = operands[0]; @@ -1258,7 +1194,7 @@ gen_split_move_double (operands) { int dregno = REGNO (dest); - /* reg = reg */ + /* Reg = reg. */ if (GET_CODE (src) == REG) { int sregno = REGNO (src); @@ -1277,7 +1213,7 @@ gen_split_move_double (operands) operand_subword (src, !reverse, TRUE, mode))); } - /* reg = constant */ + /* Reg = constant. */ else if (GET_CODE (src) == CONST_INT || GET_CODE (src) == CONST_DOUBLE) { rtx words[2]; @@ -1291,7 +1227,7 @@ gen_split_move_double (operands) words[1])); } - /* reg = mem */ + /* Reg = mem. */ else if (GET_CODE (src) == MEM) { /* If the high-address word is used in the address, we must load it @@ -1320,12 +1256,11 @@ gen_split_move_double (operands) adjust_address (src, SImode, !reverse * UNITS_PER_WORD))); } - else abort (); } - /* mem = reg */ + /* Mem = reg. */ /* We used to optimize loads from single registers as st r1,r3; st r2,+r3 @@ -1360,11 +1295,8 @@ gen_split_move_double (operands) /* Implements the FUNCTION_ARG_PARTIAL_NREGS macro. */ int -function_arg_partial_nregs (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type; - int named ATTRIBUTE_UNUSED; +function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named ATTRIBUTE_UNUSED) { int ret; unsigned int size = @@ -1391,12 +1323,8 @@ function_arg_partial_nregs (cum, mode, type, named) and mode MODE, and we rely on this fact. */ void -m32r_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type; - int *pretend_size; - int no_rtl; +m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int *pretend_size, int no_rtl) { int first_anon_arg; @@ -1432,8 +1360,7 @@ m32r_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) /* Implement `va_arg'. */ rtx -m32r_va_arg (valist, type) - tree valist, type; +m32r_va_arg (tree valist, tree type) { HOST_WIDE_INT size, rsize; tree t; @@ -1447,7 +1374,6 @@ m32r_va_arg (valist, type) tree type_ptr, type_ptr_ptr; /* Pass by reference. */ - type_ptr = build_pointer_type (type); type_ptr_ptr = build_pointer_type (type_ptr); @@ -1463,7 +1389,6 @@ m32r_va_arg (valist, type) else { /* Pass by value. */ - if (size < UNITS_PER_WORD) { /* Care for bigendian correction on the aligned address. */ @@ -1492,11 +1417,8 @@ m32r_va_arg (valist, type) } static int -m32r_adjust_cost (insn, link, dep_insn, cost) - rtx insn ATTRIBUTE_UNUSED; - rtx link ATTRIBUTE_UNUSED; - rtx dep_insn ATTRIBUTE_UNUSED; - int cost; +m32r_adjust_cost (rtx insn ATTRIBUTE_UNUSED, rtx link ATTRIBUTE_UNUSED, + rtx dep_insn ATTRIBUTE_UNUSED, int cost) { return cost; } @@ -1505,8 +1427,7 @@ m32r_adjust_cost (insn, link, dep_insn, cost) /* Return true if INSN is real instruction bearing insn. */ static int -m32r_is_insn (insn) - rtx insn; +m32r_is_insn (rtx insn) { return (INSN_P (insn) && GET_CODE (PATTERN (insn)) != USE @@ -1518,9 +1439,7 @@ m32r_is_insn (insn) short instructions are scheduled ahead of the long ones. */ static int -m32r_adjust_priority (insn, priority) - rtx insn; - int priority; +m32r_adjust_priority (rtx insn, int priority) { if (m32r_is_insn (insn) && get_attr_insn_size (insn) != INSN_SIZE_SHORT) @@ -1533,10 +1452,9 @@ m32r_adjust_priority (insn, priority) /* Initialize for scheduling a group of instructions. */ static void -m32r_sched_init (stream, verbose, max_ready) - FILE * stream ATTRIBUTE_UNUSED; - int verbose ATTRIBUTE_UNUSED; - int max_ready ATTRIBUTE_UNUSED; +m32r_sched_init (FILE * stream ATTRIBUTE_UNUSED, + int verbose ATTRIBUTE_UNUSED, + int max_ready ATTRIBUTE_UNUSED) { m32r_sched_odd_word_p = FALSE; } @@ -1545,12 +1463,8 @@ m32r_sched_init (stream, verbose, max_ready) /* Reorder the schedulers priority list if needed */ static int -m32r_sched_reorder (stream, verbose, ready, n_readyp, clock) - FILE * stream; - int verbose; - rtx * ready; - int *n_readyp; - int clock ATTRIBUTE_UNUSED; +m32r_sched_reorder (FILE * stream, int verbose, rtx * ready, + int *n_readyp, int clock ATTRIBUTE_UNUSED) { int n_ready = *n_readyp; @@ -1568,11 +1482,11 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock) if (n_ready > 1) { - rtx * long_head = (rtx *) alloca (sizeof (rtx) * n_ready); + rtx * long_head = alloca (sizeof (rtx) * n_ready); rtx * long_tail = long_head; - rtx * short_head = (rtx *) alloca (sizeof (rtx) * n_ready); + rtx * short_head = alloca (sizeof (rtx) * n_ready); rtx * short_tail = short_head; - rtx * new_head = (rtx *) alloca (sizeof (rtx) * n_ready); + rtx * new_head = alloca (sizeof (rtx) * n_ready); rtx * new_tail = new_head + (n_ready - 1); int i; @@ -1611,19 +1525,19 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock) } /* If we are on an odd word, emit a single short instruction if - we can */ + we can. */ if (m32r_sched_odd_word_p && short_head != short_tail) *new_tail-- = *short_head++; - /* Now dump out all of the long instructions */ + /* Now dump out all of the long instructions. */ while (long_head != long_tail) *new_tail-- = *long_head++; - /* Now dump out all of the short instructions */ + /* Now dump out all of the short instructions. */ while (short_head != short_tail) *new_tail-- = *short_head++; - if (new_tail+1 != new_head) + if (new_tail + 1 != new_head) abort (); memcpy (ready, new_head, sizeof (rtx) * n_ready); @@ -1657,9 +1571,10 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock) This is sort of a lie. The m32r can issue only 1 long insn at once, but it can issue 2 short insns. The default therefore is set at 2, but this can be overridden by the command line option - -missue-rate=1 */ + -missue-rate=1. */ + static int -m32r_issue_rate () +m32r_issue_rate (void) { return ((TARGET_LOW_ISSUE_RATE) ? 1 : 2); } @@ -1667,12 +1582,9 @@ m32r_issue_rate () /* If we have a machine that can issue a variable # of instructions per cycle, indicate how many more instructions can be issued after the current one. */ + static int -m32r_variable_issue (stream, verbose, insn, how_many) - FILE * stream; - int verbose; - rtx insn; - int how_many; +m32r_variable_issue (FILE * stream, int verbose, rtx insn, int how_many) { int orig_odd_word_p = m32r_sched_odd_word_p; int short_p = FALSE; @@ -1709,10 +1621,7 @@ m32r_variable_issue (stream, verbose, insn, how_many) /* Cost functions. */ static bool -m32r_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code ATTRIBUTE_UNUSED; - int *total; +m32r_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) { switch (code) { @@ -1736,6 +1645,7 @@ m32r_rtx_costs (x, code, outer_code, total) case CONST_DOUBLE: { rtx high, low; + split_double (x, &high, &low); *total = COSTS_N_INSNS (!INT16_P (INTVAL (high)) + !INT16_P (INTVAL (low))); @@ -1764,8 +1674,7 @@ m32r_rtx_costs (x, code, outer_code, total) call with DECL = NULL_TREE. */ enum m32r_function_type -m32r_compute_function_type (decl) - tree decl; +m32r_compute_function_type (tree decl) { /* Cached value. */ static enum m32r_function_type fn_type = M32R_FUNCTION_UNKNOWN; @@ -1838,23 +1747,22 @@ Notes: containing anonymous args separately but that complicates things too much (so it's not done). 3) The return address is saved after the register save area so as to have as - many insns as possible between the restoration of `lr' and the `jmp lr'. -*/ + many insns as possible between the restoration of `lr' and the `jmp lr'. */ /* Structure to be filled in by m32r_compute_frame_size with register save masks, and offsets for the current function. */ struct m32r_frame_info { - unsigned int total_size; /* # bytes that the entire frame takes up */ - unsigned int extra_size; /* # bytes of extra stuff */ - unsigned int pretend_size; /* # bytes we push and pretend caller did */ - unsigned int args_size; /* # bytes that outgoing arguments take up */ - unsigned int reg_size; /* # bytes needed to store regs */ - unsigned int var_size; /* # bytes that variables take up */ - unsigned int gmask; /* mask of saved gp registers */ - unsigned int save_fp; /* nonzero if fp must be saved */ - unsigned int save_lr; /* nonzero if lr (return addr) must be saved */ - int initialized; /* nonzero if frame size already calculated */ + unsigned int total_size; /* # bytes that the entire frame takes up. */ + unsigned int extra_size; /* # bytes of extra stuff. */ + unsigned int pretend_size; /* # bytes we push and pretend caller did. */ + unsigned int args_size; /* # bytes that outgoing arguments take up. */ + unsigned int reg_size; /* # bytes needed to store regs. */ + unsigned int var_size; /* # bytes that variables take up. */ + unsigned int gmask; /* Mask of saved gp registers. */ + unsigned int save_fp; /* Nonzero if fp must be saved. */ + unsigned int save_lr; /* Nonzero if lr (return addr) must be saved. */ + int initialized; /* Nonzero if frame size already calculated. */ }; /* Current frame information calculated by m32r_compute_frame_size. */ @@ -1864,7 +1772,7 @@ static struct m32r_frame_info current_frame_info; static struct m32r_frame_info zero_frame_info; #define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM)) -#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM)) +#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM)) /* Tell prologue and epilogue if register REGNO should be saved / restored. The return address and frame pointer are treated separately. @@ -1874,10 +1782,10 @@ static struct m32r_frame_info zero_frame_info; && (regs_ever_live[regno] && (!call_used_regs[regno] || interrupt_p))) #define MUST_SAVE_FRAME_POINTER (regs_ever_live[FRAME_POINTER_REGNUM]) -#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM] || current_function_profile) +#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM] || current_function_profile) -#define SHORT_INSN_SIZE 2 /* size of small instructions */ -#define LONG_INSN_SIZE 4 /* size of long instructions */ +#define SHORT_INSN_SIZE 2 /* Size of small instructions. */ +#define LONG_INSN_SIZE 4 /* Size of long instructions. */ /* Return the bytes needed to compute the frame pointer from the current stack pointer. @@ -1885,8 +1793,7 @@ static struct m32r_frame_info zero_frame_info; SIZE is the size needed for local variables. */ unsigned int -m32r_compute_frame_size (size) - int size; /* # of var. bytes allocated. */ +m32r_compute_frame_size (int size) /* # of var. bytes allocated. */ { int regno; unsigned int total_size, var_size, args_size, pretend_size, extra_size; @@ -1909,7 +1816,6 @@ m32r_compute_frame_size (size) interrupt_p = M32R_INTERRUPT_P (fn_type); /* Calculate space needed for registers. */ - for (regno = 0; regno < M32R_MAX_INT_REGS; regno++) { if (MUST_SAVE_REGISTER (regno, interrupt_p)) @@ -1951,7 +1857,7 @@ m32r_compute_frame_size (size) function. If not specified, 0 is used. */ int -m32r_first_insn_address () +m32r_first_insn_address (void) { if (! current_frame_info.initialized) m32r_compute_frame_size (get_frame_size ()); @@ -1962,7 +1868,7 @@ m32r_first_insn_address () /* Expand the m32r prologue as a series of insns. */ void -m32r_expand_prologue () +m32r_expand_prologue (void) { int regno; int frame_size; @@ -1989,7 +1895,6 @@ m32r_expand_prologue () } /* Save any registers we need to and set up fp. */ - if (current_frame_info.save_fp) emit_insn (gen_movsi_push (stack_pointer_rtx, frame_pointer_rtx)); @@ -2014,13 +1919,14 @@ m32r_expand_prologue () + current_frame_info.reg_size)); if (frame_size == 0) - ; /* nothing to do */ + ; /* Nothing to do. */ else if (frame_size <= 32768) emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (-frame_size))); else { rtx tmp = gen_rtx_REG (Pmode, PROLOGUE_TMP_REGNUM); + emit_insn (gen_movsi (tmp, GEN_INT (frame_size))); emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, tmp)); } @@ -2038,18 +1944,13 @@ m32r_expand_prologue () m32r_compute_frame_size which calculates the prolog size. */ static void -m32r_output_function_prologue (file, size) - FILE * file; - HOST_WIDE_INT size; +m32r_output_function_prologue (FILE * file, HOST_WIDE_INT size) { enum m32r_function_type fn_type = m32r_compute_function_type (current_function_decl); /* If this is an interrupt handler, mark it as such. */ if (M32R_INTERRUPT_P (fn_type)) - { - fprintf (file, "\t%s interrupt handler\n", - ASM_COMMENT_START); - } + fprintf (file, "\t%s interrupt handler\n", ASM_COMMENT_START); if (! current_frame_info.initialized) m32r_compute_frame_size (size); @@ -2068,9 +1969,7 @@ m32r_output_function_prologue (file, size) and regs. */ static void -m32r_output_function_epilogue (file, size) - FILE * file; - HOST_WIDE_INT size ATTRIBUTE_UNUSED; +m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { int regno; int noepilogue = FALSE; @@ -2111,7 +2010,7 @@ m32r_output_function_epilogue (file, size) { unsigned int reg_offset = var_size + args_size; if (reg_offset == 0) - ; /* nothing to do */ + ; /* Nothing to do. */ else if (reg_offset < 128) fprintf (file, "\taddi %s,%s%d\n", sp_str, IMMEDIATE_PREFIX, reg_offset); @@ -2127,6 +2026,7 @@ m32r_output_function_epilogue (file, size) else if (frame_pointer_needed) { unsigned int reg_offset = var_size + args_size; + if (reg_offset == 0) fprintf (file, "\tmv %s,%s\n", sp_str, fp_str); else if (reg_offset < 32768) @@ -2167,11 +2067,6 @@ m32r_output_function_epilogue (file, size) fprintf (file, "\tjmp %s\n", reg_names[RETURN_ADDR_REGNUM]); } -#if 0 /* no longer needed */ - /* Ensure the function cleanly ends on a 32 bit boundary. */ - fprintf (file, "\t.fillinsn\n"); -#endif - /* Reset state info for each function. */ current_frame_info = zero_frame_info; m32r_compute_function_type (NULL_TREE); @@ -2181,7 +2076,7 @@ m32r_output_function_epilogue (file, size) epilogue. */ int -direct_return () +direct_return (void) { if (!reload_completed) return FALSE; @@ -2193,14 +2088,14 @@ direct_return () } -/* PIC */ +/* PIC. */ /* Emit special PIC prologues and epilogues. */ void -m32r_finalize_pic () +m32r_finalize_pic (void) { - /* nothing to do */ + /* Nothing to do. */ } /* Nested function support. */ @@ -2210,15 +2105,14 @@ m32r_finalize_pic () CXT is an RTX for the static chain value for the function. */ void -m32r_initialize_trampoline (tramp, fnaddr, cxt) - rtx tramp ATTRIBUTE_UNUSED; - rtx fnaddr ATTRIBUTE_UNUSED; - rtx cxt ATTRIBUTE_UNUSED; +m32r_initialize_trampoline (rtx tramp ATTRIBUTE_UNUSED, + rtx fnaddr ATTRIBUTE_UNUSED, + rtx cxt ATTRIBUTE_UNUSED) { } static void -m32r_file_start () +m32r_file_start (void) { default_file_start (); @@ -2233,10 +2127,7 @@ m32r_file_start () For `%' followed by punctuation, CODE is the punctuation and X is null. */ void -m32r_print_operand (file, x, code) - FILE * file; - rtx x; - int code; +m32r_print_operand (FILE * file, rtx x, int code) { rtx addr; @@ -2281,11 +2172,11 @@ m32r_print_operand (file, x, code) output_operand_lossage ("invalid operand to %%R code"); return; - case 'H' : /* High word */ - case 'L' : /* Low word */ + case 'H' : /* High word. */ + case 'L' : /* Low word. */ if (GET_CODE (x) == REG) { - /* L = least significant word, H = most significant word */ + /* L = least significant word, H = most significant word. */ if ((WORDS_BIG_ENDIAN != 0) ^ (code == 'L')) fputs (reg_names[REGNO (x)], file); else @@ -2317,8 +2208,8 @@ m32r_print_operand (file, x, code) return; } - case 'B' : /* Bottom half */ - case 'T' : /* Top half */ + case 'B' : /* Bottom half. */ + case 'T' : /* Top half. */ /* Output the argument to a `seth' insn (sets the Top half-word). For constants output arguments to a seth/or3 pair to set Top and Bottom halves. For symbols output arguments to a seth/add3 pair to @@ -2393,12 +2284,6 @@ m32r_print_operand (file, x, code) fputs (IMMEDIATE_PREFIX, file); return; -#if 0 /* ??? no longer used */ - case '@' : - fputs (reg_names[SDA_REGNUM], file); - return; -#endif - case 0 : /* Do nothing special. */ break; @@ -2469,13 +2354,11 @@ m32r_print_operand (file, x, code) /* Print a memory address as an operand to reference that memory location. */ void -m32r_print_operand_address (file, addr) - FILE * file; - rtx addr; +m32r_print_operand_address (FILE * file, rtx addr) { - register rtx base; - register rtx index = 0; - int offset = 0; + rtx base; + rtx index = 0; + int offset = 0; switch (GET_CODE (addr)) { @@ -2542,15 +2425,15 @@ m32r_print_operand_address (file, addr) fputs (reg_names[REGNO (XEXP (addr, 0))], file); break; - case PRE_INC : /* Assume SImode */ + case PRE_INC : /* Assume SImode. */ fprintf (file, "+%s", reg_names[REGNO (XEXP (addr, 0))]); break; - case PRE_DEC : /* Assume SImode */ + case PRE_DEC : /* Assume SImode. */ fprintf (file, "-%s", reg_names[REGNO (XEXP (addr, 0))]); break; - case POST_INC : /* Assume SImode */ + case POST_INC : /* Assume SImode. */ fprintf (file, "%s+", reg_names[REGNO (XEXP (addr, 0))]); break; @@ -2561,10 +2444,9 @@ m32r_print_operand_address (file, addr) } /* Return true if the operands are the constants 0 and 1. */ + int -zero_and_one (operand1, operand2) - rtx operand1; - rtx operand2; +zero_and_one (rtx operand1, rtx operand2) { return GET_CODE (operand1) == CONST_INT @@ -2574,12 +2456,11 @@ zero_and_one (operand1, operand2) } /* Return nonzero if the operand is suitable for use in a conditional move sequence. */ + int -conditional_move_operand (operand, mode) - rtx operand; - enum machine_mode mode; +conditional_move_operand (rtx operand, enum machine_mode mode) { - /* Only defined for simple integers so far... */ + /* Only defined for simple integers so far... */ if (mode != SImode && mode != HImode && mode != QImode) return FALSE; @@ -2603,11 +2484,10 @@ conditional_move_operand (operand, mode) } } -/* Return true if the code is a test of the carry bit */ +/* Return true if the code is a test of the carry bit. */ + int -carry_compare_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +carry_compare_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { rtx x; @@ -2633,10 +2513,9 @@ carry_compare_operand (op, mode) conditional_move_operand() function above. The destination is operand[0]. The condition is operand [1]. The 'true' value is operand [2] and the 'false' value is operand [3]. */ + char * -emit_cond_move (operands, insn) - rtx * operands; - rtx insn ATTRIBUTE_UNUSED; +emit_cond_move (rtx * operands, rtx insn ATTRIBUTE_UNUSED) { static char buffer [100]; const char * dest = reg_names [REGNO (operands [0])]; @@ -2671,10 +2550,9 @@ emit_cond_move (operands, insn) /* Returns true if the registers contained in the two rtl expressions are different. */ + int -m32r_not_same_reg (a, b) - rtx a; - rtx b; +m32r_not_same_reg (rtx a, rtx b) { int reg_a = -1; int reg_b = -2; @@ -2696,11 +2574,9 @@ m32r_not_same_reg (a, b) /* Use a library function to move some bytes. */ + static void -block_move_call (dest_reg, src_reg, bytes_rtx) - rtx dest_reg; - rtx src_reg; - rtx bytes_rtx; +block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx) { /* We want to pass the size as Pmode, which will normally be SImode but will be DImode if we are using 64 bit longs and pointers. */ @@ -2738,8 +2614,7 @@ block_move_call (dest_reg, src_reg, bytes_rtx) operands[3] is the alignment. */ void -m32r_expand_block_move (operands) - rtx operands[]; +m32r_expand_block_move (rtx operands[]) { rtx orig_dst = operands[0]; rtx orig_src = operands[1]; @@ -2830,9 +2705,7 @@ m32r_expand_block_move (operands) operands[4] is a temp register. */ void -m32r_output_block_move (insn, operands) - rtx insn ATTRIBUTE_UNUSED; - rtx operands[]; +m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) { HOST_WIDE_INT bytes = INTVAL (operands[2]); int first_time; @@ -2947,10 +2820,9 @@ m32r_output_block_move (insn, operands) /* Return true if op is an integer constant, less than or equal to MAX_MOVE_BYTES. */ + int -m32r_block_immediate_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m32r_block_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != CONST_INT || INTVAL (op) > MAX_MOVE_BYTES @@ -2963,9 +2835,8 @@ m32r_block_immediate_operand (op, mode) /* Return true if using NEW_REG in place of OLD_REG is ok. */ int -m32r_hard_regno_rename_ok (old_reg, new_reg) - unsigned int old_reg ATTRIBUTE_UNUSED; - unsigned int new_reg; +m32r_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED, + unsigned int new_reg) { /* Interrupt routines can't clobber any register that isn't already used. */ if (lookup_attribute ("interrupt", DECL_ATTRIBUTES (current_function_decl)) diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index f3289d8ce84..1ed1f095df0 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1,23 +1,23 @@ -/* Definitions of target machine for GNU compiler, Mitsubishi M32R cpu. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +/* Definitions of target machine for GNU compiler, Renesas M32R cpu. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -This file is part of GCC. + 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 2, or (at your option) -any later version. + 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 2, 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. + 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 COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* Things to do: - longlong.h? @@ -42,14 +42,18 @@ Boston, MA 02111-1307, USA. */ /* M32R/X overrides. */ /* Print subsidiary information on the compiler version in use. */ -#define TARGET_VERSION fprintf (stderr, " (m32r/x)"); +#define TARGET_VERSION fprintf (stderr, " (m32r/x/2)"); /* Additional flags for the preprocessor. */ -#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__} %{m32r:-U__M32RX__}" +#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__ -D__m32rx__ -U__M32R2__ -U__m32r2__} \ +%{m32r2:-D__M32R2__ -D__m32r2__ -U__M32RX__ -U__m32rx__} \ +%{m32r:-U__M32RX__ -U__m32rx__ -U__M32R2__ -U__m32r2__} \ + " + /* Assembler switches. */ #define ASM_CPU_SPEC \ -"%{m32r} %{m32rx} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts" +"%{m32r} %{m32rx} %{m32r2} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts" /* Use m32rx specific crt0/crtinit/crtfini files. */ #define STARTFILE_CPU_SPEC "%{!shared:crt0.o%s} %{m32rx:m32rx/crtinit.o%s} %{!m32rx:crtinit.o%s}" @@ -58,7 +62,8 @@ Boston, MA 02111-1307, USA. */ /* Extra machine dependent switches. */ #define SUBTARGET_SWITCHES \ { "32rx", TARGET_M32RX_MASK, "Compile for the m32rx" }, \ - { "32r", -TARGET_M32RX_MASK, "" }, + { "32r2", TARGET_M32R2_MASK, "Compile for the m32r2" }, \ + { "32r", -(TARGET_M32RX_MASK+TARGET_M32R2_MASK), "" }, /* Define this macro as a C expression for the initializer of an array of strings to tell the driver program which options are defaults for this @@ -223,6 +228,12 @@ extern int target_flags; #undef TARGET_M32R #define TARGET_M32R (! TARGET_M32RX) +/* Support extended instruction set of m32r2. */ +#define TARGET_M32R2_MASK (1 << 6) +#define TARGET_M32R2 (target_flags & TARGET_M32RX_MASK) +#undef TARGET_M32R +#define TARGET_M32R (! TARGET_M32RX && ! TARGET_M32R2) + /* Macro to define tables used to set the flags. This is a list in braces of pairs in braces, each pair being { "NAME", VALUE } @@ -1710,7 +1721,6 @@ extern char m32r_punct_chars[256]; /* Generate DBX and DWARF debugging information. */ #define DBX_DEBUGGING_INFO 1 -#define DWARF_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 /* Prefer STABS (for now). */ diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index 061e524e3a7..4c9bb6f1276 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -1,17 +1,17 @@ -;; Machine description of the Mitsubishi M32R cpu for GNU C compiler -;; Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +;; Machine description of the Renesas M32R cpu for GNU C compiler +;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2003 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 2, or (at your option) -;; any later version. +;; 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 2, 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. +;; 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 COPYING. If not, write to @@ -72,8 +72,12 @@ (define_attr "m32rx" "no,yes" (const (symbol_ref "(TARGET_M32RX != 0)"))) +(define_attr "m32r2" "no,yes" + (const (symbol_ref "(TARGET_M32R2 != 0)"))) + (define_attr "m32rx_pipeline" "either,s,o,long,m32r" - (cond [(eq_attr "m32rx" "no") + (cond [(and (eq_attr "m32rx" "no") + (eq_attr "m32r2" "no")) (const_string "m32r") (eq_attr "insn_size" "!short") @@ -496,7 +500,7 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") - (match_operand:SI 1 "seth_add3_operand" "i"))] + (match_operand:SI 1 "seth_add3_operand" ""))] "TARGET_ADDR32" [(set (match_dup 0) (high:SI (match_dup 1))) @@ -1180,7 +1184,7 @@ [(set (reg:SI 17) (eq:SI (match_operand:SI 0 "register_operand" "r,r") (match_operand:SI 1 "reg_or_zero_operand" "r,P")))] - "TARGET_M32RX" + "TARGET_M32RX || TARGET_M32R2" "@ cmpeq %0, %1 cmpz %0" @@ -1237,23 +1241,6 @@ cmpui %0,%#%1" [(set_attr "type" "int2,int4") (set_attr "length" "2,4")]) - - -;; reg == small constant comparisons are best handled by putting the result -;; of the comparison in a tmp reg and then using beqz/bnez. -;; ??? The result register doesn't contain 0/STORE_FLAG_VALUE, -;; it contains 0/nonzero. - -(define_insn "cmp_ne_small_const_insn" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (ne:SI (match_operand:SI 1 "register_operand" "0,r") - (match_operand:SI 2 "cmp_int16_operand" "N,P")))] - "" - "@ - addi %0,%#%N2 - add3 %0,%1,%#%N2" - [(set_attr "type" "int2,int4") - (set_attr "length" "2,4")]) ;; These control RTL generation for conditional jump insns. @@ -1612,7 +1599,7 @@ if (! register_operand (op1, mode)) op1 = force_reg (mode, op1); - if (TARGET_M32RX) + if (TARGET_M32RX || TARGET_M32R2) { if (! reg_or_zero_operand (op2, mode)) op2 = force_reg (mode, op2); @@ -1638,7 +1625,7 @@ (eq:SI (match_operand:SI 1 "register_operand" "%r") (match_operand:SI 2 "reg_or_zero_operand" "rP"))) (clobber (reg:SI 17))] - "TARGET_M32RX" + "TARGET_M32RX || TARGET_M32R2" "#" [(set_attr "type" "multi") (set_attr "length" "6")]) @@ -1648,7 +1635,7 @@ (eq:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "reg_or_zero_operand" ""))) (clobber (reg:SI 17))] - "TARGET_M32RX" + "TARGET_M32RX || TARGET_M32R2" [(set (reg:SI 17) (eq:SI (match_dup 1) (match_dup 2))) diff --git a/gcc/config/m32r/t-m32r b/gcc/config/m32r/t-m32r index f8cff4abf5e..8770f1ea8a3 100644 --- a/gcc/config/m32r/t-m32r +++ b/gcc/config/m32r/t-m32r @@ -41,14 +41,16 @@ $(T)crtfini.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H) -o $(T)crtfini.o m32rx: mkdir $@ +m32r2: + mkdir $@ # -mmodel={small,medium} requires separate libraries. # We don't build libraries for the large model, instead we use the medium # libraries. The only difference is that the large model can handle jumps # more than 26 signed bits away. -MULTILIB_OPTIONS = mmodel=small/mmodel=medium m32r/m32rx -MULTILIB_DIRNAMES = small medium m32r m32rx +MULTILIB_OPTIONS = mmodel=small/mmodel=medium m32r/m32rx/m32r2 +MULTILIB_DIRNAMES = small medium m32r m32rx m32r2 MULTILIB_MATCHES = mmodel?medium=mmodel?large # Set MULTILIB_EXTRA_OPTS so shipped libraries have small data in .sdata and diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h index 73a539349f9..d4582ab803d 100644 --- a/gcc/config/m68hc11/m68hc11-protos.h +++ b/gcc/config/m68hc11/m68hc11-protos.h @@ -20,126 +20,118 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern int m68hc11_override_options PARAMS((void)); -extern int m68hc11_optimization_options PARAMS((int,int)); -extern void m68hc11_conditional_register_usage PARAMS((void)); -extern int hard_regno_mode_ok PARAMS((int, enum machine_mode)); -extern int m68hc11_hard_regno_rename_ok PARAMS((int, int)); +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); -extern int m68hc11_total_frame_size PARAMS((void)); -extern int m68hc11_initial_frame_pointer_offset PARAMS((void)); -extern int m68hc11_initial_elimination_offset PARAMS((int, int)); +extern int m68hc11_total_frame_size (void); +extern int m68hc11_initial_frame_pointer_offset (void); +extern int m68hc11_initial_elimination_offset (int, int); -extern void expand_prologue PARAMS((void)); -extern void expand_epilogue PARAMS((void)); +extern void expand_prologue (void); +extern void expand_epilogue (void); #ifdef TREE_CODE -extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*, - enum machine_mode, - tree, - int)); +extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*, + enum machine_mode, + tree, + int); #endif #ifdef RTX_CODE -extern void m68hc11_initialize_trampoline PARAMS((rtx, rtx, rtx)); +extern void m68hc11_initialize_trampoline (rtx, rtx, rtx); -extern rtx m68hc11_expand_compare_and_branch PARAMS((enum rtx_code, - rtx, rtx, rtx)); -extern enum reg_class preferred_reload_class PARAMS((rtx, enum reg_class)); +extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx); +extern enum reg_class preferred_reload_class (rtx, enum reg_class); -extern int m68hc11_go_if_legitimate_address PARAMS((rtx, - enum machine_mode, - int)); +extern int m68hc11_go_if_legitimate_address (rtx, enum machine_mode, int); -extern int m68hc11_legitimize_address PARAMS((rtx*, rtx, enum machine_mode)); +extern int m68hc11_legitimize_address (rtx*, rtx, enum machine_mode); -extern void m68hc11_notice_update_cc PARAMS((rtx, rtx)); -extern void m68hc11_notice_keep_cc PARAMS((rtx)); +extern void m68hc11_notice_update_cc (rtx, rtx); +extern void m68hc11_notice_keep_cc (rtx); -extern void m68hc11_gen_movqi PARAMS((rtx, rtx*)); -extern void m68hc11_gen_movhi PARAMS((rtx, rtx*)); -extern void m68hc11_gen_rotate PARAMS((enum rtx_code, rtx, rtx*)); +extern void m68hc11_gen_movqi (rtx, rtx*); +extern void m68hc11_gen_movhi (rtx, rtx*); +extern void m68hc11_gen_rotate (enum rtx_code, rtx, rtx*); -extern void m68hc11_output_swap PARAMS((rtx,rtx*)); +extern void m68hc11_output_swap (rtx, rtx*); -extern int next_insn_test_reg PARAMS((rtx,rtx)); +extern int next_insn_test_reg (rtx, rtx); -extern void print_operand PARAMS((FILE*,rtx,int)); -extern void print_operand_address PARAMS((FILE*,rtx)); +extern void print_operand (FILE*, rtx, int); +extern void print_operand_address (FILE*, rtx); -extern int m68hc11_reload_operands PARAMS((rtx*)); +extern int m68hc11_reload_operands (rtx*); -extern int dead_register_here PARAMS((rtx, rtx)); +extern int dead_register_here (rtx, rtx); -extern int push_pop_operand_p PARAMS((rtx)); -extern void m68hc11_split_move PARAMS((rtx, rtx, rtx)); -extern void m68hc11_split_compare_and_branch PARAMS((enum rtx_code, - rtx, rtx, rtx)); -extern void aux_restore_IX_IY PARAMS((rtx)); -extern void aux_validate_IX_IY PARAMS((rtx)); +extern int push_pop_operand_p (rtx); +extern void m68hc11_split_move (rtx, rtx, rtx); +extern void m68hc11_split_compare_and_branch (enum rtx_code, + rtx, rtx, rtx); -extern rtx m68hc11_gen_lowpart PARAMS((enum machine_mode, rtx)); -extern rtx m68hc11_gen_highpart PARAMS((enum machine_mode, rtx)); +extern rtx m68hc11_gen_lowpart (enum machine_mode, rtx); +extern rtx m68hc11_gen_highpart (enum machine_mode, rtx); #ifdef HAVE_MACHINE_MODES -extern int m68hc11_memory_move_cost PARAMS((enum machine_mode, enum reg_class, - int)); -extern int m68hc11_register_move_cost PARAMS((enum machine_mode, - enum reg_class, enum reg_class)); - -extern void m68hc11_emit_libcall PARAMS((const char*, enum rtx_code, - enum machine_mode, enum machine_mode, - int, rtx*)); -extern int m68hc11_small_indexed_indirect_p PARAMS((rtx, enum machine_mode)); -extern int m68hc11_symbolic_p PARAMS((rtx, enum machine_mode)); -extern int m68hc11_indirect_p PARAMS((rtx, enum machine_mode)); -extern int go_if_legitimate_address2 PARAMS((rtx, enum machine_mode, int)); - -extern int reg_or_indexed_operand PARAMS((rtx,enum machine_mode)); -extern int tst_operand PARAMS((rtx,enum machine_mode)); -extern int cmp_operand PARAMS((rtx,enum machine_mode)); -extern int memory_indexed_operand PARAMS((rtx, enum machine_mode)); - -extern void m68hc11_split_logical PARAMS((enum machine_mode, int, rtx*)); - -extern int m68hc11_register_indirect_p PARAMS((rtx, enum machine_mode)); - -extern int symbolic_memory_operand PARAMS((rtx, enum machine_mode)); - -extern int memory_reload_operand PARAMS((rtx, enum machine_mode)); -extern int stack_register_operand PARAMS((rtx, enum machine_mode)); -extern int d_register_operand PARAMS((rtx, enum machine_mode)); -extern int hard_addr_reg_operand PARAMS((rtx, enum machine_mode)); -extern int arith_src_operand PARAMS((rtx, enum machine_mode)); -extern int m68hc11_logical_operator PARAMS((rtx, enum machine_mode)); -extern int m68hc11_arith_operator PARAMS((rtx, enum machine_mode)); -extern int m68hc11_non_shift_operator PARAMS((rtx, enum machine_mode)); -extern int m68hc11_shift_operator PARAMS((rtx, enum machine_mode)); -extern int m68hc11_unary_operator PARAMS((rtx, enum machine_mode)); -extern int m68hc11_eq_compare_operator PARAMS((rtx, enum machine_mode)); -extern int non_push_operand PARAMS((rtx, enum machine_mode)); -extern int hard_reg_operand PARAMS((rtx, enum machine_mode)); -extern int soft_reg_operand PARAMS((rtx, enum machine_mode)); -extern int reg_or_some_mem_operand PARAMS((rtx, enum machine_mode)); +extern int m68hc11_memory_move_cost (enum machine_mode, enum reg_class, int); +extern int m68hc11_register_move_cost (enum machine_mode, + enum reg_class, enum reg_class); + +extern void m68hc11_emit_libcall (const char*, enum rtx_code, + enum machine_mode, enum machine_mode, + int, rtx*); +extern int m68hc11_small_indexed_indirect_p (rtx, enum machine_mode); +extern int m68hc11_symbolic_p (rtx, enum machine_mode); +extern int m68hc11_indirect_p (rtx, enum machine_mode); +extern int go_if_legitimate_address2 (rtx, enum machine_mode, int); + +extern int reg_or_indexed_operand (rtx,enum machine_mode); +extern int tst_operand (rtx,enum machine_mode); +extern int cmp_operand (rtx,enum machine_mode); +extern int memory_indexed_operand (rtx, enum machine_mode); + +extern void m68hc11_split_logical (enum machine_mode, int, rtx*); + +extern int m68hc11_register_indirect_p (rtx, enum machine_mode); + +extern int symbolic_memory_operand (rtx, enum machine_mode); + +extern int memory_reload_operand (rtx, enum machine_mode); +extern int stack_register_operand (rtx, enum machine_mode); +extern int d_register_operand (rtx, enum machine_mode); +extern int hard_addr_reg_operand (rtx, enum machine_mode); +extern int arith_src_operand (rtx, enum machine_mode); +extern int m68hc11_logical_operator (rtx, enum machine_mode); +extern int m68hc11_arith_operator (rtx, enum machine_mode); +extern int m68hc11_non_shift_operator (rtx, enum machine_mode); +extern int m68hc11_shift_operator (rtx, enum machine_mode); +extern int m68hc11_unary_operator (rtx, enum machine_mode); +extern int m68hc11_eq_compare_operator (rtx, enum machine_mode); +extern int non_push_operand (rtx, enum machine_mode); +extern int hard_reg_operand (rtx, enum machine_mode); +extern int soft_reg_operand (rtx, enum machine_mode); +extern int reg_or_some_mem_operand (rtx, enum machine_mode); #if defined TREE_CODE -extern void m68hc11_init_cumulative_args PARAMS((CUMULATIVE_ARGS*, - tree, - rtx)); - -extern rtx m68hc11_function_arg PARAMS((const CUMULATIVE_ARGS* , - enum machine_mode, - tree, int)); -extern int m68hc11_function_arg_pass_by_reference PARAMS((const CUMULATIVE_ARGS*, - enum machine_mode, - tree, - int)); -extern int m68hc11_function_arg_padding PARAMS((enum machine_mode, tree)); - -extern void m68hc11_function_epilogue PARAMS((FILE*,int)); - -extern int m68hc11_is_far_symbol PARAMS((rtx)); -extern int m68hc11_is_trap_symbol PARAMS((rtx)); +extern void m68hc11_init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx); + +extern rtx m68hc11_function_arg (const CUMULATIVE_ARGS* , + enum machine_mode, + tree, int); +extern int m68hc11_function_arg_pass_by_reference (const CUMULATIVE_ARGS*, + enum machine_mode, + tree, + int); +extern int m68hc11_function_arg_padding (enum machine_mode, tree); + +extern void m68hc11_function_epilogue (FILE*,int); + +extern int m68hc11_is_far_symbol (rtx); +extern int m68hc11_is_trap_symbol (rtx); #endif /* TREE_CODE */ diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 3f1cb4f9941..9a8651dd440 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -59,34 +59,34 @@ Note: #include "target.h" #include "target-def.h" -static void emit_move_after_reload PARAMS ((rtx, rtx, rtx)); -static rtx simplify_logical PARAMS ((enum machine_mode, int, rtx, rtx *)); -static void m68hc11_emit_logical PARAMS ((enum machine_mode, int, rtx *)); -static void m68hc11_reorg PARAMS ((void)); -static int go_if_legitimate_address_internal PARAMS((rtx, enum machine_mode, - int)); -static int register_indirect_p PARAMS((rtx, enum machine_mode, int)); -static rtx m68hc11_expand_compare PARAMS((enum rtx_code, rtx, rtx)); -static int must_parenthesize PARAMS ((rtx)); -static int m68hc11_address_cost PARAMS ((rtx)); -static int m68hc11_shift_cost PARAMS ((enum machine_mode, rtx, int)); -static int m68hc11_rtx_costs_1 PARAMS ((rtx, enum rtx_code, enum rtx_code)); -static bool m68hc11_rtx_costs PARAMS ((rtx, int, int, int *)); -static int m68hc11_auto_inc_p PARAMS ((rtx)); -static tree m68hc11_handle_fntype_attribute PARAMS ((tree *, tree, tree, int, bool *)); +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, int, rtx *); +static void m68hc11_reorg (void); +static int go_if_legitimate_address_internal (rtx, enum machine_mode, int); +static int register_indirect_p (rtx, enum machine_mode, int); +static rtx m68hc11_expand_compare (enum rtx_code, rtx, rtx); +static int must_parenthesize (rtx); +static int m68hc11_address_cost (rtx); +static int m68hc11_shift_cost (enum machine_mode, rtx, int); +static int m68hc11_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); +static bool m68hc11_rtx_costs (rtx, int, int, int *); +static int m68hc11_auto_inc_p (rtx); +static tree m68hc11_handle_fntype_attribute (tree *, tree, tree, int, bool *); const struct attribute_spec m68hc11_attribute_table[]; -void create_regs_rtx PARAMS ((void)); +void create_regs_rtx (void); -static void asm_print_register PARAMS ((FILE *, int)); -static void m68hc11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static void m68hc11_asm_out_constructor PARAMS ((rtx, int)); -static void m68hc11_asm_out_destructor PARAMS ((rtx, int)); -static void m68hc11_file_start PARAMS ((void)); -static void m68hc11_encode_section_info PARAMS((tree, rtx, int)); -static int autoinc_mode PARAMS((rtx)); -static int m68hc11_make_autoinc_notes PARAMS((rtx *, void *)); -static void m68hc11_init_libfuncs PARAMS ((void)); +static void asm_print_register (FILE *, int); +static void m68hc11_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void m68hc11_asm_out_constructor (rtx, int); +static void m68hc11_asm_out_destructor (rtx, int); +static void m68hc11_file_start (void); +static void m68hc11_encode_section_info (tree, rtx, int); +static unsigned int m68hc11_section_type_flags (tree, const char*, int); +static int autoinc_mode (rtx); +static int m68hc11_make_autoinc_notes (rtx *, void *); +static void m68hc11_init_libfuncs (void); /* Must be set to 1 to produce debug messages. */ int debug_m6811 = 0; @@ -240,6 +240,9 @@ static int nb_soft_regs; #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m68hc11_encode_section_info +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS m68hc11_section_type_flags + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m68hc11_rtx_costs #undef TARGET_ADDRESS_COST @@ -254,7 +257,7 @@ static int nb_soft_regs; struct gcc_target targetm = TARGET_INITIALIZER; int -m68hc11_override_options () +m68hc11_override_options (void) { memset (m68hc11_reg_valid_for_index, 0, sizeof (m68hc11_reg_valid_for_index)); @@ -320,7 +323,7 @@ m68hc11_override_options () void -m68hc11_conditional_register_usage () +m68hc11_conditional_register_usage (void) { int i; int cnt = atoi (m68hc11_soft_reg_count); @@ -353,7 +356,7 @@ static const char *const reg_class_names[] = REG_CLASS_NAMES; void -create_regs_rtx () +create_regs_rtx (void) { /* regs_inited = 1; */ ix_reg = gen_rtx (REG, HImode, HARD_X_REGNUM); @@ -379,9 +382,7 @@ create_regs_rtx () registers. They may be stored in soft registers if there are enough of them. */ int -hard_regno_mode_ok (regno, mode) - int regno; - enum machine_mode mode; +hard_regno_mode_ok (int regno, enum machine_mode mode) { switch (GET_MODE_SIZE (mode)) { @@ -409,8 +410,7 @@ hard_regno_mode_ok (regno, mode) } int -m68hc11_hard_regno_rename_ok (reg1, reg2) - int reg1, reg2; +m68hc11_hard_regno_rename_ok (int reg1, int reg2) { /* Don't accept renaming to Z register. We will replace it to X,Y or D during machine reorg pass. */ @@ -426,9 +426,7 @@ m68hc11_hard_regno_rename_ok (reg1, reg2) } enum reg_class -preferred_reload_class (operand, class) - rtx operand; - enum reg_class class; +preferred_reload_class (rtx operand, enum reg_class class) { enum machine_mode mode; @@ -546,10 +544,7 @@ preferred_reload_class (operand, class) For 68hc11: n,r with n in [0..255] and r in A_REGS class For 68hc12: n,r no constraint on the constant, r in A_REGS class. */ static int -register_indirect_p (operand, mode, strict) - rtx operand; - enum machine_mode mode; - int strict; +register_indirect_p (rtx operand, enum machine_mode mode, int strict) { rtx base, offset; @@ -611,9 +606,7 @@ register_indirect_p (operand, mode, strict) /* Returns 1 if the operand fits in a 68HC11 indirect mode or in a 68HC12 1-byte index addressing mode. */ int -m68hc11_small_indexed_indirect_p (operand, mode) - rtx operand; - enum machine_mode mode; +m68hc11_small_indexed_indirect_p (rtx operand, enum machine_mode mode) { rtx base, offset; @@ -674,9 +667,7 @@ m68hc11_small_indexed_indirect_p (operand, mode) } int -m68hc11_register_indirect_p (operand, mode) - rtx operand; - enum machine_mode mode; +m68hc11_register_indirect_p (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) != MEM) return 0; @@ -687,10 +678,8 @@ m68hc11_register_indirect_p (operand, mode) } static int -go_if_legitimate_address_internal (operand, mode, strict) - rtx operand; - enum machine_mode mode; - int strict; +go_if_legitimate_address_internal (rtx operand, enum machine_mode mode, + int strict) { if (CONSTANT_ADDRESS_P (operand) && TARGET_M6812) { @@ -717,10 +706,8 @@ go_if_legitimate_address_internal (operand, mode, strict) } int -m68hc11_go_if_legitimate_address (operand, mode, strict) - rtx operand; - enum machine_mode mode; - int strict; +m68hc11_go_if_legitimate_address (rtx operand, enum machine_mode mode, + int strict) { int result; @@ -752,18 +739,16 @@ m68hc11_go_if_legitimate_address (operand, mode, strict) } int -m68hc11_legitimize_address (operand, old_operand, mode) - rtx *operand ATTRIBUTE_UNUSED; - rtx old_operand ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_legitimize_address (rtx *operand ATTRIBUTE_UNUSED, + rtx old_operand ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED) { return 0; } int -m68hc11_reload_operands (operands) - rtx operands[]; +m68hc11_reload_operands (rtx operands[]) { enum machine_mode mode; @@ -858,13 +843,9 @@ m68hc11_reload_operands (operands) } void -m68hc11_emit_libcall (name, code, dmode, smode, noperands, operands) - const char *name; - enum rtx_code code; - enum machine_mode dmode; - enum machine_mode smode; - int noperands; - rtx *operands; +m68hc11_emit_libcall (const char *name, enum rtx_code code, + enum machine_mode dmode, enum machine_mode smode, + int noperands, rtx *operands) { rtx ret; rtx insns; @@ -902,8 +883,7 @@ m68hc11_emit_libcall (name, code, dmode, smode, noperands, operands) (same as auto_inc_p() in rtlanal.c but do not take into account the stack). */ static int -m68hc11_auto_inc_p (x) - rtx x; +m68hc11_auto_inc_p (rtx x) { return GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC @@ -914,9 +894,7 @@ m68hc11_auto_inc_p (x) /* Predicates for machine description. */ int -memory_reload_operand (operand, mode) - rtx operand; - enum machine_mode mode ATTRIBUTE_UNUSED; +memory_reload_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (operand) == MEM && GET_CODE (XEXP (operand, 0)) == PLUS @@ -927,9 +905,7 @@ memory_reload_operand (operand, mode) } int -tst_operand (operand, mode) - rtx operand; - enum machine_mode mode; +tst_operand (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM && reload_completed == 0) { @@ -941,9 +917,7 @@ tst_operand (operand, mode) } int -cmp_operand (operand, mode) - rtx operand; - enum machine_mode mode; +cmp_operand (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM) { @@ -955,9 +929,7 @@ cmp_operand (operand, mode) } int -non_push_operand (operand, mode) - rtx operand; - enum machine_mode mode; +non_push_operand (rtx operand, enum machine_mode mode) { if (general_operand (operand, mode) == 0) return 0; @@ -968,9 +940,7 @@ non_push_operand (operand, mode) } int -reg_or_some_mem_operand (operand, mode) - rtx operand; - enum machine_mode mode; +reg_or_some_mem_operand (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM) { @@ -992,9 +962,7 @@ reg_or_some_mem_operand (operand, mode) } int -m68hc11_symbolic_p (operand, mode) - rtx operand; - enum machine_mode mode; +m68hc11_symbolic_p (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM) { @@ -1007,9 +975,7 @@ m68hc11_symbolic_p (operand, mode) } int -m68hc11_indirect_p (operand, mode) - rtx operand; - enum machine_mode mode; +m68hc11_indirect_p (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM) { @@ -1028,17 +994,13 @@ m68hc11_indirect_p (operand, mode) } int -stack_register_operand (operand, mode) - rtx operand; - enum machine_mode mode ATTRIBUTE_UNUSED; +stack_register_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) { return SP_REG_P (operand); } int -d_register_operand (operand, mode) - rtx operand; - enum machine_mode mode ATTRIBUTE_UNUSED; +d_register_operand (rtx operand, enum machine_mode mode) { if (GET_MODE (operand) != mode && mode != VOIDmode) return 0; @@ -1053,9 +1015,7 @@ d_register_operand (operand, mode) } int -hard_addr_reg_operand (operand, mode) - rtx operand; - enum machine_mode mode ATTRIBUTE_UNUSED; +hard_addr_reg_operand (rtx operand, enum machine_mode mode) { if (GET_MODE (operand) != mode && mode != VOIDmode) return 0; @@ -1070,9 +1030,7 @@ hard_addr_reg_operand (operand, mode) } int -hard_reg_operand (operand, mode) - rtx operand; - enum machine_mode mode; +hard_reg_operand (rtx operand, enum machine_mode mode) { if (GET_MODE (operand) != mode && mode != VOIDmode) return 0; @@ -1086,9 +1044,7 @@ hard_reg_operand (operand, mode) } int -memory_indexed_operand (operand, mode) - rtx operand; - enum machine_mode mode ATTRIBUTE_UNUSED; +memory_indexed_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (operand) != MEM) return 0; @@ -1107,8 +1063,7 @@ memory_indexed_operand (operand, mode) } int -push_pop_operand_p (operand) - rtx operand; +push_pop_operand_p (rtx operand) { if (GET_CODE (operand) != MEM) { @@ -1122,9 +1077,7 @@ push_pop_operand_p (operand) reference and a constant. */ int -symbolic_memory_operand (op, mode) - register rtx op; - enum machine_mode mode; +symbolic_memory_operand (rtx op, enum machine_mode mode) { switch (GET_CODE (op)) { @@ -1152,25 +1105,19 @@ symbolic_memory_operand (op, mode) } int -m68hc11_eq_compare_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_eq_compare_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == EQ || GET_CODE (op) == NE; } int -m68hc11_logical_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_logical_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR; } int -m68hc11_arith_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_arith_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS @@ -1180,9 +1127,7 @@ m68hc11_arith_operator (op, mode) } int -m68hc11_non_shift_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_non_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS; @@ -1190,9 +1135,7 @@ m68hc11_non_shift_operator (op, mode) /* Return true if op is a shift operator. */ int -m68hc11_shift_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == ROTATE || GET_CODE (op) == ROTATERT || GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFT @@ -1200,9 +1143,7 @@ m68hc11_shift_operator (op, mode) } int -m68hc11_unary_operator (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +m68hc11_unary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return GET_CODE (op) == NEG || GET_CODE (op) == NOT || GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND; @@ -1218,10 +1159,7 @@ m68hc11_unary_operator (op, mode) */ void -m68hc11_initialize_trampoline (tramp, fnaddr, cxt) - rtx tramp; - rtx fnaddr; - rtx cxt; +m68hc11_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) { const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM]; @@ -1276,12 +1214,10 @@ static rtx trap_handler_symbol = 0; /* Handle an attribute requiring a FUNCTION_TYPE, FIELD_DECL or TYPE_DECL; arguments as in struct attribute_spec.handler. */ static tree -m68hc11_handle_fntype_attribute (node, name, args, flags, no_add_attrs) - tree *node; - tree name; - tree args ATTRIBUTE_UNUSED; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +m68hc11_handle_fntype_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_TYPE && TREE_CODE (*node) != METHOD_TYPE @@ -1301,10 +1237,7 @@ m68hc11_handle_fntype_attribute (node, name, args, flags, no_add_attrs) in SYMBOL_REF_FLAG. */ static void -m68hc11_encode_section_info (decl, rtl, first) - tree decl; - rtx rtl; - int first ATTRIBUTE_UNUSED; +m68hc11_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) { tree func_attr; int trap_handler; @@ -1337,9 +1270,21 @@ m68hc11_encode_section_info (decl, rtl, first) SYMBOL_REF_FLAG (XEXP (rtl, 0)) = is_far; } +static unsigned int +m68hc11_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags = default_section_type_flags (decl, name, reloc); + + if (strncmp (name, ".eeprom", 7) == 0) + { + flags |= SECTION_WRITE | SECTION_CODE | SECTION_OVERRIDE; + } + + return flags; +} + int -m68hc11_is_far_symbol (sym) - rtx sym; +m68hc11_is_far_symbol (rtx sym) { if (GET_CODE (sym) == MEM) sym = XEXP (sym, 0); @@ -1348,8 +1293,7 @@ m68hc11_is_far_symbol (sym) } int -m68hc11_is_trap_symbol (sym) - rtx sym; +m68hc11_is_trap_symbol (rtx sym) { if (GET_CODE (sym) == MEM) sym = XEXP (sym, 0); @@ -1366,11 +1310,10 @@ m68hc11_is_trap_symbol (sym) SCz: I tried to pass DImode by reference but it seems that this does not work very well. */ int -m68hc11_function_arg_pass_by_reference (cum, mode, type, named) - const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; - tree type; - int named ATTRIBUTE_UNUSED; +m68hc11_function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, + int named ATTRIBUTE_UNUSED) { return ((type && TREE_CODE (type) == ARRAY_TYPE) /* Consider complex values as aggregates, so care for TCmode. */ @@ -1382,9 +1325,7 @@ m68hc11_function_arg_pass_by_reference (cum, mode, type, named) /* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ int -m68hc11_initial_elimination_offset (from, to) - int from; - int to; +m68hc11_initial_elimination_offset (int from, int to) { int trap_handler; tree func_attr; @@ -1451,10 +1392,7 @@ m68hc11_initial_elimination_offset (from, to) For a library call, FNTYPE is 0. */ void -m68hc11_init_cumulative_args (cum, fntype, libname) - CUMULATIVE_ARGS *cum; - tree fntype; - rtx libname; +m68hc11_init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname) { tree ret_type; @@ -1507,11 +1445,8 @@ m68hc11_init_cumulative_args (cum, fntype, libname) (TYPE is null for libcalls where that information may not be available.) */ void -m68hc11_function_arg_advance (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type; - int named ATTRIBUTE_UNUSED; +m68hc11_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named ATTRIBUTE_UNUSED) { if (mode != BLKmode) { @@ -1548,11 +1483,8 @@ m68hc11_function_arg_advance (cum, mode, type, named) (otherwise it is an extra parameter matching an ellipsis). */ struct rtx_def * -m68hc11_function_arg (cum, mode, type, named) - const CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type ATTRIBUTE_UNUSED; - int named ATTRIBUTE_UNUSED; +m68hc11_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED) { if (cum->words != 0) { @@ -1580,9 +1512,7 @@ m68hc11_function_arg (cum, mode, type, named) Structures are stored left shifted in their argument slot. */ int -m68hc11_function_arg_padding (mode, type) - enum machine_mode mode; - tree type; +m68hc11_function_arg_padding (enum machine_mode mode, tree type) { if (type != 0 && AGGREGATE_TYPE_P (type)) return upward; @@ -1597,8 +1527,7 @@ m68hc11_function_arg_padding (mode, type) /* Emit a move after the reload pass has completed. This is used to emit the prologue and epilogue. */ static void -emit_move_after_reload (to, from, scratch) - rtx to, from, scratch; +emit_move_after_reload (rtx to, rtx from, rtx scratch) { rtx insn; @@ -1640,7 +1569,7 @@ emit_move_after_reload (to, from, scratch) } int -m68hc11_total_frame_size () +m68hc11_total_frame_size (void) { int size; int regno; @@ -1661,9 +1590,8 @@ m68hc11_total_frame_size () } static void -m68hc11_output_function_epilogue (out, size) - FILE *out ATTRIBUTE_UNUSED; - HOST_WIDE_INT size ATTRIBUTE_UNUSED; +m68hc11_output_function_epilogue (FILE *out ATTRIBUTE_UNUSED, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* We catch the function epilogue generation to have a chance to clear the z_replacement_completed flag. */ @@ -1671,7 +1599,7 @@ m68hc11_output_function_epilogue (out, size) } void -expand_prologue () +expand_prologue (void) { tree func_attr; int size; @@ -1775,7 +1703,7 @@ expand_prologue () } void -expand_epilogue () +expand_epilogue (void) { int size; register int regno; @@ -1888,9 +1816,7 @@ expand_epilogue () fixed to work for constants and 68HC11 specific registers. */ rtx -m68hc11_gen_lowpart (mode, x) - enum machine_mode mode; - rtx x; +m68hc11_gen_lowpart (enum machine_mode mode, rtx x) { /* We assume that the low part of an auto-inc mode is the same with the mode changed and that the caller split the larger mode in the @@ -1965,9 +1891,7 @@ m68hc11_gen_lowpart (mode, x) } rtx -m68hc11_gen_highpart (mode, x) - enum machine_mode mode; - rtx x; +m68hc11_gen_highpart (enum machine_mode mode, rtx x) { /* We assume that the high part of an auto-inc mode is the same with the mode changed and that the caller split the larger mode in the @@ -2086,9 +2010,7 @@ m68hc11_gen_highpart (mode, x) of code when we know that some register dies or can be clobbered. */ int -dead_register_here (x, reg) - rtx x; - rtx reg; +dead_register_here (rtx x, rtx reg) { rtx x_reg; rtx p; @@ -2166,9 +2088,7 @@ dead_register_here (x, reg) /* Print the name of register 'regno' in the assembly file. */ static void -asm_print_register (file, regno) - FILE *file; - int regno; +asm_print_register (FILE *file, int regno) { const char *name = reg_names[regno]; @@ -2211,10 +2131,7 @@ asm_print_register (file, regno) ignored. */ void -print_operand (file, op, letter) - FILE *file; - rtx op; - int letter; +print_operand (FILE *file, rtx op, int letter) { if (letter == 't') { @@ -2367,8 +2284,7 @@ print_operand (file, op, letter) around it. This must be done only if there is a symbol whose name is a processor register. */ static int -must_parenthesize (op) - rtx op; +must_parenthesize (rtx op) { const char *name; @@ -2414,9 +2330,7 @@ must_parenthesize (op) reference whose address is ADDR. ADDR is an RTL expression. */ void -print_operand_address (file, addr) - FILE *file; - rtx addr; +print_operand_address (FILE *file, rtx addr) { rtx base; rtx offset; @@ -2567,9 +2481,7 @@ print_operand_address (file, addr) /* Splitting of some instructions. */ static rtx -m68hc11_expand_compare (code, op0, op1) - enum rtx_code code; - rtx op0, op1; +m68hc11_expand_compare (enum rtx_code code, rtx op0, rtx op1) { rtx ret = 0; @@ -2586,9 +2498,8 @@ m68hc11_expand_compare (code, op0, op1) } rtx -m68hc11_expand_compare_and_branch (code, op0, op1, label) - enum rtx_code code; - rtx op0, op1, label; +m68hc11_expand_compare_and_branch (enum rtx_code code, rtx op0, rtx op1, + rtx label) { rtx tmp; @@ -2740,8 +2651,7 @@ m68hc11_expand_compare_and_branch (code, op0, op1, label) /* Return the increment/decrement mode of a MEM if it is such. Return CONST if it is anything else. */ static int -autoinc_mode (x) - rtx x; +autoinc_mode (rtx x) { if (GET_CODE (x) != MEM) return CONST; @@ -2757,9 +2667,7 @@ autoinc_mode (x) } static int -m68hc11_make_autoinc_notes (x, data) - rtx *x; - void *data; +m68hc11_make_autoinc_notes (rtx *x, void *data) { rtx insn; @@ -2783,8 +2691,7 @@ m68hc11_make_autoinc_notes (x, data) The scratch register 'scratch' is used as a temporary to load store intermediate values. It must be a hard register. */ void -m68hc11_split_move (to, from, scratch) - rtx to, from, scratch; +m68hc11_split_move (rtx to, rtx from, rtx scratch) { rtx low_to, low_from; rtx high_to, high_from; @@ -2990,11 +2897,7 @@ m68hc11_split_move (to, from, scratch) } static rtx -simplify_logical (mode, code, operand, result) - enum machine_mode mode; - int code; - rtx operand; - rtx *result; +simplify_logical (enum machine_mode mode, int code, rtx operand, rtx *result) { int val; int mask; @@ -3034,10 +2937,7 @@ simplify_logical (mode, code, operand, result) } static void -m68hc11_emit_logical (mode, code, operands) - enum machine_mode mode; - int code; - rtx *operands; +m68hc11_emit_logical (enum machine_mode mode, int code, rtx *operands) { rtx result; int need_copy; @@ -3106,10 +3006,7 @@ m68hc11_emit_logical (mode, code, operands) } void -m68hc11_split_logical (mode, code, operands) - enum machine_mode mode; - int code; - rtx *operands; +m68hc11_split_logical (enum machine_mode mode, int code, rtx *operands) { rtx low[4]; rtx high[4]; @@ -3157,9 +3054,7 @@ m68hc11_split_logical (mode, code, operands) /* Code generation. */ void -m68hc11_output_swap (insn, operands) - rtx insn ATTRIBUTE_UNUSED; - rtx operands[]; +m68hc11_output_swap (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) { /* We have to be careful with the cc_status. An address register swap is generated for some comparison. The comparison is made with D @@ -3211,9 +3106,7 @@ m68hc11_output_swap (insn, operands) This is used to decide whether a move that set flags should be used instead. */ int -next_insn_test_reg (insn, reg) - rtx insn; - rtx reg; +next_insn_test_reg (rtx insn, rtx reg) { rtx body; @@ -3234,9 +3127,7 @@ next_insn_test_reg (insn, reg) /* Generate the code to move a 16-bit operand into another one. */ void -m68hc11_gen_movhi (insn, operands) - rtx insn; - rtx *operands; +m68hc11_gen_movhi (rtx insn, rtx *operands) { int reg; @@ -3650,9 +3541,7 @@ m68hc11_gen_movhi (insn, operands) } void -m68hc11_gen_movqi (insn, operands) - rtx insn; - rtx *operands; +m68hc11_gen_movqi (rtx insn, rtx *operands) { /* Move a register or memory to the same location. This is possible because such insn can appear @@ -3932,10 +3821,7 @@ m68hc11_gen_movqi (insn, operands) The source and destination must be D or A and the shift must be a constant. */ void -m68hc11_gen_rotate (code, insn, operands) - enum rtx_code code; - rtx insn; - rtx operands[]; +m68hc11_gen_rotate (enum rtx_code code, rtx insn, rtx operands[]) { int val; @@ -4014,9 +3900,7 @@ m68hc11_gen_rotate (code, insn, operands) Do not alter them if the instruction would not alter the cc's. */ void -m68hc11_notice_update_cc (exp, insn) - rtx exp; - rtx insn ATTRIBUTE_UNUSED; +m68hc11_notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED) { /* recognize SET insn's. */ if (GET_CODE (exp) == SET) @@ -4116,8 +4000,7 @@ m68hc11_notice_update_cc (exp, insn) the register 'reg'. See if the previous flags can be kept for the next instruction to avoid a comparison. */ void -m68hc11_notice_keep_cc (reg) - rtx reg; +m68hc11_notice_keep_cc (rtx reg) { if (reg == 0 || cc_prev_status.value1 == 0 @@ -4192,10 +4075,10 @@ struct replace_info int z_loaded_with_sp; }; -static int m68hc11_check_z_replacement PARAMS ((rtx, struct replace_info *)); -static void m68hc11_find_z_replacement PARAMS ((rtx, struct replace_info *)); -static void m68hc11_z_replacement PARAMS ((rtx)); -static void m68hc11_reassign_regs PARAMS ((rtx)); +static int m68hc11_check_z_replacement (rtx, struct replace_info *); +static void m68hc11_find_z_replacement (rtx, struct replace_info *); +static void m68hc11_z_replacement (rtx); +static void m68hc11_reassign_regs (rtx); int z_replacement_completed = 0; @@ -4205,9 +4088,7 @@ int z_replacement_completed = 0; continue replacement in next insns. */ static int -m68hc11_check_z_replacement (insn, info) - rtx insn; - struct replace_info *info; +m68hc11_check_z_replacement (rtx insn, struct replace_info *info) { int this_insn_uses_ix; int this_insn_uses_iy; @@ -4770,9 +4651,7 @@ m68hc11_check_z_replacement (insn, info) } static void -m68hc11_find_z_replacement (insn, info) - rtx insn; - struct replace_info *info; +m68hc11_find_z_replacement (rtx insn, struct replace_info *info) { int reg; @@ -4883,8 +4762,7 @@ m68hc11_find_z_replacement (insn, info) Z and of the replacement register. */ static void -m68hc11_z_replacement (insn) - rtx insn; +m68hc11_z_replacement (rtx insn) { rtx replace_reg_qi; rtx replace_reg; @@ -5094,8 +4972,7 @@ m68hc11_z_replacement (insn) on the instruction. */ static void -m68hc11_reassign_regs (first) - rtx first; +m68hc11_reassign_regs (rtx first) { rtx insn; @@ -5159,7 +5036,7 @@ m68hc11_reassign_regs (first) 'z_replacement_completed' is set to 2. */ static void -m68hc11_reorg () +m68hc11_reorg (void) { int split_done = 0; rtx insn, first; @@ -5277,10 +5154,8 @@ m68hc11_init_libfuncs (void) /* Cost of moving memory. */ int -m68hc11_memory_move_cost (mode, class, in) - enum machine_mode mode; - enum reg_class class; - int in ATTRIBUTE_UNUSED; +m68hc11_memory_move_cost (enum machine_mode mode, enum reg_class class, + int in ATTRIBUTE_UNUSED) { if (class <= H_REGS && class > NO_REGS) { @@ -5304,10 +5179,8 @@ m68hc11_memory_move_cost (mode, class, in) have a move cost of 2. Setting a higher cost will force reload to check the constraints. */ int -m68hc11_register_move_cost (mode, from, to) - enum machine_mode mode; - enum reg_class from; - enum reg_class to; +m68hc11_register_move_cost (enum machine_mode mode, enum reg_class from, + enum reg_class to) { /* All costs are symmetric, so reduce cases by putting the lower number class as the destination. */ @@ -5329,8 +5202,7 @@ m68hc11_register_move_cost (mode, from, to) If ADDR is not a valid address, its cost is irrelevant. */ static int -m68hc11_address_cost (addr) - rtx addr; +m68hc11_address_cost (rtx addr) { int cost = 4; @@ -5411,10 +5283,7 @@ m68hc11_address_cost (addr) } static int -m68hc11_shift_cost (mode, x, shift) - enum machine_mode mode; - rtx x; - int shift; +m68hc11_shift_cost (enum machine_mode mode, rtx x, int shift) { int total; @@ -5443,10 +5312,8 @@ m68hc11_shift_cost (mode, x, shift) } static int -m68hc11_rtx_costs_1 (x, code, outer_code) - rtx x; - enum rtx_code code; - enum rtx_code outer_code ATTRIBUTE_UNUSED; +m68hc11_rtx_costs_1 (rtx x, enum rtx_code code, + enum rtx_code outer_code ATTRIBUTE_UNUSED) { enum machine_mode mode = GET_MODE (x); int extra_cost = 0; @@ -5579,10 +5446,7 @@ m68hc11_rtx_costs_1 (x, code, outer_code) } static bool -m68hc11_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code; - int *total; +m68hc11_rtx_costs (rtx x, int code, int outer_code, int *total) { switch (code) { @@ -5634,7 +5498,7 @@ m68hc11_rtx_costs (x, code, outer_code, total) static void -m68hc11_file_start () +m68hc11_file_start (void) { default_file_start (); @@ -5643,18 +5507,14 @@ m68hc11_file_start () static void -m68hc11_asm_out_constructor (symbol, priority) - rtx symbol; - int priority; +m68hc11_asm_out_constructor (rtx symbol, int priority) { default_ctor_section_asm_out_constructor (symbol, priority); fprintf (asm_out_file, "\t.globl\t__do_global_ctors\n"); } static void -m68hc11_asm_out_destructor (symbol, priority) - rtx symbol; - int priority; +m68hc11_asm_out_destructor (rtx symbol, int priority) { default_dtor_section_asm_out_destructor (symbol, priority); fprintf (asm_out_file, "\t.globl\t__do_global_dtors\n"); diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index 7efa0029a49..ba0a2c7eef1 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -1420,7 +1420,7 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER]; macro is used in only one place: `find_reloads_address' in reload.c. For M68HC11, we handle large displacements of a base register - by splitting the addend accors an addhi3 insn. + by splitting the addend across an addhi3 insn. For M68HC12, the 64K offset range is available. */ diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index 5bf21c55e3d..03e637088fc 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -86,13 +86,9 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ builtin_define_std ("mc68000"); \ builtin_define_std ("mc68020"); \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=posix"); \ } \ while (0) diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 565e41ff7cd..b99d1553bb3 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -43,6 +43,20 @@ Boston, MA 02111-1307, USA. */ #include "debug.h" #include "flags.h" +/* The ASM_DOT macro allows easy string pasting to handle the differences + between MOTOROLA and MIT syntaxes in asm_fprintf(), which doesn't + support the %. option. */ +#if MOTOROLA +# define ASM_DOT "." +# define ASM_DOTW ".w" +# define ASM_DOTL ".l" +#else +# define ASM_DOT "" +# define ASM_DOTW "" +# define ASM_DOTL "" +#endif + + /* Structure describing stack frame layout. */ struct m68k_frame { @@ -462,15 +476,8 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED before actually allocating the space. */ if (current_function_limit_stack && GET_CODE (stack_limit_rtx) == SYMBOL_REF) - { -#if defined (MOTOROLA) - asm_fprintf (stream, "\tcmp.l %I%s+%wd,%Rsp\n\ttrapcs\n", - XSTR (stack_limit_rtx, 0), current_frame.size + 4); -#else - asm_fprintf (stream, "\tcmpl %I%s+%wd,%Rsp\n\ttrapcs\n", - XSTR (stack_limit_rtx, 0), current_frame.size + 4); -#endif - } + asm_fprintf (stream, "\tcmp" ASM_DOT "l %I%s+%wd,%Rsp\n\ttrapcs\n", + XSTR (stack_limit_rtx, 0), current_frame.size + 4); /* On ColdFire add register save into initial stack frame setup, if possible. */ fsize_with_regs = current_frame.size; @@ -480,51 +487,25 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED if (frame_pointer_needed) { if (current_frame.size == 0 && TARGET_68040) - { /* on the 68040, pea + move is faster than link.w 0 */ -#ifdef MOTOROLA - fprintf (stream, "\tpea (%s)\n\tmove.l %s,%s\n", - reg_names[FRAME_POINTER_REGNUM], - reg_names[STACK_POINTER_REGNUM], - reg_names[FRAME_POINTER_REGNUM]); -#else - fprintf (stream, "\tpea %s@\n\tmovel %s,%s\n", - reg_names[FRAME_POINTER_REGNUM], - reg_names[STACK_POINTER_REGNUM], - reg_names[FRAME_POINTER_REGNUM]); -#endif - } + fprintf (stream, MOTOROLA ? + "\tpea (%s)\n\tmove.l %s,%s\n" : + "\tpea %s@\n\tmovel %s,%s\n", + reg_names[FRAME_POINTER_REGNUM], + reg_names[STACK_POINTER_REGNUM], + reg_names[FRAME_POINTER_REGNUM]); else if (fsize_with_regs < 0x8000) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tlink.w %s,%I%wd\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#else - asm_fprintf (stream, "\tlink %s,%I%wd\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I%wd\n", + reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); else if (TARGET_68020) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tlink.l %s,%I%wd\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#else - asm_fprintf (stream, "\tlink %s,%I%wd\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tlink" ASM_DOTL " %s,%I%wd\n", + reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); else - { - /* Adding negative number is faster on the 68040. */ -#ifdef MOTOROLA - asm_fprintf (stream, "\tlink.w %s,%I0\n\tadd.l %I%wd,%Rsp\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#else - asm_fprintf (stream, "\tlink %s,%I0\n\taddl %I%wd,%Rsp\n", - reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); -#endif - } + /* Adding negative number is faster on the 68040. */ + asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I0\n" + "\tadd" ASM_DOT "l %I%wd,%Rsp\n", + reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs); + if (dwarf2out_do_frame ()) { char *l; @@ -542,61 +523,32 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED if (fsize_with_regs <= 8) { if (!TARGET_COLDFIRE) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tsubq.w %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\tsubqw %I%wd,%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tsubq" ASM_DOT "w %I%wd,%Rsp\n", + fsize_with_regs); else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tsubq.l %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\tsubql %I%wd,%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tsubq" ASM_DOT "l %I%wd,%Rsp\n", + fsize_with_regs); } else if (fsize_with_regs <= 16 && TARGET_CPU32) - { - /* On the CPU32 it is faster to use two subqw instructions to - subtract a small integer (8 < N <= 16) to a register. */ -#ifdef MOTOROLA - asm_fprintf (stream, - "\tsubq.w %I8,%Rsp\n\tsubq.w %I%wd,%Rsp\n", - fsize_with_regs - 8); -#else - asm_fprintf (stream, "\tsubqw %I8,%Rsp\n\tsubqw %I%wd,%Rsp\n", - fsize_with_regs - 8); -#endif - } + /* On the CPU32 it is faster to use two subqw instructions to + subtract a small integer (8 < N <= 16) to a register. */ + asm_fprintf (stream, + "\tsubq" ASM_DOT "w %I8,%Rsp\n" + "\tsubq" ASM_DOT "w %I%wd,%Rsp\n", + fsize_with_regs - 8); else if (TARGET_68040) - { - /* Adding negative number is faster on the 68040. */ -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", -fsize_with_regs); -#else - asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", -fsize_with_regs); -#endif - } + /* Adding negative number is faster on the 68040. */ + asm_fprintf (stream, "\tadd" ASM_DOT "w %I%wd,%Rsp\n", + -fsize_with_regs); else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", -fsize_with_regs); -#else - asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", -fsize_with_regs); -#endif - } + asm_fprintf (stream, MOTOROLA ? + "\tlea (%wd,%Rsp),%Rsp\n" : + "\tlea %Rsp@(%wd),%Rsp\n", + -fsize_with_regs); } else /* fsize_with_regs >= 0x8000 */ - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", -fsize_with_regs); -#else - asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", -fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tadd" ASM_DOT "l %I%wd,%Rsp\n", -fsize_with_regs); + if (dwarf2out_do_frame ()) { cfa_offset += current_frame.size + 4; @@ -606,11 +558,11 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED if (current_frame.fpu_mask) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tfmovm %I0x%x,-(%Rsp)\n", current_frame.fpu_mask); -#else - asm_fprintf (stream, "\tfmovem %I0x%x,%Rsp@-\n", current_frame.fpu_mask); -#endif + asm_fprintf (stream, MOTOROLA ? + "\tfmovm %I0x%x,-(%Rsp)\n" : + "\tfmovem %I0x%x,%Rsp@-\n", + current_frame.fpu_mask); + if (dwarf2out_do_frame ()) { char *l = (char *) dwarf2out_cfi_label (); @@ -630,15 +582,8 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED if (current_function_limit_stack) { if (REG_P (stack_limit_rtx)) - { -#if defined (MOTOROLA) - asm_fprintf (stream, "\tcmp.l %s,%Rsp\n\ttrapcs\n", - reg_names[REGNO (stack_limit_rtx)]); -#else - asm_fprintf (stream, "\tcmpl %s,%Rsp\n\ttrapcs\n", - reg_names[REGNO (stack_limit_rtx)]); -#endif - } + asm_fprintf (stream, "\tcmp" ASM_DOT "l %s,%Rsp\n\ttrapcs\n", + reg_names[REGNO (stack_limit_rtx)]); else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF) warning ("stack limit expression is not supported"); } @@ -655,12 +600,9 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED for (i = 0; i < 16; i++) if (current_frame.reg_rev_mask & (1 << i)) { - asm_fprintf (stream, -#ifdef MOTOROLA - "\t%Omove.l %s,-(%Rsp)\n", -#else - "\tmovel %s,%Rsp@-\n", -#endif + asm_fprintf (stream, MOTOROLA ? + "\t%Omove.l %s,-(%Rsp)\n" : + "\tmovel %s,%Rsp@-\n", reg_names[15 - i]); if (dwarf2out_do_frame ()) { @@ -676,27 +618,21 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED else if (current_frame.reg_rev_mask) { if (TARGET_COLDFIRE) - { - /* The ColdFire does not support the predecrement form of the - MOVEM instruction, so we must adjust the stack pointer and - then use the plain address register indirect mode. - The required register save space was combined earlier with - the fsize_with_regs amount. */ - -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l %I0x%x,(%Rsp)\n", current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %I0x%x,%Rsp@\n", current_frame.reg_mask); -#endif - } + /* The ColdFire does not support the predecrement form of the + MOVEM instruction, so we must adjust the stack pointer and + then use the plain address register indirect mode. + The required register save space was combined earlier with + the fsize_with_regs amount. */ + + asm_fprintf (stream, MOTOROLA ? + "\tmovm.l %I0x%x,(%Rsp)\n" : + "\tmoveml %I0x%x,%Rsp@\n", + current_frame.reg_mask); else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l %I0x%x,-(%Rsp)\n", current_frame.reg_rev_mask); -#else - asm_fprintf (stream, "\tmoveml %I0x%x,%Rsp@-\n", current_frame.reg_rev_mask); -#endif - } + asm_fprintf (stream, MOTOROLA ? + "\tmovm.l %I0x%x,-(%Rsp)\n" : + "\tmoveml %I0x%x,%Rsp@-\n", + current_frame.reg_rev_mask); if (dwarf2out_do_frame ()) { char *l = (char *) dwarf2out_cfi_label (); @@ -723,16 +659,17 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED } else { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n", - reg_names[PIC_OFFSET_TABLE_REGNUM]); -#else - asm_fprintf (stream, "\tmovel %I%U_GLOBAL_OFFSET_TABLE_, %s\n", - reg_names[PIC_OFFSET_TABLE_REGNUM]); - asm_fprintf (stream, "\tlea %Rpc@(0,%s:l),%s\n", - reg_names[PIC_OFFSET_TABLE_REGNUM], - reg_names[PIC_OFFSET_TABLE_REGNUM]); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n", + reg_names[PIC_OFFSET_TABLE_REGNUM]); + else + { + asm_fprintf (stream, "\tmovel %I%U_GLOBAL_OFFSET_TABLE_, %s\n", + reg_names[PIC_OFFSET_TABLE_REGNUM]); + asm_fprintf (stream, "\tlea %Rpc@(0,%s:l),%s\n", + reg_names[PIC_OFFSET_TABLE_REGNUM], + reg_names[PIC_OFFSET_TABLE_REGNUM]); + } } } } @@ -811,24 +748,9 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED /* Because the ColdFire doesn't support moveml with complex address modes we make an extra correction here. */ if (TARGET_COLDFIRE) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Omove.l %I%d,%Ra1\n", - -fsize - current_frame.offset); -#else - asm_fprintf (stream, "\tmovel %I%d,%Ra1\n", - -fsize - current_frame.offset); -#endif - } - else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Omove.l %I%wd,%Ra1\n", -fsize); -#else - asm_fprintf (stream, "\tmovel %I%wd,%Ra1\n", -fsize); -#endif - } + fsize += current_frame.offset; + asm_fprintf (stream, "\t%Omove" ASM_DOT "l %I%wd,%Ra1\n", -fsize); fsize = 0, big = true; } if (current_frame.reg_no <= 2) @@ -846,41 +768,34 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED { if (big) { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Omove.l -%wd(%s,%Ra1.l),%s\n", - offset, - reg_names[FRAME_POINTER_REGNUM], - reg_names[i]); -#else - asm_fprintf (stream, "\tmovel %s@(-%wd,%Ra1:l),%s\n", - reg_names[FRAME_POINTER_REGNUM], - offset, - reg_names[i]); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\t%Omove.l -%wd(%s,%Ra1.l),%s\n", + offset, + reg_names[FRAME_POINTER_REGNUM], + reg_names[i]); + else + asm_fprintf (stream, "\tmovel %s@(-%wd,%Ra1:l),%s\n", + reg_names[FRAME_POINTER_REGNUM], + offset, + reg_names[i]); } else if (restore_from_sp) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Omove.l (%Rsp)+,%s\n", - reg_names[i]); -#else - asm_fprintf (stream, "\tmovel %Rsp@+,%s\n", - reg_names[i]); -#endif - } + asm_fprintf (stream, MOTOROLA ? + "\t%Omove.l (%Rsp)+,%s\n" : + "\tmovel %Rsp@+,%s\n", + reg_names[i]); else { -#ifdef MOTOROLA - asm_fprintf (stream, "\t%Omove.l -%wd(%s),%s\n", - offset, - reg_names[FRAME_POINTER_REGNUM], - reg_names[i]); -#else - asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n", - reg_names[FRAME_POINTER_REGNUM], - offset, - reg_names[i]); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\t%Omove.l -%wd(%s),%s\n", + offset, + reg_names[FRAME_POINTER_REGNUM], + reg_names[i]); + else + asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n", + reg_names[FRAME_POINTER_REGNUM], + offset, + reg_names[i]); } offset -= 4; } @@ -892,76 +807,66 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED { if (big) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.l %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]); - asm_fprintf (stream, "\tmovm.l (%Ra1),%I0x%x\n", current_frame.reg_mask); -#else - asm_fprintf (stream, "\taddl %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]); - asm_fprintf (stream, "\tmoveml %Ra1@,%I0x%x\n", current_frame.reg_mask); -#endif + asm_fprintf (stream, "\tadd" ASM_DOT "l %s,%Ra1\n", + reg_names[FRAME_POINTER_REGNUM]); + asm_fprintf (stream, MOTOROLA ? + "\tmovm.l (%Ra1),%I0x%x\n" : + "\tmoveml %Ra1@,%I0x%x\n", + current_frame.reg_mask); } else if (restore_from_sp) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l (%Rsp),%I0x%x\n", current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %Rsp@,%I0x%x\n", current_frame.reg_mask); -#endif - } + asm_fprintf (stream, MOTOROLA ? + "\tmovm.l (%Rsp),%I0x%x\n" : + "\tmoveml %Rsp@,%I0x%x\n", + current_frame.reg_mask); else { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n", - current_frame.offset + fsize, - reg_names[FRAME_POINTER_REGNUM], - current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n", - reg_names[FRAME_POINTER_REGNUM], - current_frame.offset + fsize, - current_frame.reg_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n", + current_frame.offset + fsize, + reg_names[FRAME_POINTER_REGNUM], + current_frame.reg_mask); + else + asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n", + reg_names[FRAME_POINTER_REGNUM], + current_frame.offset + fsize, + current_frame.reg_mask); } } else /* !TARGET_COLDFIRE */ { if (big) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n", - current_frame.offset + fsize, - reg_names[FRAME_POINTER_REGNUM], - current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n", - reg_names[FRAME_POINTER_REGNUM], - current_frame.offset + fsize, - current_frame.reg_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n", + current_frame.offset + fsize, + reg_names[FRAME_POINTER_REGNUM], + current_frame.reg_mask); + else + asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n", + reg_names[FRAME_POINTER_REGNUM], + current_frame.offset + fsize, + current_frame.reg_mask); } else if (restore_from_sp) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l (%Rsp)+,%I0x%x\n", - current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %Rsp@+,%I0x%x\n", + asm_fprintf (stream, MOTOROLA ? + "\tmovm.l (%Rsp)+,%I0x%x\n" : + "\tmoveml %Rsp@+,%I0x%x\n", current_frame.reg_mask); -#endif } else { -#ifdef MOTOROLA - asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n", - current_frame.offset + fsize, - reg_names[FRAME_POINTER_REGNUM], - current_frame.reg_mask); -#else - asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n", - reg_names[FRAME_POINTER_REGNUM], - current_frame.offset + fsize, - current_frame.reg_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n", + current_frame.offset + fsize, + reg_names[FRAME_POINTER_REGNUM], + current_frame.reg_mask); + else + asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n", + reg_names[FRAME_POINTER_REGNUM], + current_frame.offset + fsize, + current_frame.reg_mask); } } } @@ -969,41 +874,38 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED { if (big) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tfmovm -%wd(%s,%Ra1.l),%I0x%x\n", - current_frame.foffset + fsize, - reg_names[FRAME_POINTER_REGNUM], - current_frame.fpu_rev_mask); -#else - asm_fprintf (stream, "\tfmovem %s@(-%wd,%Ra1:l),%I0x%x\n", - reg_names[FRAME_POINTER_REGNUM], - current_frame.foffset + fsize, - current_frame.fpu_rev_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tfmovm -%wd(%s,%Ra1.l),%I0x%x\n", + current_frame.foffset + fsize, + reg_names[FRAME_POINTER_REGNUM], + current_frame.fpu_rev_mask); + else + asm_fprintf (stream, "\tfmovem %s@(-%wd,%Ra1:l),%I0x%x\n", + reg_names[FRAME_POINTER_REGNUM], + current_frame.foffset + fsize, + current_frame.fpu_rev_mask); } else if (restore_from_sp) { -#ifdef MOTOROLA - asm_fprintf (stream, "\tfmovm (%Rsp)+,%I0x%x\n", - current_frame.fpu_rev_mask); -#else - asm_fprintf (stream, "\tfmovem %Rsp@+,%I0x%x\n", - current_frame.fpu_rev_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tfmovm (%Rsp)+,%I0x%x\n", + current_frame.fpu_rev_mask); + else + asm_fprintf (stream, "\tfmovem %Rsp@+,%I0x%x\n", + current_frame.fpu_rev_mask); } else { -#ifdef MOTOROLA - asm_fprintf (stream, "\tfmovm -%wd(%s),%I0x%x\n", - current_frame.foffset + fsize, - reg_names[FRAME_POINTER_REGNUM], - current_frame.fpu_rev_mask); -#else - asm_fprintf (stream, "\tfmovem %s@(-%wd),%I0x%x\n", - reg_names[FRAME_POINTER_REGNUM], - current_frame.foffset + fsize, - current_frame.fpu_rev_mask); -#endif + if (MOTOROLA) + asm_fprintf (stream, "\tfmovm -%wd(%s),%I0x%x\n", + current_frame.foffset + fsize, + reg_names[FRAME_POINTER_REGNUM], + current_frame.fpu_rev_mask); + else + asm_fprintf (stream, "\tfmovem %s@(-%wd),%I0x%x\n", + reg_names[FRAME_POINTER_REGNUM], + current_frame.foffset + fsize, + current_frame.fpu_rev_mask); } } if (frame_pointer_needed) @@ -1014,70 +916,36 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED if (fsize_with_regs <= 8) { if (!TARGET_COLDFIRE) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\taddq.w %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\taddqw %I%wd,%Rsp\n", fsize_with_regs); -#endif - } - else /* TARGET_COLDFIRE */ - { -#ifdef MOTOROLA - asm_fprintf (stream, "\taddq.l %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\taddql %I%wd,%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, "\taddq" ASM_DOT "w %I%wd,%Rsp\n", + fsize_with_regs); + else + asm_fprintf (stream, "\taddq" ASM_DOT "l %I%wd,%Rsp\n", + fsize_with_regs); } else if (fsize_with_regs <= 16 && TARGET_CPU32) { /* On the CPU32 it is faster to use two addqw instructions to add a small integer (8 < N <= 16) to a register. */ -#ifdef MOTOROLA - asm_fprintf (stream, "\taddq.w %I8,%Rsp\n\taddq.w %I%wd,%Rsp\n", - fsize_with_regs - 8); -#else - asm_fprintf (stream, "\taddqw %I8,%Rsp\n\taddqw %I%wd,%Rsp\n", + asm_fprintf (stream, "\taddq" ASM_DOT "w %I8,%Rsp\n" + "\taddq" ASM_DOT "w %I%wd,%Rsp\n", fsize_with_regs - 8); -#endif } else if (fsize_with_regs < 0x8000) { if (TARGET_68040) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tadd" ASM_DOT "w %I%wd,%Rsp\n", + fsize_with_regs); else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, MOTOROLA ? + "\tlea (%wd,%Rsp),%Rsp\n" : + "\tlea %Rsp@(%wd),%Rsp\n", + fsize_with_regs); } else - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", fsize_with_regs); -#else - asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", fsize_with_regs); -#endif - } + asm_fprintf (stream, "\tadd" ASM_DOT "l %I%wd,%Rsp\n", fsize_with_regs); } if (current_function_calls_eh_return) - { -#ifdef MOTOROLA - asm_fprintf (stream, "\tadd.l %Ra0,%Rsp\n"); -#else - asm_fprintf (stream, "\taddl %Ra0,%Rsp\n"); -#endif - } + asm_fprintf (stream, "\tadd" ASM_DOT"l %Ra0,%Rsp\n"); if (m68k_interrupt_function_p (current_function_decl)) fprintf (stream, "\trte\n"); else if (current_function_pops_args) @@ -1173,84 +1041,74 @@ output_dbcc_and_branch (rtx *operands) switch (GET_CODE (operands[3])) { case EQ: -#ifdef MOTOROLA - output_asm_insn ("dbeq %0,%l1\n\tjbeq %l2", operands); -#else - output_asm_insn ("dbeq %0,%l1\n\tjeq %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbeq %0,%l1\n\tjbeq %l2" : + "dbeq %0,%l1\n\tjeq %l2", + operands); + break; case NE: -#ifdef MOTOROLA - output_asm_insn ("dbne %0,%l1\n\tjbne %l2", operands); -#else - output_asm_insn ("dbne %0,%l1\n\tjne %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbne %0,%l1\n\tjbne %l2" : + "dbne %0,%l1\n\tjne %l2", + operands); + break; case GT: -#ifdef MOTOROLA - output_asm_insn ("dbgt %0,%l1\n\tjbgt %l2", operands); -#else - output_asm_insn ("dbgt %0,%l1\n\tjgt %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbgt %0,%l1\n\tjbgt %l2" : + "dbgt %0,%l1\n\tjgt %l2", + operands); + break; case GTU: -#ifdef MOTOROLA - output_asm_insn ("dbhi %0,%l1\n\tjbhi %l2", operands); -#else - output_asm_insn ("dbhi %0,%l1\n\tjhi %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbhi %0,%l1\n\tjbhi %l2" : + "dbhi %0,%l1\n\tjhi %l2", + operands); + break; case LT: -#ifdef MOTOROLA - output_asm_insn ("dblt %0,%l1\n\tjblt %l2", operands); -#else - output_asm_insn ("dblt %0,%l1\n\tjlt %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dblt %0,%l1\n\tjblt %l2" : + "dblt %0,%l1\n\tjlt %l2", + operands); + break; case LTU: -#ifdef MOTOROLA - output_asm_insn ("dbcs %0,%l1\n\tjbcs %l2", operands); -#else - output_asm_insn ("dbcs %0,%l1\n\tjcs %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbcs %0,%l1\n\tjbcs %l2" : + "dbcs %0,%l1\n\tjcs %l2", + operands); + break; case GE: -#ifdef MOTOROLA - output_asm_insn ("dbge %0,%l1\n\tjbge %l2", operands); -#else - output_asm_insn ("dbge %0,%l1\n\tjge %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbge %0,%l1\n\tjbge %l2" : + "dbge %0,%l1\n\tjge %l2", + operands); + break; case GEU: -#ifdef MOTOROLA - output_asm_insn ("dbcc %0,%l1\n\tjbcc %l2", operands); -#else - output_asm_insn ("dbcc %0,%l1\n\tjcc %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbcc %0,%l1\n\tjbcc %l2" : + "dbcc %0,%l1\n\tjcc %l2", + operands); + break; case LE: -#ifdef MOTOROLA - output_asm_insn ("dble %0,%l1\n\tjble %l2", operands); -#else - output_asm_insn ("dble %0,%l1\n\tjle %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dble %0,%l1\n\tjble %l2" : + "dble %0,%l1\n\tjle %l2", + operands); + break; case LEU: -#ifdef MOTOROLA - output_asm_insn ("dbls %0,%l1\n\tjbls %l2", operands); -#else - output_asm_insn ("dbls %0,%l1\n\tjls %l2", operands); -#endif - break; + output_asm_insn (MOTOROLA ? + "dbls %0,%l1\n\tjbls %l2" : + "dbls %0,%l1\n\tjls %l2", + operands); + break; default: abort (); @@ -1261,11 +1119,10 @@ output_dbcc_and_branch (rtx *operands) switch (GET_MODE (operands[0])) { case SImode: -#ifdef MOTOROLA - output_asm_insn ("clr%.w %0\n\tsubq%.l %#1,%0\n\tjbpl %l1", operands); -#else - output_asm_insn ("clr%.w %0\n\tsubq%.l %#1,%0\n\tjpl %l1", operands); -#endif + output_asm_insn (MOTOROLA ? + "clr%.w %0\n\tsubq%.l %#1,%0\n\tjbpl %l1" : + "clr%.w %0\n\tsubq%.l %#1,%0\n\tjpl %l1", + operands); break; case HImode: @@ -1312,18 +1169,17 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) loperands[4] = gen_label_rtx(); if (operand2 != const0_rtx) { -#ifdef MOTOROLA + if (MOTOROLA) #ifdef SGS_CMP_ORDER - output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands); + output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands); #else - output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands); + output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands); #endif -#else + else #ifdef SGS_CMP_ORDER - output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands); + output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands); #else - output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands); -#endif + output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands); #endif } else @@ -1339,11 +1195,7 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) #endif } -#ifdef MOTOROLA - output_asm_insn ("jbne %l4", loperands); -#else - output_asm_insn ("jne %l4", loperands); -#endif + output_asm_insn (MOTOROLA ? "jbne %l4" : "jne %l4", loperands); if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (loperands[1])) output_asm_insn ("tst%.l %1", loperands); @@ -1375,11 +1227,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) case GT: loperands[6] = gen_label_rtx(); -#ifdef MOTOROLA - output_asm_insn ("shi %5\n\tjbra %l6", loperands); -#else - output_asm_insn ("shi %5\n\tjra %l6", loperands); -#endif + output_asm_insn (MOTOROLA ? + "shi %5\n\tjbra %l6" : + "shi %5\n\tjra %l6", + loperands); (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (loperands[4])); output_asm_insn ("sgt %5", loperands); @@ -1395,11 +1246,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) case LT: loperands[6] = gen_label_rtx(); -#ifdef MOTOROLA - output_asm_insn ("scs %5\n\tjbra %l6", loperands); -#else - output_asm_insn ("scs %5\n\tjra %l6", loperands); -#endif + output_asm_insn (MOTOROLA ? + "scs %5\n\tjbra %l6" : + "scs %5\n\tjra %l6", + loperands); (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (loperands[4])); output_asm_insn ("slt %5", loperands); @@ -1415,11 +1265,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) case GE: loperands[6] = gen_label_rtx(); -#ifdef MOTOROLA - output_asm_insn ("scc %5\n\tjbra %l6", loperands); -#else - output_asm_insn ("scc %5\n\tjra %l6", loperands); -#endif + output_asm_insn (MOTOROLA ? + "scc %5\n\tjbra %l6" : + "scc %5\n\tjra %l6", + loperands); (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (loperands[4])); output_asm_insn ("sge %5", loperands); @@ -1435,11 +1284,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) case LE: loperands[6] = gen_label_rtx(); -#ifdef MOTOROLA - output_asm_insn ("sls %5\n\tjbra %l6", loperands); -#else - output_asm_insn ("sls %5\n\tjra %l6", loperands); -#endif + output_asm_insn (MOTOROLA ? + "sls %5\n\tjbra %l6" : + "sls %5\n\tjra %l6", + loperands); (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (loperands[4])); output_asm_insn ("sle %5", loperands); @@ -1937,7 +1785,7 @@ output_move_himode (rtx *operands) && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) != PLUS) { rtx labelref = XEXP (XEXP (operands[1], 0), 1); -#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES) +#if MOTOROLA && !defined (SGS_SWITCH_TABLES) #ifdef SGS asm_fprintf (asm_out_file, "\tset %LLI%d,.+2\n", CODE_LABEL_NUMBER (XEXP (labelref, 0))); @@ -2461,17 +2309,22 @@ output_addsi3 (rtx *operands) return "lea 0(%1,%2.l),%0"; else return "lea %c2(%1),%0"; -#elif defined(MOTOROLA) - if (GET_CODE (operands[2]) == REG) - return "lea (%1,%2.l),%0"; - else - return "lea (%c2,%1),%0"; -#else /* not MOTOROLA (MIT syntax) */ - if (GET_CODE (operands[2]) == REG) - return "lea %1@(0,%2:l),%0"; - else - return "lea %1@(%c2),%0"; -#endif /* not MOTOROLA */ +#else /* !SGS */ + if (MOTOROLA) + { + if (GET_CODE (operands[2]) == REG) + return "lea (%1,%2.l),%0"; + else + return "lea (%c2,%1),%0"; + } + else /* !MOTOROLA (MIT syntax) */ + { + if (GET_CODE (operands[2]) == REG) + return "lea %1@(0,%2:l),%0"; + else + return "lea %1@(%c2),%0"; + } +#endif /* !SGS */ } if (GET_CODE (operands[2]) == CONST_INT) { @@ -2509,11 +2362,7 @@ output_addsi3 (rtx *operands) if (TARGET_68040) return "add%.w %2,%0"; else -#ifdef MOTOROLA - return "lea (%c2,%0),%0"; -#else - return "lea %0@(%c2),%0"; -#endif + return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0"; } } return "add%.l %2,%0"; @@ -2595,12 +2444,17 @@ notice_update_cc (rtx exp, rtx insn) if (cc_status.value2 != 0) switch (GET_CODE (cc_status.value2)) { - case PLUS: case MINUS: case MULT: - case DIV: case UDIV: case MOD: case UMOD: case NEG: -#if 0 /* These instructions always clear the overflow bit */ case ASHIFT: case ASHIFTRT: case LSHIFTRT: case ROTATE: case ROTATERT: -#endif + /* These instructions always clear the overflow bit, and set + the carry to the bit shifted out. */ + /* ??? We don't currently have a way to signal carry not valid, + nor do we check for it in the branch insns. */ + CC_STATUS_INIT; + break; + + case PLUS: case MINUS: case MULT: + case DIV: case UDIV: case MOD: case UMOD: case NEG: if (GET_MODE (cc_status.value2) != VOIDmode) cc_status.flags |= CC_NO_OVERFLOW; break; @@ -2813,60 +2667,31 @@ print_operand (FILE *file, rtx op, int letter) { if (letter == '.') { -#if defined (MOTOROLA) - fprintf (file, "."); -#endif + if (MOTOROLA) + fprintf (file, "."); } else if (letter == '#') - { - asm_fprintf (file, "%I"); - } + asm_fprintf (file, "%I"); else if (letter == '-') - { -#ifdef MOTOROLA - asm_fprintf (file, "-(%Rsp)"); -#else - asm_fprintf (file, "%Rsp@-"); -#endif - } + asm_fprintf (file, MOTOROLA ? "-(%Rsp)" : "%Rsp@-"); else if (letter == '+') - { -#ifdef MOTOROLA - asm_fprintf (file, "(%Rsp)+"); -#else - asm_fprintf (file, "%Rsp@+"); -#endif - } + asm_fprintf (file, MOTOROLA ? "(%Rsp)+" : "%Rsp@+"); else if (letter == '@') - { -#ifdef MOTOROLA - asm_fprintf (file, "(%Rsp)"); -#else - asm_fprintf (file, "%Rsp@"); -#endif - } + asm_fprintf (file, MOTOROLA ? "(%Rsp)" : "%Rsp@"); else if (letter == '!') - { - asm_fprintf (file, "%Rfpcr"); - } + asm_fprintf (file, "%Rfpcr"); else if (letter == '$') { if (TARGET_68040_ONLY) - { - fprintf (file, "s"); - } + fprintf (file, "s"); } else if (letter == '&') { if (TARGET_68040_ONLY) - { - fprintf (file, "d"); - } + fprintf (file, "d"); } else if (letter == '/') - { - asm_fprintf (file, "%R"); - } + asm_fprintf (file, "%R"); else if (letter == 'o') { /* This is only for direct addresses with TARGET_PCREL */ @@ -2892,13 +2717,7 @@ print_operand (FILE *file, rtx op, int letter) && !(GET_CODE (XEXP (op, 0)) == CONST_INT && INTVAL (XEXP (op, 0)) < 0x8000 && INTVAL (XEXP (op, 0)) >= -0x8000)) - { -#ifdef MOTOROLA - fprintf (file, ".l"); -#else - fprintf (file, ":l"); -#endif - } + fprintf (file, MOTOROLA ? ".l" : ":l"); } else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == SFmode) { @@ -2963,18 +2782,18 @@ print_operand (FILE *file, rtx op, int letter) -fPIC code the offset is output in long mode (eg movel a5@(_foo:l), a0) */ #ifndef ASM_OUTPUT_CASE_FETCH -#ifdef MOTOROLA -#ifdef SGS -#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ +# if MOTOROLA +# ifdef SGS +# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ asm_fprintf (file, "%LLD%d(%Rpc,%s.", labelno, regname) -#else -#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ +# else /* !SGS */ +# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ asm_fprintf (file, "%LL%d-%LLI%d.b(%Rpc,%s.", labelno, labelno, regname) -#endif -#else -#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ +# endif /* !SGS */ +# else /* !MOTOROLA */ +# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ asm_fprintf (file, "%Rpc@(%LL%d-%LLI%d-2:b,%s:", labelno, labelno, regname) -#endif +# endif /* !MOTOROLA */ #endif /* ASM_OUTPUT_CASE_FETCH */ void @@ -2986,25 +2805,15 @@ print_operand_address (FILE *file, rtx addr) switch (GET_CODE (addr)) { case REG: -#ifdef MOTOROLA - fprintf (file, "(%s)", reg_names[REGNO (addr)]); -#else - fprintf (file, "%s@", reg_names[REGNO (addr)]); -#endif + fprintf (file, MOTOROLA ? "(%s)" : "%s@", reg_names[REGNO (addr)]); break; case PRE_DEC: -#ifdef MOTOROLA - fprintf (file, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]); -#else - fprintf (file, "%s@-", reg_names[REGNO (XEXP (addr, 0))]); -#endif + fprintf (file, MOTOROLA ? "-(%s)" : "%s@-", + reg_names[REGNO (XEXP (addr, 0))]); break; case POST_INC: -#ifdef MOTOROLA - fprintf (file, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]); -#else - fprintf (file, "%s@+", reg_names[REGNO (XEXP (addr, 0))]); -#endif + fprintf (file, MOTOROLA ? "(%s)+" : "%s@+", + reg_names[REGNO (XEXP (addr, 0))]); break; case PLUS: reg1 = reg2 = ireg = breg = offset = 0; @@ -3124,13 +2933,7 @@ print_operand_address (FILE *file, rtx addr) fprintf (file, "l"); } if (scale != 1) - { -#ifdef MOTOROLA - fprintf (file, "*%d", scale); -#else - fprintf (file, ":%d", scale); -#endif - } + fprintf (file, MOTOROLA ? "*%d" : ":%d", scale); putc (')', file); break; } @@ -3154,66 +2957,55 @@ print_operand_address (FILE *file, rtx addr) { abort (); } -#ifdef MOTOROLA - if (addr != 0) + if (MOTOROLA) { - output_addr_const (file, addr); - if (flag_pic && (breg == pic_offset_table_rtx)) + if (addr != 0) { - fprintf (file, "@GOT"); - if (flag_pic == 1) - fprintf (file, ".w"); + output_addr_const (file, addr); + if (flag_pic && (breg == pic_offset_table_rtx)) + { + fprintf (file, "@GOT"); + if (flag_pic == 1) + fprintf (file, ".w"); + } } + fprintf (file, "(%s", reg_names[REGNO (breg)]); + if (ireg != 0) + putc (',', file); } - fprintf (file, "(%s", reg_names[REGNO (breg)]); - if (ireg != 0) - { - putc (',', file); - } -#else - fprintf (file, "%s@(", reg_names[REGNO (breg)]); - if (addr != 0) - { - output_addr_const (file, addr); - if ((flag_pic == 1) && (breg == pic_offset_table_rtx)) - fprintf (file, ":w"); - if ((flag_pic == 2) && (breg == pic_offset_table_rtx)) - fprintf (file, ":l"); - } - if (addr != 0 && ireg != 0) + else /* !MOTOROLA */ { - putc (',', file); - } -#endif + fprintf (file, "%s@(", reg_names[REGNO (breg)]); + if (addr != 0) + { + output_addr_const (file, addr); + if (breg == pic_offset_table_rtx) + switch (flag_pic) + { + case 1: + fprintf (file, ":w"); break; + case 2: + fprintf (file, ":l"); break; + default: + break; + } + if (ireg != 0) + putc (',', file); + } + } /* !MOTOROLA */ if (ireg != 0 && GET_CODE (ireg) == MULT) { scale = INTVAL (XEXP (ireg, 1)); ireg = XEXP (ireg, 0); } if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) - { -#ifdef MOTOROLA - fprintf (file, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]); -#else - fprintf (file, "%s:w", reg_names[REGNO (XEXP (ireg, 0))]); -#endif - } + fprintf (file, MOTOROLA ? "%s.w" : "%s:w", + reg_names[REGNO (XEXP (ireg, 0))]); else if (ireg != 0) - { -#ifdef MOTOROLA - fprintf (file, "%s.l", reg_names[REGNO (ireg)]); -#else - fprintf (file, "%s:l", reg_names[REGNO (ireg)]); -#endif - } + fprintf (file, MOTOROLA ? "%s.l" : "%s:l", + reg_names[REGNO (ireg)]); if (scale != 1) - { -#ifdef MOTOROLA - fprintf (file, "*%d", scale); -#else - fprintf (file, ":%d", scale); -#endif - } + fprintf (file, MOTOROLA ? "*%d" : ":%d", scale); putc (')', file); break; } @@ -3232,16 +3024,15 @@ print_operand_address (FILE *file, rtx addr) && INTVAL (addr) < 0x8000 && INTVAL (addr) >= -0x8000) { -#ifdef MOTOROLA + if (MOTOROLA) #ifdef SGS - /* Many SGS assemblers croak on size specifiers for constants. */ - fprintf (file, "%d", (int) INTVAL (addr)); -#else - fprintf (file, "%d.w", (int) INTVAL (addr)); -#endif + /* Many SGS assemblers croak on size specifiers for constants. */ + fprintf (file, "%d", (int) INTVAL (addr)); #else - fprintf (file, "%d:w", (int) INTVAL (addr)); + fprintf (file, "%d.w", (int) INTVAL (addr)); #endif + else /* !MOTOROLA */ + fprintf (file, "%d:w", (int) INTVAL (addr)); } else if (GET_CODE (addr) == CONST_INT) { @@ -3327,7 +3118,6 @@ strict_low_part_peephole_ok (enum machine_mode mode, rtx first_insn, } p = prev_nonnote_insn (p); - } return false; @@ -3648,23 +3438,20 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, const char *fmt; if (delta > 0 && delta <= 8) -#ifdef MOTOROLA - asm_fprintf (file, "\taddq.l %I%d,4(%Rsp)\n", (int) delta); -#else - asm_fprintf (file, "\taddql %I%d,%Rsp@(4)\n", (int) delta); -#endif + asm_fprintf (file, MOTOROLA ? + "\taddq.l %I%d,4(%Rsp)\n" : + "\taddql %I%d,%Rsp@(4)\n", + (int) delta); else if (delta < 0 && delta >= -8) -#ifdef MOTOROLA - asm_fprintf (file, "\tsubq.l %I%d,4(%Rsp)\n", (int) -delta); -#else - asm_fprintf (file, "\tsubql %I%d,%Rsp@(4)\n", (int) -delta); -#endif + asm_fprintf (file, MOTOROLA ? + "\tsubq.l %I%d,4(%Rsp)\n" : + "\tsubql %I%d,%Rsp@(4)\n", + (int) -delta); else -#ifdef MOTOROLA - asm_fprintf (file, "\tadd.l %I%wd,4(%Rsp)\n", delta); -#else - asm_fprintf (file, "\taddl %I%wd,%Rsp@(4)\n", delta); -#endif + asm_fprintf (file, MOTOROLA ? + "\tadd.l %I%wd,4(%Rsp)\n" : + "\taddl %I%wd,%Rsp@(4)\n", + delta); xops[0] = DECL_RTL (function); @@ -3675,22 +3462,19 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, fmt = "bra.l %o0"; else if ((flag_pic == 1) || TARGET_68020) { -#ifdef MOTOROLA + if (MOTOROLA) #ifdef HPUX_ASM - fmt = "bra.l %0"; -#else -#ifdef USE_GAS - fmt = "bra.l %0@PLTPC"; + fmt = "bra.l %0"; +#elif defined(USE_GAS) + fmt = "bra.l %0@PLTPC"; #else - fmt = "bra %0@PLTPC"; -#endif + fmt = "bra %0@PLTPC"; #endif -#else + else /* !MOTOROLA */ #ifdef USE_GAS - fmt = "bra.l %0"; + fmt = "bra.l %0"; #else - fmt = "jra %0,a1"; -#endif + fmt = "jra %0,a1"; #endif } else if (optimize_size || TARGET_ID_SHARED_LIBRARY) @@ -3700,7 +3484,7 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, } else { -#if defined (MOTOROLA) && !defined (USE_GAS) +#if MOTOROLA && !defined (USE_GAS) fmt = "jmp %0"; #else fmt = "jra %0"; diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index d1f4243a2d2..423895de32c 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -20,6 +20,18 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to have MOTOROLA always defined (either 0 or 1) because we use + if-statements and ?: on it. This way we have compile-time error checking + for both the MOTOROLA and MIT code paths. We do rely on the host compiler + to optimize away all constant tests. */ +#ifdef MOTOROLA +# undef MOTOROLA +# define MOTOROLA 1 /* Use the Motorola assembly syntax. */ +# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)") +#else +# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)") +# define MOTOROLA 0 /* Use the MIT assembly syntax. */ +#endif /* Note that some other tm.h files include this one and then override many of the definitions that relate to assembler syntax. */ @@ -103,13 +115,6 @@ Boston, MA 02111-1307, USA. */ /* Set the default */ #define INT_OP_GROUP INT_OP_DOT_WORD -/* Print subsidiary information on the compiler version in use. */ -#ifdef MOTOROLA -#define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)"); -#else -#define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)"); -#endif - /* Run-time compilation parameters selecting different hardware subsets. */ extern int target_flags; @@ -208,7 +213,7 @@ extern int target_flags; #define MASK_RTD (1<<16) #define TARGET_RTD (target_flags & MASK_RTD) -/* Support A5 relative data seperate from text. +/* Support A5 relative data separate from text. * This option implies -fPIC, however it inhibits the generation of the * A5 save/restore in functions and the loading of a5 with a got pointer. */ @@ -1399,11 +1404,11 @@ __transfer_from_trampoline () \ #define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN) #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \ -{ if (cc_prev_status.flags & CC_IN_68881) \ +do { if (cc_prev_status.flags & CC_IN_68881) \ return FLOAT; \ if (cc_prev_status.flags & CC_NO_OVERFLOW) \ return NO_OV; \ - return NORMAL; } + return NORMAL; } while (0) /* Control the assembler format that we output. */ diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 5883f4ba35a..11f219c8266 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -698,18 +698,14 @@ if (!TARGET_68040 && !TARGET_68060) return \"sub%.l %0,%0\"; else - { -#ifdef MOTOROLA + return MOTOROLA ? #ifdef SGS /* Many SGS assemblers croak on size specifiers for constants. */ - return \"lea 0,%0\"; -#else - return \"lea 0.w,%0\"; -#endif + \"lea 0,%0\" : #else - return \"lea 0:w,%0\"; + \"lea 0.w,%0\" : #endif - } + \"lea 0:w,%0\"; } /* moveq is faster on the 68000. */ if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_COLDFIRE)) @@ -907,18 +903,14 @@ if (!TARGET_68040 && !TARGET_68060) return \"sub%.l %0,%0\"; else - { -#ifdef MOTOROLA + return MOTOROLA ? #ifdef SGS /* Many SGS assemblers croak on size specifiers for constants. */ - return \"lea 0,%0\"; -#else - return \"lea 0.w,%0\"; -#endif + \"lea 0,%0\" : #else - return \"lea 0:w,%0\"; + \"lea 0.w,%0\" : #endif - } + \"lea 0:w,%0\"; } /* moveq is faster on the 68000. */ if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_COLDFIRE)) @@ -1448,29 +1440,26 @@ && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) { operands[0] = XEXP (XEXP (operands[0], 0), 0); -#ifdef MOTOROLA + return MOTOROLA ? #ifdef SGS - return \"clr%.l -(%0)\;move%.b %1,3(%0)\"; -#else - return \"clr%.l -(%0)\;move%.b %1,(3,%0)\"; -#endif + \"clr%.l -(%0)\;move%.b %1,3(%0)\" : #else - return \"clrl %0@-\;moveb %1,%0@(3)\"; + \"clr%.l -(%0)\;move%.b %1,(3,%0)\" : #endif + \"clrl %0@-\;moveb %1,%0@(3)\"; + } else if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == POST_INC) { operands[0] = XEXP (XEXP (operands[0], 0), 0); -#ifdef MOTOROLA + return MOTOROLA ? #ifdef SGS - return \"clr%.l (%0)+\;move%.b %1,-1(%0)\"; + \"clr%.l (%0)+\;move%.b %1,-1(%0)\" : #else - return \"clr%.l (%0)+\;move%.b %1,(-1,%0)\"; -#endif -#else - return \"clrl %0@+\;moveb %1,%0@(-1)\"; + \"clr%.l (%0)+\;move%.b %1,(-1,%0)\" : #endif + \"clrl %0@+\;moveb %1,%0@(-1)\"; } else { @@ -2003,11 +1992,7 @@ operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0)); } output_asm_insn (\"move%.l %1,%0\", operands); -#ifdef MOTOROLA - output_asm_insn (\"jbpl %l3\", operands); -#else - output_asm_insn (\"jpl %l3\", operands); -#endif + output_asm_insn (MOTOROLA ? \"jbpl %l3\" : \"jpl %l3\", operands); output_asm_insn (\"addq%.l %#1,%2\", operands); (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[3])); @@ -2094,11 +2079,7 @@ } } if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) -#ifdef MOTOROLA - return \"lea (%c2,%0),%0\"; -#else - return \"lea %0@(%c2),%0\"; -#endif + return MOTOROLA ? \"lea (%c2,%0),%0\" : \"lea %0@(%c2),%0\"; } return \"add%.w %2,%0\"; }") @@ -2154,11 +2135,7 @@ } } if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) -#ifdef MOTOROLA - return \"lea (%c1,%0),%0\"; -#else - return \"lea %0@(%c1),%0\"; -#endif + return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\"; } return \"add%.w %1,%0\"; }") @@ -2208,11 +2185,7 @@ } } if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) -#ifdef MOTOROLA - return \"lea (%c1,%0),%0\"; -#else - return \"lea %0@(%c1),%0\"; -#endif + return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\"; } return \"add%.w %1,%0\"; }") @@ -2621,11 +2594,7 @@ "" "* { -#if defined(MOTOROLA) - return \"muls%.w %2,%0\"; -#else - return \"muls %2,%0\"; -#endif + return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\"; }") (define_insn "mulhisi3" @@ -2637,11 +2606,7 @@ "" "* { -#if defined(MOTOROLA) - return \"muls%.w %2,%0\"; -#else - return \"muls %2,%0\"; -#endif + return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\"; }") (define_insn "" @@ -2652,11 +2617,7 @@ "INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff" "* { -#if defined(MOTOROLA) - return \"muls%.w %2,%0\"; -#else - return \"muls %2,%0\"; -#endif + return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\"; }") (define_expand "mulsi3" @@ -2690,11 +2651,7 @@ "" "* { -#if defined(MOTOROLA) - return \"mulu%.w %2,%0\"; -#else - return \"mulu %2,%0\"; -#endif + return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\"; }") (define_insn "" @@ -2705,11 +2662,7 @@ "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff" "* { -#if defined(MOTOROLA) - return \"mulu%.w %2,%0\"; -#else - return \"mulu %2,%0\"; -#endif + return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\"; }") ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the @@ -3182,11 +3135,10 @@ "!TARGET_COLDFIRE || TARGET_CF_HWDIV" "* { -#ifdef MOTOROLA - output_asm_insn (\"ext%.l %0\;divs%.w %2,%0\", operands); -#else - output_asm_insn (\"extl %0\;divs %2,%0\", operands); -#endif + output_asm_insn (MOTOROLA ? + \"ext%.l %0\;divs%.w %2,%0\" : + \"extl %0\;divs %2,%0\", + operands); if (!find_reg_note(insn, REG_UNUSED, operands[3])) { CC_STATUS_INIT; @@ -3205,11 +3157,10 @@ "!TARGET_COLDFIRE || TARGET_CF_HWDIV" "* { -#ifdef MOTOROLA - output_asm_insn (\"and%.l %#0xFFFF,%0\;divu%.w %2,%0\", operands); -#else - output_asm_insn (\"and%.l %#0xFFFF,%0\;divu %2,%0\", operands); -#endif + output_asm_insn (MOTOROLA ? + \"and%.l %#0xFFFF,%0\;divu%.w %2,%0\" : + \"and%.l %#0xFFFF,%0\;divu %2,%0\", + operands); if (!find_reg_note(insn, REG_UNUSED, operands[3])) { CC_STATUS_INIT; @@ -5663,22 +5614,19 @@ { CC_STATUS_INIT; if (which_alternative == 1) -#ifdef MOTOROLA - return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\"; -#else - return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\"; -#endif + { + if (MOTOROLA) + return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\"; + else + return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\"; + } if ((cc_prev_status.value1 && rtx_equal_p (cc_prev_status.value1, operands[0])) || (cc_prev_status.value2 && rtx_equal_p (cc_prev_status.value2, operands[0]))) { cc_status = cc_prev_status; -#ifdef MOTOROLA - return \"jbeq %l1\"; -#else - return \"jeq %l1\"; -#endif + return MOTOROLA ? \"jbeq %l1\" : \"jeq %l1\"; } if (GET_CODE (operands[0]) == REG) operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); @@ -5690,47 +5638,42 @@ { if (reg_overlap_mentioned_p (operands[2], operands[3])) { -#ifdef MOTOROLA - return \"or%.l %0,%2\;jbeq %l1\"; -#else - return \"or%.l %0,%2\;jeq %l1\"; -#endif + if (MOTOROLA) + return \"or%.l %0,%2\;jbeq %l1\"; + else + return \"or%.l %0,%2\;jeq %l1\"; } else { -#ifdef MOTOROLA - return \"or%.l %3,%2\;jbeq %l1\"; -#else - return \"or%.l %3,%2\;jeq %l1\"; -#endif + if (MOTOROLA) + return \"or%.l %3,%2\;jbeq %l1\"; + else + return \"or%.l %3,%2\;jeq %l1\"; } } -#ifdef MOTOROLA - return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\"; -#else - return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\"; -#endif + if (MOTOROLA) + return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\"; + else + return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\"; } operands[4] = gen_label_rtx(); if (TARGET_68020 || TARGET_COLDFIRE) { -#ifdef MOTOROLA - output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands); -#else - output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands); -#endif + if (MOTOROLA) + output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands); + else + output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands); } else { -#ifdef MOTOROLA + if (MOTOROLA) #ifdef SGS_CMP_ORDER - output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands); -#else - output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands); -#endif + output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands); #else - output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands); + output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands); #endif + else + output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands); } (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4])); @@ -5753,11 +5696,7 @@ && rtx_equal_p (cc_prev_status.value2, operands[0]))) { cc_status = cc_prev_status; -#ifdef MOTOROLA - return \"jbne %l1\"; -#else - return \"jne %l1\"; -#endif + return MOTOROLA ? \"jbne %l1\" : \"jne %l1\"; } CC_STATUS_INIT; if (GET_CODE (operands[0]) == REG) @@ -5770,46 +5709,41 @@ { if (reg_overlap_mentioned_p (operands[2], operands[3])) { -#ifdef MOTOROLA - return \"or%.l %0,%2\;jbne %l1\"; -#else - return \"or%.l %0,%2\;jne %l1\"; -#endif + if (MOTOROLA) + return \"or%.l %0,%2\;jbne %l1\"; + else + return \"or%.l %0,%2\;jne %l1\"; } else { -#ifdef MOTOROLA - return \"or%.l %3,%2\;jbne %l1\"; -#else - return \"or%.l %3,%2\;jne %l1\"; -#endif + if (MOTOROLA) + return \"or%.l %3,%2\;jbne %l1\"; + else + return \"or%.l %3,%2\;jne %l1\"; } } -#ifdef MOTOROLA - return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\"; -#else - return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\"; -#endif + if (MOTOROLA) + return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\"; + else + return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\"; } if (TARGET_68020 || TARGET_COLDFIRE) { -#ifdef MOTOROLA - return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\"; -#else - return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\"; -#endif + if (MOTOROLA) + return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\"; + else + return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\"; } else { -#ifdef MOTOROLA + if (MOTOROLA) #ifdef SGS_CMP_ORDER - return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\"; + return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\"; #else - return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\"; -#endif -#else - return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\"; + return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\"; #endif + else + return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\"; } } ") @@ -5830,19 +5764,11 @@ cc_status = cc_prev_status; if (cc_status.flags & CC_REVERSED) { -#ifdef MOTOROLA - return \"jble %l1\"; -#else - return \"jle %l1\"; -#endif + return MOTOROLA ? \"jble %l1\" : \"jle %l1\"; } else { -#ifdef MOTOROLA - return \"jbpl %l1\"; -#else - return \"jpl %l1\"; -#endif + return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\"; } } CC_STATUS_INIT; @@ -5858,11 +5784,7 @@ #endif } -#ifdef MOTOROLA - return \"jbpl %l1\"; -#else - return \"jpl %l1\"; -#endif + return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\"; } ") (define_insn "blt0_di" @@ -5882,19 +5804,11 @@ cc_status = cc_prev_status; if (cc_status.flags & CC_REVERSED) { -#ifdef MOTOROLA - return \"jbgt %l1\"; -#else - return \"jgt %l1\"; -#endif + return MOTOROLA ? \"jbgt %l1\" : \"jgt %l1\"; } else { -#ifdef MOTOROLA - return \"jbmi %l1\"; -#else - return \"jmi %l1\"; -#endif + return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\"; } } CC_STATUS_INIT; @@ -5910,11 +5824,7 @@ #endif } -#ifdef MOTOROLA - return \"jbmi %l1\"; -#else - return \"jmi %l1\"; -#endif + return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\"; } ") (define_insn "beq" @@ -5926,11 +5836,10 @@ "" "* { -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\"); -#else - OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\"); + else + OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\"); }") (define_insn "bne" @@ -5942,11 +5851,10 @@ "" "* { -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\"); -#else - OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\"); + else + OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\"); }") (define_insn "bgt" @@ -5957,11 +5865,10 @@ (pc)))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0); -#else - OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0); + else + OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0); ") (define_insn "bgtu" @@ -5972,11 +5879,7 @@ (pc)))] "" "* -#ifdef MOTOROLA - return \"jbhi %l0\"; -#else - return \"jhi %l0\"; -#endif + return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\"; ") (define_insn "blt" @@ -5987,11 +5890,10 @@ (pc)))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\"); -#else - OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\"); + else + OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\"); ") (define_insn "bltu" @@ -6002,11 +5904,7 @@ (pc)))] "" "* -#ifdef MOTOROLA - return \"jbcs %l0\"; -#else - return \"jcs %l0\"; -#endif + return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\"; ") (define_insn "bge" @@ -6017,11 +5915,10 @@ (pc)))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\"); -#else - OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\"); + else + OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\"); ") (define_insn "bgeu" @@ -6032,11 +5929,7 @@ (pc)))] "" "* -#ifdef MOTOROLA - return \"jbcc %l0\"; -#else - return \"jcc %l0\"; -#endif + return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\"; ") (define_insn "ble" @@ -6047,11 +5940,10 @@ (pc)))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0); -#else - OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0); + else + OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0); ") (define_insn "bleu" @@ -6062,11 +5954,7 @@ (pc)))] "" "* -#ifdef MOTOROLA - return \"jbls %l0\"; -#else - return \"jls %l0\"; -#endif + return MOTOROLA ? \"jbls %l0\" : \"jls %l0\"; ") (define_insn "bordered" @@ -6078,11 +5966,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbor %l0"; -#else - return "fjor %l0"; -#endif + return MOTOROLA ? "fbor %l0" : "fjor %l0"; }) (define_insn "bunordered" @@ -6094,11 +5978,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbun %l0"; -#else - return "fjun %l0"; -#endif + return MOTOROLA ? "fbun %l0" : "fjun %l0"; }) (define_insn "buneq" @@ -6110,11 +5990,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbueq %l0"; -#else - return "fjueq %l0"; -#endif + return MOTOROLA ? "fbueq %l0" : "fjueq %l0"; }) (define_insn "bunge" @@ -6126,11 +6002,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbuge %l0"; -#else - return "fjuge %l0"; -#endif + return MOTOROLA ? "fbuge %l0" : "fjuge %l0"; }) (define_insn "bungt" @@ -6142,11 +6014,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbugt %l0"; -#else - return "fjugt %l0"; -#endif + return MOTOROLA ? "fbugt %l0" : "fjugt %l0"; }) (define_insn "bunle" @@ -6158,11 +6026,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbule %l0"; -#else - return "fjule %l0"; -#endif + return MOTOROLA ? "fbule %l0" : "fjule %l0"; }) (define_insn "bunlt" @@ -6174,11 +6038,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbult %l0"; -#else - return "fjult %l0"; -#endif + return MOTOROLA ? "fbult %l0" : "fjult %l0"; }) (define_insn "bltgt" @@ -6190,11 +6050,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbogl %l0"; -#else - return "fjogl %l0"; -#endif + return MOTOROLA ? "fbogl %l0" : "fjogl %l0"; }) ;; Negated conditional jump instructions. @@ -6208,11 +6064,10 @@ "" "* { -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\"); -#else - OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\"); + else + OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\"); }") (define_insn "" @@ -6224,11 +6079,10 @@ "" "* { -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\"); -#else - OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\"); + else + OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\"); }") (define_insn "" @@ -6239,11 +6093,10 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0); -#else - OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0); + else + OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0); ") (define_insn "" @@ -6254,11 +6107,7 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - return \"jbls %l0\"; -#else - return \"jls %l0\"; -#endif + return MOTOROLA ? \"jbls %l0\" : \"jls %l0\"; ") (define_insn "" @@ -6269,11 +6118,10 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\"); -#else - OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\"); + else + OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\"); ") (define_insn "" @@ -6284,11 +6132,7 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - return \"jbcc %l0\"; -#else - return \"jcc %l0\"; -#endif + return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\"; ") (define_insn "" @@ -6299,11 +6143,10 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\"); -#else - OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\"); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\"); + else + OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\"); ") (define_insn "" @@ -6314,11 +6157,7 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - return \"jbcs %l0\"; -#else - return \"jcs %l0\"; -#endif + return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\"; ") (define_insn "" @@ -6329,11 +6168,10 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0); -#else - OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0); -#endif + if (MOTOROLA) + OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0); + else + OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0); ") (define_insn "" @@ -6344,11 +6182,7 @@ (label_ref (match_operand 0 "" ""))))] "" "* -#ifdef MOTOROLA - return \"jbhi %l0\"; -#else - return \"jhi %l0\"; -#endif + return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\"; ") (define_insn "*bordered_rev" @@ -6360,11 +6194,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbun %l0"; -#else - return "fjun %l0"; -#endif + return MOTOROLA ? "fbun %l0" : "fjun %l0"; }) (define_insn "*bunordered_rev" @@ -6376,11 +6206,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbor %l0"; -#else - return "fjor %l0"; -#endif + return MOTOROLA ? "fbor %l0" : "fjor %l0"; }) (define_insn "*buneq_rev" @@ -6392,11 +6218,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbogl %l0"; -#else - return "fjogl %l0"; -#endif + return MOTOROLA ? "fbogl %l0" : "fjogl %l0"; }) (define_insn "*bunge_rev" @@ -6408,11 +6230,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbolt %l0"; -#else - return "fjolt %l0"; -#endif + return MOTOROLA ? "fbolt %l0" : "fjolt %l0"; }) (define_insn "*bunle_rev" @@ -6424,11 +6242,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbogt %l0"; -#else - return "fjogt %l0"; -#endif + return MOTOROLA ? "fbogt %l0" : "fjogt %l0"; }) (define_insn "*bunlt_rev" @@ -6440,11 +6254,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fboge %l0"; -#else - return "fjoge %l0"; -#endif + return MOTOROLA ? "fboge %l0" : "fjoge %l0"; }) (define_insn "*bltgt_rev" @@ -6456,11 +6266,7 @@ { if (!(cc_prev_status.flags & CC_IN_68881)) abort (); -#ifdef MOTOROLA - return "fbueq %l0"; -#else - return "fjueq %l0"; -#endif + return MOTOROLA ? "fbueq %l0" : "fjueq %l0"; }) ;; Unconditional and other jump instructions @@ -6469,11 +6275,7 @@ (label_ref (match_operand 0 "" "")))] "" "* -#ifdef MOTOROLA - return \"jbra %l0\"; -#else - return \"jra %l0\"; -#endif + return MOTOROLA ? \"jbra %l0\" : \"jra %l0\"; ") ;; We support two different ways of handling dispatch tables. @@ -6497,11 +6299,7 @@ (use (label_ref (match_operand 1 "" "")))] "" "* -#ifdef MOTOROLA - return \"jmp (%0)\"; -#else - return \"jmp %0@\"; -#endif + return MOTOROLA ? \"jmp (%0)\" : \"jmp %0@\"; ") ;; Jump to variable address from dispatch table of relative addresses. @@ -6542,28 +6340,16 @@ { if (ADDRESS_REG_P (operands[0])) { -#ifdef MOTOROLA - return \"jmp (2,pc,%0.l)\"; -#else - return \"jmp pc@(2,%0:l)\"; -#endif + return MOTOROLA ? \"jmp (2,pc,%0.l)\" : \"jmp pc@(2,%0:l)\"; } + else if (MOTOROLA) + return \"ext%.l %0\;jmp (2,pc,%0.l)\"; else - { -#ifdef MOTOROLA - return \"ext%.l %0\;jmp (2,pc,%0.l)\"; -#else - return \"extl %0\;jmp pc@(2,%0:l)\"; -#endif - } + return \"extl %0\;jmp pc@(2,%0:l)\"; } else { -#ifdef MOTOROLA - return \"jmp (2,pc,%0.w)\"; -#else - return \"jmp pc@(2,%0:w)\"; -#endif + return MOTOROLA ? \"jmp (2,pc,%0.w)\" : \"jmp pc@(2,%0:w)\"; } #endif #endif @@ -6588,21 +6374,19 @@ return \"dbra %0,%l1\"; if (GET_CODE (operands[0]) == MEM) { -#ifdef MOTOROLA - return \"subq%.w %#1,%0\;jbcc %l1\"; -#else /* not MOTOROLA */ - return \"subqw %#1,%0\;jcc %l1\"; -#endif + if (MOTOROLA) + return \"subq%.w %#1,%0\;jbcc %l1\"; + else + return \"subqw %#1,%0\;jcc %l1\"; } -#ifdef MOTOROLA + if (MOTOROLA) #ifdef SGS_CMP_ORDER - return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\"; + return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\"; #else /* not SGS_CMP_ORDER */ - return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\"; -#endif -#else /* not MOTOROLA */ - return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\"; + return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\"; #endif + else + return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\"; }") (define_insn "" @@ -6619,23 +6403,26 @@ "* { CC_STATUS_INIT; -#ifdef MOTOROLA - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subq%.l %#1,%0\;jbcc %l1\"; + if (MOTOROLA) + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subq%.l %#1,%0\;jbcc %l1\"; #ifdef SGS_CMP_ORDER - return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; + return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; #else /* not SGS_CMP_ORDER */ - return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; + return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; #endif /* not SGS_CMP_ORDER */ -#else /* not MOTOROLA */ - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subql %#1,%0\;jcc %l1\"; - return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\"; -#endif /* not MOTOROLA */ + } + else + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subql %#1,%0\;jcc %l1\"; + return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\"; + } }") ;; Two dbra patterns that use REG_NOTES info generated by strength_reduce. @@ -6655,23 +6442,26 @@ "* { CC_STATUS_INIT; -#ifdef MOTOROLA - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subq%.w %#1,%0\;jbcc %l1\"; + if (MOTOROLA) + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subq%.w %#1,%0\;jbcc %l1\"; #ifdef SGS_CMP_ORDER - return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\"; + return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\"; #else /* not SGS_CMP_ORDER */ - return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\"; + return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\"; #endif /* not SGS_CMP_ORDER */ -#else /* not MOTOROLA */ - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subqw %#1,%0\;jcc %l1\"; - return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\"; -#endif /* not MOTOROLA */ + } + else + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subqw %#1,%0\;jcc %l1\"; + return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\"; + } }") (define_expand "decrement_and_branch_until_zero" @@ -6703,23 +6493,26 @@ "* { CC_STATUS_INIT; -#ifdef MOTOROLA - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subq%.l %#1,%0\;jbcc %l1\"; + if (MOTOROLA) + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subq%.l %#1,%0\;jbcc %l1\"; #ifdef SGS_CMP_ORDER - return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; + return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; #else /* not SGS_CMP_ORDER */ - return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; + return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; #endif /* not SGS_CMP_ORDER */ -#else /* not MOTOROLA */ - if (DATA_REG_P (operands[0])) - return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\"; - if (GET_CODE (operands[0]) == MEM) - return \"subql %#1,%0\;jcc %l1\"; - return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\"; -#endif /* not MOTOROLA */ + } + else + { + if (DATA_REG_P (operands[0])) + return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\"; + if (GET_CODE (operands[0]) == MEM) + return \"subql %#1,%0\;jcc %l1\"; + return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\"; + } }") @@ -6781,7 +6574,7 @@ "! flag_pic" "* -#if defined (MOTOROLA) && !defined (USE_GAS) +#if MOTOROLA && !defined (USE_GAS) return \"jsr %0\"; #else return \"jbsr %0\"; @@ -6823,7 +6616,7 @@ ;; Operand 2 not really used on the m68000. "! flag_pic" "* -#if defined (MOTOROLA) && !defined (USE_GAS) +#if MOTOROLA && !defined (USE_GAS) return \"jsr %1\"; #else return \"jbsr %1\"; @@ -6919,7 +6712,7 @@ && GET_CODE (XEXP (operands[1], 0)) != PLUS) { rtx labelref = XEXP (operands[1], 1); -#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES) +#if MOTOROLA && !defined (SGS_SWITCH_TABLES) #ifdef SGS asm_fprintf (asm_out_file, \"\\tset %LLI%d,.+2\\n\", CODE_LABEL_NUMBER (XEXP (labelref, 0))); @@ -6995,12 +6788,10 @@ { if (TARGET_68040) output_asm_insn (\"add%.w %1,%0\", xoperands); - else -#ifdef MOTOROLA + else if (MOTOROLA) output_asm_insn (\"lea (%c1,%0),%0\", xoperands); -#else + else output_asm_insn (\"lea %0@(%c1),%0\", xoperands); -#endif } else output_asm_insn (\"add%.l %1,%0\", xoperands); @@ -7042,14 +6833,10 @@ { if (TARGET_68040) output_asm_insn (\"add%.w %1,%0\", xoperands); + else if (MOTOROLA) + output_asm_insn (\"lea (%c1,%0),%0\", xoperands); else - { -#ifdef MOTOROLA - output_asm_insn (\"lea (%c1,%0),%0\", xoperands); -#else - output_asm_insn (\"lea %0@(%c1),%0\", xoperands); -#endif - } + output_asm_insn (\"lea %0@(%c1),%0\", xoperands); } else output_asm_insn (\"add%.l %1,%0\", xoperands); diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h index 6aebf3840e8..dfccef66c02 100644 --- a/gcc/config/m68k/m68kelf.h +++ b/gcc/config/m68k/m68kelf.h @@ -22,13 +22,6 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* These are necessary for -fpic/-fPIC to work correctly. */ -#ifndef MOTOROLA -#define MOTOROLA /* Use MOTOROLA syntax. */ -#endif -#ifndef USE_GAS /* forces jsbr instead of jsr. */ -#define USE_GAS -#endif #ifndef SWBEG_ASM_OP #define SWBEG_ASM_OP "\t.swbeg\t" @@ -246,8 +239,6 @@ extern int switch_table_difference_label_flag; fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1)); /* end of stuff from m68kv4.h */ -#undef SGS_CMP_ORDER - #undef ENDFILE_SPEC #define ENDFILE_SPEC "crtend.o%s" diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h index 79569e3e65a..bbc8bdb20c8 100644 --- a/gcc/config/m68k/netbsd-elf.h +++ b/gcc/config/m68k/netbsd-elf.h @@ -143,9 +143,6 @@ while (0) Here is a bunch of stuff lifted from m68kelf.h. We don't use that file directly, because it has a lot of baggage we don't want. */ -#define MOTOROLA /* Use Motorola syntax */ -#define USE_GAS /* But GAS wants jbsr instead of jsr */ - /* The prefix for register names. Note that REGISTER_NAMES is supposed to include this prefix. Also note that this is NOT an diff --git a/gcc/config/m68k/rtemself.h b/gcc/config/m68k/rtemself.h index ea9ed2df249..5945f76c7e6 100644 --- a/gcc/config/m68k/rtemself.h +++ b/gcc/config/m68k/rtemself.h @@ -20,8 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define MOTOROLA /* Use Motorola syntax rather than MIT. */ - /* Target OS builtins. */ #undef TARGET_OS_CPP_BUILTINS /* Defined in m68kemb.h. */ #define TARGET_OS_CPP_BUILTINS() \ diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h index 0231539281d..3ef0b9742a1 100644 --- a/gcc/config/m68k/uclinux.h +++ b/gcc/config/m68k/uclinux.h @@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */ profiling, or libg.a. */ #undef LIB_SPEC #define LIB_SPEC "\ -%{mid-shared-library:-R libc.gdb%s} -lc \ +%{mid-shared-library:-R libc.gdb%s -elf2flt -shared-lib-id 0} -lc \ " /* we don't want a .eh_frame section. */ @@ -55,6 +55,8 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("linux"); \ builtin_define_std ("unix"); \ builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ if (TARGET_ID_SHARED_LIBRARY) \ builtin_define ("__ID_SHARED_LIBRARY__"); \ diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h index c879368d4a7..deb44d66be0 100644 --- a/gcc/config/mcore/mcore-elf.h +++ b/gcc/config/mcore/mcore-elf.h @@ -31,9 +31,6 @@ Boston, MA 02111-1307, USA. */ #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -/* But allow DWARF 1 if the user wants it. */ -#define DWARF_DEBUGGING_INFO 1 - #define EXPORTS_SECTION_ASM_OP "\t.section .exports" #define SUBTARGET_EXTRA_SECTIONS in_exports diff --git a/gcc/config/mips/_tilib.c b/gcc/config/mips/_tilib.c index 7118f842588..25e326c86da 100644 --- a/gcc/config/mips/_tilib.c +++ b/gcc/config/mips/_tilib.c @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ #include "coretypes.h" #include "tm.h" -#if _MIPS_SIM == 2 /* N32 */ || _MIPS_SIM == 3 /* 64 */ +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 typedef int TItype __attribute__ ((mode (TI))); typedef int DItype __attribute__ ((mode (DI))); diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index d708bcf5d96..5bac6e6fd60 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -423,12 +423,6 @@ while (0) #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -/* Define the `__builtin_va_list' type for the ABI. On IRIX 6, this - type is `char *'. */ -#undef BUILD_VA_LIST_TYPE -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = build_pointer_type (char_type_node) - #undef ASM_DECLARE_OBJECT_NAME #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name @@ -442,8 +436,7 @@ while (0) /* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */ /* ??? If no mabi=X option give, but a mipsX option is, then should depend on the mipsX option. */ -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ +#define IRIX6_STARTFILE_SPEC \ "%{!shared: \ %{mabi=32:%{pg:gcrt1.o%s} \ %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \ @@ -467,8 +460,10 @@ while (0) %{!p:/usr/lib32/mips4/crt1.o%s}}} \ %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \ %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \ - %{!p:/usr/lib32/mips3/crt1.o%s}}}}} \ - crtbegin.o%s" + %{!p:/usr/lib32/mips3/crt1.o%s}}}}}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%(irix6_startfile_spec) crtbegin.o%s" #undef LIB_SPEC #define LIB_SPEC \ @@ -487,10 +482,8 @@ while (0) /* ??? If no mabi=X option give, but a mipsX option is, then should depend on the mipsX option. */ -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "crtend.o%s \ - %{!shared: \ +#define IRIX6_ENDFILE_SPEC \ + "%{!shared: \ %{mabi=32:crtn.o%s}\ %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\ %{!mips4:/usr/lib32/mips3/crtn.o%s}}\ @@ -499,6 +492,9 @@ while (0) %{!mabi*:%{mips4:/usr/lib32/mips4/crtn.o%s}\ %{!mips4:/usr/lib32/mips3/crtn.o%s}}}" +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s %(irix6_endfile_spec)" + /* ??? If no mabi=X option give, but a mipsX option is, then should depend on the mipsX option. */ #undef LINK_SPEC @@ -522,3 +518,8 @@ do { \ } while (0) #define MIPS_TFMODE_FORMAT mips_extended_format + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "irix6_startfile_spec", IRIX6_STARTFILE_SPEC }, \ + { "irix6_endfile_spec", IRIX6_ENDFILE_SPEC }, diff --git a/gcc/config/mips/iris6gld.h b/gcc/config/mips/iris6gld.h index 3ae5587c2fa..1e5ee2c9f96 100644 --- a/gcc/config/mips/iris6gld.h +++ b/gcc/config/mips/iris6gld.h @@ -44,8 +44,17 @@ Boston, MA 02111-1307, USA. */ %{static: -non_shared} \ %{!static: \ %{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \ -%{rpath} -init __do_global_ctors -fini __do_global_dtors \ +%{rpath} -init __gcc_init -fini __gcc_fini \ %{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}" +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%(irix6_startfile_spec) irix6-crti.o%s crtbegin.o%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s irix6-crtn.o%s %(irix6_endfile_spec)" + /* The GNU linker supports one-only sections. */ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) + +#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4" +#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4" diff --git a/gcc/config/mips/irix6-crti.asm b/gcc/config/mips/irix6-crti.asm new file mode 100644 index 00000000000..5d8ede70390 --- /dev/null +++ b/gcc/config/mips/irix6-crti.asm @@ -0,0 +1,33 @@ + .abicalls + .set noreorder + .set nomacro + + .section .init,0x1,0x6,4,4 + jr $31 + nop + + .globl __gcc_init +__gcc_init: +#if _MIPS_SIM == _ABIO32 + addiu $sp,$sp,-16 + sw $31,0($sp) +#else + daddiu $sp,$sp,-16 + sd $31,0($sp) + sd $28,8($sp) +#endif + + .section .fini,0x1,0x6,4,4 + jr $31 + nop + + .globl __gcc_fini +__gcc_fini: +#if _MIPS_SIM == _ABIO32 + addiu $sp,$sp,-16 + sw $31,0($sp) +#else + daddiu $sp,$sp,-16 + sd $31,0($sp) + sd $28,8($sp) +#endif diff --git a/gcc/config/mips/irix6-crtn.asm b/gcc/config/mips/irix6-crtn.asm new file mode 100644 index 00000000000..647e8e13e31 --- /dev/null +++ b/gcc/config/mips/irix6-crtn.asm @@ -0,0 +1,27 @@ + .abicalls + .set noreorder + .set nomacro + + .section .init,0x1,0x6,4,4 +#if _MIPS_SIM == _ABIO32 + lw $31,0($sp) + jr $31 + addiu $sp,$sp,16 +#else + ld $31,0($sp) + ld $28,8($sp) + jr $31 + daddiu $sp,$sp,16 +#endif + + .section .fini,0x1,0x6,4,4 +#if _MIPS_SIM == _ABIO32 + lw $31,0($sp) + jr $31 + addiu $sp,$sp,16 +#else + ld $31,0($sp) + ld $28,8($sp) + jr $31 + daddiu $sp,$sp,16 +#endif diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c deleted file mode 100644 index 47c72a8ec86..00000000000 --- a/gcc/config/mips/irix6-libc-compat.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Compensate for inconsistent structure return conventions on IRIX 6. */ -/* Compile this one with gcc. */ -/* Copyright (C) 2001 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 2, or (at your option) -any later version. - -In addition to the permissions in the GNU General Public License, the -Free Software Foundation gives you unlimited permission to link the -compiled version of this file into combinations with other programs, -and to distribute those combinations without any restriction coming -from the use of this file. (The General Public License restrictions -do apply in other respects; for example, they cover modification of -the file, and distribution when not linked into a combine -executable.) - -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 COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* GCC doesn't correctly implement the structure and union return - conventions of the N32 and N64 ABIs on IRIX 6, as described in the - MIPSpro N32 ABI Handbook, ch. 2, Calling Convention Implementations, p.7. - The ABI requires that structures (or trailing parts of structures) smaller - than 8 bytes (a 64-bit register) are left-justified, whereas GCC - right-justifies them. - - While GCC is internally consistent, calling routines compiled with a - compiler that does implement the documented ABI (like SGIs MIPSpro C - compiler) doesn't work. This is primarily an issue for system libraries - like libc. Fortunately, there exist only very few routines that return - structures by value, so until the underlying bug is fixed, it is possible - to work around it by providing wrappers for the few affected routines. - - These wrappers rely on the fact that e.g. libc contains weak versions of - those routines, and the real implementation is provided by _-prefixed - variants. So we can provide our own versions, which will only be linked - if the application uses any of the affected functions, calling the private - variants and then shifting the result as required. - - This is a rewrite of code created by Andy Polyakov. */ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -/* This must only be used for the N32 and N64 ABIs. O32 is correct. */ - -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - -/* The affected return values need to be shifted by - - BITS_PER_WORD - (sizeof (value) * BITS_PER_UNIT). - - Since only 32-bit results are involved, the shift count is always 32. */ -#define SHIFT_BITS 32 - -extern machreg_t _inet_makeaddr (machreg_t, machreg_t); - -/* has - - struct in_addr inet_makeaddr (int, int); (IRIX 6.2) - struct in_addr inet_makeaddr (in_addr_t, in_addr_t); (IRIX 6.5) */ - -machreg_t -inet_makeaddr (machreg_t net, machreg_t lna) -{ - return _inet_makeaddr (net, lna) >> SHIFT_BITS; -} - -#endif /* _ABIN32 || _ABI64 */ diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 48c5e3c908d..ae64020882e 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -55,12 +55,9 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ - builtin_define ("__gnu_linux__"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ builtin_define ("__PIC__"); \ builtin_define ("__pic__"); \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_assert ("system=linux"); \ /* The GNU C++ standard library requires this. */ \ if (c_dialect_cxx ()) \ builtin_define ("_GNU_SOURCE"); \ diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 2e31138e127..a5daae09827 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -30,11 +30,12 @@ extern int mips_reg_mode_ok_for_base_p (rtx, enum machine_mode, int); extern int mips_address_insns (rtx, enum machine_mode); extern int mips_const_insns (rtx); extern int mips_fetch_insns (rtx); -extern bool mips_global_pic_constant_p (rtx); extern bool mips_legitimate_address_p (enum machine_mode, rtx, int); extern bool mips_legitimize_address (rtx *, enum machine_mode); +extern rtx mips_gotoff_global (rtx); +extern rtx mips_load_got_page (rtx); +extern rtx mips_load_got_global (rtx, rtx); extern bool mips_legitimize_move (enum machine_mode, rtx, rtx); -extern rtx mips_delegitimize_address (rtx); extern int m16_uimm3_b (rtx, enum machine_mode); extern int m16_simm4_1 (rtx, enum machine_mode); @@ -84,7 +85,6 @@ extern bool mips_pad_arg_upward (enum machine_mode, tree); extern bool mips_pad_reg_upward (enum machine_mode, tree); extern int mips_setup_incoming_varargs (const CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern tree mips_build_va_list (void); extern void mips_va_start (tree, rtx); extern struct rtx_def *mips_va_arg (tree, tree); @@ -111,8 +111,9 @@ extern void mips_declare_object (FILE *, const char *, const char *, extern void mips_declare_object_name (FILE *, const char *, tree); extern void mips_finish_declare_object (FILE *, tree, int, int); +extern rtx mips_rewrite_small_data (rtx); extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT); -extern int mips_initial_elimination_offset (int, int); +extern HOST_WIDE_INT mips_initial_elimination_offset (int, int); extern rtx mips_return_addr (int, rtx); extern void mips_expand_prologue (void); extern void mips_expand_epilogue (int); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index db087f144a6..ba358fcfbf6 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -52,6 +52,7 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "target-def.h" #include "integrate.h" +#include "langhooks.h" /* Enumeration for all of the relational tests, so that we can build arrays indexed by the test type, and not worry about the order @@ -80,6 +81,25 @@ enum internal_test { #define INTERNAL_SYMBOL_P(SYM) \ (XSTR (SYM, 0)[0] == '*' && XSTR (SYM, 0)[1] == LOCAL_LABEL_PREFIX[0]) +/* True if X is an unspec wrapper around a SYMBOL_REF or LABEL_REF. */ +#define UNSPEC_ADDRESS_P(X) \ + (GET_CODE (X) == UNSPEC \ + && XINT (X, 1) >= UNSPEC_ADDRESS_FIRST \ + && XINT (X, 1) < UNSPEC_ADDRESS_FIRST + NUM_SYMBOL_TYPES) + +/* Extract the symbol or label from UNSPEC wrapper X. */ +#define UNSPEC_ADDRESS(X) \ + XVECEXP (X, 0, 0) + +/* Extract the symbol type from UNSPEC wrapper X. */ +#define UNSPEC_ADDRESS_TYPE(X) \ + ((enum mips_symbol_type) (XINT (X, 1) - UNSPEC_ADDRESS_FIRST)) + +/* True if X is (const $gp). This is used to initialize the mips16 + gp pseudo register. */ +#define CONST_GP_P(X) \ + (GET_CODE (X) == CONST && XEXP (X, 0) == pic_offset_table_rtx) + /* The maximum distance between the top of the stack frame and the value $sp has when we save & restore registers. @@ -93,40 +113,7 @@ enum internal_test { multi-instruction addu sequence. Use 0x7fe0 to work around this. */ #define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7fe0) -/* Classifies a non-literal integer constant. - - CONSTANT_NONE - Not one of the constants below. - - CONSTANT_GP - The global pointer, treated as a constant when TARGET_MIPS16. - The rtx has the form: - - (const (reg $gp)). - - CONSTANT_RELOC - A signed 16-bit relocation against either a symbol - or a symbol plus an offset. The relocation has the form: - - (unspec [(SYMBOL) ...] RELOC) - - Any offset is added outside the unspec, such as: - - (plus (unspec [(SYMBOL) ...] RELOC) (const_int OFFSET)) - - In either case, the whole expression is wrapped in a (const ...). - - CONSTANT_SYMBOLIC - A reference to a symbol, possibly with an offset. */ -enum mips_constant_type { - CONSTANT_NONE, - CONSTANT_GP, - CONSTANT_RELOC, - CONSTANT_SYMBOLIC -}; - - -/* Classifies a SYMBOL_REF or LABEL_REF. +/* Classifies a SYMBOL_REF, LABEL_REF or UNSPEC address. SYMBOL_GENERAL Used when none of the below apply. @@ -142,21 +129,40 @@ enum mips_constant_type { the global offset table. SYMBOL_GOT_GLOBAL - Likewise non-local data. */ + Likewise non-local data. + + SYMBOL_GOTOFF_PAGE + An UNSPEC wrapper around a SYMBOL_GOT_LOCAL. It represents the + offset from _gp of a GOT page entry. + + SYMBOL_GOTOFF_GLOBAL + An UNSPEC wrapper around a SYMBOL_GOT_GLOBAL. It represents the + the offset from _gp of the symbol's GOT entry. + + SYMBOL_GOTOFF_CALL + Like SYMBOL_GOTOFF_GLOBAL, but used when calling a global function. + The GOT entry is allowed to point to a stub rather than to the + function itself. + + SYMBOL_GOTOFF_LOADGP + An UNSPEC wrapper around a function's address. It represents the + offset of _gp from the start of the function. */ enum mips_symbol_type { SYMBOL_GENERAL, SYMBOL_SMALL_DATA, SYMBOL_CONSTANT_POOL, SYMBOL_GOT_LOCAL, - SYMBOL_GOT_GLOBAL + SYMBOL_GOT_GLOBAL, + SYMBOL_GOTOFF_PAGE, + SYMBOL_GOTOFF_GLOBAL, + SYMBOL_GOTOFF_CALL, + SYMBOL_GOTOFF_LOADGP }; +#define NUM_SYMBOL_TYPES (SYMBOL_GOTOFF_LOADGP + 1) /* Classifies an address. - ADDRESS_INVALID - The address should be rejected as invalid. - ADDRESS_REG A natural register + offset address. The register satisfies mips_valid_base_register_p and the offset is a const_arith_operand. @@ -171,7 +177,6 @@ enum mips_symbol_type { ADDRESS_SYMBOLIC: A constant symbolic address (equivalent to CONSTANT_SYMBOLIC). */ enum mips_address_type { - ADDRESS_INVALID, ADDRESS_REG, ADDRESS_LO_SUM, ADDRESS_CONST_INT, @@ -184,32 +189,24 @@ typedef void (*mips_save_restore_fn) (rtx, rtx); struct constant; struct mips_arg_info; -struct mips_constant_info; struct mips_address_info; struct mips_integer_op; -static bool mips_reloc_offset_ok_p (int, HOST_WIDE_INT); -static enum mips_constant_type - mips_classify_constant (struct mips_constant_info *, rtx); static enum mips_symbol_type mips_classify_symbol (rtx); +static void mips_split_const (rtx, rtx *, HOST_WIDE_INT *); +static bool mips_symbolic_constant_p (rtx, enum mips_symbol_type *); static bool mips_valid_base_register_p (rtx, enum machine_mode, int); -static bool mips_symbolic_address_p (rtx, HOST_WIDE_INT, - enum machine_mode, int); -static enum mips_address_type - mips_classify_address (struct mips_address_info *, rtx, - enum machine_mode, int, int); -static bool mips_splittable_symbol_p (enum mips_symbol_type, HOST_WIDE_INT); +static bool mips_symbolic_address_p (enum mips_symbol_type, enum machine_mode); +static bool mips_classify_address (struct mips_address_info *, rtx, + enum machine_mode, int); static int mips_symbol_insns (enum mips_symbol_type); static bool mips16_unextended_reference_p (enum machine_mode mode, rtx, rtx); -static rtx mips_reloc (rtx, int); -static rtx mips_lui_reloc (rtx, int); static rtx mips_force_temporary (rtx, rtx); +static rtx mips_split_symbol (rtx, rtx); +static rtx mips_unspec_address (rtx, enum mips_symbol_type); +static rtx mips_unspec_offset_high (rtx, rtx, enum mips_symbol_type); +static rtx mips_load_got (rtx, rtx, enum mips_symbol_type); static rtx mips_add_offset (rtx, HOST_WIDE_INT); -static rtx mips_load_got (rtx, rtx, int); -static rtx mips_load_got16 (rtx, int); -static rtx mips_load_got32 (rtx, rtx, int, int); -static rtx mips_emit_high (rtx, rtx); -static bool mips_legitimize_symbol (rtx, rtx *, int); static unsigned int mips_build_shift (struct mips_integer_op *, HOST_WIDE_INT); static unsigned int mips_build_lower (struct mips_integer_op *, unsigned HOST_WIDE_INT); @@ -233,10 +230,14 @@ static bool mips_get_unaligned_mem (rtx *, unsigned int, int, rtx *, rtx *); static void mips_set_architecture (const struct mips_cpu_info *); static void mips_set_tune (const struct mips_cpu_info *); static struct machine_function *mips_init_machine_status (void); -static const char *mips_reloc_string (int); +static void print_operand_reloc (FILE *, rtx, const char **); static bool mips_assemble_integer (rtx, unsigned int, int); static void mips_file_start (void); static void mips_file_end (void); +static bool mips_rewrite_small_data_p (rtx); +static int small_data_pattern_1 (rtx *, void *); +static int mips_rewrite_small_data_1 (rtx *, void *); +static bool mips_function_has_gp_insn (void); static unsigned int mips_global_pointer (void); static bool mips_save_reg_p (unsigned int); static void mips_save_restore_reg (enum machine_mode, int, HOST_WIDE_INT, @@ -246,7 +247,6 @@ static void mips_output_function_prologue (FILE *, HOST_WIDE_INT); static void mips_set_frame_expr (rtx); static rtx mips_frame_set (rtx, rtx); static void mips_save_reg (rtx, rtx); -static void mips_gp_insn (rtx, rtx); static void mips_output_function_epilogue (FILE *, HOST_WIDE_INT); static void mips_restore_reg (rtx, rtx); static int symbolic_expression_p (rtx); @@ -256,7 +256,12 @@ static void mips_select_section (tree, int, unsigned HOST_WIDE_INT) ATTRIBUTE_UNUSED; static bool mips_in_small_data_p (tree); static void mips_encode_section_info (tree, rtx, int); -static rtx mips_sdata_pointer (void); +static int mips_fpr_return_fields (tree, tree *); +static bool mips_return_in_msb (tree); +static rtx mips_return_fpr_pair (enum machine_mode mode, + enum machine_mode mode1, HOST_WIDE_INT, + enum machine_mode mode2, HOST_WIDE_INT); +static rtx mips16_gp_pseudo_reg (void); static void mips16_fp_args (FILE *, int, int); static void build_mips16_function_stub (FILE *); static void mips16_optimize_gp (void); @@ -275,6 +280,7 @@ static int mips_adjust_cost (rtx, rtx, rtx, int); static int mips_issue_rate (void); static int mips_use_dfa_pipeline_interface (void); static void mips_init_libfuncs (void); +static tree mips_build_builtin_va_list (void); #if TARGET_IRIX static void irix_asm_named_section_1 (const char *, unsigned int, @@ -294,21 +300,21 @@ static unsigned int irix_section_type_flags (tree, const char *, int); struct mips_frame_info GTY(()) { - long total_size; /* # bytes that the entire frame takes up */ - long var_size; /* # bytes that variables take up */ - long args_size; /* # bytes that outgoing arguments take up */ - long cprestore_size; /* # bytes that the .cprestore slot takes up */ - int gp_reg_size; /* # bytes needed to store gp regs */ - int fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long fmask; /* mask of saved fp registers */ - long gp_save_offset; /* offset from vfp to store gp registers */ - long fp_save_offset; /* offset from vfp to store fp registers */ - long gp_sp_offset; /* offset from new sp to store gp registers */ - long fp_sp_offset; /* offset from new sp to store fp registers */ - int initialized; /* != 0 if frame size already calculated */ - int num_gp; /* number of gp registers saved */ - int num_fp; /* number of fp registers saved */ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* # bytes that variables take up */ + HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */ + HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */ + HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ + HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ + HOST_WIDE_INT gp_save_offset; /* offset from vfp to store gp registers */ + HOST_WIDE_INT fp_save_offset; /* offset from vfp to store fp registers */ + HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */ + HOST_WIDE_INT fp_sp_offset; /* offset from new sp to store fp registers */ + bool initialized; /* true if frame size already calculated */ + int num_gp; /* number of gp registers saved */ + int num_fp; /* number of fp registers saved */ }; struct machine_function GTY(()) { @@ -336,6 +342,9 @@ struct machine_function GTY(()) { /* True if the whole function is suitable for .set noreorder and .set nomacro. */ bool all_noreorder_p; + + /* True if the function is known to have an instruction that needs $gp. */ + bool has_gp_insn_p; }; /* Information about a single argument. */ @@ -365,30 +374,8 @@ struct mips_arg_info }; -/* Struct for recording constants. The meaning of the fields depends - on a mips_constant_type: - - CONSTANT_NONE - CONSTANT_GP - No fields are valid. - - CONSTANT_SYMBOLIC - SYMBOL is the referenced symbol and OFFSET is the constant offset. - - CONSTANT_RELOC - SYMBOL and OFFSET are the same as for CONSTANT_SYMBOLIC. RELOC is - the relocation number. */ -struct mips_constant_info -{ - int reloc; - rtx symbol; - HOST_WIDE_INT offset; -}; - - /* Information about an address described by mips_address_type. - ADDRESS_INVALID ADDRESS_CONST_INT No fields are used. @@ -397,16 +384,18 @@ struct mips_constant_info ADDRESS_LO_SUM REG is the register that contains the high part of the address, - OFFSET is the symbolic address being referenced, and C contains - the individual components of the symbolic address. + OFFSET is the symbolic address being referenced and SYMBOL_TYPE + is the type of OFFSET's symbol. ADDRESS_SYMBOLIC - C contains the symbol and offset. */ + SYMBOL_TYPE is the type of symbol being referenced. */ + struct mips_address_info { + enum mips_address_type type; rtx reg; rtx offset; - struct mips_constant_info c; + enum mips_symbol_type symbol_type; }; @@ -555,6 +544,18 @@ static int mips_flag_delayed_branch; static GTY (()) int mips_output_filename_first_time = 1; +/* mips_split_p[X] is true if symbols of type X can be split by + mips_split_symbol(). */ +static bool mips_split_p[NUM_SYMBOL_TYPES]; + +/* mips_lo_relocs[X] is the relocation to use when a symbol of type X + appears in a LO_SUM. It can be null if such LO_SUMs aren't valid or + if they are matched by a special .md file pattern. */ +static const char *mips_lo_relocs[NUM_SYMBOL_TYPES]; + +/* Likewise for HIGHs. */ +static const char *mips_hi_relocs[NUM_SYMBOL_TYPES]; + /* Hardware names for the registers. If -mrnames is used, this will be overwritten with mips_sw_reg_names. */ @@ -569,7 +570,7 @@ char mips_reg_names[][8] = "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23", "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31", "hi", "lo", "", "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4", - "$fcc5","$fcc6","$fcc7","", "", "", "", "", + "$fcc5","$fcc6","$fcc7","", "", "", "", "$fakec", "$c0r0", "$c0r1", "$c0r2", "$c0r3", "$c0r4", "$c0r5", "$c0r6", "$c0r7", "$c0r8", "$c0r9", "$c0r10","$c0r11","$c0r12","$c0r13","$c0r14","$c0r15", "$c0r16","$c0r17","$c0r18","$c0r19","$c0r20","$c0r21","$c0r22","$c0r23", @@ -598,7 +599,7 @@ char mips_sw_reg_names[][8] = "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23", "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31", "hi", "lo", "", "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4", - "$fcc5","$fcc6","$fcc7","$rap", "", "", "", "", + "$fcc5","$fcc6","$fcc7","$rap", "", "", "", "$fakec", "$c0r0", "$c0r1", "$c0r2", "$c0r3", "$c0r4", "$c0r5", "$c0r6", "$c0r7", "$c0r8", "$c0r9", "$c0r10","$c0r11","$c0r12","$c0r13","$c0r14","$c0r15", "$c0r16","$c0r17","$c0r18","$c0r19","$c0r20","$c0r21","$c0r22","$c0r23", @@ -761,8 +762,6 @@ const struct mips_cpu_info mips_cpu_info_table[] = { #define TARGET_RTX_COSTS mips_rtx_costs #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST mips_address_cost -#undef TARGET_DELEGITIMIZE_ADDRESS -#define TARGET_DELEGITIMIZE_ADDRESS mips_delegitimize_address #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO mips_encode_section_info @@ -792,85 +791,13 @@ const struct mips_cpu_info mips_cpu_info_table[] = { #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS mips_init_libfuncs +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST mips_build_builtin_va_list +#undef TARGET_RETURN_IN_MSB +#define TARGET_RETURN_IN_MSB mips_return_in_msb + struct gcc_target targetm = TARGET_INITIALIZER; -/* Return true if RELOC is a valid relocation number and OFFSET can be - added to the relocation symbol. - - Note that OFFSET might not refer to part of the object. For example, - in an expression like x[i - 0x12345], we might try to take the address - of "x - 0x12345". */ - -static bool -mips_reloc_offset_ok_p (int reloc, HOST_WIDE_INT offset) -{ - switch (reloc) - { - case RELOC_GOT_PAGE: - /* The linker should provide enough page entries to cope with - 16-bit offsets from a valid segment address. */ - return SMALL_OPERAND (offset); - - case RELOC_GOT_HI: - case RELOC_GOT_LO: - case RELOC_GOT_DISP: - case RELOC_CALL16: - case RELOC_CALL_HI: - case RELOC_CALL_LO: - case RELOC_LOADGP_HI: - case RELOC_LOADGP_LO: - /* These relocations should be applied to bare symbols only. */ - return offset == 0; - - default: - return false; - } -} - - -/* If X is one of the constants described by mips_constant_type, - store its components in INFO and return its type. */ - -static enum mips_constant_type -mips_classify_constant (struct mips_constant_info *info, rtx x) -{ - enum mips_constant_type type; - - type = CONSTANT_SYMBOLIC; - info->offset = 0; - - if (GET_CODE (x) == CONST) - { - x = XEXP (x, 0); - - if (x == pic_offset_table_rtx) - return CONSTANT_GP; - - while (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) - { - info->offset += INTVAL (XEXP (x, 1)); - x = XEXP (x, 0); - } - - if (TARGET_EXPLICIT_RELOCS - && GET_CODE (x) == UNSPEC - && mips_reloc_offset_ok_p (XINT (x, 1), info->offset)) - { - info->reloc = XINT (x, 1); - x = XVECEXP (x, 0, 0); - type = CONSTANT_RELOC; - } - } - - if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) - { - info->symbol = x; - return type; - } - return CONSTANT_NONE; -} - - /* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */ static enum mips_symbol_type @@ -918,6 +845,83 @@ mips_classify_symbol (rtx x) } +/* Split X into a base and a constant offset, storing them in *BASE + and *OFFSET respectively. */ + +static void +mips_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset) +{ + *offset = 0; + + if (GET_CODE (x) == CONST) + x = XEXP (x, 0); + + if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + *offset += INTVAL (XEXP (x, 1)); + x = XEXP (x, 0); + } + *base = x; +} + + +/* Return true if X is a symbolic constant that can be calculated in + the same way as a bare symbol. If it is, store the type of the + symbol in *SYMBOL_TYPE. */ + +static bool +mips_symbolic_constant_p (rtx x, enum mips_symbol_type *symbol_type) +{ + HOST_WIDE_INT offset; + + mips_split_const (x, &x, &offset); + if (UNSPEC_ADDRESS_P (x)) + *symbol_type = UNSPEC_ADDRESS_TYPE (x); + else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) + *symbol_type = mips_classify_symbol (x); + else + return false; + + if (offset == 0) + return true; + + /* Check whether a nonzero offset is valid for the underlying + relocations. */ + switch (*symbol_type) + { + case SYMBOL_GENERAL: + /* %hi() and %lo() can handle anything. */ + return true; + + case SYMBOL_SMALL_DATA: + /* Make sure that the offset refers to something within the + -G limit. If the offset is allowed to grow too much, + it could overflow the range of %gp_rel(). */ + return (offset > 0 && offset < mips_section_threshold); + + case SYMBOL_CONSTANT_POOL: + /* Similarly check the range of offsets for mips16 constant + pool entries. */ + return (CONSTANT_POOL_ADDRESS_P (x) + && offset > 0 + && offset < (int) GET_MODE_SIZE (get_pool_mode (x))); + + case SYMBOL_GOT_LOCAL: + case SYMBOL_GOTOFF_PAGE: + /* The linker should provide enough local GOT entries for a + 16-bit offset. Larger offsets may lead to GOT overflow. */ + return SMALL_OPERAND (offset); + + case SYMBOL_GOT_GLOBAL: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + return false; + } + abort (); +} + + /* This function is used to implement REG_MODE_OK_FOR_BASE_P. */ int @@ -943,155 +947,94 @@ mips_valid_base_register_p (rtx x, enum machine_mode mode, int strict) } -/* Return true if SYMBOL + OFFSET should be considered a legitimate - address. LEA_P is true and MODE is word_mode if the address - will be used in an LA or DLA macro. Otherwise MODE is the - mode of the value being accessed. - - Some guiding principles: - - - Allow a nonzero offset when it takes no additional instructions. - Ask for other offsets to be added separately. - - - Only allow multi-instruction load or store macros when MODE is - word-sized or smaller. For other modes (including BLKmode) - it is better to move the address into a register first. */ +/* Return true if symbols of type SYMBOL_TYPE can directly address a value + with mode MODE. This is used for both symbolic and LO_SUM addresses. */ static bool -mips_symbolic_address_p (rtx symbol, HOST_WIDE_INT offset, - enum machine_mode mode, int lea_p) +mips_symbolic_address_p (enum mips_symbol_type symbol_type, + enum machine_mode mode) { - if (TARGET_EXPLICIT_RELOCS) - return false; - - switch (mips_classify_symbol (symbol)) + switch (symbol_type) { case SYMBOL_GENERAL: - /* General symbols aren't valid addresses in mips16 code: - they have to go into the constant pool. */ - return (!TARGET_MIPS16 - && !mips_split_addresses - && SINGLE_WORD_MODE_P (mode)); + return !TARGET_MIPS16; case SYMBOL_SMALL_DATA: - /* Small data references are normally OK for any address. - But for mips16 code, we need to use a pseudo register - instead of $gp as the base register. */ - return !TARGET_MIPS16; + return true; case SYMBOL_CONSTANT_POOL: - /* PC-relative addressing is only available for lw, sw, ld and sd. - There's also a PC-relative add instruction. */ - return lea_p || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; + /* PC-relative addressing is only available for lw, sw, ld and sd. */ + return GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; + + case SYMBOL_GOT_LOCAL: + return true; case SYMBOL_GOT_GLOBAL: - /* The address of the symbol is stored in the GOT. We can load - it using an LA or DLA instruction, but any offset is added - afterwards. */ - return lea_p && offset == 0; + /* The address will have to be loaded from the GOT first. */ + return false; - case SYMBOL_GOT_LOCAL: - /* The symbol is part of a block of local memory. We fetch the - address of the local memory from the GOT and then add the - offset for this symbol. This addition can take the form of an - offset(base) address, so the symbol is a legitimate address. */ - return SINGLE_WORD_MODE_P (mode); + case SYMBOL_GOTOFF_PAGE: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + return true; } abort (); } -/* If X is a valid address, describe it in INFO and return its type. - STRICT says to only allow hard registers. MODE and LEA_P are - the same as for mips_symbolic_address_p. */ +/* Return true if X is a valid address for machine mode MODE. If it is, + fill in INFO appropriately. STRICT is true if we should only accept + hard base registers. */ -static enum mips_address_type +static bool mips_classify_address (struct mips_address_info *info, rtx x, - enum machine_mode mode, int strict, int lea_p) + enum machine_mode mode, int strict) { switch (GET_CODE (x)) { case REG: case SUBREG: - if (mips_valid_base_register_p (x, mode, strict)) - { - info->reg = x; - info->offset = const0_rtx; - return ADDRESS_REG; - } - return ADDRESS_INVALID; + info->type = ADDRESS_REG; + info->reg = x; + info->offset = const0_rtx; + return mips_valid_base_register_p (info->reg, mode, strict); case PLUS: - if (mips_valid_base_register_p (XEXP (x, 0), mode, strict) - && const_arith_operand (XEXP (x, 1), VOIDmode)) - { - info->reg = XEXP (x, 0); - info->offset = XEXP (x, 1); - return ADDRESS_REG; - } - return ADDRESS_INVALID; + info->type = ADDRESS_REG; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (mips_valid_base_register_p (info->reg, mode, strict) + && const_arith_operand (info->offset, VOIDmode)); case LO_SUM: - if (SINGLE_WORD_MODE_P (mode) - && mips_valid_base_register_p (XEXP (x, 0), mode, strict) - && (mips_classify_constant (&info->c, XEXP (x, 1)) - == CONSTANT_SYMBOLIC) - && mips_splittable_symbol_p (mips_classify_symbol (info->c.symbol), - info->c.offset)) - { - info->reg = XEXP (x, 0); - info->offset = XEXP (x, 1); - return ADDRESS_LO_SUM; - } - return ADDRESS_INVALID; + info->type = ADDRESS_LO_SUM; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (mips_valid_base_register_p (info->reg, mode, strict) + && mips_symbolic_constant_p (info->offset, &info->symbol_type) + && mips_symbolic_address_p (info->symbol_type, mode) + && mips_lo_relocs[info->symbol_type] != 0); case CONST_INT: /* Small-integer addresses don't occur very often, but they are legitimate if $0 is a valid base register. */ - if (!TARGET_MIPS16 && SMALL_INT (x)) - return ADDRESS_CONST_INT; - return ADDRESS_INVALID; + info->type = ADDRESS_CONST_INT; + return !TARGET_MIPS16 && SMALL_INT (x); case CONST: case LABEL_REF: case SYMBOL_REF: - if (mips_classify_constant (&info->c, x) == CONSTANT_SYMBOLIC - && mips_symbolic_address_p (info->c.symbol, info->c.offset, - mode, lea_p)) - return ADDRESS_SYMBOLIC; - return ADDRESS_INVALID; - - default: - return ADDRESS_INVALID; - } -} - -/* Return true if symbols of the given type can be split into a - high part and a LO_SUM. In the case of small data symbols, - the high part will be $gp. */ - -static bool -mips_splittable_symbol_p (enum mips_symbol_type type, HOST_WIDE_INT offset) -{ - switch (type) - { - case SYMBOL_GENERAL: - return TARGET_EXPLICIT_RELOCS || mips_split_addresses; - - case SYMBOL_GOT_LOCAL: - return TARGET_EXPLICIT_RELOCS && SMALL_OPERAND (offset); - - case SYMBOL_SMALL_DATA: - return ((TARGET_EXPLICIT_RELOCS || TARGET_MIPS16) - && (offset == 0 - || (offset > 0 && offset <= mips_section_threshold))); + info->type = ADDRESS_SYMBOLIC; + return (mips_symbolic_constant_p (x, &info->symbol_type) + && mips_symbolic_address_p (info->symbol_type, mode) + && !mips_split_p[info->symbol_type]); default: return false; } } - - + /* Return the number of instructions needed to load a symbol of the given type into a register. If valid in an address, the same number of instructions are needed for loads and stores. Treat extended @@ -1103,6 +1046,11 @@ mips_symbol_insns (enum mips_symbol_type type) switch (type) { case SYMBOL_GENERAL: + /* In mips16 code, general symbols must be fetched from the + constant pool. */ + if (TARGET_MIPS16) + return 0; + /* When using 64-bit symbols, we need 5 preparatory instructions, such as: @@ -1124,17 +1072,6 @@ mips_symbol_insns (enum mips_symbol_type type) extended instruction. */ return 2; - case SYMBOL_GOT_GLOBAL: - /* When using a small GOT, we just fetch the address using - a gp-relative load. For a big GOT, we need a sequence - such as: - - lui $at,%got_hi(symbol) - daddu $at,$at,$gp - - and the final address is $at + %got_lo(symbol). */ - return (TARGET_XGOT ? 3 : 1); - case SYMBOL_GOT_LOCAL: /* For o32 and o64, the sequence is: @@ -1146,6 +1083,24 @@ mips_symbol_insns (enum mips_symbol_type type) of GAS insert a nop in the n32/n64 sequences too so, for simplicity, use the worst case of 3 instructions. */ return 3; + + case SYMBOL_GOT_GLOBAL: + /* When using a small GOT, we just fetch the address using + a gp-relative load. For a big GOT, we need a sequence + such as: + + lui $at,%got_hi(symbol) + daddu $at,$at,$gp + + and the final address is $at + %got_lo(symbol). */ + return (TARGET_XGOT ? 3 : 1); + + case SYMBOL_GOTOFF_PAGE: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + /* Check whether the offset is a 16- or 32-bit value. */ + return mips_split_p[type] ? 2 : 1; } abort (); } @@ -1189,27 +1144,25 @@ mips_address_insns (rtx x, enum machine_mode mode) /* Each word of a multi-word value will be accessed individually. */ factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; - switch (mips_classify_address (&addr, x, mode, 0, 0)) - { - case ADDRESS_INVALID: - return 0; - - case ADDRESS_REG: - if (TARGET_MIPS16 - && !mips16_unextended_reference_p (mode, addr.reg, addr.offset)) - return factor * 2; - return factor; + if (mips_classify_address (&addr, x, mode, false)) + switch (addr.type) + { + case ADDRESS_REG: + if (TARGET_MIPS16 + && !mips16_unextended_reference_p (mode, addr.reg, addr.offset)) + return factor * 2; + return factor; - case ADDRESS_LO_SUM: - return (TARGET_MIPS16 ? factor * 2 : factor); + case ADDRESS_LO_SUM: + return (TARGET_MIPS16 ? factor * 2 : factor); - case ADDRESS_CONST_INT: - return factor; + case ADDRESS_CONST_INT: + return factor; - case ADDRESS_SYMBOLIC: - return factor * mips_symbol_insns (mips_classify_symbol (addr.c.symbol)); - } - abort (); + case ADDRESS_SYMBOLIC: + return factor * mips_symbol_insns (addr.symbol_type); + } + return 0; } @@ -1218,13 +1171,21 @@ mips_address_insns (rtx x, enum machine_mode mode) int mips_const_insns (rtx x) { - struct mips_constant_info c; struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS]; + enum mips_symbol_type symbol_type; + HOST_WIDE_INT offset; switch (GET_CODE (x)) { case CONSTANT_P_RTX: + return 1; + case HIGH: + if (TARGET_MIPS16 + || !mips_symbolic_constant_p (XEXP (x, 0), &symbol_type) + || !mips_split_p[symbol_type]) + return 0; + return 1; case CONST_INT: @@ -1244,20 +1205,37 @@ mips_const_insns (rtx x) case CONST_DOUBLE: return (!TARGET_MIPS16 && x == CONST0_RTX (GET_MODE (x)) ? 1 : 0); - default: - switch (mips_classify_constant (&c, x)) + case CONST: + if (CONST_GP_P (x)) + return 1; + + /* See if we can refer to X directly. */ + if (mips_symbolic_constant_p (x, &symbol_type)) + return mips_symbol_insns (symbol_type); + + /* Otherwise try splitting the constant into a base and offset. + 16-bit offsets can be added using an extra addiu. Larger offsets + must be calculated separately and then added to the base. */ + mips_split_const (x, &x, &offset); + if (offset != 0) { - case CONSTANT_NONE: - return 0; + int n = mips_const_insns (x); + if (n != 0) + { + if (SMALL_OPERAND (offset)) + return n + 1; + else + return n + 1 + mips_build_integer (codes, offset); + } + } + return 0; - case CONSTANT_GP: - case CONSTANT_RELOC: - return 1; + case SYMBOL_REF: + case LABEL_REF: + return mips_symbol_insns (mips_classify_symbol (x)); - case CONSTANT_SYMBOLIC: - return mips_symbol_insns (mips_classify_symbol (c.symbol)); - } - abort (); + default: + return 0; } } @@ -1275,19 +1253,6 @@ mips_fetch_insns (rtx x) } -/* Return true if OP is a symbolic constant that refers to a - global PIC symbol. */ - -bool -mips_global_pic_constant_p (rtx op) -{ - struct mips_constant_info c; - - return (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC - && mips_classify_symbol (c.symbol) == SYMBOL_GOT_GLOBAL); -} - - /* Return truth value of whether OP can be used as an operands where a register or 16 bit unsigned integer is needed. */ @@ -1306,10 +1271,7 @@ uns_arith_operand (rtx op, enum machine_mode mode) int const_arith_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { - struct mips_constant_info c; - - return ((GET_CODE (op) == CONST_INT && SMALL_INT (op)) - || mips_classify_constant (&c, op) == CONSTANT_RELOC); + return GET_CODE (op) == CONST_INT && SMALL_INT (op); } @@ -1477,10 +1439,10 @@ pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) int call_insn_operand (rtx op, enum machine_mode mode) { - struct mips_constant_info c; + enum mips_symbol_type symbol_type; - if (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC) - switch (mips_classify_symbol (c.symbol)) + if (mips_symbolic_constant_p (op, &symbol_type)) + switch (symbol_type) { case SYMBOL_GENERAL: /* If -mlong-calls, force all calls to use register addressing. */ @@ -1492,7 +1454,7 @@ call_insn_operand (rtx op, enum machine_mode mode) Using "la $25,foo; jal $25" would prevent the lazy binding of "foo", so keep the address of global symbols with the jal macro. */ - return c.offset == 0 && !TARGET_EXPLICIT_RELOCS; + return !TARGET_EXPLICIT_RELOCS; default: return false; @@ -1507,15 +1469,35 @@ call_insn_operand (rtx op, enum machine_mode mode) int move_operand (rtx op, enum machine_mode mode) { - struct mips_constant_info c; + enum mips_symbol_type symbol_type; - if (GET_CODE (op) == HIGH && TARGET_ABICALLS) + if (!general_operand (op, mode)) return false; - if (GET_CODE (op) == CONST_INT && !TARGET_MIPS16) - return (SMALL_INT (op) || SMALL_INT_UNSIGNED (op) || LUI_INT (op)); - if (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC) - return mips_symbolic_address_p (c.symbol, c.offset, word_mode, 1); - return general_operand (op, mode); + + switch (GET_CODE (op)) + { + case CONST_INT: + /* When generating mips16 code, LEGITIMATE_CONSTANT_P rejects + CONST_INTs that can't be loaded using simple insns. */ + if (TARGET_MIPS16) + return true; + + /* Otherwise check whether the constant can be loaded in a single + instruction. */ + return LUI_INT (op) || SMALL_INT (op) || SMALL_INT_UNSIGNED (op); + + case CONST: + case SYMBOL_REF: + case LABEL_REF: + if (CONST_GP_P (op)) + return true; + + return (mips_symbolic_constant_p (op, &symbol_type) + && !mips_split_p[symbol_type]); + + default: + return true; + } } @@ -1536,9 +1518,35 @@ consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) int symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { - struct mips_constant_info c; + enum mips_symbol_type symbol_type; + + return mips_symbolic_constant_p (op, &symbol_type); +} + + +/* Return true if we're generating PIC and OP is a global symbol. */ + +int +global_got_operand (rtx op, enum machine_mode mode) +{ + enum mips_symbol_type symbol_type; + + return ((mode == VOIDmode || mode == GET_MODE (op)) + && mips_symbolic_constant_p (op, &symbol_type) + && symbol_type == SYMBOL_GOT_GLOBAL); +} + + +/* Likewise for local symbols. */ + +int +local_got_operand (rtx op, enum machine_mode mode) +{ + enum mips_symbol_type symbol_type; - return mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC; + return ((mode == VOIDmode || mode == GET_MODE (op)) + && mips_symbolic_constant_p (op, &symbol_type) + && symbol_type == SYMBOL_GOT_LOCAL); } @@ -1552,8 +1560,8 @@ stack_operand (rtx op, enum machine_mode mode) return ((mode == VOIDmode || mode == GET_MODE (op)) && GET_CODE (op) == MEM - && mips_classify_address (&addr, XEXP (op, 0), - GET_MODE (op), false, true) == ADDRESS_REG + && mips_classify_address (&addr, XEXP (op, 0), GET_MODE (op), false) + && addr.type == ADDRESS_REG && addr.reg == stack_pointer_rtx); } @@ -1568,199 +1576,138 @@ mips_legitimate_address_p (enum machine_mode mode, rtx x, int strict) { struct mips_address_info addr; - return mips_classify_address (&addr, x, mode, strict, 0) != ADDRESS_INVALID; + return mips_classify_address (&addr, x, mode, strict); } -/* Return an rtx that represents the effect of applying relocation - RELOC to symbolic address ADDR. */ +/* Copy VALUE to a register and return that register. If new psuedos + are allowed, copy it into a new register, otherwise use DEST. */ static rtx -mips_reloc (rtx addr, int reloc) +mips_force_temporary (rtx dest, rtx value) { - struct mips_constant_info c; - rtx x; - - if (mips_classify_constant (&c, addr) != CONSTANT_SYMBOLIC) - abort (); - - x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, c.symbol), reloc); - return plus_constant (gen_rtx_CONST (VOIDmode, x), c.offset); + if (!no_new_pseudos) + return force_reg (Pmode, value); + else + { + emit_move_insn (copy_rtx (dest), value); + return dest; + } } -/* Likewise, but shift the result left 16 bits. The expression can be - used as the right hand side of an LUISI or LUIDI pattern. */ +/* Return a LO_SUM expression for ADDR. TEMP is as for mips_force_temporary + and is used to load the high part into a register. */ static rtx -mips_lui_reloc (rtx addr, int reloc) +mips_split_symbol (rtx temp, rtx addr) { - return gen_rtx_UNSPEC (Pmode, - gen_rtvec (1, mips_reloc (addr, reloc)), - UNSPEC_HIGH); + rtx high; + + if (TARGET_MIPS16) + high = mips16_gp_pseudo_reg (); + else + high = mips_force_temporary (temp, gen_rtx_HIGH (Pmode, copy_rtx (addr))); + return gen_rtx_LO_SUM (Pmode, high, addr); } -/* Copy VALUE to a register and return that register. Use DEST as the - register if non-null, otherwise create a new one. - VALUE must be valid on the right hand side of a simple SET pattern. - The operation happens in Pmode. */ +/* Return an UNSPEC address with underlying address ADDRESS and symbol + type SYMBOL_TYPE. */ static rtx -mips_force_temporary (rtx dest, rtx value) +mips_unspec_address (rtx address, enum mips_symbol_type symbol_type) { - if (dest == 0) - return force_reg (Pmode, value); - else - { - if (!rtx_equal_p (dest, value)) - emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (dest), value)); - return dest; - } + rtx base; + HOST_WIDE_INT offset; + + mips_split_const (address, &base, &offset); + base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), + UNSPEC_ADDRESS_FIRST + symbol_type); + return plus_constant (gen_rtx_CONST (Pmode, base), offset); } -/* Return a legitimate address for REG + OFFSET. This function will - create a temporary register if OFFSET is not a SMALL_OPERAND. */ +/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the + high part to BASE and return the result. Just return BASE otherwise. + + The returned expression can be used as the first operand to a LO_SUM. */ static rtx -mips_add_offset (rtx reg, HOST_WIDE_INT offset) +mips_unspec_offset_high (rtx base, rtx addr, enum mips_symbol_type symbol_type) { - if (!SMALL_OPERAND (offset)) - reg = expand_simple_binop (GET_MODE (reg), PLUS, - GEN_INT (CONST_HIGH_PART (offset)), - reg, NULL, 0, OPTAB_WIDEN); - - return plus_constant (reg, CONST_LOW_PART (offset)); + if (mips_split_p[symbol_type]) + { + addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type)); + base = force_reg (Pmode, expand_simple_binop (Pmode, PLUS, base, addr, + NULL, 0, OPTAB_WIDEN)); + } + return base; } -/* Return the GOT entry whose address is given by %RELOC(ADDR)(BASE). - BASE is a base register (such as $gp), ADDR is addresses being - sought and RELOC is the relocation that should be used. */ +/* Return a memory reference for the GOT slot whose offset is given by + mips_unspec_address (ADDR, SYMBOL_TYPE). Register BASE contains the + high part of the offset plus $gp. */ static rtx -mips_load_got (rtx base, rtx addr, int reloc) +mips_load_got (rtx base, rtx addr, enum mips_symbol_type symbol_type) { - rtx mem; + rtx mem, offset; - mem = gen_rtx_MEM (ptr_mode, - gen_rtx_PLUS (Pmode, base, mips_reloc (addr, reloc))); + offset = mips_unspec_address (addr, symbol_type); + mem = gen_rtx_MEM (ptr_mode, gen_rtx_LO_SUM (Pmode, base, offset)); set_mem_alias_set (mem, mips_got_alias_set); - /* GOT references can't trap. */ + /* GOT entries are constant and references to them can't trap. */ + RTX_UNCHANGING_P (mem) = 1; MEM_NOTRAP_P (mem) = 1; - /* If we allow a function's address to be lazily bound, its entry - may change after the first call. Other entries are constant. */ - if (reloc != RELOC_CALL16 && reloc != RELOC_CALL_LO) - RTX_UNCHANGING_P (mem) = 1; - return mem; } -/* Obtain the address of ADDR from the GOT using relocation RELOC. - The returned address may be used on the right hand side of a SET. */ +/* Return the offset of ADDR's GOT entry from _gp. ADDR is a + global_got_operand. */ -static rtx -mips_load_got16 (rtx addr, int reloc) +rtx +mips_gotoff_global (rtx addr) { - return mips_load_got (pic_offset_table_rtx, addr, reloc); + return mips_unspec_address (addr, SYMBOL_GOTOFF_GLOBAL); } -/* Like mips_load_got16, but for 32-bit offsets. HIGH_RELOC is the - relocation that gives the high 16 bits of the offset and LOW_RELOC is - the relocation that gives the low 16 bits. TEMP is a Pmode register - to use a temporary, or null if new registers can be created at will. */ +/* Fetch the high part of local_got_operand ADDR from the GOT. */ -static rtx -mips_load_got32 (rtx temp, rtx addr, int high_reloc, int low_reloc) +rtx +mips_load_got_page (rtx addr) { - rtx x; - - x = mips_force_temporary (temp, mips_lui_reloc (addr, high_reloc)); - x = mips_force_temporary (temp, - gen_rtx_PLUS (Pmode, pic_offset_table_rtx, x)); - return mips_load_got (x, addr, low_reloc); + return mips_load_got (pic_offset_table_rtx, addr, SYMBOL_GOTOFF_PAGE); } -/* Copy the high part of ADDR into a register and return the register. - Use DEST as the register if non-null. */ +/* Fetch the address of global_got_operand ADDR from the GOT. BASE is a + register that holds the address _gp + %got_hi(ADDR). */ -static rtx -mips_emit_high (rtx dest, rtx addr) +rtx +mips_load_got_global (rtx base, rtx addr) { - rtx high, x; - - high = gen_rtx_HIGH (Pmode, addr); - if (TARGET_ABICALLS) - { - x = mips_load_got16 (copy_rtx (addr), RELOC_GOT_PAGE); - x = mips_force_temporary (dest, x); - set_unique_reg_note (get_last_insn (), REG_EQUAL, high); - } - else - x = mips_force_temporary (dest, high); - - return x; + return mips_load_got (base, addr, SYMBOL_GOTOFF_GLOBAL); } -/* See if *XLOC is a symbolic constant that can be reduced in some way. - If it is, set *XLOC to the reduced expression and return true. - The new expression will be both a legitimate address and a legitimate - source operand for a mips.md SET pattern. If OFFSETABLE_P, the - address will be offsetable. - - DEST is a register to use a temporary, or null if new registers - can be created at will. */ +/* Return a legitimate address for REG + OFFSET. This function will + create a temporary register if OFFSET is not a SMALL_OPERAND. */ -static bool -mips_legitimize_symbol (rtx dest, rtx *xloc, int offsetable_p) +static rtx +mips_add_offset (rtx reg, HOST_WIDE_INT offset) { - struct mips_constant_info c; - enum mips_symbol_type symbol_type; - rtx x; - - if (mips_classify_constant (&c, *xloc) != CONSTANT_SYMBOLIC) - return false; - - symbol_type = mips_classify_symbol (c.symbol); - - /* If a non-offsetable address is OK, try splitting it into a - high part and a LO_SUM. */ - if (!offsetable_p && mips_splittable_symbol_p (symbol_type, c.offset)) - { - if (symbol_type == SYMBOL_SMALL_DATA) - x = mips_sdata_pointer (); - else - x = mips_emit_high (dest, *xloc); - if (x != 0) - { - *xloc = gen_rtx_LO_SUM (Pmode, x, copy_rtx (*xloc)); - return true; - } - } - - /* If the offset is nonzero, move the symbol into a register (always valid) - and add the constant in afterwards. This requires an extra temporary if - the offset isn't a signed 16-bit number. - - For mips16, it's better to force the constant into memory instead. */ - if (!TARGET_MIPS16 - && c.offset != 0 - && (SMALL_OPERAND (c.offset) || dest == 0)) - { - x = (dest == 0 ? gen_reg_rtx (Pmode) : dest); - emit_move_insn (copy_rtx (x), c.symbol); - *xloc = mips_add_offset (x, c.offset); - return true; - } + if (!SMALL_OPERAND (offset)) + reg = expand_simple_binop (GET_MODE (reg), PLUS, + GEN_INT (CONST_HIGH_PART (offset)), + reg, NULL, 0, OPTAB_WIDEN); - return false; + return plus_constant (reg, CONST_LOW_PART (offset)); } @@ -1772,8 +1719,16 @@ mips_legitimize_symbol (rtx dest, rtx *xloc, int offsetable_p) bool mips_legitimize_address (rtx *xloc, enum machine_mode mode) { - if (mips_legitimize_symbol (0, xloc, !SINGLE_WORD_MODE_P (mode))) - return true; + enum mips_symbol_type symbol_type; + + /* See if the address can split into a high part and a LO_SUM. */ + if (mips_symbolic_constant_p (*xloc, &symbol_type) + && mips_symbolic_address_p (symbol_type, mode) + && mips_split_p[symbol_type]) + { + *xloc = mips_split_symbol (0, *xloc); + return true; + } if (GET_CODE (*xloc) == PLUS && GET_CODE (XEXP (*xloc, 1)) == CONST_INT) { @@ -1929,54 +1884,48 @@ mips_move_integer (rtx dest, unsigned HOST_WIDE_INT value) static void mips_legitimize_const_move (enum machine_mode mode, rtx dest, rtx src) { - rtx temp; - - temp = no_new_pseudos ? dest : 0; - - /* If generating PIC, the high part of an address is loaded from the GOT. */ - if (GET_CODE (src) == HIGH) - { - mips_emit_high (dest, XEXP (src, 0)); - return; - } + rtx base; + HOST_WIDE_INT offset; + enum mips_symbol_type symbol_type; + /* Split moves of big integers into smaller pieces. In mips16 code, + it's better to force the constant into memory instead. */ if (GET_CODE (src) == CONST_INT && !TARGET_MIPS16) { mips_move_integer (dest, INTVAL (src)); return; } - /* Fetch global symbols from the GOT. */ - if (TARGET_EXPLICIT_RELOCS - && GET_CODE (src) == SYMBOL_REF - && mips_classify_symbol (src) == SYMBOL_GOT_GLOBAL) + /* See if the symbol can be split. For mips16, this is often worse than + forcing it in the constant pool since it needs the single-register form + of addiu or daddiu. */ + if (!TARGET_MIPS16 + && mips_symbolic_constant_p (src, &symbol_type) + && mips_split_p[symbol_type]) { - if (TARGET_XGOT) - src = mips_load_got32 (temp, src, RELOC_GOT_HI, RELOC_GOT_LO); - else - src = mips_load_got16 (src, RELOC_GOT_DISP); - emit_insn (gen_rtx_SET (VOIDmode, dest, src)); + emit_move_insn (dest, mips_split_symbol (dest, src)); return; } - /* Try handling the source operand as a symbolic address. */ - if (mips_legitimize_symbol (temp, &src, false)) + /* If we have (const (plus symbol offset)), load the symbol first + and then add in the offset. This is usually better than forcing + the constant into memory, at least in non-mips16 code. */ + mips_split_const (src, &base, &offset); + if (!TARGET_MIPS16 + && offset != 0 + && (!no_new_pseudos || SMALL_OPERAND (offset))) { - emit_insn (gen_rtx_SET (VOIDmode, dest, src)); + base = mips_force_temporary (dest, base); + emit_move_insn (dest, mips_add_offset (base, offset)); return; } src = force_const_mem (mode, src); /* When using explicit relocs, constant pool references are sometimes - not legitimate addresses. mips_legitimize_symbol must be able to - deal with all such cases. */ - if (GET_CODE (src) == MEM && !memory_operand (src, VOIDmode)) - { - src = copy_rtx (src); - if (!mips_legitimize_symbol (temp, &XEXP (src, 0), false)) - abort (); - } + not legitimate addresses. */ + if (!memory_operand (src, VOIDmode)) + src = replace_equiv_address (src, mips_split_symbol (dest, XEXP (src, 0))); emit_move_insn (dest, src); } @@ -2007,30 +1956,6 @@ mips_legitimize_move (enum machine_mode mode, rtx dest, rtx src) } return false; } - - -/* Convert GOT and GP-relative accesses back into their original form. - Used by both TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */ - -rtx -mips_delegitimize_address (rtx x) -{ - struct mips_constant_info c; - - if (GET_CODE (x) == MEM - && GET_CODE (XEXP (x, 0)) == PLUS - && mips_classify_constant (&c, XEXP (XEXP (x, 0), 1)) == CONSTANT_RELOC - && mips_classify_symbol (c.symbol) == SYMBOL_GOT_GLOBAL) - return c.symbol; - - if (GET_CODE (x) == LO_SUM - && XEXP (x, 0) == (TARGET_MIPS16 - ? cfun->machine->mips16_gp_pseudo_rtx - : pic_offset_table_rtx)) - return XEXP (x, 1); - - return x; -} /* We need a lot of little routines to check constant values on the mips16. These are used to figure out how long the instruction will @@ -2257,17 +2182,17 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total) case SYMBOL_REF: case LABEL_REF: case CONST_DOUBLE: - if (((outer_code) == PLUS || (outer_code) == MINUS) - && const_arith_operand (x, VOIDmode)) - { - *total = 0; - return true; - } + if (LEGITIMATE_CONSTANT_P (x)) + { + *total = COSTS_N_INSNS (1); + return true; + } else - { - int n = mips_const_insns (x); - return (n == 0 ? CONSTANT_POOL_COST : COSTS_N_INSNS (n)); - } + { + /* The value will need to be fetched from the constant pool. */ + *total = CONSTANT_POOL_COST; + return true; + } case MEM: { @@ -2554,7 +2479,7 @@ mips_subword (rtx op, int high_p) } if (GET_CODE (op) == MEM) - return adjust_address (op, word_mode, byte); + return mips_rewrite_small_data (adjust_address (op, word_mode, byte)); return simplify_gen_subreg (word_mode, op, mode, byte); } @@ -2644,7 +2569,6 @@ const char * mips_output_move (rtx dest, rtx src) { enum rtx_code dest_code, src_code; - struct mips_constant_info c; bool dbl_p; dest_code = GET_CODE (dest); @@ -2721,20 +2645,11 @@ mips_output_move (rtx dest, rtx src) if (src_code == HIGH) return "lui\t%0,%h1"; - switch (mips_classify_constant (&c, src)) - { - case CONSTANT_NONE: - break; - - case CONSTANT_GP: - return "move\t%0,%1"; + if (CONST_GP_P (src)) + return "move\t%0,%1"; - case CONSTANT_RELOC: - return "li\t%0,%1"; - - case CONSTANT_SYMBOLIC: - return (dbl_p ? "dla\t%0,%a1" : "la\t%0,%a1"); - } + if (symbolic_operand (src, VOIDmode)) + return (dbl_p ? "dla\t%0,%1" : "la\t%0,%1"); } if (src_code == REG && FP_REG_P (REGNO (src))) { @@ -3273,18 +3188,27 @@ mips_expand_call (rtx result, rtx addr, rtx args_size, rtx aux, int sibcall_p) { if (!call_insn_operand (addr, VOIDmode)) { - /* When generating PIC, try to allow global functions to be - lazily bound. */ + /* If we're generating PIC, and this call is to a global function, + try to allow its address to be resolved lazily. This isn't + possible for NewABI sibcalls since the value of $gp on entry + to the stub would be our caller's gp, not ours. */ if (TARGET_EXPLICIT_RELOCS - && GET_CODE (addr) == SYMBOL_REF - && mips_classify_symbol (addr) == SYMBOL_GOT_GLOBAL) + && !(sibcall_p && TARGET_NEWABI) + && global_got_operand (addr, VOIDmode)) { - if (TARGET_XGOT) - addr = mips_load_got32 (0, addr, RELOC_CALL_HI, RELOC_CALL_LO); + rtx high, lo_sum_symbol; + + high = mips_unspec_offset_high (pic_offset_table_rtx, + addr, SYMBOL_GOTOFF_CALL); + lo_sum_symbol = mips_unspec_address (addr, SYMBOL_GOTOFF_CALL); + addr = gen_reg_rtx (Pmode); + if (Pmode == SImode) + emit_insn (gen_load_callsi (addr, high, lo_sum_symbol)); else - addr = mips_load_got16 (addr, RELOC_CALL16); + emit_insn (gen_load_calldi (addr, high, lo_sum_symbol)); } - addr = force_reg (Pmode, addr); + else + addr = force_reg (Pmode, addr); } if (TARGET_MIPS16 @@ -3982,16 +3906,15 @@ mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum, and two offsets, although we could have designed this with two pointers and three offsets. */ - -tree -mips_build_va_list (void) +static tree +mips_build_builtin_va_list (void) { if (EABI_FLOAT_VARARGS_P) { tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff, f_res, record; tree array, index; - record = make_node (RECORD_TYPE); + record = (*lang_hooks.types.make_type) (RECORD_TYPE); f_ovfl = build_decl (FIELD_DECL, get_identifier ("__overflow_argptr"), ptr_type_node); @@ -4027,7 +3950,11 @@ mips_build_va_list (void) layout_type (record); return record; } + else if (TARGET_IRIX && !TARGET_IRIX5) + /* On IRIX 6, this type is 'char *'. */ + return build_pointer_type (char_type_node); else + /* Otherwise, we use 'void *'. */ return ptr_type_node; } @@ -4678,6 +4605,7 @@ override_options (void) switch ((int) mips_arch) { case PROCESSOR_R4100: + case PROCESSOR_R4111: case PROCESSOR_R4120: target_flags |= MASK_SOFT_FLOAT; break; @@ -4705,8 +4633,6 @@ override_options (void) defaults for the N32/N64 ABIs. */ if (TARGET_IRIX && !TARGET_SGI_O32_AS) { - flag_gnu_linker = 1; - targetm.have_ctors_dtors = true; targetm.asm_out.constructor = default_named_section_asm_out_constructor; targetm.asm_out.destructor = default_named_section_asm_out_destructor; @@ -4737,10 +4663,10 @@ override_options (void) /* Adapt wording to IRIX version: IRIX 5 only had a single ABI, so -mabi=32 isn't usually specified. */ if (TARGET_IRIX5) - warning ("-g is only supported using GNU as,"); + inform ("-g is only supported using GNU as,"); else - warning ("-g is only supported using GNU as with -mabi=32,"); - warning ("-g option disabled"); + inform ("-g is only supported using GNU as with -mabi=32,"); + inform ("-g option disabled"); write_symbols = NO_DEBUG; } } @@ -5028,6 +4954,68 @@ override_options (void) /* Create a unique alias set for GOT references. */ mips_got_alias_set = new_alias_set (); + + if (TARGET_EXPLICIT_RELOCS || mips_split_addresses) + { + mips_split_p[SYMBOL_GENERAL] = true; + mips_hi_relocs[SYMBOL_GENERAL] = "%hi("; + mips_lo_relocs[SYMBOL_GENERAL] = "%lo("; + } + + if (TARGET_MIPS16) + { + /* The high part is provided by a pseudo copy of $gp. */ + mips_split_p[SYMBOL_SMALL_DATA] = true; + mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gprel("; + } + + if (TARGET_EXPLICIT_RELOCS) + { + /* Small data constants are kept whole until after reload, + then lowered by mips_rewrite_small_data. */ + mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gp_rel("; + + mips_split_p[SYMBOL_GOT_LOCAL] = true; + if (TARGET_NEWABI) + { + mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got_page("; + mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%got_ofst("; + } + else + { + mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got("; + mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%lo("; + } + + if (TARGET_XGOT) + { + /* The HIGH and LO_SUM are matched by special .md patterns. */ + mips_split_p[SYMBOL_GOT_GLOBAL] = true; + + mips_split_p[SYMBOL_GOTOFF_GLOBAL] = true; + mips_hi_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_hi("; + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_lo("; + + mips_split_p[SYMBOL_GOTOFF_CALL] = true; + mips_hi_relocs[SYMBOL_GOTOFF_CALL] = "%call_hi("; + mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call_lo("; + } + else + { + if (TARGET_NEWABI) + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_disp("; + else + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got("; + mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call16("; + } + } + + if (TARGET_NEWABI) + { + mips_split_p[SYMBOL_GOTOFF_LOADGP] = true; + mips_hi_relocs[SYMBOL_GOTOFF_LOADGP] = "%hi(%neg(%gp_rel("; + mips_lo_relocs[SYMBOL_GOTOFF_LOADGP] = "%lo(%neg(%gp_rel("; + } } /* Implement CONDITIONAL_REGISTER_USAGE. */ @@ -5208,8 +5196,6 @@ void print_operand (FILE *file, rtx op, int letter) { register enum rtx_code code; - struct mips_constant_info c; - const char *reloc; if (PRINT_OPERAND_PUNCT_VALID_P (letter)) { @@ -5350,16 +5336,7 @@ print_operand (FILE *file, rtx op, int letter) code = GET_CODE (op); - if (letter == 'h') - { - if (GET_CODE (op) != HIGH) - abort (); - fputs ("%hi(", file); - output_addr_const (file, XEXP (op, 0)); - fputc (')', file); - } - - else if (letter == 'C') + if (letter == 'C') switch (code) { case EQ: fputs ("eq", file); break; @@ -5411,6 +5388,17 @@ print_operand (FILE *file, rtx op, int letter) fatal_insn ("PRINT_OPERAND, invalid insn for %%W", op); } + else if (letter == 'h') + { + if (GET_CODE (op) == HIGH) + op = XEXP (op, 0); + + print_operand_reloc (file, op, mips_hi_relocs); + } + + else if (letter == 'R') + print_operand_reloc (file, op, mips_lo_relocs); + else if (letter == 'S') { char buffer[100]; @@ -5483,62 +5471,40 @@ print_operand (FILE *file, rtx op, int letter) else if (letter == 't') fputs (code == EQ ? "t" : "f", file); - else - switch (mips_classify_constant (&c, op)) - { - case CONSTANT_SYMBOLIC: - if (letter == 'R') - { - if (mips_classify_symbol (c.symbol) == SYMBOL_SMALL_DATA) - fputs (TARGET_MIPS16 ? "%gprel(" : "%gp_rel(", file); - else if (TARGET_ABICALLS && TARGET_NEWABI) - fputs ("%got_ofst(", file); - else - fputs ("%lo(", file); - output_addr_const (file, op); - fputc (')', file); - break; - } - /* ... fall through ... */ + else if (CONST_GP_P (op)) + print_operand (file, XEXP (op, 0), letter); - case CONSTANT_NONE: - output_addr_const (file, op); - break; + else + output_addr_const (file, op); +} - case CONSTANT_GP: - fputs (reg_names[PIC_OFFSET_TABLE_REGNUM], file); - break; - case CONSTANT_RELOC: - reloc = mips_reloc_string (c.reloc); - fputs (reloc, file); - output_addr_const (file, plus_constant (c.symbol, c.offset)); - while (*reloc != 0) - if (*reloc++ == '(') - fputc (')', file); - } -} - -/* Return the assembly operator used for the given type of relocation. */ +/* Print symbolic operand OP, which is part of a HIGH or LO_SUM. + RELOCS is the array of relocations to use. */ -static const char * -mips_reloc_string (int reloc) +static void +print_operand_reloc (FILE *file, rtx op, const char **relocs) { - switch (reloc) - { - case RELOC_GOT_HI: return "%got_hi("; - case RELOC_GOT_LO: return "%got_lo("; - case RELOC_GOT_PAGE: return (TARGET_NEWABI ? "%got_page(" : "%got("); - case RELOC_GOT_DISP: return (TARGET_NEWABI ? "%got_disp(" : "%got("); - case RELOC_CALL16: return "%call16("; - case RELOC_CALL_HI: return "%call_hi("; - case RELOC_CALL_LO: return "%call_lo("; - case RELOC_LOADGP_HI: return "%hi(%neg(%gp_rel("; - case RELOC_LOADGP_LO: return "%lo(%neg(%gp_rel("; - } - abort (); -} + enum mips_symbol_type symbol_type; + const char *p; + rtx base; + HOST_WIDE_INT offset; + if (!mips_symbolic_constant_p (op, &symbol_type) || relocs[symbol_type] == 0) + fatal_insn ("PRINT_OPERAND, invalid operand for relocation", op); + + /* If OP uses an UNSPEC address, we want to print the inner symbol. */ + mips_split_const (op, &base, &offset); + if (UNSPEC_ADDRESS_P (base)) + op = plus_constant (UNSPEC_ADDRESS (base), offset); + + fputs (relocs[symbol_type], file); + output_addr_const (file, op); + for (p = relocs[symbol_type]; *p != 0; p++) + if (*p == '(') + fputc (')', file); +} + /* Output address operand X to FILE. */ void @@ -5546,26 +5512,24 @@ print_operand_address (FILE *file, rtx x) { struct mips_address_info addr; - switch (mips_classify_address (&addr, x, word_mode, 1, 1)) - { - case ADDRESS_INVALID: - abort (); - - case ADDRESS_REG: - print_operand (file, addr.offset, 0); - fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); - return; + if (mips_classify_address (&addr, x, word_mode, true)) + switch (addr.type) + { + case ADDRESS_REG: + print_operand (file, addr.offset, 0); + fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); + return; - case ADDRESS_LO_SUM: - print_operand (file, addr.offset, 'R'); - fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); - return; + case ADDRESS_LO_SUM: + print_operand (file, addr.offset, 'R'); + fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); + return; - case ADDRESS_CONST_INT: - case ADDRESS_SYMBOLIC: - output_addr_const (file, x); - return; - } + case ADDRESS_CONST_INT: + case ADDRESS_SYMBOLIC: + output_addr_const (file, x); + return; + } abort (); } @@ -5611,14 +5575,7 @@ mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name) extern_head = p; } - if (TARGET_IRIX && mips_abi == ABI_32 - && TREE_CODE (decl) == FUNCTION_DECL - /* ??? Don't include alloca, since gcc will always expand it - inline. If we don't do this, the C++ library fails to build. */ - && strcmp (name, "alloca") - /* ??? Don't include __builtin_next_arg, because then gcc will not - bootstrap under Irix 5.1. */ - && strcmp (name, "__builtin_next_arg")) + if (TARGET_IRIX && mips_abi == ABI_32 && TREE_CODE (decl) == FUNCTION_DECL) { p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); p->next = extern_head; @@ -5889,7 +5846,8 @@ mips_file_end (void) name_tree = get_identifier (p->name); /* Positively ensure only one .extern for any given symbol. */ - if (! TREE_ASM_WRITTEN (name_tree)) + if (!TREE_ASM_WRITTEN (name_tree) + && TREE_SYMBOL_REFERENCED (name_tree)) { TREE_ASM_WRITTEN (name_tree) = 1; /* In IRIX 5 or IRIX 6 for the O32 ABI, we must output a @@ -5987,6 +5945,93 @@ mips_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end) } #endif +/* Return true if X is a small data address that can be rewritten + as a LO_SUM. */ + +static bool +mips_rewrite_small_data_p (rtx x) +{ + enum mips_symbol_type symbol_type; + + return (TARGET_EXPLICIT_RELOCS + && mips_symbolic_constant_p (x, &symbol_type) + && symbol_type == SYMBOL_SMALL_DATA); +} + + +/* A for_each_rtx callback for small_data_pattern. */ + +static int +small_data_pattern_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + if (GET_CODE (*loc) == LO_SUM) + return -1; + + return mips_rewrite_small_data_p (*loc); +} + +/* Return true if OP refers to small data symbols directly, not through + a LO_SUM. */ + +int +small_data_pattern (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return (GET_CODE (op) != SEQUENCE + && for_each_rtx (&op, small_data_pattern_1, 0)); +} + +/* A for_each_rtx callback, used by mips_rewrite_small_data. */ + +static int +mips_rewrite_small_data_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + if (mips_rewrite_small_data_p (*loc)) + *loc = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, *loc); + + if (GET_CODE (*loc) == LO_SUM) + return -1; + + return 0; +} + +/* If possible, rewrite OP so that it refers to small data using + explicit relocations. */ + +rtx +mips_rewrite_small_data (rtx op) +{ + op = copy_insn (op); + for_each_rtx (&op, mips_rewrite_small_data_1, 0); + return op; +} + +/* Return true if the current function has an insn that implicitly + refers to $gp. */ + +static bool +mips_function_has_gp_insn (void) +{ + /* Don't bother rechecking if we found one last time. */ + if (!cfun->machine->has_gp_insn_p) + { + rtx insn; + + push_topmost_sequence (); + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn) + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER + && (get_attr_got (insn) != GOT_UNSET + || small_data_pattern (PATTERN (insn), VOIDmode))) + break; + pop_topmost_sequence (); + + cfun->machine->has_gp_insn_p = (insn != 0); + } + return cfun->machine->has_gp_insn_p; +} + + /* Return the register that should be used as the global pointer within this function. Return 0 if the function doesn't need a global pointer. */ @@ -6009,6 +6054,11 @@ mips_global_pointer (void) if (current_function_profile) return GLOBAL_POINTER_REGNUM; + /* If the function has a nonlocal goto, $gp must hold the correct + global pointer for the target function. */ + if (current_function_has_nonlocal_goto) + return GLOBAL_POINTER_REGNUM; + /* If the gp is never referenced, there's no need to initialize it. Note that reload can sometimes introduce constant pool references into a function that otherwise didn't need them. For example, @@ -6023,7 +6073,8 @@ mips_global_pointer (void) In cases like these, reload will have added the constant to the pool but no instruction will yet refer to it. */ if (!regs_ever_live[GLOBAL_POINTER_REGNUM] - && !current_function_uses_const_pool) + && !current_function_uses_const_pool + && !mips_function_has_gp_insn ()) return 0; /* We need a global pointer, but perhaps we can use a call-clobbered @@ -6032,7 +6083,8 @@ mips_global_pointer (void) for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) if (!regs_ever_live[regno] && call_used_regs[regno] - && !fixed_regs[regno]) + && !fixed_regs[regno] + && regno != PIC_FUNCTION_ADDR_REGNUM) return regno; return GLOBAL_POINTER_REGNUM; @@ -6153,8 +6205,8 @@ compute_frame_size (HOST_WIDE_INT size) HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */ HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long fmask; /* mask of saved fp registers */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ cfun->machine->global_pointer = mips_global_pointer (); @@ -6187,7 +6239,7 @@ compute_frame_size (HOST_WIDE_INT size) if (mips_save_reg_p (regno)) { gp_reg_size += GET_MODE_SIZE (gpr_mode); - mask |= 1L << (regno - GP_REG_FIRST); + mask |= 1 << (regno - GP_REG_FIRST); } /* We need to restore these for the handler. */ @@ -6200,7 +6252,7 @@ compute_frame_size (HOST_WIDE_INT size) if (regno == INVALID_REGNUM) break; gp_reg_size += GET_MODE_SIZE (gpr_mode); - mask |= 1L << (regno - GP_REG_FIRST); + mask |= 1 << (regno - GP_REG_FIRST); } } @@ -6240,7 +6292,7 @@ compute_frame_size (HOST_WIDE_INT size) if (mask) { - unsigned long offset; + HOST_WIDE_INT offset; offset = (args_size + cprestore_size + var_size + gp_reg_size - GET_MODE_SIZE (gpr_mode)); @@ -6255,9 +6307,11 @@ compute_frame_size (HOST_WIDE_INT size) if (fmask) { - unsigned long offset = (args_size + cprestore_size + var_size - + gp_reg_rounded + fp_reg_size - - FP_INC * UNITS_PER_FPREG); + HOST_WIDE_INT offset; + + offset = (args_size + cprestore_size + var_size + + gp_reg_rounded + fp_reg_size + - FP_INC * UNITS_PER_FPREG); cfun->machine->frame.fp_sp_offset = offset; cfun->machine->frame.fp_save_offset = offset - total_size; } @@ -6275,10 +6329,10 @@ compute_frame_size (HOST_WIDE_INT size) pointer or argument pointer. TO is either the stack pointer or hard frame pointer. */ -int +HOST_WIDE_INT mips_initial_elimination_offset (int from, int to) { - int offset; + HOST_WIDE_INT offset; compute_frame_size (get_frame_size ()); @@ -6423,12 +6477,15 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* .frame FRAMEREG, FRAMESIZE, RETREG */ fprintf (file, - "\t.frame\t%s,%ld,%s\t\t# vars= %ld, regs= %d/%d, args= %ld, gp= %ld\n", + "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s\t\t" + "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d/%d" + ", args= " HOST_WIDE_INT_PRINT_DEC + ", gp= " HOST_WIDE_INT_PRINT_DEC "\n", (reg_names[(frame_pointer_needed) ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]), ((frame_pointer_needed && TARGET_MIPS16) - ? ((long) tsize - cfun->machine->frame.args_size) - : (long) tsize), + ? tsize - cfun->machine->frame.args_size + : tsize), reg_names[GP_REG_FIRST + 31], cfun->machine->frame.var_size, cfun->machine->frame.num_gp, @@ -6437,9 +6494,10 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) cfun->machine->frame.cprestore_size); /* .mask MASK, GPOFFSET; .fmask FPOFFSET */ - fprintf (file, "\t.mask\t0x%08lx,%ld\n\t.fmask\t0x%08lx,%ld\n", + fprintf (file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", cfun->machine->frame.mask, - cfun->machine->frame.gp_save_offset, + cfun->machine->frame.gp_save_offset); + fprintf (file, "\t.fmask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", cfun->machine->frame.fmask, cfun->machine->frame.fp_save_offset); @@ -6493,11 +6551,15 @@ mips_frame_set (rtx mem, rtx reg) static void mips_save_reg (rtx reg, rtx mem) { - if (GET_MODE (reg) == DFmode && mips_split_64bit_move_p (mem, reg)) + if (GET_MODE (reg) == DFmode && !TARGET_FLOAT64) { rtx x1, x2; - mips_split_64bit_move (mem, reg); + if (mips_split_64bit_move_p (mem, reg)) + mips_split_64bit_move (mem, reg); + else + emit_move_insn (mem, reg); + x1 = mips_frame_set (mips_subword (mem, 0), mips_subword (reg, 0)); x2 = mips_frame_set (mips_subword (mem, 1), mips_subword (reg, 1)); mips_set_frame_expr (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x1, x2))); @@ -6522,26 +6584,6 @@ mips_save_reg (rtx reg, rtx mem) } -/* Emit an instruction to move SRC into DEST. When generating - explicit reloc code, mark the instruction as potentially dead. */ - -static void -mips_gp_insn (rtx dest, rtx src) -{ - rtx insn; - - insn = emit_insn (gen_rtx_SET (VOIDmode, dest, src)); - if (TARGET_EXPLICIT_RELOCS) - { - /* compute_frame_size assumes that any function which uses the - constant pool will need a gp. However, all constant - pool references could be eliminated, in which case - it is OK for flow to delete the gp load as well. */ - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, - REG_NOTES (insn)); - } -} - /* Expand the prologue into a bunch of separate insns. */ void @@ -6609,7 +6651,7 @@ mips_expand_prologue (void) /* Set up the frame pointer, if we're using one. In mips16 code, we point the frame pointer ahead of the outgoing argument area. This should allow more variables & incoming arguments to be - acceesed with unextended instructions. */ + accessed with unextended instructions. */ if (frame_pointer_needed) { if (TARGET_MIPS16 && cfun->machine->frame.args_size != 0) @@ -6632,19 +6674,12 @@ mips_expand_prologue (void) /* If generating n32/n64 abicalls, emit the instructions to load $gp. */ if (TARGET_ABICALLS && TARGET_NEWABI && cfun->machine->global_pointer > 0) { - rtx fnsymbol, fnaddr; - - fnsymbol = XEXP (DECL_RTL (current_function_decl), 0); - fnaddr = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); - - mips_gp_insn (MIPS_PROLOGUE_TEMP (Pmode), - mips_lui_reloc (fnsymbol, RELOC_LOADGP_HI)); - mips_gp_insn (MIPS_PROLOGUE_TEMP (Pmode), - gen_rtx_PLUS (Pmode, MIPS_PROLOGUE_TEMP (Pmode), fnaddr)); - mips_gp_insn (pic_offset_table_rtx, - gen_rtx_PLUS (Pmode, MIPS_PROLOGUE_TEMP (Pmode), - mips_reloc (fnsymbol, RELOC_LOADGP_LO))); + rtx addr, offset, incoming_address; + addr = XEXP (DECL_RTL (current_function_decl), 0); + offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP); + incoming_address = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); + emit_insn (gen_loadgp (offset, incoming_address)); if (!TARGET_EXPLICIT_RELOCS) emit_insn (gen_loadgp_blockage ()); } @@ -7104,6 +7139,96 @@ mips_encode_section_info (tree decl, rtx rtl, int first) default_encode_section_info (decl, rtl, first); } +/* See whether VALTYPE is a record whose fields should be returned in + floating-point registers. If so, return the number of fields and + list them in FIELDS (which should have two elements). Return 0 + otherwise. + + For n32 & n64, a structure with one or two fields is returned in + floating-point registers as long as every field has a floating-point + type. */ + +static int +mips_fpr_return_fields (tree valtype, tree *fields) +{ + tree field; + int i; + + if (!TARGET_NEWABI) + return 0; + + if (TREE_CODE (valtype) != RECORD_TYPE) + return 0; + + i = 0; + for (field = TYPE_FIELDS (valtype); field != 0; field = TREE_CHAIN (field)) + { + if (TREE_CODE (field) != FIELD_DECL) + continue; + + if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE) + return 0; + + if (i == 2) + return 0; + + fields[i++] = field; + } + return i; +} + + +/* Implement TARGET_RETURN_IN_MSB. For n32 & n64, we should return + a value in the most significant part of $2/$3 if: + + - the target is big-endian; + + - the value has a structure or union type (we generalize this to + cover aggregates from other languages too); and + + - the structure is not returned in floating-point registers. */ + +static bool +mips_return_in_msb (tree valtype) +{ + tree fields[2]; + + return (TARGET_NEWABI + && TARGET_BIG_ENDIAN + && AGGREGATE_TYPE_P (valtype) + && mips_fpr_return_fields (valtype, fields) == 0); +} + + +/* Return a composite value in a pair of floating-point registers. + MODE1 and OFFSET1 are the mode and byte offset for the first value, + likewise MODE2 and OFFSET2 for the second. MODE is the mode of the + complete value. + + For n32 & n64, $f0 always holds the first value and $f2 the second. + Otherwise the values are packed together as closely as possible. */ + +static rtx +mips_return_fpr_pair (enum machine_mode mode, + enum machine_mode mode1, HOST_WIDE_INT offset1, + enum machine_mode mode2, HOST_WIDE_INT offset2) +{ + int inc; + + inc = (TARGET_NEWABI ? 2 : FP_INC); + return gen_rtx_PARALLEL + (mode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode1, FP_RETURN), + GEN_INT (offset1)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode2, FP_RETURN + inc), + GEN_INT (offset2)))); + +} + + /* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls, VALTYPE is the return type and MODE is VOIDmode. For libcalls, VALTYPE is null and MODE is the mode of the return value. */ @@ -7112,121 +7237,63 @@ rtx mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, enum machine_mode mode) { - int reg = GP_RETURN; - enum mode_class mclass; - int unsignedp = 1; - if (valtype) { + tree fields[2]; + int unsignedp; + mode = TYPE_MODE (valtype); unsignedp = TREE_UNSIGNED (valtype); /* Since we define PROMOTE_FUNCTION_RETURN, we must promote the mode just as PROMOTE_MODE does. */ mode = promote_mode (valtype, mode, &unsignedp, 1); - } - mclass = GET_MODE_CLASS (mode); - - if (mclass == MODE_FLOAT && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE) - reg = FP_RETURN; - - else if (mclass == MODE_FLOAT && mode == TFmode) - /* long doubles are really split between f0 and f2, not f1. Eek. - Use DImode for each component, since GCC wants integer modes - for subregs. */ - return gen_rtx_PARALLEL - (VOIDmode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (DImode, FP_RETURN), - GEN_INT (0)), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (DImode, FP_RETURN + 2), - GEN_INT (GET_MODE_SIZE (mode) / 2)))); - - - else if (mclass == MODE_COMPLEX_FLOAT - && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2) - { - enum machine_mode cmode = GET_MODE_INNER (mode); - - return gen_rtx_PARALLEL - (VOIDmode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (cmode, FP_RETURN), - GEN_INT (0)), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (cmode, FP_RETURN + FP_INC), - GEN_INT (GET_MODE_SIZE (cmode))))); - } - - else if (valtype && TREE_CODE (valtype) == RECORD_TYPE - && mips_abi != ABI_32 - && mips_abi != ABI_O64 - && mips_abi != ABI_EABI) - { - /* A struct with only one or two floating point fields is returned in - the floating point registers. */ - tree field, fields[2]; - int i; - - for (i = 0, field = TYPE_FIELDS (valtype); field; - field = TREE_CHAIN (field)) - { - if (TREE_CODE (field) != FIELD_DECL) - continue; - if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE || i >= 2) - break; + /* Handle structures whose fields are returned in $f0/$f2. */ + switch (mips_fpr_return_fields (valtype, fields)) + { + case 1: + return gen_rtx_REG (mode, FP_RETURN); - fields[i++] = field; + case 2: + return mips_return_fpr_pair (mode, + TYPE_MODE (TREE_TYPE (fields[0])), + int_byte_position (fields[0]), + TYPE_MODE (TREE_TYPE (fields[1])), + int_byte_position (fields[1])); } - /* Must check i, so that we reject structures with no elements. */ - if (! field) + /* If a value is passed in the most significant part of a register, see + whether we have to round the mode up to a whole number of words. */ + if (mips_return_in_msb (valtype)) { - if (i == 1) - { - /* The structure has DImode, but we don't allow DImode values - in FP registers, so we use a PARALLEL even though it isn't - strictly necessary. */ - enum machine_mode field_mode = TYPE_MODE (TREE_TYPE (fields[0])); - - return gen_rtx_PARALLEL - (mode, - gen_rtvec (1, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (field_mode, - FP_RETURN), - const0_rtx))); - } - - else if (i == 2) + HOST_WIDE_INT size = int_size_in_bytes (valtype); + if (size % UNITS_PER_WORD != 0) { - enum machine_mode first_mode - = TYPE_MODE (TREE_TYPE (fields[0])); - enum machine_mode second_mode - = TYPE_MODE (TREE_TYPE (fields[1])); - HOST_WIDE_INT first_offset = int_byte_position (fields[0]); - HOST_WIDE_INT second_offset = int_byte_position (fields[1]); - - return gen_rtx_PARALLEL - (mode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (first_mode, - FP_RETURN), - GEN_INT (first_offset)), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (second_mode, - FP_RETURN + 2), - GEN_INT (second_offset)))); + size += UNITS_PER_WORD - size % UNITS_PER_WORD; + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); } } } - return gen_rtx_REG (mode, reg); + if (GET_MODE_CLASS (mode) == MODE_FLOAT + && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE) + return gen_rtx_REG (mode, FP_RETURN); + + /* Handle long doubles for n32 & n64. */ + if (mode == TFmode) + return mips_return_fpr_pair (mode, + DImode, 0, + DImode, GET_MODE_SIZE (mode) / 2); + + if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT + && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2) + return mips_return_fpr_pair (mode, + GET_MODE_INNER (mode), 0, + GET_MODE_INNER (mode), + GET_MODE_SIZE (mode) / 2); + + return gen_rtx_REG (mode, GP_RETURN); } /* The implementation of FUNCTION_ARG_PASS_BY_REFERENCE. Return @@ -7425,14 +7492,8 @@ mips_valid_pointer_mode (enum machine_mode mode) hold the $gp value. */ static rtx -mips_sdata_pointer (void) +mips16_gp_pseudo_reg (void) { - if (TARGET_EXPLICIT_RELOCS) - return pic_offset_table_rtx; - - if (!TARGET_MIPS16 || no_new_pseudos) - return 0; - if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX) { rtx const_gp; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 1b51913a022..e144d64bc41 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -476,7 +476,7 @@ extern const struct mips_cpu_info *mips_tune_info; { \ builtin_define ("_LANGUAGE_OBJECTIVE_C"); \ builtin_define ("__LANGUAGE_OBJECTIVE_C"); \ - /* Bizzare, but needed at least for Irix. */ \ + /* Bizarre, but needed at least for Irix. */ \ builtin_define_std ("LANGUAGE_C"); \ builtin_define ("_LANGUAGE_C"); \ } \ @@ -1244,8 +1244,6 @@ extern const struct mips_cpu_info *mips_tune_info; SFmode register saves. */ #define DWARF_CIE_DATA_ALIGNMENT 4 -#define FIND_BASE_TERM(X) mips_delegitimize_address (X) - /* Correct the offset of automatic variables and arguments. Note that the MIPS debug format wants all automatic variables and arguments to be in terms of the virtual frame pointer (stack pointer before @@ -1470,7 +1468,8 @@ extern const struct mips_cpu_info *mips_tune_info; - 8 condition code registers - 2 accumulator registers (hi and lo) - 32 registers each for coprocessors 0, 2 and 3 - - 6 dummy entries that were used at various times in the past. */ + - FAKE_CALL_REGNO (see the comment above load_callsi for details) + - 5 dummy entries that were used at various times in the past. */ #define FIRST_PSEUDO_REGISTER 176 @@ -2028,9 +2027,7 @@ extern enum reg_class mips_char_to_class[256]; part of a call sequence and allow a global 'foo' to be lazily bound. */ #define DANGEROUS_FOR_LA25_P(OP) \ - (TARGET_ABICALLS \ - && !TARGET_EXPLICIT_RELOCS \ - && mips_global_pic_constant_p (OP)) + (!TARGET_EXPLICIT_RELOCS && global_got_operand (OP, VOIDmode)) /* Letters in the range `Q' through `U' may be defined in a machine-dependent fashion to stand for arbitrary operand types. @@ -2234,7 +2231,7 @@ extern enum reg_class mips_char_to_class[256]; /* 1 if N is a possible register number for a function value. On the MIPS, R2 R3 and F0 F2 are the only register thus used. - Currently, R2 and F0 are only implemented here (C has no complex type) */ + Currently, R2 and F0 are only implemented here (C has no complex type) */ #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_RETURN || (N) == FP_RETURN \ || (LONG_DOUBLE_TYPE_SIZE == 128 && FP_RETURN != GP_RETURN \ @@ -2321,9 +2318,7 @@ typedef struct mips_args { /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. - For a library call, FNTYPE is 0. - -*/ + For a library call, FNTYPE is 0. */ #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ init_cumulative_args (&CUM, FNTYPE, LIBNAME) \ @@ -2412,10 +2407,6 @@ typedef struct mips_args { : ((LOC) + 15) & ~15) -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = mips_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ mips_va_start (valist, nextarg) @@ -2802,7 +2793,11 @@ typedef struct mips_args { #define PREDICATE_CODES \ {"uns_arith_operand", { REG, CONST_INT, SUBREG, ADDRESSOF }}, \ {"symbolic_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \ - {"const_arith_operand", { CONST, CONST_INT }}, \ + {"global_got_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \ + {"local_got_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \ + {"const_arith_operand", { CONST_INT }}, \ + {"small_data_pattern", { SET, PARALLEL, UNSPEC, \ + UNSPEC_VOLATILE }}, \ {"arith_operand", { REG, CONST_INT, CONST, SUBREG, ADDRESSOF }}, \ {"reg_or_0_operand", { REG, CONST_INT, CONST_DOUBLE, SUBREG, ADDRESSOF }}, \ {"small_int", { CONST_INT }}, \ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index def0088fd1e..5b758c87693 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -53,20 +53,12 @@ (UNSPEC_LDR 23) (UNSPEC_SDL 24) (UNSPEC_SDR 25) + (UNSPEC_LOADGP 26) + (UNSPEC_LOAD_CALL 27) - ;; Constants used in relocation unspecs. RELOC_GOT_PAGE and RELOC_GOT_DISP - ;; are really only available for n32 and n64. However, it is convenient - ;; to reuse them for SVR4 PIC, where they represent the local and global - ;; forms of R_MIPS_GOT16. - (RELOC_GOT_HI 100) - (RELOC_GOT_LO 101) - (RELOC_GOT_PAGE 102) - (RELOC_GOT_DISP 103) - (RELOC_CALL16 104) - (RELOC_CALL_HI 105) - (RELOC_CALL_LO 106) - (RELOC_LOADGP_HI 107) - (RELOC_LOADGP_LO 108)]) + (UNSPEC_ADDRESS_FIRST 100) + + (FAKE_CALL_REGNO 79)]) ;; .................... ;; @@ -74,6 +66,9 @@ ;; ;; .................... +(define_attr "got" "unset,xgot_high,load" + (const_string "unset")) + ;; For jal instructions, this attribute is DIRECT when the target address ;; is symbolic and INDIRECT when it is a register. (define_attr "jal" "unset,direct,indirect" @@ -125,8 +120,8 @@ ;; nop no operation (define_attr "type" "unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop" - (cond [(eq_attr "jal" "!unset") - (const_string "call")] + (cond [(eq_attr "jal" "!unset") (const_string "call") + (eq_attr "got" "load") (const_string "load")] (const_string "unknown"))) ;; Main data type used by the insn @@ -179,6 +174,11 @@ (const_int 24) ] (const_int 12)) + (eq_attr "got" "load") + (const_int 4) + (eq_attr "got" "xgot_high") + (const_int 8) + (eq_attr "type" "const") (symbol_ref "mips_const_insns (operands[1]) * 4") (eq_attr "type" "load") @@ -883,7 +883,7 @@ rtx tmp = gen_reg_rtx (DImode); emit_move_insn (tmp, operands[1]); - emit_insn (gen_addsi3 (tmp, tmp, operands[2])); + emit_insn (gen_adddi3 (tmp, tmp, operands[2])); emit_move_insn (operands[0], tmp); DONE; } @@ -4061,8 +4061,8 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_lwl" [(set (match_operand:SI 0 "register_operand" "=d") - (unspec:SI [(match_operand:BLK 1 "general_operand" "m") - (match_operand:QI 2 "general_operand" "m")] + (unspec:SI [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m")] UNSPEC_LWL))] "!TARGET_MIPS16" "lwl\t%0,%2" @@ -4072,8 +4072,8 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_lwr" [(set (match_operand:SI 0 "register_operand" "=d") - (unspec:SI [(match_operand:BLK 1 "general_operand" "m") - (match_operand:QI 2 "general_operand" "m") + (unspec:SI [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m") (match_operand:SI 3 "register_operand" "0")] UNSPEC_LWR))] "!TARGET_MIPS16" @@ -4085,7 +4085,7 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_swl" [(set (match_operand:BLK 0 "memory_operand" "=m") (unspec:BLK [(match_operand:SI 1 "reg_or_0_operand" "dJ") - (match_operand:QI 2 "general_operand" "m")] + (match_operand:QI 2 "memory_operand" "m")] UNSPEC_SWL))] "!TARGET_MIPS16" "swl\t%z1,%2" @@ -4095,7 +4095,7 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_swr" [(set (match_operand:BLK 0 "memory_operand" "+m") (unspec:BLK [(match_operand:SI 1 "reg_or_0_operand" "dJ") - (match_operand:QI 2 "general_operand" "m") + (match_operand:QI 2 "memory_operand" "m") (match_dup 0)] UNSPEC_SWR))] "!TARGET_MIPS16" @@ -4106,8 +4106,8 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_ldl" [(set (match_operand:DI 0 "register_operand" "=d") - (unspec:DI [(match_operand:BLK 1 "general_operand" "m") - (match_operand:QI 2 "general_operand" "m")] + (unspec:DI [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m")] UNSPEC_LDL))] "TARGET_64BIT && !TARGET_MIPS16" "ldl\t%0,%2" @@ -4116,8 +4116,8 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_ldr" [(set (match_operand:DI 0 "register_operand" "=d") - (unspec:DI [(match_operand:BLK 1 "general_operand" "m") - (match_operand:QI 2 "general_operand" "m") + (unspec:DI [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m") (match_operand:DI 3 "register_operand" "0")] UNSPEC_LDR))] "TARGET_64BIT && !TARGET_MIPS16" @@ -4129,7 +4129,7 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_sdl" [(set (match_operand:BLK 0 "memory_operand" "=m") (unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ") - (match_operand:QI 2 "general_operand" "m")] + (match_operand:QI 2 "memory_operand" "m")] UNSPEC_SDL))] "TARGET_64BIT && !TARGET_MIPS16" "sdl\t%z1,%2" @@ -4139,7 +4139,7 @@ dsrl\t%3,%3,1\n\ (define_insn "mov_sdr" [(set (match_operand:BLK 0 "memory_operand" "+m") (unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ") - (match_operand:QI 2 "general_operand" "m") + (match_operand:QI 2 "memory_operand" "m") (match_dup 0)] UNSPEC_SDR))] "TARGET_64BIT && !TARGET_MIPS16" @@ -4147,31 +4147,109 @@ dsrl\t%3,%3,1\n\ [(set_attr "type" "store") (set_attr "mode" "DI")]) +;; Insns to fetch a global symbol from a big GOT. -;; Instructions for loading a relocation expression using "lui". +(define_insn_and_split "*xgot_hisi" + [(set (match_operand:SI 0 "register_operand" "=d") + (high:SI (match_operand:SI 1 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (high:SI (match_dup 2))) + (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))] +{ + operands[2] = mips_gotoff_global (operands[1]); + operands[3] = pic_offset_table_rtx; +} + [(set_attr "got" "xgot_high")]) -(define_insn "luisi" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand 1 "const_arith_operand" "")] UNSPEC_HIGH))] - "" - "lui\t%0,%1" - [(set_attr "type" "arith")]) +(define_insn_and_split "*xgot_losi" + [(set (match_operand:SI 0 "register_operand" "=d") + (lo_sum:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 3))] + { operands[3] = mips_load_got_global (operands[1], operands[2]); } + [(set_attr "got" "load")]) -(define_insn "luidi" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand 1 "const_arith_operand" "")] UNSPEC_HIGH))] - "TARGET_64BIT" - "lui\t%0,%1" - [(set_attr "type" "arith")]) +(define_insn_and_split "*xgot_hidi" + [(set (match_operand:DI 0 "register_operand" "=d") + (high:DI (match_operand:DI 1 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (high:DI (match_dup 2))) + (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] +{ + operands[2] = mips_gotoff_global (operands[1]); + operands[3] = pic_offset_table_rtx; +} + [(set_attr "got" "xgot_high")]) +(define_insn_and_split "*xgot_lodi" + [(set (match_operand:DI 0 "register_operand" "=d") + (lo_sum:DI (match_operand:DI 1 "register_operand" "d") + (match_operand:DI 2 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 3))] + { operands[3] = mips_load_got_global (operands[1], operands[2]); } + [(set_attr "got" "load")]) + +;; Insns to fetch a global symbol from a normal GOT. + +(define_insn_and_split "*got_dispsi" + [(set (match_operand:SI 0 "register_operand" "=d") + (match_operand:SI 1 "global_got_operand" ""))] + "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 2))] + { operands[2] = mips_load_got_global (pic_offset_table_rtx, operands[1]); } + [(set_attr "got" "load")]) + +(define_insn_and_split "*got_dispdi" + [(set (match_operand:DI 0 "register_operand" "=d") + (match_operand:DI 1 "global_got_operand" ""))] + "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 2))] + { operands[2] = mips_load_got_global (pic_offset_table_rtx, operands[1]); } + [(set_attr "got" "load")]) + +;; Insns for loading the high part of a local symbol. + +(define_insn_and_split "*got_pagesi" + [(set (match_operand:SI 0 "register_operand" "=d") + (high:SI (match_operand:SI 1 "local_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 2))] + { operands[2] = mips_load_got_page (operands[1]); } + [(set_attr "got" "load")]) + +(define_insn_and_split "*got_pagedi" + [(set (match_operand:DI 0 "register_operand" "=d") + (high:DI (match_operand:DI 1 "local_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 2))] + { operands[2] = mips_load_got_page (operands[1]); } + [(set_attr "got" "load")]) ;; Instructions for adding the low 16 bits of an address to a register. ;; Operand 2 is the address: print_operand works out which relocation ;; should be applied. (define_insn "*lowsi" - [(set (match_operand:SI 0 "register_operand" "=r") - (lo_sum:SI (match_operand:SI 1 "register_operand" "r") + [(set (match_operand:SI 0 "register_operand" "=d") + (lo_sum:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "immediate_operand" "")))] "!TARGET_MIPS16" "addiu\t%0,%1,%R2" @@ -4179,8 +4257,8 @@ dsrl\t%3,%3,1\n\ (set_attr "mode" "SI")]) (define_insn "*lowdi" - [(set (match_operand:DI 0 "register_operand" "=r") - (lo_sum:DI (match_operand:DI 1 "register_operand" "r") + [(set (match_operand:DI 0 "register_operand" "=d") + (lo_sum:DI (match_operand:DI 1 "register_operand" "d") (match_operand:DI 2 "immediate_operand" "")))] "!TARGET_MIPS16 && TARGET_64BIT" "daddiu\t%0,%1,%R2" @@ -5048,6 +5126,26 @@ dsrl\t%3,%3,1\n\ (set_attr "mode" "SF") (set_attr "length" "4")]) +;; Insn to initialize $gp for n32/n64 abicalls. Operand 0 is the offset +;; of _gp from the start of this function. Operand 1 is the incoming +;; function address. +(define_insn_and_split "loadgp" + [(unspec_volatile [(match_operand 0 "" "") + (match_operand 1 "register_operand" "")] UNSPEC_LOADGP)] + "TARGET_ABICALLS && TARGET_NEWABI" + "#" + "" + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 2) (match_dup 4)) + (set (match_dup 2) (match_dup 5))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_rtx_HIGH (Pmode, operands[0]); + operands[4] = gen_rtx_PLUS (Pmode, operands[2], operands[1]); + operands[5] = gen_rtx_LO_SUM (Pmode, operands[2], operands[0]); +} + [(set_attr "length" "12")]) + ;; The use of gp is hidden when not using explicit relocations. ;; This blockage instruction prevents the gp load from being ;; scheduled after an implicit use of gp. It also prevents @@ -8154,8 +8252,8 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/" ;; Normal return. (define_insn "return_internal" - [(use (match_operand 0 "pmode_register_operand" "")) - (return)] + [(return) + (use (match_operand 0 "pmode_register_operand" ""))] "" "%*j\t%0%/" [(set_attr "type" "jump") @@ -8236,6 +8334,42 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/" ;; ;; .................... +;; Instructions to load a call address from the GOT. The address might +;; point to a function or to a lazy binding stub. In the latter case, +;; the stub will use the dynamic linker to resolve the function, which +;; in turn will change the GOT entry to point to the function's real +;; address. +;; +;; This means that every call, even pure and constant ones, can +;; potentially modify the GOT entry. And once a stub has been called, +;; we must not call it again. +;; +;; We represent this restriction using an imaginary fixed register that +;; acts like a GOT version number. By making the register call-clobbered, +;; we tell the target-independent code that the address could be changed +;; by any call insn. +(define_insn "load_callsi" + [(set (match_operand:SI 0 "register_operand" "=c") + (unspec:SI [(match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "immediate_operand" "") + (reg:SI FAKE_CALL_REGNO)] + UNSPEC_LOAD_CALL))] + "TARGET_ABICALLS" + "lw\t%0,%R2(%1)" + [(set_attr "type" "load") + (set_attr "length" "4")]) + +(define_insn "load_calldi" + [(set (match_operand:DI 0 "register_operand" "=c") + (unspec:DI [(match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "immediate_operand" "") + (reg:DI FAKE_CALL_REGNO)] + UNSPEC_LOAD_CALL))] + "TARGET_ABICALLS" + "ld\t%0,%R2(%1)" + [(set_attr "type" "load") + (set_attr "length" "4")]) + ;; Sibling calls. All these patterns use jump instructions. ;; If TARGET_SIBCALLS, call_insn_operand will only accept constant @@ -9038,3 +9172,9 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/" [(set_attr "type" "branch") (set_attr "mode" "none") (set_attr "length" "8")]) + +(define_split + [(match_operand 0 "small_data_pattern" "")] + "reload_completed" + [(match_dup 0)] + { operands[0] = mips_rewrite_small_data (operands[0]); }) diff --git a/gcc/config/mips/t-iris6 b/gcc/config/mips/t-iris6 index d157b3a0ca9..e6713106dba 100644 --- a/gcc/config/mips/t-iris6 +++ b/gcc/config/mips/t-iris6 @@ -1,22 +1,18 @@ # ??? If no mabi=X option given, but a mipsX option is, then should deal # with that. -MULTILIB_OPTIONS=mabi=32/mabi=n32/mabi=64 +MULTILIB_OPTIONS=mabi=n32/mabi=32/mabi=64 MULTILIB_DIRNAMES= MULTILIB_MATCHES= -MULTILIB_OSDIRNAMES=mabi=32 . mabi=64 +MULTILIB_OSDIRNAMES=. mabi=32 mabi=64 LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib # For svr4 we build crtbegin.o and crtend.o which serve to add begin and # end labels to the .ctors and .dtors section when we link using gcc. - EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -CRTSTUFF_T_CFLAGS=-g1 -# This is only needed in the static libgcc as a band-aid until gcc correctly -# implements the N32/N64 ABI structure passing conventions -LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/mips/irix6-libc-compat.c +CRTSTUFF_T_CFLAGS=-g1 LIB2FUNCS_EXTRA = $(srcdir)/config/mips/_tilib.c diff --git a/gcc/config/mips/t-iris6gld b/gcc/config/mips/t-iris6gld new file mode 100644 index 00000000000..2926be0cb44 --- /dev/null +++ b/gcc/config/mips/t-iris6gld @@ -0,0 +1,9 @@ +$(T)irix6-crti.o: $(srcdir)/config/mips/irix6-crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $@ -x assembler-with-cpp $< + +$(T)irix6-crtn.o: $(srcdir)/config/mips/irix6-crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $@ -x assembler-with-cpp $< + +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o irix6-crti.o irix6-crtn.o diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h index 59358df4386..0130498ce5a 100644 --- a/gcc/config/mn10300/linux.h +++ b/gcc/config/mn10300/linux.h @@ -23,16 +23,7 @@ #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=posix"); \ - } \ - while (0) +#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() #undef CPP_SPEC #define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \ diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h index 8e843259b1f..1c6bc7a4095 100644 --- a/gcc/config/mn10300/mn10300-protos.h +++ b/gcc/config/mn10300/mn10300-protos.h @@ -22,41 +22,41 @@ Boston, MA 02111-1307, USA. */ #ifdef RTX_CODE #ifdef TREE_CODE -extern void mn10300_va_start PARAMS ((tree, rtx)); +extern void mn10300_va_start (tree, rtx); #endif /* TREE_CODE */ -extern struct rtx_def *legitimize_address PARAMS ((rtx, rtx, enum machine_mode)); -extern rtx legitimize_pic_address (rtx, rtx); +extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode); +extern rtx legitimize_pic_address (rtx, rtx); extern int legitimate_pic_operand_p (rtx); -extern void print_operand PARAMS ((FILE *, rtx, int)); -extern void print_operand_address PARAMS ((FILE *, rtx)); -extern void mn10300_print_reg_list PARAMS ((FILE *, int)); -extern int mn10300_get_live_callee_saved_regs PARAMS ((void)); -extern void mn10300_gen_multiple_store PARAMS ((int)); -extern void notice_update_cc PARAMS ((rtx, rtx)); -extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, - enum machine_mode, rtx)); -extern const char *output_tst PARAMS ((rtx, rtx)); -extern int store_multiple_operation PARAMS ((rtx, enum machine_mode)); -extern int symbolic_operand PARAMS ((rtx, enum machine_mode)); -extern int call_address_operand PARAMS ((rtx, enum machine_mode)); -extern int impossible_plus_operand PARAMS ((rtx, enum machine_mode)); -extern int const_8bit_operand PARAMS ((rtx, enum machine_mode)); - -extern bool mn10300_wide_const_load_uses_clr PARAMS ((rtx operands[2])); +extern void print_operand (FILE *, rtx, int); +extern void print_operand_address (FILE *, rtx); +extern void mn10300_print_reg_list (FILE *, int); +extern int mn10300_get_live_callee_saved_regs (void); +extern void mn10300_gen_multiple_store (int); +extern void notice_update_cc (rtx, rtx); +extern enum reg_class secondary_reload_class (enum reg_class, + enum machine_mode, rtx); +extern const char *output_tst (rtx, rtx); +extern int store_multiple_operation (rtx, enum machine_mode); +extern int symbolic_operand (rtx, enum machine_mode); +extern int call_address_operand (rtx, enum machine_mode); +extern int impossible_plus_operand (rtx, enum machine_mode); +extern int const_8bit_operand (rtx, enum machine_mode); + +extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, tree, int)); -extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, - enum machine_mode, tree, int)); -extern struct rtx_def *mn10300_va_arg PARAMS ((tree, tree)); +extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); +extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); +extern struct rtx_def *mn10300_va_arg (tree, tree); #endif /* TREE_CODE */ -extern struct rtx_def *mn10300_builtin_saveregs PARAMS ((void)); -extern void expand_prologue PARAMS ((void)); -extern void expand_epilogue PARAMS ((void)); -extern int initial_offset PARAMS ((int, int)); -extern int can_use_return_insn PARAMS ((void)); -extern int mask_ok_for_mem_btst PARAMS ((int, int)); +extern struct rtx_def *mn10300_builtin_saveregs (void); +extern void expand_prologue (void); +extern void expand_epilogue (void); +extern int initial_offset (int, int); +extern int can_use_return_insn (void); +extern int mask_ok_for_mem_btst (int, int); diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index ba8c6cc9b3c..1e200f9c578 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -65,10 +65,10 @@ int mn10300_protect_label; || regs_ever_live[16] || regs_ever_live[17])) -static int mn10300_address_cost_1 PARAMS ((rtx, int *)); -static int mn10300_address_cost PARAMS ((rtx)); -static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *)); -static void mn10300_file_start PARAMS ((void)); +static int mn10300_address_cost_1 (rtx, int *); +static int mn10300_address_cost (rtx); +static bool mn10300_rtx_costs (rtx, int, int, int *); +static void mn10300_file_start (void); /* Initialize the GCC target structure. */ @@ -92,7 +92,7 @@ static void mn10300_encode_section_info (tree, rtx, int); struct gcc_target targetm = TARGET_INITIALIZER; static void -mn10300_file_start () +mn10300_file_start (void) { default_file_start (); @@ -107,10 +107,7 @@ mn10300_file_start () FILE. */ void -print_operand (file, x, code) - FILE *file; - rtx x; - int code; +print_operand (FILE *file, rtx x, int code) { switch (code) { @@ -437,9 +434,7 @@ print_operand (file, x, code) /* Output assembly language output for the address ADDR to FILE. */ void -print_operand_address (file, addr) - FILE *file; - rtx addr; +print_operand_address (FILE *file, rtx addr) { switch (GET_CODE (addr)) { @@ -477,7 +472,7 @@ print_operand_address (file, addr) /* Count the number of FP registers that have to be saved. */ static int -fp_regs_to_save () +fp_regs_to_save (void) { int i, n = 0; @@ -498,9 +493,7 @@ fp_regs_to_save () bits 14 to 17 must have the same value. */ void -mn10300_print_reg_list (file, mask) - FILE *file; - int mask; +mn10300_print_reg_list (FILE *file, int mask) { int need_comma; int i; @@ -531,7 +524,7 @@ mn10300_print_reg_list (file, mask) } int -can_use_return_insn () +can_use_return_insn (void) { /* size includes the fixed stack space needed for function calls. */ int size = get_frame_size () + current_function_outgoing_args_size; @@ -558,7 +551,7 @@ can_use_return_insn () all of them will be included in the mask if any one of them is used. */ int -mn10300_get_live_callee_saved_regs () +mn10300_get_live_callee_saved_regs (void) { int mask; int i; @@ -593,8 +586,7 @@ mn10300_get_live_callee_saved_regs () (reg:SI R1))) */ void -mn10300_gen_multiple_store (mask) - int mask; +mn10300_gen_multiple_store (int mask) { if (mask != 0) { @@ -642,7 +634,7 @@ mn10300_gen_multiple_store (mask) } void -expand_prologue () +expand_prologue (void) { HOST_WIDE_INT size; @@ -917,7 +909,7 @@ expand_prologue () } void -expand_epilogue () +expand_epilogue (void) { HOST_WIDE_INT size; @@ -1155,9 +1147,7 @@ expand_epilogue () /* Update the condition code from the insn. */ void -notice_update_cc (body, insn) - rtx body; - rtx insn; +notice_update_cc (rtx body, rtx insn) { switch (get_attr_cc (insn)) { @@ -1220,9 +1210,7 @@ notice_update_cc (body, insn) registers it saves. Return 0 otherwise. */ int -store_multiple_operation (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { int count; int mask; @@ -1298,9 +1286,7 @@ store_multiple_operation (op, mode) /* Return true if OP is a valid call operand. */ int -call_address_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (flag_pic) return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG); @@ -1313,10 +1299,7 @@ call_address_operand (op, mode) We might be able to simplify this. */ enum reg_class -secondary_reload_class (class, mode, in) - enum reg_class class; - enum machine_mode mode; - rtx in; +secondary_reload_class (enum reg_class class, enum machine_mode mode, rtx in) { /* Memory loads less than a full word wide can't have an address or stack pointer destination. They must use @@ -1372,8 +1355,7 @@ secondary_reload_class (class, mode, in) } int -initial_offset (from, to) - int from, to; +initial_offset (int from, int to) { /* The difference between the argument pointer and the frame pointer is the size of the callee register save area. */ @@ -1426,7 +1408,7 @@ initial_offset (from, to) /* Flush the argument registers to the stack for a stdarg function; return the new argument pointer. */ rtx -mn10300_builtin_saveregs () +mn10300_builtin_saveregs (void) { rtx offset, mem; tree fntype = TREE_TYPE (current_function_decl); @@ -1456,17 +1438,14 @@ mn10300_builtin_saveregs () } void -mn10300_va_start (valist, nextarg) - tree valist; - rtx nextarg; +mn10300_va_start (tree valist, rtx nextarg) { nextarg = expand_builtin_saveregs (); std_expand_builtin_va_start (valist, nextarg); } rtx -mn10300_va_arg (valist, type) - tree valist, type; +mn10300_va_arg (tree valist, tree type) { HOST_WIDE_INT align, rsize; tree t, ptr, pptr; @@ -1505,11 +1484,8 @@ mn10300_va_arg (valist, type) from a function. If the result is 0, the argument is pushed. */ rtx -function_arg (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type; - int named ATTRIBUTE_UNUSED; +function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named ATTRIBUTE_UNUSED) { rtx result = 0; int size, align; @@ -1558,11 +1534,8 @@ function_arg (cum, mode, type, named) in registers and partially in memory. */ int -function_arg_partial_nregs (cum, mode, type, named) - CUMULATIVE_ARGS *cum; - enum machine_mode mode; - tree type; - int named ATTRIBUTE_UNUSED; +function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named ATTRIBUTE_UNUSED) { int size, align; @@ -1599,8 +1572,7 @@ function_arg_partial_nregs (cum, mode, type, named) /* Output a tst insn. */ const char * -output_tst (operand, insn) - rtx operand, insn; +output_tst (rtx operand, rtx insn) { rtx temp; int past_call = 0; @@ -1689,9 +1661,7 @@ output_tst (operand, insn) } int -impossible_plus_operand (op, mode) - rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +impossible_plus_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (op) != PLUS) return 0; @@ -1707,9 +1677,7 @@ impossible_plus_operand (op, mode) for the btst insn which may examine memory or a register (the memory variant only allows an unsigned 8 bit integer). */ int -const_8bit_operand (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +const_8bit_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 @@ -1718,9 +1686,7 @@ const_8bit_operand (op, mode) /* Return true if the operand is the 1.0f constant. */ int -const_1f_operand (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +const_1f_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { return (op == CONST1_RTX (SFmode)); } @@ -1728,9 +1694,7 @@ const_1f_operand (op, mode) /* Similarly, but when using a zero_extract pattern for a btst where the source operand might end up in memory. */ int -mask_ok_for_mem_btst (len, bit) - int len; - int bit; +mask_ok_for_mem_btst (int len, int bit) { unsigned int mask = 0; @@ -1752,9 +1716,7 @@ mask_ok_for_mem_btst (len, bit) expressions will have one of a few well defined forms, so we need only check those forms. */ int -symbolic_operand (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; +symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (op)) { @@ -1787,10 +1749,8 @@ symbolic_operand (op, mode) But on a few ports with segmented architectures and indexed addressing (mn10300, hppa) it is used to rewrite certain problematical addresses. */ rtx -legitimize_address (x, oldx, mode) - rtx x; - rtx oldx ATTRIBUTE_UNUSED; - enum machine_mode mode ATTRIBUTE_UNUSED; +legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED) { if (flag_pic && ! legitimate_pic_operand_p (x)) x = legitimize_pic_address (oldx, NULL_RTX); @@ -1828,9 +1788,7 @@ legitimize_address (x, oldx, mode) /* Convert a non-PIC address in `orig' to a PIC address using @GOT or @GOTOFF in `reg'. */ rtx -legitimize_pic_address (orig, reg) - rtx orig; - rtx reg; +legitimize_pic_address (rtx orig, rtx reg) { if (GET_CODE (orig) == LABEL_REF || (GET_CODE (orig) == SYMBOL_REF @@ -1857,8 +1815,7 @@ legitimize_pic_address (orig, reg) /* Return zero if X references a SYMBOL_REF or LABEL_REF whose symbol isn't protected by a PIC unspec; nonzero otherwise. */ int -legitimate_pic_operand_p (x) - rtx x; +legitimate_pic_operand_p (rtx x) { register const char *fmt; register int i; @@ -1895,9 +1852,7 @@ legitimate_pic_operand_p (x) } static int -mn10300_address_cost_1 (x, unsig) - rtx x; - int *unsig; +mn10300_address_cost_1 (rtx x, int *unsig) { switch (GET_CODE (x)) { @@ -1976,18 +1931,14 @@ mn10300_address_cost_1 (x, unsig) } static int -mn10300_address_cost (x) - rtx x; +mn10300_address_cost (rtx x) { int s = 0; return mn10300_address_cost_1 (x, &s); } static bool -mn10300_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code; - int *total; +mn10300_rtx_costs (rtx x, int code, int outer_code, int *total) { switch (code) { @@ -2039,8 +1990,7 @@ mn10300_rtx_costs (x, code, outer_code, total) movdf and movdi. */ bool -mn10300_wide_const_load_uses_clr (operands) - rtx operands[2]; +mn10300_wide_const_load_uses_clr (rtx operands[2]) { long val[2]; @@ -2085,10 +2035,7 @@ mn10300_wide_const_load_uses_clr (operands) may access it using GOTOFF instead of GOT. */ static void -mn10300_encode_section_info (decl, rtl, first) - tree decl; - rtx rtl; - int first; +mn10300_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) { rtx symbol; diff --git a/gcc/config/netware.h b/gcc/config/netware.h index 64278835f3d..241e92dcf7c 100644 --- a/gcc/config/netware.h +++ b/gcc/config/netware.h @@ -51,7 +51,6 @@ Boston, MA 02111-1307, USA. */ /* set debugging info */ #define DBX_DEBUGGING_INFO 1 #undef SDB_DEBUGGING_INFO -#undef DWARF_DEBUGGING_INFO #undef XCOFF_DEBUGGING_INFO #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG diff --git a/gcc/config/ns32k/ns32k-protos.h b/gcc/config/ns32k/ns32k-protos.h index 9700a03667b..b5a2328c3c6 100644 --- a/gcc/config/ns32k/ns32k-protos.h +++ b/gcc/config/ns32k/ns32k-protos.h @@ -22,24 +22,24 @@ Boston, MA 02111-1307, USA. */ /* Prototypes for functions in ns32k.c */ #ifdef RTX_CODE -extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, - enum machine_mode, rtx)); -extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode)); - -extern void split_di PARAMS ((rtx[], int, rtx[], rtx[])); -extern void expand_block_move PARAMS ((rtx[])); -extern int global_symbolic_reference_mentioned_p PARAMS ((rtx, int)); -extern void print_operand PARAMS ((FILE *, rtx, int)); -extern void print_operand_address PARAMS ((FILE *, rtx)); -extern const char *output_move_double PARAMS ((rtx *)); -extern const char *output_shift_insn PARAMS ((rtx *)); -extern int symbolic_reference_mentioned_p PARAMS ((rtx)); +extern enum reg_class secondary_reload_class (enum reg_class, + enum machine_mode, rtx); +extern int reg_or_mem_operand (rtx, enum machine_mode); + +extern void split_di (rtx[], int, rtx[], rtx[]); +extern void expand_block_move (rtx[]); +extern int global_symbolic_reference_mentioned_p (rtx, int); +extern void print_operand (FILE *, rtx, int); +extern void print_operand_address (FILE *, rtx); +extern const char *output_move_double (rtx *); +extern const char *output_shift_insn (rtx *); +extern int symbolic_reference_mentioned_p (rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern int ns32k_return_pops_args PARAMS ((tree, tree, int)); +extern int ns32k_return_pops_args (tree, tree, int); #endif /* TREE_CODE */ -extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode)); -extern int register_move_cost PARAMS ((enum reg_class, enum reg_class)); -extern const char *output_move_dconst PARAMS ((int, const char *)); +extern int hard_regno_mode_ok (int, enum machine_mode); +extern int register_move_cost (enum reg_class, enum reg_class); +extern const char *output_move_dconst (int, const char *); diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c index bd4b561999c..e80724ecf40 100644 --- a/gcc/config/ns32k/ns32k.c +++ b/gcc/config/ns32k/ns32k.c @@ -64,15 +64,15 @@ const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = static const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES; -static rtx gen_indexed_expr PARAMS ((rtx, rtx, rtx)); -static const char *singlemove_string PARAMS ((rtx *)); -static void move_tail PARAMS ((rtx[], int, int)); -static tree ns32k_handle_fntype_attribute PARAMS ((tree *, tree, tree, int, bool *)); +static rtx gen_indexed_expr (rtx, rtx, rtx); +static const char *singlemove_string (rtx *); +static void move_tail (rtx[], int, int); +static tree ns32k_handle_fntype_attribute (tree *, tree, tree, int, bool *); const struct attribute_spec ns32k_attribute_table[]; -static void ns32k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); -static void ns32k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); -static bool ns32k_rtx_costs PARAMS ((rtx, int, int, int *)); -static int ns32k_address_cost PARAMS ((rtx)); +static void ns32k_output_function_prologue (FILE *, HOST_WIDE_INT); +static void ns32k_output_function_epilogue (FILE *, HOST_WIDE_INT); +static bool ns32k_rtx_costs (rtx, int, int, int *); +static int ns32k_address_cost (rtx); /* Initialize the GCC target structure. */ #undef TARGET_ATTRIBUTE_TABLE @@ -150,9 +150,7 @@ struct gcc_target targetm = TARGET_INITIALIZER; #endif static void -ns32k_output_function_prologue (file, size) - FILE *file; - HOST_WIDE_INT size; +ns32k_output_function_prologue (FILE *file, HOST_WIDE_INT size) { register int regno, g_regs_used = 0; int used_regs_buf[8], *bufp = used_regs_buf; @@ -330,9 +328,7 @@ ns32k_output_function_prologue (file, size) #if !defined (MERLIN_TARGET) && !defined (UTEK_ASM) static void -ns32k_output_function_epilogue (file, size) - FILE *file; - HOST_WIDE_INT size; +ns32k_output_function_epilogue (FILE *file, HOST_WIDE_INT size) { register int regno, g_regs_used = 0, f_regs_used = 0; int used_regs_buf[8], *bufp = used_regs_buf; @@ -472,9 +468,7 @@ ns32k_output_function_epilogue (file, size) /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ int -hard_regno_mode_ok (regno, mode) - int regno; - enum machine_mode mode; +hard_regno_mode_ok (int regno, enum machine_mode mode) { int size = GET_MODE_UNIT_SIZE (mode); @@ -498,10 +492,7 @@ hard_regno_mode_ok (regno, mode) } static bool -ns32k_rtx_costs (x, code, outer_code, total) - rtx x; - int code, outer_code ATTRIBUTE_UNUSED; - int *total; +ns32k_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) { switch (code) { @@ -529,9 +520,8 @@ ns32k_rtx_costs (x, code, outer_code, total) } } -int register_move_cost (CLASS1, CLASS2) - enum reg_class CLASS1; - enum reg_class CLASS2; +int +register_move_cost (enum reg_class CLASS1, enum reg_class CLASS2) { if (CLASS1 == NO_REGS || CLASS2 == NO_REGS) return 2; @@ -550,10 +540,10 @@ int register_move_cost (CLASS1, CLASS2) #if 0 /* We made the insn definitions copy from floating point to general registers via the stack. */ -int secondary_memory_needed (CLASS1, CLASS2, M) - enum reg_class CLASS1; - enum reg_class CLASS2; - enum machine_mode M; +int +secondary_memory_needed (enum reg_class CLASS1, + enum reg_class CLASS2, + enum machine_mode M) { int ret = ((SUBSET_P (CLASS1, FP_REGS) && !SUBSET_P (CLASS2, FP_REGS)) || (!SUBSET_P (CLASS1, FP_REGS) && SUBSET_P (CLASS2, FP_REGS))); @@ -567,8 +557,7 @@ int secondary_memory_needed (CLASS1, CLASS2, M) the default. */ static int -ns32k_address_cost (operand) - rtx operand; +ns32k_address_cost (rtx operand) { int cost = 0; @@ -623,10 +612,9 @@ ns32k_address_cost (operand) NO_REGS is returned. */ enum reg_class -secondary_reload_class (class, mode, in) - enum reg_class class; - enum machine_mode mode ATTRIBUTE_UNUSED; - rtx in; +secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx in) { int regno = true_regnum (in); @@ -646,8 +634,7 @@ secondary_reload_class (class, mode, in) multiplier (for MULT). */ static rtx -gen_indexed_expr (base, index, scale) - rtx base, index, scale; +gen_indexed_expr (rtx base, rtx index, rtx scale) { rtx addr; @@ -669,10 +656,7 @@ gen_indexed_expr (base, index, scale) that parallel "operands". */ void -split_di (operands, num, lo_half, hi_half) - rtx operands[]; - int num; - rtx lo_half[], hi_half[]; +split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) { while (num--) { @@ -699,8 +683,7 @@ split_di (operands, num, lo_half, hi_half) for moving operands[1] into operands[0] as a fullword. */ static const char * -singlemove_string (operands) - rtx *operands; +singlemove_string (rtx *operands) { if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) <= 7 @@ -710,8 +693,7 @@ singlemove_string (operands) } const char * -output_move_double (operands) - rtx *operands; +output_move_double (rtx *operands) { enum anon1 { REGOP, OFFSOP, PUSHOP, CNSTOP, RNDOP } optype0, optype1; rtx latehalf[2]; @@ -849,10 +831,7 @@ output_move_double (operands) operands[3] is the alignment. */ static void -move_tail (operands, bytes, offset) - rtx operands[]; - int bytes; - int offset; +move_tail (rtx operands[], int bytes, int offset) { if (bytes & 2) { @@ -866,8 +845,7 @@ move_tail (operands, bytes, offset) } void -expand_block_move (operands) - rtx operands[]; +expand_block_move (rtx operands[]) { rtx bytes_rtx = operands[2]; rtx align_rtx = operands[3]; @@ -994,9 +972,7 @@ expand_block_move (operands) /* Returns 1 if OP contains a global symbol reference */ int -global_symbolic_reference_mentioned_p (op, f) - rtx op; - int f; +global_symbolic_reference_mentioned_p (rtx op, int f) { register const char *fmt; register int i; @@ -1034,8 +1010,7 @@ global_symbolic_reference_mentioned_p (op, f) /* Returns 1 if OP contains a symbol reference */ int -symbolic_reference_mentioned_p (op) - rtx op; +symbolic_reference_mentioned_p (rtx op) { register const char *fmt; register int i; @@ -1077,12 +1052,10 @@ const struct attribute_spec ns32k_attribute_table[] = /* Handle an attribute requiring a FUNCTION_TYPE, FIELD_DECL or TYPE_DECL; arguments as in struct attribute_spec.handler. */ static tree -ns32k_handle_fntype_attribute (node, name, args, flags, no_add_attrs) - tree *node; - tree name; - tree args ATTRIBUTE_UNUSED; - int flags ATTRIBUTE_UNUSED; - bool *no_add_attrs; +ns32k_handle_fntype_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_TYPE && TREE_CODE (*node) != FIELD_DECL @@ -1115,10 +1088,7 @@ ns32k_handle_fntype_attribute (node, name, args, flags, no_add_attrs) The attribute stdcall is equivalent to RET on a per module basis. */ int -ns32k_return_pops_args (fundecl, funtype, size) - tree fundecl ATTRIBUTE_UNUSED; - tree funtype; - int size; +ns32k_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, tree funtype, int size) { int rtd = TARGET_RTD; @@ -1149,10 +1119,7 @@ ns32k_return_pops_args (fundecl, funtype, size) /* XXX time 12% of cpu time is in fprintf for non optimizing */ void -print_operand (file, x, code) - FILE *file; - rtx x; - int code; +print_operand (FILE *file, rtx x, int code) { if (code == '$') PUT_IMMEDIATE_PREFIX (file); @@ -1240,9 +1207,7 @@ print_operand (file, x, code) 90-11-25 Tatu Yl|nen */ void -print_operand_address (file, addr) - register FILE *file; - register rtx addr; +print_operand_address (register FILE *file, register rtx addr) { static const char scales[] = { 'b', 'w', 'd', 0, 'q', }; rtx offset, base, indexexp, tmp; @@ -1524,8 +1489,7 @@ print_operand_address (file, addr) better performance in many common cases by using other techniques. */ const char * -output_shift_insn (operands) - rtx *operands; +output_shift_insn (rtx *operands) { if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0 @@ -1574,9 +1538,7 @@ output_shift_insn (operands) } const char * -output_move_dconst (n, s) - int n; - const char *s; +output_move_dconst (int n, const char *s) { static char r[32]; diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h index 69d756f70c5..091b138a18c 100644 --- a/gcc/config/ns32k/ns32k.h +++ b/gcc/config/ns32k/ns32k.h @@ -383,14 +383,7 @@ while (0) /* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, - for any hard reg, then this must be 0 for correct output. - - Early documentation says SI and DI are not tieable if some reg can - be OK for SI but not for DI. However other ports (mips, i860, mvs - and tahoe) don't meet the above criterion. Evidently the real - requirement is somewhat laxer. Documentation was changed for gcc - 2.8 but was not picked up by egcs (at least egcs 1.0). Having all - integer modes tieable definitely generates faster code. */ + for any hard reg, then this must be 0 for correct output. */ #define MODES_TIEABLE_P(MODE1, MODE2) \ ((FLOAT_MODE_P(MODE1) && FLOAT_MODE_P(MODE2) \ diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h index 027c946dba3..c3808f1c34f 100644 --- a/gcc/config/pa/pa-linux.h +++ b/gcc/config/pa/pa-linux.h @@ -56,12 +56,8 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__gnu_linux__"); \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ builtin_assert ("machine=bigendian"); \ - builtin_assert ("system=posix"); \ - builtin_assert ("system=unix"); \ } \ while (0) @@ -121,14 +117,14 @@ Boston, MA 02111-1307, USA. */ #undef ASM_OUTPUT_ADDR_VEC_ELT #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ if (TARGET_BIG_SWITCH) \ - fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \ + fprintf (FILE, "\t.word .L%d\n", VALUE); \ else \ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) #undef ASM_OUTPUT_ADDR_DIFF_ELT #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ if (TARGET_BIG_SWITCH) \ - fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \ + fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \ else \ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index f5f15cb3fd3..9bf5e97e32c 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -40,6 +40,7 @@ extern const char *output_ior (rtx *); extern const char *output_move_double (rtx *); extern const char *output_fp_move_double (rtx *); extern const char *output_block_move (rtx *, int); +extern const char *output_block_clear (rtx *, int); extern const char *output_cbranch (rtx *, int, int, int, rtx); extern const char *output_lbranch (rtx, rtx); extern const char *output_bb (rtx *, int, int, int, rtx, int); @@ -63,6 +64,7 @@ extern struct rtx_def *gen_cmp_fp (enum rtx_code, rtx, rtx); extern void hppa_encode_label (rtx); extern int arith11_operand (rtx, enum machine_mode); extern int adddi3_operand (rtx, enum machine_mode); +extern int indexed_memory_operand (rtx, enum machine_mode); extern int symbolic_expression_p (rtx); extern int symbolic_memory_operand (rtx, enum machine_mode); extern int pa_adjust_insn_length (rtx, int); @@ -72,16 +74,16 @@ extern int arith5_operand (rtx, enum machine_mode); extern int uint5_operand (rtx, enum machine_mode); extern int pic_label_operand (rtx, enum machine_mode); extern int plus_xor_ior_operator (rtx, enum machine_mode); -extern int basereg_operand (rtx, enum machine_mode); +extern int borx_reg_operand (rtx, enum machine_mode); extern int shadd_operand (rtx, enum machine_mode); extern int arith_operand (rtx, enum machine_mode); extern int read_only_operand (rtx, enum machine_mode); -extern int move_operand (rtx, enum machine_mode); +extern int move_dest_operand (rtx, enum machine_mode); +extern int move_src_operand (rtx, enum machine_mode); extern int and_operand (rtx, enum machine_mode); extern int ior_operand (rtx, enum machine_mode); extern int arith32_operand (rtx, enum machine_mode); extern int uint32_operand (rtx, enum machine_mode); -extern int reg_or_nonsymb_mem_operand (rtx, enum machine_mode); extern int reg_before_reload_operand (rtx, enum machine_mode); extern int reg_or_0_operand (rtx, enum machine_mode); extern int reg_or_0_or_nonsymb_mem_operand (rtx, enum machine_mode); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 366128c2c25..6cc3deb57e0 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -94,6 +94,7 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn) #endif #endif +static void copy_reg_pointer (rtx, rtx); static int hppa_address_cost (rtx); static bool hppa_rtx_costs (rtx, int, int, int *); static inline rtx force_mode (enum machine_mode, rtx); @@ -103,7 +104,8 @@ static int pa_can_combine_p (rtx, rtx, rtx, int, rtx, rtx, rtx); static int forward_branch_p (rtx); static int shadd_constant_p (int); static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *); -static int compute_movstrsi_length (rtx); +static int compute_movstr_length (rtx); +static int compute_clrstr_length (rtx); static bool pa_assemble_integer (rtx, unsigned int, int); static void remove_useless_addtr_insns (int); static void store_reg (int, int, int); @@ -380,6 +382,16 @@ pa_init_builtins (void) #endif } +/* If FROM is a probable pointer register, mark TO as a probable + pointer register with the same pointer alignment as FROM. */ + +static void +copy_reg_pointer (rtx to, rtx from) +{ + if (REG_POINTER (from)) + mark_reg_pointer (to, REGNO_POINTER_ALIGN (REGNO (from))); +} + /* Return nonzero only if OP is a register of mode MODE, or CONST0_RTX. */ int @@ -447,21 +459,6 @@ symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) || GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF); } -/* Return 1 if the operand is either a register or a memory operand that is - not symbolic. */ - -int -reg_or_nonsymb_mem_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode)) - return 1; - - return 0; -} - /* Return 1 if the operand is either a register, zero, or a memory operand that is not symbolic. */ @@ -474,10 +471,24 @@ reg_or_0_or_nonsymb_mem_operand (rtx op, enum machine_mode mode) if (op == CONST0_RTX (mode)) return 1; - if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode)) - return 1; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); - return 0; + if (GET_CODE (op) != MEM) + return 0; + + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating move insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (XEXP (op, 0)) == PLUS + && REG_P (XEXP (XEXP (op, 0), 0)) + && REG_P (XEXP (XEXP (op, 0), 1))) + return 0; + + return (!symbolic_memory_operand (op, mode) + && memory_address_p (mode, XEXP (op, 0))); } /* Return 1 if the operand is a register operand or a non-symbolic memory @@ -498,7 +509,7 @@ reg_before_reload_operand (rtx op, enum machine_mode mode) if (reload_completed && memory_operand (op, mode) - && ! symbolic_memory_operand (op, mode)) + && !symbolic_memory_operand (op, mode)) return 1; return 0; @@ -515,10 +526,54 @@ cint_ok_for_move (HOST_WIDE_INT intval) || CONST_OK_FOR_LETTER_P (intval, 'K')); } -/* Accept anything that can be moved in one instruction into a general - register. */ +/* Return 1 iff OP is an indexed memory operand. */ +int +indexed_memory_operand (rtx op, enum machine_mode mode) +{ + if (GET_MODE (op) != mode) + return 0; + + /* Before reload, a (SUBREG (MEM...)) forces reloading into a register. */ + if (reload_completed && GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) + return 0; + + op = XEXP (op, 0); + + return (memory_address_p (mode, op) && IS_INDEX_ADDR_P (op)); +} + +/* Accept anything that can be used as a destination operand for a + move instruction. We don't accept indexed memory operands since + they are supported only for floating point stores. */ int -move_operand (rtx op, enum machine_mode mode) +move_dest_operand (rtx op, enum machine_mode mode) +{ + if (register_operand (op, mode)) + return 1; + + if (GET_MODE (op) != mode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) + return 0; + + op = XEXP (op, 0); + + return (memory_address_p (mode, op) + && !IS_INDEX_ADDR_P (op) + && !IS_LO_SUM_DLT_ADDR_P (op)); +} + +/* Accept anything that can be used as a source operand for a move + instruction. */ +int +move_src_operand (rtx op, enum machine_mode mode) { if (register_operand (op, mode)) return 1; @@ -529,41 +584,26 @@ move_operand (rtx op, enum machine_mode mode) if (GET_CODE (op) == CONST_INT) return cint_ok_for_move (INTVAL (op)); + if (GET_MODE (op) != mode) + return 0; + if (GET_CODE (op) == SUBREG) op = SUBREG_REG (op); + if (GET_CODE (op) != MEM) return 0; - op = XEXP (op, 0); - - /* We consider a LO_SUM DLT reference a move_operand now since it has - been merged into the normal movsi/movdi patterns. */ - if (GET_CODE (op) == LO_SUM - && GET_CODE (XEXP (op, 0)) == REG - && REG_OK_FOR_BASE_P (XEXP (op, 0)) - && GET_CODE (XEXP (op, 1)) == UNSPEC - && GET_MODE (op) == Pmode) - return 1; - - /* Since move_operand is only used for source operands, we can always - allow scaled indexing! */ - if (! TARGET_DISABLE_INDEXING - && GET_CODE (op) == PLUS - && ((GET_CODE (XEXP (op, 0)) == MULT - && GET_CODE (XEXP (XEXP (op, 0), 0)) == REG - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT - && INTVAL (XEXP (XEXP (op, 0), 1)) - == (HOST_WIDE_INT) GET_MODE_SIZE (mode) - && GET_CODE (XEXP (op, 1)) == REG) - || (GET_CODE (XEXP (op, 1)) == MULT - &&GET_CODE (XEXP (XEXP (op, 1), 0)) == REG - && GET_CODE (XEXP (XEXP (op, 1), 1)) == CONST_INT - && INTVAL (XEXP (XEXP (op, 1), 1)) - == (HOST_WIDE_INT) GET_MODE_SIZE (mode) - && GET_CODE (XEXP (op, 0)) == REG))) - return 1; + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating move insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (XEXP (op, 0)) == PLUS + && REG_P (XEXP (XEXP (op, 0), 0)) + && REG_P (XEXP (XEXP (op, 0), 1))) + return 0; - return memory_address_p (mode, op); + return memory_address_p (mode, XEXP (op, 0)); } /* Accept REG and any CONST_INT that can be moved in one instruction into a @@ -574,10 +614,7 @@ reg_or_cint_move_operand (rtx op, enum machine_mode mode) if (register_operand (op, mode)) return 1; - if (GET_CODE (op) == CONST_INT) - return cint_ok_for_move (INTVAL (op)); - - return 0; + return (GET_CODE (op) == CONST_INT && cint_ok_for_move (INTVAL (op))); } int @@ -830,6 +867,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) So instead we just emit the raw set, which avoids the movXX expanders completely. */ + mark_reg_pointer (reg, BITS_PER_UNIT); emit_insn (gen_rtx_SET (VOIDmode, reg, orig)); current_function_uses_pic_offset_table = 1; return reg; @@ -860,6 +898,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) current_function_uses_pic_offset_table = 1; MEM_NOTRAP_P (pic_ref) = 1; RTX_UNCHANGING_P (pic_ref) = 1; + mark_reg_pointer (reg, BITS_PER_UNIT); insn = emit_move_insn (reg, pic_ref); /* Put a REG_EQUAL note on this insn, so that it can be optimized. */ @@ -884,7 +923,9 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, base == reg ? 0 : reg); } - else abort (); + else + abort (); + if (GET_CODE (orig) == CONST_INT) { if (INT_14_BITS (orig)) @@ -894,6 +935,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) pic_ref = gen_rtx_PLUS (Pmode, base, orig); /* Likewise, should we set special REG_NOTEs here? */ } + return pic_ref; } @@ -954,6 +996,18 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, { rtx orig = x; + /* We need to canonicalize the order of operands in unscaled indexed + addresses since the code that checks if an address is valid doesn't + always try both orders. */ + if (!TARGET_NO_SPACE_REGS + && GET_CODE (x) == PLUS + && GET_MODE (x) == Pmode + && REG_P (XEXP (x, 0)) + && REG_P (XEXP (x, 1)) + && REG_POINTER (XEXP (x, 0)) + && !REG_POINTER (XEXP (x, 1))) + return gen_rtx_PLUS (Pmode, XEXP (x, 1), XEXP (x, 0)); + if (flag_pic) return legitimize_pic_address (x, mode, gen_reg_rtx (Pmode)); @@ -1422,6 +1476,36 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) register rtx operand1 = operands[1]; register rtx tem; + /* We can only handle indexed addresses in the destination operand + of floating point stores. Thus, we need to break out indexed + addresses from the destination operand. */ + if (GET_CODE (operand0) == MEM && IS_INDEX_ADDR_P (XEXP (operand0, 0))) + { + /* This is only safe up to the beginning of life analysis. */ + if (no_new_pseudos) + abort (); + + tem = copy_to_mode_reg (Pmode, XEXP (operand0, 0)); + operand0 = replace_equiv_address (operand0, tem); + } + + /* On targets with non-equivalent space registers, break out unscaled + indexed addresses from the source operand before the final CSE. + We have to do this because the REG_POINTER flag is not correctly + carried through various optimization passes and CSE may substitute + a pseudo without the pointer set for one with the pointer set. As + a result, we loose various opportunites to create insns with + unscaled indexed addresses. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (operand1) == MEM + && GET_CODE (XEXP (operand1, 0)) == PLUS + && REG_P (XEXP (XEXP (operand1, 0), 0)) + && REG_P (XEXP (XEXP (operand1, 0), 1))) + operand1 + = replace_equiv_address (operand1, + copy_to_mode_reg (Pmode, XEXP (operand1, 0))); + if (scratch_reg && reload_in_progress && GET_CODE (operand0) == REG && REGNO (operand0) >= FIRST_PSEUDO_REGISTER) @@ -1460,6 +1544,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) && ((tem = find_replacement (&XEXP (operand0, 0))) != XEXP (operand0, 0))) operand0 = gen_rtx_MEM (GET_MODE (operand0), tem); + if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM && ((tem = find_replacement (&XEXP (operand1, 0))) != XEXP (operand1, 0))) @@ -1470,7 +1555,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) (subreg (mem (addr))) cases. */ if (fp_reg_operand (operand0, mode) && ((GET_CODE (operand1) == MEM - && ! memory_address_p (DFmode, XEXP (operand1, 0))) + && !memory_address_p (DFmode, XEXP (operand1, 0))) || ((GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == MEM && !memory_address_p (DFmode, XEXP (XEXP (operand1, 0), 0))))) @@ -1489,10 +1574,11 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) if (!memory_address_p (Pmode, XEXP (operand1, 0))) { emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1)); - emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)), - Pmode, - XEXP (XEXP (operand1, 0), 0), - scratch_reg)); + emit_move_insn (scratch_reg, + gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)), + Pmode, + XEXP (XEXP (operand1, 0), 0), + scratch_reg)); } else emit_move_insn (scratch_reg, XEXP (operand1, 0)); @@ -1505,7 +1591,8 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) && ! memory_address_p (DFmode, XEXP (operand0, 0))) || ((GET_CODE (operand0) == SUBREG) && GET_CODE (XEXP (operand0, 0)) == MEM - && !memory_address_p (DFmode, XEXP (XEXP (operand0, 0), 0)))) + && !memory_address_p (DFmode, + XEXP (XEXP (operand0, 0), 0)))) && scratch_reg) { if (GET_CODE (operand0) == SUBREG) @@ -1617,7 +1704,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) emit_move_insn (operand0, scratch_reg); return 1; } - /* Handle most common case: storing into a register. */ + /* Handle the most common case: storing into a register. */ else if (register_operand (operand0, mode)) { if (register_operand (operand1, mode) @@ -1629,7 +1716,67 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) /* Only `general_operands' can come here, so MEM is ok. */ || GET_CODE (operand1) == MEM) { - /* Run this case quickly. */ + /* Various sets are created during RTL generation which don't + have the REG_POINTER flag correctly set. After the CSE pass, + instruction recognition can fail if we don't consistently + set this flag when performing register copies. This should + also improve the opportunities for creating insns that use + unscaled indexing. */ + if (REG_P (operand0) && REG_P (operand1)) + { + if (REG_POINTER (operand1) + && !REG_POINTER (operand0) + && !HARD_REGISTER_P (operand0)) + copy_reg_pointer (operand0, operand1); + else if (REG_POINTER (operand0) + && !REG_POINTER (operand1) + && !HARD_REGISTER_P (operand1)) + copy_reg_pointer (operand1, operand0); + } + + /* When MEMs are broken out, the REG_POINTER flag doesn't + get set. In some cases, we can set the REG_POINTER flag + from the declaration for the MEM. */ + if (REG_P (operand0) + && GET_CODE (operand1) == MEM + && !REG_POINTER (operand0)) + { + tree decl = MEM_EXPR (operand1); + + /* Set the register pointer flag and register alignment + if the declaration for this memory reference is a + pointer type. Fortran indirect argument references + are ignored. */ + if (decl + && !(flag_argument_noalias > 1 + && TREE_CODE (decl) == INDIRECT_REF + && TREE_CODE (TREE_OPERAND (decl, 0)) == PARM_DECL)) + { + tree type; + + /* If this is a COMPONENT_REF, use the FIELD_DECL from + tree operand 1. */ + if (TREE_CODE (decl) == COMPONENT_REF) + decl = TREE_OPERAND (decl, 1); + + type = TREE_TYPE (decl); + if (TREE_CODE (type) == ARRAY_TYPE) + type = get_inner_array_type (type); + + if (POINTER_TYPE_P (type)) + { + int align; + + type = TREE_TYPE (type); + /* Using TYPE_ALIGN_OK is rather conservative as + only the ada frontend actually sets it. */ + align = (TYPE_ALIGN_OK (type) ? TYPE_ALIGN (type) + : BITS_PER_UNIT); + mark_reg_pointer (operand0, align); + } + } + } + emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1)); return 1; } @@ -1776,6 +1923,8 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) else { operands[1] = legitimize_pic_address (operand1, mode, temp); + if (REG_P (operand0) && REG_P (operands[1])) + copy_reg_pointer (operand0, operands[1]); emit_insn (gen_rtx_SET (VOIDmode, operand0, operands[1])); } } @@ -1803,9 +1952,10 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) Don't mark hard registers though. That loses. */ if (GET_CODE (operand0) == REG && REGNO (operand0) >= FIRST_PSEUDO_REGISTER) - REG_POINTER (operand0) = 1; + mark_reg_pointer (operand0, BITS_PER_UNIT); if (REGNO (temp) >= FIRST_PSEUDO_REGISTER) - REG_POINTER (temp) = 1; + mark_reg_pointer (temp, BITS_PER_UNIT); + if (ishighonly) set = gen_rtx_SET (mode, operand0, temp); else @@ -2431,8 +2581,8 @@ find_addr_reg (rtx addr) OPERANDS[0] is the destination pointer as a REG, clobbered. OPERANDS[1] is the source pointer as a REG, clobbered. OPERANDS[2] is a register for temporary storage. - OPERANDS[4] is the size as a CONST_INT OPERANDS[3] is a register for temporary storage. + OPERANDS[4] is the size as a CONST_INT OPERANDS[5] is the alignment safe to use, as a CONST_INT. OPERANDS[6] is another temporary register. */ @@ -2442,15 +2592,43 @@ output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) int align = INTVAL (operands[5]); unsigned long n_bytes = INTVAL (operands[4]); - /* We can't move more than four bytes at a time because the PA + /* We can't move more than a word at a time because the PA has no longer integer move insns. (Could use fp mem ops?) */ - if (align > 4) - align = 4; + if (align > (TARGET_64BIT ? 8 : 4)) + align = (TARGET_64BIT ? 8 : 4); /* Note that we know each loop below will execute at least twice (else we would have open-coded the copy). */ switch (align) { + case 8: + /* Pre-adjust the loop counter. */ + operands[4] = GEN_INT (n_bytes - 16); + output_asm_insn ("ldi %4,%2", operands); + + /* Copying loop. */ + output_asm_insn ("ldd,ma 8(%1),%3", operands); + output_asm_insn ("ldd,ma 8(%1),%6", operands); + output_asm_insn ("std,ma %3,8(%0)", operands); + output_asm_insn ("addib,>= -16,%2,.-12", operands); + output_asm_insn ("std,ma %6,8(%0)", operands); + + /* Handle the residual. There could be up to 7 bytes of + residual to copy! */ + if (n_bytes % 16 != 0) + { + operands[4] = GEN_INT (n_bytes % 8); + if (n_bytes % 16 >= 8) + output_asm_insn ("ldd,ma 8(%1),%3", operands); + if (n_bytes % 8 != 0) + output_asm_insn ("ldd 0(%1),%6", operands); + if (n_bytes % 16 >= 8) + output_asm_insn ("std,ma %3,8(%0)", operands); + if (n_bytes % 8 != 0) + output_asm_insn ("stdby,e %6,%4(%0)", operands); + } + return ""; + case 4: /* Pre-adjust the loop counter. */ operands[4] = GEN_INT (n_bytes - 8); @@ -2536,7 +2714,7 @@ output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) count insns rather than emit them. */ static int -compute_movstrsi_length (rtx insn) +compute_movstr_length (rtx insn) { rtx pat = PATTERN (insn); unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 7), 0)); @@ -2545,8 +2723,8 @@ compute_movstrsi_length (rtx insn) /* We can't move more than four bytes at a time because the PA has no longer integer move insns. (Could use fp mem ops?) */ - if (align > 4) - align = 4; + if (align > (TARGET_64BIT ? 8 : 4)) + align = (TARGET_64BIT ? 8 : 4); /* The basic copying loop. */ n_insns = 6; @@ -2564,6 +2742,148 @@ compute_movstrsi_length (rtx insn) /* Lengths are expressed in bytes now; each insn is 4 bytes. */ return n_insns * 4; } + +/* Emit code to perform a block clear. + + OPERANDS[0] is the destination pointer as a REG, clobbered. + OPERANDS[1] is a register for temporary storage. + OPERANDS[2] is the size as a CONST_INT + OPERANDS[3] is the alignment safe to use, as a CONST_INT. */ + +const char * +output_block_clear (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) +{ + int align = INTVAL (operands[3]); + unsigned long n_bytes = INTVAL (operands[2]); + + /* We can't clear more than a word at a time because the PA + has no longer integer move insns. */ + if (align > (TARGET_64BIT ? 8 : 4)) + align = (TARGET_64BIT ? 8 : 4); + + /* Note that we know each loop below will execute at least twice + (else we would have open-coded the copy). */ + switch (align) + { + case 8: + /* Pre-adjust the loop counter. */ + operands[2] = GEN_INT (n_bytes - 16); + output_asm_insn ("ldi %2,%1", operands); + + /* Loop. */ + output_asm_insn ("std,ma %%r0,8(%0)", operands); + output_asm_insn ("addib,>= -16,%1,.-4", operands); + output_asm_insn ("std,ma %%r0,8(%0)", operands); + + /* Handle the residual. There could be up to 7 bytes of + residual to copy! */ + if (n_bytes % 16 != 0) + { + operands[2] = GEN_INT (n_bytes % 8); + if (n_bytes % 16 >= 8) + output_asm_insn ("std,ma %%r0,8(%0)", operands); + if (n_bytes % 8 != 0) + output_asm_insn ("stdby,e %%r0,%2(%0)", operands); + } + return ""; + + case 4: + /* Pre-adjust the loop counter. */ + operands[2] = GEN_INT (n_bytes - 8); + output_asm_insn ("ldi %2,%1", operands); + + /* Loop. */ + output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands); + output_asm_insn ("addib,>= -8,%1,.-4", operands); + output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands); + + /* Handle the residual. There could be up to 7 bytes of + residual to copy! */ + if (n_bytes % 8 != 0) + { + operands[2] = GEN_INT (n_bytes % 4); + if (n_bytes % 8 >= 4) + output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands); + if (n_bytes % 4 != 0) + output_asm_insn ("{stbys|stby},e %%r0,%2(%0)", operands); + } + return ""; + + case 2: + /* Pre-adjust the loop counter. */ + operands[2] = GEN_INT (n_bytes - 4); + output_asm_insn ("ldi %2,%1", operands); + + /* Loop. */ + output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands); + output_asm_insn ("addib,>= -4,%1,.-4", operands); + output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands); + + /* Handle the residual. */ + if (n_bytes % 4 != 0) + { + if (n_bytes % 4 >= 2) + output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands); + if (n_bytes % 2 != 0) + output_asm_insn ("stb %%r0,0(%0)", operands); + } + return ""; + + case 1: + /* Pre-adjust the loop counter. */ + operands[2] = GEN_INT (n_bytes - 2); + output_asm_insn ("ldi %2,%1", operands); + + /* Loop. */ + output_asm_insn ("{stbs|stb},ma %%r0,1(%0)", operands); + output_asm_insn ("addib,>= -2,%1,.-4", operands); + output_asm_insn ("{stbs|stb},ma %%r0,1(%0)", operands); + + /* Handle the residual. */ + if (n_bytes % 2 != 0) + output_asm_insn ("stb %%r0,0(%0)", operands); + + return ""; + + default: + abort (); + } +} + +/* Count the number of insns necessary to handle this block move. + + Basic structure is the same as emit_block_move, except that we + count insns rather than emit them. */ + +static int +compute_clrstr_length (rtx insn) +{ + rtx pat = PATTERN (insn); + unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 4), 0)); + unsigned long n_bytes = INTVAL (XEXP (XVECEXP (pat, 0, 3), 0)); + unsigned int n_insns = 0; + + /* We can't clear more than a word at a time because the PA + has no longer integer move insns. */ + if (align > (TARGET_64BIT ? 8 : 4)) + align = (TARGET_64BIT ? 8 : 4); + + /* The basic loop. */ + n_insns = 4; + + /* Residuals. */ + if (n_bytes % (2 * align) != 0) + { + if ((n_bytes % (2 * align)) >= align) + n_insns++; + + if ((n_bytes % align) != 0) + n_insns++; + } + + /* Lengths are expressed in bytes now; each insn is 4 bytes. */ + return n_insns * 4; +} const char * @@ -3868,12 +4188,17 @@ hppa_pic_save_rtx (void) void hppa_profile_hook (int label_no) { + /* We use SImode for the address of the function in both 32 and + 64-bit code to avoid having to provide DImode versions of the + lcla2 and load_offset_label_address insn patterns. */ + rtx reg = gen_reg_rtx (SImode); + rtx label_rtx = gen_label_rtx (); rtx begin_label_rtx, call_insn; char begin_label_name[16]; ASM_GENERATE_INTERNAL_LABEL (begin_label_name, FUNC_BEGIN_PROLOG_LABEL, label_no); - begin_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (begin_label_name)); + begin_label_rtx = gen_rtx_SYMBOL_REF (SImode, ggc_strdup (begin_label_name)); if (TARGET_64BIT) emit_move_insn (arg_pointer_rtx, @@ -3882,6 +4207,18 @@ hppa_profile_hook (int label_no) emit_move_insn (gen_rtx_REG (word_mode, 26), gen_rtx_REG (word_mode, 2)); + /* The address of the function is loaded into %r25 with a instruction- + relative sequence that avoids the use of relocations. The sequence + is split so that the load_offset_label_address instruction can + occupy the delay slot of the call to _mcount. */ + if (TARGET_PA_20) + emit_insn (gen_lcla2 (reg, label_rtx)); + else + emit_insn (gen_lcla1 (reg, label_rtx)); + + emit_insn (gen_load_offset_label_address (gen_rtx_REG (SImode, 25), + reg, begin_label_rtx, label_rtx)); + #ifndef NO_PROFILE_COUNTERS { rtx count_label_rtx, addr, r24; @@ -3894,35 +4231,31 @@ hppa_profile_hook (int label_no) r24 = gen_rtx_REG (Pmode, 24); emit_move_insn (r24, addr); - /* %r25 is set from within the output pattern. */ call_insn = - emit_call_insn (gen_call_profiler (gen_rtx_SYMBOL_REF (Pmode, "_mcount"), - GEN_INT (TARGET_64BIT ? 24 : 12), - begin_label_rtx)); + emit_call_insn (gen_call (gen_rtx_MEM (Pmode, + gen_rtx_SYMBOL_REF (Pmode, + "_mcount")), + GEN_INT (TARGET_64BIT ? 24 : 12))); use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), r24); } #else - /* %r25 is set from within the output pattern. */ + call_insn = - emit_call_insn (gen_call_profiler (gen_rtx_SYMBOL_REF (Pmode, "_mcount"), - GEN_INT (TARGET_64BIT ? 16 : 8), - begin_label_rtx)); + emit_call_insn (gen_call (gen_rtx_MEM (Pmode, + gen_rtx_SYMBOL_REF (Pmode, + "_mcount")), + GEN_INT (TARGET_64BIT ? 16 : 8))); + #endif + use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), gen_rtx_REG (SImode, 25)); + use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), gen_rtx_REG (SImode, 26)); + /* Indicate the _mcount call cannot throw, nor will it execute a non-local goto. */ REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, constm1_rtx, REG_NOTES (call_insn)); - - if (flag_pic) - { - use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx); - if (TARGET_64BIT) - use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx); - - emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); - } } /* Fetch the return address for the frame COUNT steps up from @@ -4319,8 +4652,8 @@ pa_adjust_insn_length (rtx insn, int length) /* Jumps inside switch tables which have unfilled delay slots need adjustment. */ if (GET_CODE (insn) == JUMP_INSN - && simplejump_p (insn) - && GET_MODE (insn) == SImode) + && GET_CODE (pat) == PARALLEL + && get_attr_type (insn) == TYPE_BTABLE_BRANCH) return 4; /* Millicode insn with an unfilled delay slot. */ else if (GET_CODE (insn) == INSN @@ -4337,7 +4670,15 @@ pa_adjust_insn_length (rtx insn, int length) && GET_CODE (XEXP (XVECEXP (pat, 0, 0), 1)) == MEM && GET_MODE (XEXP (XVECEXP (pat, 0, 0), 0)) == BLKmode && GET_MODE (XEXP (XVECEXP (pat, 0, 0), 1)) == BLKmode) - return compute_movstrsi_length (insn) - 4; + return compute_movstr_length (insn) - 4; + /* Block clear pattern. */ + else if (GET_CODE (insn) == INSN + && GET_CODE (pat) == PARALLEL + && GET_CODE (XVECEXP (pat, 0, 0)) == SET + && GET_CODE (XEXP (XVECEXP (pat, 0, 0), 0)) == MEM + && XEXP (XVECEXP (pat, 0, 0), 1) == const0_rtx + && GET_MODE (XEXP (XVECEXP (pat, 0, 0), 0)) == BLKmode) + return compute_clrstr_length (insn) - 4; /* Conditional branch with an unfilled delay slot. */ else if (GET_CODE (insn) == JUMP_INSN && ! simplejump_p (insn)) { @@ -4637,8 +4978,14 @@ print_operand (FILE *file, rtx x, int code) fputs (",ma", file); break; case PLUS: - if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT - || GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT) + if (GET_CODE (XEXP (XEXP (x, 0), 0)) == REG + && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG) + { + if (ASSEMBLER_DIALECT == 0) + fputs ("x", file); + } + else if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT + || GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT) { if (ASSEMBLER_DIALECT == 0) fputs ("x,s", file); @@ -4713,20 +5060,33 @@ print_operand (FILE *file, rtx x, int code) base = XEXP (XEXP (x, 0), 0); fprintf (file, "%d(%s)", size, reg_names [REGNO (base)]); break; - default: - if (GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT) + case PLUS: + if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT) fprintf (file, "%s(%s)", reg_names [REGNO (XEXP (XEXP (XEXP (x, 0), 0), 0))], reg_names [REGNO (XEXP (XEXP (x, 0), 1))]); - else if (GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT) + else if (GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT) fprintf (file, "%s(%s)", reg_names [REGNO (XEXP (XEXP (XEXP (x, 0), 1), 0))], reg_names [REGNO (XEXP (XEXP (x, 0), 0))]); + else if (GET_CODE (XEXP (XEXP (x, 0), 0)) == REG + && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG) + { + /* Because the REG_POINTER flag can get lost during reload, + GO_IF_LEGITIMATE_ADDRESS canonicalizes the order of the + index and base registers in the combined move patterns. */ + rtx base = XEXP (XEXP (x, 0), 1); + rtx index = XEXP (XEXP (x, 0), 0); + + fprintf (file, "%s(%s)", + reg_names [REGNO (index)], reg_names [REGNO (base)]); + } else output_address (XEXP (x, 0)); break; + default: + output_address (XEXP (x, 0)); + break; } } else @@ -5579,6 +5939,12 @@ output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn) if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) return "nop"; + /* The doubleword form of the cmpib instruction doesn't have the LEU + and GTU conditions while the cmpb instruction does. Since we accept + zero for cmpb, we must ensure that we use cmpb for the comparison. */ + if (GET_MODE (operands[1]) == DImode && operands[2] == const0_rtx) + operands[2] = gen_rtx_REG (DImode, 0); + /* If this is a long branch with its delay slot unfilled, set `nullify' as it can nullify the delay slot and save a nop. */ if (length == 8 && dbr_sequence_length () == 0) @@ -7646,32 +8012,33 @@ shadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op))); } -/* Return 1 if OP is valid as a base register in a reg + reg address. */ +/* Return 1 if OP is valid as a base or index register in a + REG+REG address. */ int -basereg_operand (rtx op, enum machine_mode mode) +borx_reg_operand (rtx op, enum machine_mode mode) { - /* cse will create some unscaled indexed addresses, however; it - generally isn't a win on the PA, so avoid creating unscaled - indexed addresses until after cse is finished. */ - if (!cse_not_expected) + if (GET_CODE (op) != REG) return 0; - /* Allow any register when TARGET_NO_SPACE_REGS is in effect since - we don't have to worry about the braindamaged implicit space - register selection from the basereg. */ - if (TARGET_NO_SPACE_REGS) - return (GET_CODE (op) == REG); + /* We must reject virtual registers as the only expressions that + can be instantiated are REG and REG+CONST. */ + if (op == virtual_incoming_args_rtx + || op == virtual_stack_vars_rtx + || op == virtual_stack_dynamic_rtx + || op == virtual_outgoing_args_rtx + || op == virtual_cfa_rtx) + return 0; /* While it's always safe to index off the frame pointer, it's not - always profitable, particularly when the frame pointer is being - eliminated. */ - if (! flag_omit_frame_pointer && op == frame_pointer_rtx) - return 1; + profitable to do so when the frame pointer is being eliminated. */ + if (!reload_completed + && flag_omit_frame_pointer + && !current_function_calls_alloca + && op == frame_pointer_rtx) + return 0; - return (GET_CODE (op) == REG - && REG_POINTER (op) - && register_operand (op, mode)); + return register_operand (op, mode); } /* Return 1 if this operand is anything other than a hard register. */ @@ -7848,7 +8215,8 @@ following_call (rtx insn) The jump instructions within the table are special; we must be able to identify them during assembly output (if the jumps don't get filled we need to emit a nop rather than nullifying the delay slot)). We - identify jumps in switch tables by marking the SET with DImode. + identify jumps in switch tables by using insns with the attribute + type TYPE_BTABLE_BRANCH. We also surround the jump table itself with BEGIN_BRTAB and END_BRTAB insns. This serves two purposes, first it prevents jump.c from @@ -7874,7 +8242,7 @@ pa_reorg (void) /* Find and explode all ADDR_VEC or ADDR_DIFF_VEC insns. */ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { - rtx pattern, tmp, location; + rtx pattern, tmp, location, label; unsigned int length, i; /* Find an ADDR_VEC or ADDR_DIFF_VEC insn to explode. */ @@ -7900,57 +8268,17 @@ pa_reorg (void) location = NEXT_INSN (location); if (GET_CODE (pattern) == ADDR_VEC) - { - /* Emit the jump itself. */ - tmp = gen_jump (XEXP (XVECEXP (pattern, 0, i), 0)); - tmp = emit_jump_insn_after (tmp, location); - JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 0, i), 0); - /* It is easy to rely on the branch table markers - during assembly output to trigger the correct code - for a switch table jump with an unfilled delay slot, - - However, that requires state and assumes that we look - at insns in order. - - We can't make such assumptions when computing the length - of instructions. Ugh. We could walk the insn chain to - determine if this instruction is in a branch table, but - that can get rather expensive, particularly during the - branch shortening phase of the compiler. - - So instead we mark this jump as being special. This is - far from ideal and knows that no code after this will - muck around with the mode of the JUMP_INSN itself. */ - PUT_MODE (tmp, SImode); - LABEL_NUSES (JUMP_LABEL (tmp))++; - location = NEXT_INSN (location); - } + label = XEXP (XVECEXP (pattern, 0, i), 0); else - { - /* Emit the jump itself. */ - tmp = gen_jump (XEXP (XVECEXP (pattern, 1, i), 0)); - tmp = emit_jump_insn_after (tmp, location); - JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 1, i), 0); - /* It is easy to rely on the branch table markers - during assembly output to trigger the correct code - for a switch table jump with an unfilled delay slot, - - However, that requires state and assumes that we look - at insns in order. - - We can't make such assumptions when computing the length - of instructions. Ugh. We could walk the insn chain to - determine if this instruction is in a branch table, but - that can get rather expensive, particularly during the - branch shortening phase of the compiler. - - So instead we mark this jump as being special. This is - far from ideal and knows that no code after this will - muck around with the mode of the JUMP_INSN itself. */ - PUT_MODE (tmp, SImode); - LABEL_NUSES (JUMP_LABEL (tmp))++; - location = NEXT_INSN (location); - } + label = XEXP (XVECEXP (pattern, 1, i), 0); + + tmp = gen_short_jump (label); + + /* Emit the jump itself. */ + tmp = emit_jump_insn_after (tmp, location); + JUMP_LABEL (tmp) = label; + LABEL_NUSES (label)++; + location = NEXT_INSN (location); /* Emit a BARRIER after the jump. */ emit_barrier_after (location); @@ -7968,7 +8296,12 @@ pa_reorg (void) } else { - /* Sill need an end_brtab insn. */ + /* Still need brtab marker insns. FIXME: the presence of these + markers disables output of the branch table to readonly memory, + and any alignment directives that might be needed. Possibly, + the begin_brtab insn should be output before the label for the + table. This doesn matter at the moment since the tables are + always output in the text section. */ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { /* Find an ADDR_VEC insn. */ @@ -8612,10 +8945,8 @@ cmpib_comparison_operator (rtx op, enum machine_mode mode) not be placed in the read-only data section. */ static void -pa_select_section (exp, reloc, align) - tree exp; - int reloc; - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; +pa_select_section (tree exp, int reloc, + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { if (TREE_CODE (exp) == VAR_DECL && TREE_READONLY (exp) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index ce69b3bc19b..312d58c4213 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -641,9 +641,9 @@ extern struct rtx_def *hppa_pic_save_rtx (void); in some cases it is preferable to use a more restrictive class. */ #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS) -/* Return the register class of a scratch register needed to copy IN into - or out of a register in CLASS in MODE. If it can be done directly - NO_REGS is returned. +/* Return the register class of a scratch register needed to copy + IN into a register in CLASS in MODE, or a register in CLASS in MODE + to IN. If it can be done directly NO_REGS is returned. Avoid doing any work for the common case calls. */ @@ -993,7 +993,7 @@ extern int may_call_alloca; #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - if (! TARGET_64BIT) \ + if (!TARGET_64BIT) \ { \ fputs ("\tldw 36(%r22),%r21\n", FILE); \ fputs ("\tbb,>=,n %r21,30,.+16\n", FILE); \ @@ -1003,10 +1003,20 @@ extern int may_call_alloca; fputs ("\tdepwi 0,31,2,%r21\n", FILE); \ fputs ("\tldw 4(%r21),%r19\n", FILE); \ fputs ("\tldw 0(%r21),%r21\n", FILE); \ - fputs ("\tldsid (%r21),%r1\n", FILE); \ - fputs ("\tmtsp %r1,%sr0\n", FILE); \ - fputs ("\tbe 0(%sr0,%r21)\n", FILE); \ - fputs ("\tldw 40(%r22),%r29\n", FILE); \ + if (TARGET_PA_20) \ + { \ + fputs ("\tbve (%r21)\n", FILE); \ + fputs ("\tldw 40(%r22),%r29\n", FILE); \ + fputs ("\t.word 0\n", FILE); \ + fputs ("\t.word 0\n", FILE); \ + } \ + else \ + { \ + fputs ("\tldsid (%r21),%r1\n", FILE); \ + fputs ("\tmtsp %r1,%sr0\n", FILE); \ + fputs ("\tbe 0(%sr0,%r21)\n", FILE); \ + fputs ("\tldw 40(%r22),%r29\n", FILE); \ + } \ fputs ("\t.word 0\n", FILE); \ fputs ("\t.word 0\n", FILE); \ fputs ("\t.word 0\n", FILE); \ @@ -1029,16 +1039,21 @@ extern int may_call_alloca; } \ } -/* Length in units of the trampoline for entering a nested function. +/* Length in units of the trampoline for entering a nested function. */ + +#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52) - Flush the cache entries corresponding to the first and last addresses - of the trampoline. This is necessary as the trampoline may cross two - cache lines. +/* Length in units of the trampoline instruction code. */ - If the code part of the trampoline ever grows to > 32 bytes, then it - will become necessary to hack on the cacheflush pattern in pa.md. */ +#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40)) -#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52) +/* Minimum length of a cache line. A length of 16 will work on all + PA-RISC processors. All PA 1.1 processors have a cache line of + 32 bytes. Most but not all PA 2.0 processors have a cache line + of 64 bytes. As cache flushes are expensive and we don't support + PA 1.0, we use a minimum length of 32. */ + +#define MIN_CACHELINE_SIZE 32 /* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. @@ -1048,55 +1063,87 @@ extern int may_call_alloca; Move the static chain value to trampoline template at offset 40. Move the trampoline address to trampoline template at offset 44. Move r19 to trampoline template at offset 48. The latter two - words create a plabel for the indirect call to the trampoline. */ + words create a plabel for the indirect call to the trampoline. + + A similar sequence is used for the 64-bit port but the plabel is + at the beginning of the trampoline. + + Finally, the cache entries for the trampoline code are flushed. + This is necessary to ensure that the trampoline instruction sequence + is written to memory prior to any attempts at prefetching the code + sequence. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - if (! TARGET_64BIT) \ + rtx start_addr = gen_reg_rtx (Pmode); \ + rtx end_addr = gen_reg_rtx (Pmode); \ + rtx line_length = gen_reg_rtx (Pmode); \ + rtx tmp; \ + \ + if (!TARGET_64BIT) \ { \ - rtx start_addr, end_addr; \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 36)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 40)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \ \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 36)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 40)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 44)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (TRAMP)); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 48)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), \ + /* Create a fat pointer for the trampoline. */ \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 44)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), (TRAMP)); \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 48)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ gen_rtx_REG (Pmode, 19)); \ + \ /* fdc and fic only use registers for the address to flush, \ - they do not accept integer displacements. */ \ - start_addr = force_reg (Pmode, (TRAMP)); \ - end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \ - emit_insn (gen_dcacheflush (start_addr, end_addr)); \ - end_addr = force_reg (Pmode, plus_constant (start_addr, 32)); \ - emit_insn (gen_icacheflush (start_addr, end_addr, start_addr, \ - gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));\ + they do not accept integer displacements. We align the \ + start and end addresses to the beginning of their respective \ + cache lines to minimize the number of lines flushed. */ \ + tmp = force_reg (Pmode, (TRAMP)); \ + emit_insn (gen_andsi3 (start_addr, tmp, \ + GEN_INT (-MIN_CACHELINE_SIZE))); \ + tmp = force_reg (Pmode, \ + plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \ + emit_insn (gen_andsi3 (end_addr, tmp, \ + GEN_INT (-MIN_CACHELINE_SIZE))); \ + emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \ + emit_insn (gen_dcacheflush (start_addr, end_addr, line_length)); \ + emit_insn (gen_icacheflush (start_addr, end_addr, line_length, \ + gen_reg_rtx (Pmode), \ + gen_reg_rtx (Pmode), \ + gen_reg_rtx (Pmode))); \ } \ else \ { \ - rtx start_addr, end_addr; \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 56)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 64)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \ \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 56)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 64)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \ /* Create a fat pointer for the trampoline. */ \ - end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), end_addr); \ - end_addr = gen_rtx_REG (Pmode, 27); \ - start_addr = memory_address (Pmode, plus_constant ((TRAMP), 24)); \ - emit_move_insn (gen_rtx_MEM (Pmode, start_addr), end_addr); \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 16)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ + force_reg (Pmode, plus_constant ((TRAMP), 32))); \ + tmp = memory_address (Pmode, plus_constant ((TRAMP), 24)); \ + emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ + gen_rtx_REG (Pmode, 27)); \ + \ /* fdc and fic only use registers for the address to flush, \ - they do not accept integer displacements. */ \ - start_addr = force_reg (Pmode, (TRAMP)); \ - end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \ - emit_insn (gen_dcacheflush (start_addr, end_addr)); \ - end_addr = force_reg (Pmode, plus_constant (start_addr, 32)); \ - emit_insn (gen_icacheflush (start_addr, end_addr, start_addr, \ - gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));\ + they do not accept integer displacements. We align the \ + start and end addresses to the beginning of their respective \ + cache lines to minimize the number of lines flushed. */ \ + tmp = force_reg (Pmode, plus_constant ((TRAMP), 32)); \ + emit_insn (gen_anddi3 (start_addr, tmp, \ + GEN_INT (-MIN_CACHELINE_SIZE))); \ + tmp = force_reg (Pmode, \ + plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \ + emit_insn (gen_anddi3 (end_addr, tmp, \ + GEN_INT (-MIN_CACHELINE_SIZE))); \ + emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \ + emit_insn (gen_dcacheflush (start_addr, end_addr, line_length)); \ + emit_insn (gen_icacheflush (start_addr, end_addr, line_length, \ + gen_reg_rtx (Pmode), \ + gen_reg_rtx (Pmode), \ + gen_reg_rtx (Pmode))); \ } \ } @@ -1198,83 +1245,87 @@ extern int may_call_alloca; || cint_ok_for_move (INTVAL (X)))) \ && !function_label_operand (X, VOIDmode)) -/* Subroutine for EXTRA_CONSTRAINT. +/* Subroutines for EXTRA_CONSTRAINT. Return 1 iff OP is a pseudo which did not get a hard register and we are running the reload pass. */ - #define IS_RELOADING_PSEUDO_P(OP) \ ((reload_in_progress \ && GET_CODE (OP) == REG \ && REGNO (OP) >= FIRST_PSEUDO_REGISTER \ && reg_renumber [REGNO (OP)] < 0)) +/* Return 1 iff OP is a scaled or unscaled index address. */ +#define IS_INDEX_ADDR_P(OP) \ + (GET_CODE (OP) == PLUS \ + && GET_MODE (OP) == Pmode \ + && (GET_CODE (XEXP (OP, 0)) == MULT \ + || GET_CODE (XEXP (OP, 1)) == MULT \ + || (REG_P (XEXP (OP, 0)) \ + && REG_P (XEXP (OP, 1))))) + +/* Return 1 iff OP is a LO_SUM DLT address. */ +#define IS_LO_SUM_DLT_ADDR_P(OP) \ + (GET_CODE (OP) == LO_SUM \ + && GET_MODE (OP) == Pmode \ + && REG_P (XEXP (OP, 0)) \ + && REG_OK_FOR_BASE_P (XEXP (OP, 0)) \ + && GET_CODE (XEXP (OP, 1)) == UNSPEC) + /* Optional extra constraints for this machine. Borrowed from sparc.h. - For the HPPA, `Q' means that this is a memory operand but not a - symbolic memory operand. Note that an unassigned pseudo register - is such a memory operand. Needed because reload will generate - these things in insns and then not re-recognize the insns, causing - constrain_operands to fail. + `A' is a LO_SUM DLT memory operand. + + `Q' is any memory operand that isn't a symbolic, indexed or lo_sum + memory operand. Note that an unassigned pseudo register is such a + memory operand. Needed because reload will generate these things + and then not re-recognize the insn, causing constrain_operands to + fail. - `R' is used for scaled indexed addresses. + `R' is a scaled/unscaled indexed memory operand. `S' is the constant 31. - `T' is for fp loads and stores. */ -#define EXTRA_CONSTRAINT(OP, C) \ - ((C) == 'Q' ? \ - (IS_RELOADING_PSEUDO_P (OP) \ - || (GET_CODE (OP) == MEM \ - && (memory_address_p (GET_MODE (OP), XEXP (OP, 0))\ - || reload_in_progress) \ - && ! symbolic_memory_operand (OP, VOIDmode) \ - && !(GET_CODE (XEXP (OP, 0)) == PLUS \ - && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT\ - || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT))))\ - : ((C) == 'R' ? \ - (GET_CODE (OP) == MEM \ - && GET_CODE (XEXP (OP, 0)) == PLUS \ - && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT \ - || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT) \ - && (move_operand (OP, GET_MODE (OP)) \ - || memory_address_p (GET_MODE (OP), XEXP (OP, 0))\ - || reload_in_progress)) \ - : ((C) == 'T' ? \ - (GET_CODE (OP) == MEM \ - /* Using DFmode forces only short displacements \ - to be recognized as valid in reg+d addresses. \ - However, this is not necessary for PA2.0 since\ - it has long FP loads/stores. \ - \ - FIXME: the ELF32 linker clobbers the LSB of \ - the FP register number in {fldw,fstw} insns. \ - Thus, we only allow long FP loads/stores on \ - TARGET_64BIT. */ \ - && memory_address_p ((TARGET_PA_20 \ - && !TARGET_ELF32 \ - ? GET_MODE (OP) \ - : DFmode), \ - XEXP (OP, 0)) \ - && !(GET_CODE (XEXP (OP, 0)) == LO_SUM \ - && GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (XEXP (OP, 0), 0))\ - && GET_CODE (XEXP (XEXP (OP, 0), 1)) == UNSPEC\ - && GET_MODE (XEXP (OP, 0)) == Pmode) \ - && !(GET_CODE (XEXP (OP, 0)) == PLUS \ - && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT\ - || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT)))\ - : ((C) == 'U' ? \ - (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 63) \ - : ((C) == 'A' ? \ - (GET_CODE (OP) == MEM \ - && GET_CODE (XEXP (OP, 0)) == LO_SUM \ - && GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (XEXP (OP, 0), 0)) \ - && GET_CODE (XEXP (XEXP (OP, 0), 1)) == UNSPEC \ - && GET_MODE (XEXP (OP, 0)) == Pmode) \ - : ((C) == 'S' ? \ - (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 31) : 0)))))) + `T' is for fp loads and stores. + + `U' is the constant 63. */ + +#define EXTRA_CONSTRAINT(OP, C) \ + ((C) == 'Q' ? \ + (IS_RELOADING_PSEUDO_P (OP) \ + || (GET_CODE (OP) == MEM \ + && (reload_in_progress \ + || memory_address_p (GET_MODE (OP), XEXP (OP, 0))) \ + && !symbolic_memory_operand (OP, VOIDmode) \ + && !IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0)) \ + && !IS_INDEX_ADDR_P (XEXP (OP, 0)))) \ + : ((C) == 'A' ? \ + (GET_CODE (OP) == MEM \ + && IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0))) \ + : ((C) == 'R' ? \ + (GET_CODE (OP) == MEM \ + && IS_INDEX_ADDR_P (XEXP (OP, 0))) \ + : ((C) == 'T' ? \ + (GET_CODE (OP) == MEM \ + && !IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0)) \ + && !IS_INDEX_ADDR_P (XEXP (OP, 0)) \ + /* Using DFmode forces only short displacements \ + to be recognized as valid in reg+d addresses. \ + However, this is not necessary for PA2.0 since \ + it has long FP loads/stores. \ + \ + FIXME: the ELF32 linker clobbers the LSB of \ + the FP register number in {fldw,fstw} insns. \ + Thus, we only allow long FP loads/stores on \ + TARGET_64BIT. */ \ + && memory_address_p ((TARGET_PA_20 && !TARGET_ELF32 \ + ? GET_MODE (OP) \ + : DFmode), \ + XEXP (OP, 0))) \ + : ((C) == 'S' ? \ + (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 31) \ + : ((C) == 'U' ? \ + (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 63) : 0)))))) /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx @@ -1310,16 +1361,53 @@ extern int may_call_alloca; #endif -/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression - that is a valid memory address for an instruction. - The MODE argument is the machine mode for the MEM expression - that wants to use this address. - - On the HP-PA, the actual legitimate addresses must be - REG+REG, REG+(REG*SCALE) or REG+SMALLINT. - But we can treat a SYMBOL_REF as legitimate if it is part of this - function's constant-pool, because such addresses can actually - be output as REG+SMALLINT. +/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a + valid memory address for an instruction. The MODE argument is the + machine mode for the MEM expression that wants to use this address. + + On HP PA-RISC, the legitimate address forms are REG+SMALLINT, + REG+REG, and REG+(REG*SCALE). The indexed address forms are only + available with floating point loads and stores, and integer loads. + We get better code by allowing indexed addresses in the initial + RTL generation. + + The acceptance of indexed addresses as legitimate implies that we + must provide patterns for doing indexed integer stores, or the move + expanders must force the address of an indexed store to a register. + We have adopted the latter approach. + + Another function of GO_IF_LEGITIMATE_ADDRESS is to ensure that + the base register is a valid pointer for indexed instructions. + On targets that have non-equivalent space registers, we have to + know at the time of assembler output which register in a REG+REG + pair is the base register. The REG_POINTER flag is sometimes lost + in reload and the following passes, so it can't be relied on during + code generation. Thus, we either have to canonicalize the order + of the registers in REG+REG indexed addresses, or treat REG+REG + addresses separately and provide patterns for both permutations. + + The latter approach requires several hundred additional lines of + code in pa.md. The downside to canonicalizing is that a PLUS + in the wrong order can't combine to form to make a scaled indexed + memory operand. As we won't need to canonicalize the operands if + the REG_POINTER lossage can be fixed, it seems better canonicalize. + + We initially break out scaled indexed addresses in canonical order + in emit_move_sequence. LEGITIMIZE_ADDRESS also canonicalizes + scaled indexed addresses during RTL generation. However, fold_rtx + has its own opinion on how the operands of a PLUS should be ordered. + If one of the operands is equivalent to a constant, it will make + that operand the second operand. As the base register is likely to + be equivalent to a SYMBOL_REF, we have made it the second operand. + + GO_IF_LEGITIMATE_ADDRESS accepts REG+REG as legitimate when the + operands are in the order INDEX+BASE on targets with non-equivalent + space registers, and in any order on targets with equivalent space + registers. It accepts both MULT+BASE and BASE+MULT for scaled indexing. + + We treat a SYMBOL_REF as legitimate if it is part of the current + function's constant-pool, because such addresses can actually be + output as REG+SMALLINT. Note we only allow 5 bit immediates for access to a constant address; doing so avoids losing for loading/storing a FP register at an address @@ -1337,87 +1425,114 @@ extern int may_call_alloca; #define VAL_14_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x2000 < 0x4000) #define INT_14_BITS(X) VAL_14_BITS_P (INTVAL (X)) -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ -{ \ - if ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \ +/* These are the modes that we allow for scaled indexing. */ +#define MODE_OK_FOR_SCALED_INDEXING_P(MODE) \ + ((TARGET_64BIT && (MODE) == DImode) \ + || (MODE) == SImode \ + || (MODE) == HImode \ + || (!TARGET_SOFT_FLOAT && ((MODE) == DFmode || (MODE) == SFmode))) + +/* These are the modes that we allow for unscaled indexing. */ +#define MODE_OK_FOR_UNSCALED_INDEXING_P(MODE) \ + ((TARGET_64BIT && (MODE) == DImode) \ + || (MODE) == SImode \ + || (MODE) == HImode \ + || (MODE) == QImode \ + || (!TARGET_SOFT_FLOAT && ((MODE) == DFmode || (MODE) == SFmode))) + +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ +{ \ + if ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \ || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC \ || GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC) \ - && REG_P (XEXP (X, 0)) \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)))) \ - goto ADDR; \ - else if (GET_CODE (X) == PLUS) \ - { \ - rtx base = 0, index = 0; \ - if (REG_P (XEXP (X, 0)) \ - && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ - base = XEXP (X, 0), index = XEXP (X, 1); \ - else if (REG_P (XEXP (X, 1)) \ - && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ - base = XEXP (X, 1), index = XEXP (X, 0); \ - if (base != 0) \ - if (GET_CODE (index) == CONST_INT \ - && ((INT_14_BITS (index) \ - && (TARGET_SOFT_FLOAT \ - || (TARGET_PA_20 \ - && ((MODE == SFmode \ - && (INTVAL (index) % 4) == 0)\ - || (MODE == DFmode \ - && (INTVAL (index) % 8) == 0)))\ - || ((MODE) != SFmode && (MODE) != DFmode))) \ - || INT_5_BITS (index))) \ - goto ADDR; \ - if (! TARGET_SOFT_FLOAT \ - && ! TARGET_DISABLE_INDEXING \ - && base \ - && ((MODE) == SFmode || (MODE) == DFmode) \ - && GET_CODE (index) == MULT \ - && GET_CODE (XEXP (index, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (index, 0)) \ - && GET_CODE (XEXP (index, 1)) == CONST_INT \ - && INTVAL (XEXP (index, 1)) == ((MODE) == SFmode ? 4 : 8))\ - goto ADDR; \ - } \ - else if (GET_CODE (X) == LO_SUM \ - && GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ - && CONSTANT_P (XEXP (X, 1)) \ - && (TARGET_SOFT_FLOAT \ - /* We can allow symbolic LO_SUM addresses\ - for PA2.0. */ \ - || (TARGET_PA_20 \ - && !TARGET_ELF32 \ - && GET_CODE (XEXP (X, 1)) != CONST_INT)\ - || ((MODE) != SFmode \ - && (MODE) != DFmode))) \ - goto ADDR; \ - else if (GET_CODE (X) == LO_SUM \ - && GET_CODE (XEXP (X, 0)) == SUBREG \ - && GET_CODE (SUBREG_REG (XEXP (X, 0))) == REG\ - && REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0)))\ - && CONSTANT_P (XEXP (X, 1)) \ - && (TARGET_SOFT_FLOAT \ - /* We can allow symbolic LO_SUM addresses\ - for PA2.0. */ \ - || (TARGET_PA_20 \ - && !TARGET_ELF32 \ - && GET_CODE (XEXP (X, 1)) != CONST_INT)\ - || ((MODE) != SFmode \ - && (MODE) != DFmode))) \ - goto ADDR; \ - else if (GET_CODE (X) == LABEL_REF \ - || (GET_CODE (X) == CONST_INT \ - && INT_5_BITS (X))) \ - goto ADDR; \ - /* Needed for -fPIC */ \ - else if (GET_CODE (X) == LO_SUM \ - && GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ - && GET_CODE (XEXP (X, 1)) == UNSPEC \ - && (TARGET_SOFT_FLOAT \ - || (TARGET_PA_20 && !TARGET_ELF32) \ - || ((MODE) != SFmode \ - && (MODE) != DFmode))) \ - goto ADDR; \ + && REG_P (XEXP (X, 0)) \ + && REG_OK_FOR_BASE_P (XEXP (X, 0)))) \ + goto ADDR; \ + else if (GET_CODE (X) == PLUS) \ + { \ + rtx base = 0, index = 0; \ + if (REG_P (XEXP (X, 1)) \ + && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ + base = XEXP (X, 1), index = XEXP (X, 0); \ + else if (REG_P (XEXP (X, 0)) \ + && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ + base = XEXP (X, 0), index = XEXP (X, 1); \ + if (base \ + && GET_CODE (index) == CONST_INT \ + && ((INT_14_BITS (index) \ + && (TARGET_SOFT_FLOAT \ + || (TARGET_PA_20 \ + && ((MODE == SFmode \ + && (INTVAL (index) % 4) == 0) \ + || (MODE == DFmode \ + && (INTVAL (index) % 8) == 0))) \ + || ((MODE) != SFmode && (MODE) != DFmode))) \ + || INT_5_BITS (index))) \ + goto ADDR; \ + if (!TARGET_DISABLE_INDEXING \ + /* Only accept the "canonical" INDEX+BASE operand order \ + on targets with non-equivalent space registers. */ \ + && (TARGET_NO_SPACE_REGS \ + ? (base && REG_P (index)) \ + : (base == XEXP (X, 1) && REG_P (index) \ + && REG_POINTER (base) && !REG_POINTER (index))) \ + && MODE_OK_FOR_UNSCALED_INDEXING_P (MODE) \ + && REG_OK_FOR_INDEX_P (index) \ + && borx_reg_operand (base, Pmode) \ + && borx_reg_operand (index, Pmode)) \ + goto ADDR; \ + if (!TARGET_DISABLE_INDEXING \ + && base \ + && GET_CODE (index) == MULT \ + && MODE_OK_FOR_SCALED_INDEXING_P (MODE) \ + && REG_P (XEXP (index, 0)) \ + && GET_MODE (XEXP (index, 0)) == Pmode \ + && REG_OK_FOR_INDEX_P (XEXP (index, 0)) \ + && GET_CODE (XEXP (index, 1)) == CONST_INT \ + && INTVAL (XEXP (index, 1)) \ + == (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \ + && borx_reg_operand (base, Pmode)) \ + goto ADDR; \ + } \ + else if (GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X, 0)) == REG \ + && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ + && CONSTANT_P (XEXP (X, 1)) \ + && (TARGET_SOFT_FLOAT \ + /* We can allow symbolic LO_SUM addresses for PA2.0. */ \ + || (TARGET_PA_20 \ + && !TARGET_ELF32 \ + && GET_CODE (XEXP (X, 1)) != CONST_INT) \ + || ((MODE) != SFmode \ + && (MODE) != DFmode))) \ + goto ADDR; \ + else if (GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X, 0)) == SUBREG \ + && GET_CODE (SUBREG_REG (XEXP (X, 0))) == REG \ + && REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0))) \ + && CONSTANT_P (XEXP (X, 1)) \ + && (TARGET_SOFT_FLOAT \ + /* We can allow symbolic LO_SUM addresses for PA2.0. */ \ + || (TARGET_PA_20 \ + && !TARGET_ELF32 \ + && GET_CODE (XEXP (X, 1)) != CONST_INT) \ + || ((MODE) != SFmode \ + && (MODE) != DFmode))) \ + goto ADDR; \ + else if (GET_CODE (X) == LABEL_REF \ + || (GET_CODE (X) == CONST_INT \ + && INT_5_BITS (X))) \ + goto ADDR; \ + /* Needed for -fPIC */ \ + else if (GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X, 0)) == REG \ + && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ + && GET_CODE (XEXP (X, 1)) == UNSPEC \ + && (TARGET_SOFT_FLOAT \ + || (TARGET_PA_20 && !TARGET_ELF32) \ + || ((MODE) != SFmode \ + && (MODE) != DFmode))) \ + goto ADDR; \ } /* Look for machine dependent ways to make the invalid address AD a @@ -1550,11 +1665,14 @@ do { \ #define FUNCTION_NAME_P(NAME) (*(NAME) == '@') -/* Specify the machine mode that this machine uses - for the index in the tablejump instruction. */ -#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? TImode : DImode) +/* Specify the machine mode that this machine uses for the index in the + tablejump instruction. For small tables, an element consists of a + ia-relative branch and its delay slot. When -mbig-switch is specified, + we use a 32-bit absolute address for non-pic code, and a 32-bit offset + for both 32 and 64-bit pic code. */ +#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? SImode : DImode) -/* Jump tables must be 32 bit aligned, no matter the size of the element. */ +/* Jump tables must be 32-bit aligned, no matter the size of the element. */ #define ADDR_VEC_ALIGN(ADDR_VEC) 2 /* Define this as 1 if `char' should by default be signed; else as 0. */ @@ -1673,6 +1791,12 @@ do { \ /* Control the assembler format that we output. */ +/* A C string constant describing how to begin a comment in the target + assembler language. The compiler assumes that the comment will end at + the end of the line. */ + +#define ASM_COMMENT_START ";" + /* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */ @@ -1718,35 +1842,41 @@ do { \ #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \ output_ascii ((FILE), (P), (SIZE)) -/* This is how to output an element of a case-vector that is absolute. - Note that this method makes filling these branch delay slots - impossible. */ +/* Jump tables are always placed in the text section. Technically, it + is possible to put them in the readonly data section when -mbig-switch + is specified. This has the benefit of getting the table out of .text + and reducing branch lengths as a result. The downside is that an + additional insn (addil) is needed to access the table when generating + PIC code. The address difference table also has to use 32-bit + pc-relative relocations. Currently, GAS does not support these + relocations, although it is easily modified to do this operation. + The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0" + when using ELF GAS. A simple difference can be used when using + SOM GAS or the HP assembler. The final downside is GDB complains + about the nesting of the label for the table when debugging. */ -#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ - if (TARGET_BIG_SWITCH) \ - fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'L$%04d,%%r1\n\tbe RR'L$%04d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \ - else \ - fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE) - -/* Jump tables are executable code and live in the TEXT section on the PA. */ #define JUMP_TABLES_IN_TEXT_SECTION 1 -/* This is how to output an element of a case-vector that is relative. - This must be defined correctly as it is used when generating PIC code. +/* This is how to output an element of a case-vector that is absolute. */ - I believe it safe to use the same definition as ASM_OUTPUT_ADDR_VEC_ELT - on the PA since ASM_OUTPUT_ADDR_VEC_ELT uses pc-relative jump instructions - rather than a table of absolute addresses. */ +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ + if (TARGET_BIG_SWITCH) \ + fprintf (FILE, "\t.word L$%04d\n", VALUE); \ + else \ + fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE) + +/* This is how to output an element of a case-vector that is relative. + Since we always place jump tables in the text section, the difference + is absolute and requires no relocation. */ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ - if (TARGET_BIG_SWITCH) \ - fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'L$%04d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \ - else \ + if (TARGET_BIG_SWITCH) \ + fprintf (FILE, "\t.word L$%04d-L$%04d\n", VALUE, REL); \ + else \ fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE) -/* This is how to output an assembler line - that says to advance the location counter - to a multiple of 2**LOG bytes. */ +/* This is how to output an assembler line that says to advance the + location counter to a multiple of 2**LOG bytes. */ #define ASM_OUTPUT_ALIGN(FILE,LOG) \ fprintf (FILE, "\t.align %d\n", (1<<(LOG))) @@ -1856,16 +1986,17 @@ do { \ #define JMP_BUF_SIZE 50 #define PREDICATE_CODES \ - {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \ + {"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ {"call_operand_address", {LABEL_REF, SYMBOL_REF, CONST_INT, \ CONST_DOUBLE, CONST, HIGH, CONSTANT_P_RTX}}, \ + {"indexed_memory_operand", {SUBREG, MEM}}, \ {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ {"symbolic_memory_operand", {SUBREG, MEM}}, \ {"reg_before_reload_operand", {REG, MEM}}, \ - {"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \ {"reg_or_0_or_nonsymb_mem_operand", {SUBREG, REG, MEM, CONST_INT, \ CONST_DOUBLE}}, \ - {"move_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, MEM}}, \ + {"move_dest_operand", {SUBREG, REG, MEM}}, \ + {"move_src_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, MEM}}, \ {"reg_or_cint_move_operand", {SUBREG, REG, CONST_INT}}, \ {"pic_label_operand", {LABEL_REF, CONST}}, \ {"fp_reg_operand", {REG}}, \ @@ -1889,7 +2020,6 @@ do { \ {"pc_or_label_operand", {PC, LABEL_REF}}, \ {"plus_xor_ior_operator", {PLUS, XOR, IOR}}, \ {"shadd_operand", {CONST_INT}}, \ - {"basereg_operand", {REG}}, \ {"div_operand", {REG, CONST_INT}}, \ {"ireg_operand", {REG}}, \ {"cmpib_comparison_operator", {EQ, NE, LT, LE, LEU, \ diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 958c635670d..16356776188 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -32,7 +32,7 @@ ;; type "binary" insns have two input operands (1,2) and one output (0) (define_attr "type" - "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch" + "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch" (const_string "binary")) (define_attr "pa_combine_type" @@ -74,7 +74,7 @@ ;; For conditional branches. (define_attr "in_branch_delay" "false,true" - (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") + (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") (eq_attr "length" "4")) (const_string "true") (const_string "false"))) @@ -82,7 +82,7 @@ ;; Disallow instructions which use the FPU since they will tie up the FPU ;; even if the instruction is nullified. (define_attr "in_nullified_branch_delay" "false,true" - (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch") + (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch") (eq_attr "length" "4")) (const_string "true") (const_string "false"))) @@ -90,7 +90,7 @@ ;; For calls and millicode calls. Allow unconditional branches in the ;; delay slot. (define_attr "in_call_delay" "false,true" - (cond [(and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") + (cond [(and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") (eq_attr "length" "4")) (const_string "true") (eq_attr "type" "uncond_branch") @@ -110,7 +110,7 @@ [(eq_attr "in_call_delay" "true") (nil) (nil)]) ;; Return and other similar instructions. -(define_delay (eq_attr "type" "branch,parallel_branch") +(define_delay (eq_attr "type" "btable_branch,branch,parallel_branch") [(eq_attr "in_branch_delay" "true") (nil) (nil)]) ;; Floating point conditional branch delay slot description and @@ -505,7 +505,7 @@ ;; to assume have zero latency. (define_insn_reservation "Z2" 0 (and - (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl") + (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl") (eq_attr "cpu" "8000")) "inm_8000,rnm_8000") @@ -513,7 +513,7 @@ ;; retirement unit. (define_insn_reservation "Z3" 0 (and - (eq_attr "type" "uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") + (eq_attr "type" "uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch") (eq_attr "cpu" "8000")) "inm0_8000+inm1_8000,rnm0_8000+rnm1_8000") @@ -2263,13 +2263,13 @@ }") (define_insn "" - [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand" - "=r,r,r,r,r,r,Q,!*q,!f,f,*TR") - (match_operand:SI 1 "move_operand" - "A,r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))] + [(set (match_operand:SI 0 "move_dest_operand" + "=r,r,r,r,r,r,Q,!*q,!*f,*f,T") + (match_operand:SI 1 "move_src_operand" + "A,r,J,N,K,RQ,rM,!rM,!*fM,RT,*f"))] "(register_operand (operands[0], SImode) || reg_or_0_operand (operands[1], SImode)) - && ! TARGET_SOFT_FLOAT" + && !TARGET_SOFT_FLOAT" "@ ldw RT'%A1,%0 copy %1,%0 @@ -2287,10 +2287,155 @@ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")]) (define_insn "" - [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand" - "=r,r,r,r,r,r,Q,!*q") - (match_operand:SI 1 "move_operand" - "A,r,J,N,K,RQ,rM,!rM"))] + [(set (match_operand:SI 0 "indexed_memory_operand" "=R") + (match_operand:SI 1 "register_operand" "f"))] + "!TARGET_SOFT_FLOAT + && !TARGET_DISABLE_INDEXING + && reload_completed" + "fstw%F0 %1,%0" + [(set_attr "type" "fpstore") + (set_attr "pa_combine_type" "addmove") + (set_attr "length" "4")]) + +; Rewrite RTL using an indexed store. This will allow the insn that +; computes the address to be deleted if the register it sets is dead. +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 4)) + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "reg_or_0_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 2 "register_operand" "") + (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 4)))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 4)) + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 2 "register_operand" "") + (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 4)))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:SI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:SI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:DI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SI (plus:DI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:SI 0 "move_dest_operand" + "=r,r,r,r,r,r,Q,!*q") + (match_operand:SI 1 "move_src_operand" + "A,r,J,N,K,RQ,rM,!rM"))] "(register_operand (operands[0], SImode) || reg_or_0_operand (operands[1], SImode)) && TARGET_SOFT_FLOAT" @@ -2307,26 +2452,32 @@ (set_attr "pa_combine_type" "addmove") (set_attr "length" "4,4,4,4,4,4,4,4")]) +;; Load or store with base-register modification. (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") - (mem:SI (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldwx|ldw} %2(%1),%0" + (mem:SI (plus:DI (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L")))) + (set (match_dup 1) + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldw,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) +; And a zero extended variant. (define_insn "" - [(set (match_operand:SI 0 "register_operand" "=r") - (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldwx|ldw} %1(%2),%0" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (mem:SI + (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) + (set (match_dup 1) + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldw,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) -;; Load or store with base-register modification. - (define_expand "pre_load" [(parallel [(set (match_operand:SI 0 "register_operand" "") (mem (plus (match_operand 1 "register_operand" "") @@ -2453,9 +2604,9 @@ ;; Note since this pattern can be created at reload time (via movsi), all ;; the same rules for movsi apply here. (no new pseudos, no temporaries). (define_insn "" - [(set (match_operand 0 "pmode_register_operand" "=a") + [(set (match_operand 0 "pmode_register_operand" "=r") (match_operand 1 "pic_label_operand" ""))] - "" + "TARGET_PA_20" "* { rtx xoperands[3]; @@ -2463,14 +2614,11 @@ xoperands[0] = operands[0]; xoperands[1] = operands[1]; - if (TARGET_SOM || ! TARGET_GAS) - xoperands[2] = gen_label_rtx (); + xoperands[2] = gen_label_rtx (); - output_asm_insn (\"{bl|b,l} .+8,%0\", xoperands); - output_asm_insn (\"{depi|depwi} 0,31,2,%0\", xoperands); - if (TARGET_SOM || ! TARGET_GAS) - (*targetm.asm_out.internal_label) (asm_out_file, \"L\", - CODE_LABEL_NUMBER (xoperands[2])); + (*targetm.asm_out.internal_label) (asm_out_file, \"L\", + CODE_LABEL_NUMBER (xoperands[2])); + output_asm_insn (\"mfia %0\", xoperands); /* If we're trying to load the address of a label that happens to be close, then we can use a shorter sequence. */ @@ -2478,27 +2626,46 @@ && INSN_ADDRESSES_SET_P () && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0))) - INSN_ADDRESSES (INSN_UID (insn))) < 8100) + output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands); + else { - /* Prefixing with R% here is wrong, it extracts just 11 bits and is - always non-negative. */ - if (TARGET_SOM || ! TARGET_GAS) - output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands); - else - output_asm_insn (\"ldo %1-$PIC_pcrel$0+8(%0),%0\", xoperands); + output_asm_insn (\"addil L%%%1-%2,%0\", xoperands); + output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands); } + return \"\"; +}" + [(set_attr "type" "multi") + (set_attr "length" "12")]) ; 8 or 12 + +(define_insn "" + [(set (match_operand 0 "pmode_register_operand" "=a") + (match_operand 1 "pic_label_operand" ""))] + "!TARGET_PA_20" + "* +{ + rtx xoperands[3]; + extern FILE *asm_out_file; + + xoperands[0] = operands[0]; + xoperands[1] = operands[1]; + xoperands[2] = gen_label_rtx (); + + output_asm_insn (\"bl .+8,%0\", xoperands); + output_asm_insn (\"depi 0,31,2,%0\", xoperands); + (*targetm.asm_out.internal_label) (asm_out_file, \"L\", + CODE_LABEL_NUMBER (xoperands[2])); + + /* If we're trying to load the address of a label that happens to be + close, then we can use a shorter sequence. */ + if (GET_CODE (operands[1]) == LABEL_REF + && INSN_ADDRESSES_SET_P () + && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0))) + - INSN_ADDRESSES (INSN_UID (insn))) < 8100) + output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands); else { - if (TARGET_SOM || ! TARGET_GAS) - { - output_asm_insn (\"addil L%%%1-%2,%0\", xoperands); - output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands); - } - else - { - output_asm_insn (\"addil L%%%1-$PIC_pcrel$0+8,%0\", xoperands); - output_asm_insn (\"ldo R%%%1-$PIC_pcrel$0+12(%0),%0\", - xoperands); - } + output_asm_insn (\"addil L%%%1-%2,%0\", xoperands); + output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands); } return \"\"; }" @@ -2699,8 +2866,10 @@ }") (define_insn "" - [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,!*q,!*f") - (match_operand:HI 1 "move_operand" "r,J,N,K,RQ,rM,!rM,!*fM"))] + [(set (match_operand:HI 0 "move_dest_operand" + "=r,r,r,r,r,Q,!*q,!*f") + (match_operand:HI 1 "move_src_operand" + "r,J,N,K,RQ,rM,!rM,!*fM"))] "register_operand (operands[0], HImode) || reg_or_0_operand (operands[1], HImode)" "@ @@ -2718,31 +2887,37 @@ (define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") - (mem:HI (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldhx|ldh} %2(%1),%0" + (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r") + (match_operand:SI 2 "int5_operand" "L")))) + (set (match_dup 1) + (plus:SI (match_dup 1) (match_dup 2)))] + "" + "{ldhs|ldh},mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) (define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") - (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldhx|ldh} %1(%2),%0" + (mem:HI (plus:DI (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L")))) + (set (match_dup 1) + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldh,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) -; Now zero extended variants. +; And a zero extended variant. (define_insn "" - [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (mem:HI - (plus:SI - (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldhx|ldh} %2(%1),%0" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (mem:HI + (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) + (set (match_dup 1) + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldh,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) @@ -2750,17 +2925,8 @@ [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (mem:HI (plus:SI - (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldhx|ldh} %1(%2),%0" - [(set_attr "type" "load") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:HI 0 "register_operand" "=r") - (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r") - (match_operand:SI 2 "int5_operand" "L")))) + (match_operand:SI 1 "register_operand" "+r") + (match_operand:SI 2 "int5_operand" "L"))))) (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))] "" @@ -2768,17 +2934,16 @@ [(set_attr "type" "load") (set_attr "length" "4")]) -; And a zero extended variant. (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (mem:HI - (plus:SI - (match_operand:SI 1 "register_operand" "+r") - (match_operand:SI 2 "int5_operand" "L"))))) + (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) (set (match_dup 1) - (plus:SI (match_dup 1) (match_dup 2)))] - "" - "{ldhs|ldh},mb %2(%1),%0" + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldh,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) @@ -2793,6 +2958,17 @@ [(set_attr "type" "store") (set_attr "length" "4")]) +(define_insn "" + [(set (mem:HI (plus:DI (match_operand:DI 0 "register_operand" "+r") + (match_operand:DI 1 "int5_operand" "L"))) + (match_operand:HI 2 "reg_or_0_operand" "rM")) + (set (match_dup 0) + (plus:DI (match_dup 0) (match_dup 1)))] + "TARGET_64BIT" + "sth,mb %r2,%1(%0)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + (define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") (plus:HI (match_operand:HI 1 "register_operand" "r") @@ -2814,8 +2990,10 @@ }") (define_insn "" - [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,!*q,!*f") - (match_operand:QI 1 "move_operand" "r,J,N,K,RQ,rM,!rM,!*fM"))] + [(set (match_operand:QI 0 "move_dest_operand" + "=r,r,r,r,r,Q,!*q,!*f") + (match_operand:QI 1 "move_src_operand" + "r,J,N,K,RQ,rM,!rM,!*fM"))] "register_operand (operands[0], QImode) || reg_or_0_operand (operands[1], QImode)" "@ @@ -2833,86 +3011,55 @@ (define_insn "" [(set (match_operand:QI 0 "register_operand" "=r") - (mem:QI (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %2(%1),%0" + (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r") + (match_operand:SI 2 "int5_operand" "L")))) + (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))] + "" + "{ldbs|ldb},mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) (define_insn "" [(set (match_operand:QI 0 "register_operand" "=r") - (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %1(%2),%0" + (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L")))) + (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldb,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) -; Indexed byte load with zero extension to SImode or HImode. +; Now the same thing with zero extensions. (define_insn "" - [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (mem:QI - (plus:SI - (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %2(%1),%0" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (mem:QI (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) + (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldb,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (mem:QI - (plus:SI - (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %1(%2),%0" - [(set_attr "type" "load") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:HI 0 "register_operand" "=r") - (zero_extend:HI (mem:QI - (plus:SI - (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %2(%1),%0" - [(set_attr "type" "load") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:HI 0 "register_operand" "=r") - (zero_extend:HI (mem:QI - (plus:SI - (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r")))))] - "! TARGET_DISABLE_INDEXING" - "{ldbx|ldb} %1(%2),%0" - [(set_attr "type" "load") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:QI 0 "register_operand" "=r") - (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r") - (match_operand:SI 2 "int5_operand" "L")))) + (zero_extend:SI (mem:QI (plus:SI + (match_operand:SI 1 "register_operand" "+r") + (match_operand:SI 2 "int5_operand" "L"))))) (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))] "" "{ldbs|ldb},mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) -; Now the same thing with zero extensions. (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (mem:QI (plus:SI - (match_operand:SI 1 "register_operand" "+r") - (match_operand:SI 2 "int5_operand" "L"))))) - (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))] - "" - "{ldbs|ldb},mb %2(%1),%0" + (zero_extend:SI (mem:QI (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) + (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldb,mb %2(%1),%0" [(set_attr "type" "load") (set_attr "length" "4")]) @@ -2927,6 +3074,17 @@ [(set_attr "type" "load") (set_attr "length" "4")]) +(define_insn "" + [(set (match_operand:HI 0 "register_operand" "=r") + (zero_extend:HI (mem:QI (plus:DI + (match_operand:DI 1 "register_operand" "+r") + (match_operand:DI 2 "int5_operand" "L"))))) + (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_64BIT" + "ldb,mb %2(%1),%0" + [(set_attr "type" "load") + (set_attr "length" "4")]) + (define_insn "" [(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "+r") (match_operand:SI 1 "int5_operand" "L"))) @@ -2938,21 +3096,32 @@ [(set_attr "type" "store") (set_attr "length" "4")]) +(define_insn "" + [(set (mem:QI (plus:DI (match_operand:DI 0 "register_operand" "+r") + (match_operand:DI 1 "int5_operand" "L"))) + (match_operand:QI 2 "reg_or_0_operand" "rM")) + (set (match_dup 0) + (plus:DI (match_dup 0) (match_dup 1)))] + "TARGET_64BIT" + "stb,mb %r2,%1(%0)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + ;; The definition of this insn does not really explain what it does, -;; but it should suffice -;; that anything generated as this insn will be recognized as one -;; and that it will not successfully combine with anything. +;; but it should suffice that anything generated as this insn will be +;; recognized as a movstrsi operation, and that it will not successfully +;; combine with anything. (define_expand "movstrsi" [(parallel [(set (match_operand:BLK 0 "" "") (match_operand:BLK 1 "" "")) - (clobber (match_scratch:SI 7 "")) - (clobber (match_scratch:SI 8 "")) (clobber (match_dup 4)) (clobber (match_dup 5)) (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) (use (match_operand:SI 2 "arith_operand" "")) (use (match_operand:SI 3 "const_int_operand" ""))])] - "!TARGET_64BIT" + "!TARGET_64BIT && optimize > 0" " { int size, align; @@ -2974,7 +3143,7 @@ If the size is large in respect to the known alignment, then use the library routines. - If the size is small in repsect to the known alignment, then open + If the size is small in respect to the known alignment, then open code the copy (since that will lead to better scheduling). Else use the block move pattern. */ @@ -2987,8 +3156,7 @@ align = INTVAL (operands[3]); align = align > 4 ? 4 : align; - /* If size/alignment > 8 (eg size is large in respect to alignment), - then use the library routines. */ + /* If size/alignment is large, then use the library routines. */ if (size / align > 16) FAIL; @@ -3006,28 +3174,470 @@ operands[4] = gen_reg_rtx (SImode); operands[5] = gen_reg_rtx (SImode); operands[6] = gen_reg_rtx (SImode); - operands[7] = XEXP (operands[0], 0); - operands[8] = XEXP (operands[1], 0); + operands[7] = gen_reg_rtx (SImode); + operands[8] = gen_reg_rtx (SImode); }") ;; The operand constraints are written like this to support both compile-time -;; and run-time determined byte count. If the count is run-time determined, -;; the register with the byte count is clobbered by the copying code, and -;; therefore it is forced to operand 2. If the count is compile-time -;; determined, we need two scratch registers for the unrolled code. -(define_insn "movstrsi_internal" +;; and run-time determined byte counts. The expander and output_block_move +;; only support compile-time determined counts at this time. +;; +;; If the count is run-time determined, the register with the byte count +;; is clobbered by the copying code, and therefore it is forced to operand 2. +;; +;; We used to clobber operands 0 and 1. However, a change to regrename.c +;; broke this semantic for pseudo registers. We can't use match_scratch +;; as this requires two registers in the class R1_REGS when the MEMs for +;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are +;; forced to internally copy operands 0 and 1 to operands 7 and 8, +;; respectively. We then split or peephole optimize after reload. +(define_insn "movstrsi_prereload" [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r")) (mem:BLK (match_operand:SI 1 "register_operand" "r,r"))) - (clobber (match_scratch:SI 7 "=0,0")) - (clobber (match_scratch:SI 8 "=1,1")) (clobber (match_operand:SI 2 "register_operand" "=r,r")) ;loop cnt/tmp - (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp + (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2 + (clobber (match_operand:SI 7 "register_operand" "=&r,&r")) ;item tmp3 + (clobber (match_operand:SI 8 "register_operand" "=&r,&r")) ;item tmp4 (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count (use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment "!TARGET_64BIT" + "#" + [(set_attr "type" "multi,multi")]) + +(define_split + [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" "")) + (mem:BLK (match_operand:SI 1 "register_operand" ""))) + (clobber (match_operand:SI 2 "register_operand" "")) + (clobber (match_operand:SI 3 "register_operand" "")) + (clobber (match_operand:SI 6 "register_operand" "")) + (clobber (match_operand:SI 7 "register_operand" "")) + (clobber (match_operand:SI 8 "register_operand" "")) + (use (match_operand:SI 4 "arith_operand" "")) + (use (match_operand:SI 5 "const_int_operand" ""))])] + "!TARGET_64BIT && reload_completed && !flag_peephole2" + [(set (match_dup 7) (match_dup 0)) + (set (match_dup 8) (match_dup 1)) + (parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8))) + (clobber (match_dup 2)) + (clobber (match_dup 3)) + (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) + (use (match_dup 4)) + (use (match_dup 5)) + (const_int 0)])] + "") + +(define_peephole2 + [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" "")) + (mem:BLK (match_operand:SI 1 "register_operand" ""))) + (clobber (match_operand:SI 2 "register_operand" "")) + (clobber (match_operand:SI 3 "register_operand" "")) + (clobber (match_operand:SI 6 "register_operand" "")) + (clobber (match_operand:SI 7 "register_operand" "")) + (clobber (match_operand:SI 8 "register_operand" "")) + (use (match_operand:SI 4 "arith_operand" "")) + (use (match_operand:SI 5 "const_int_operand" ""))])] + "!TARGET_64BIT" + [(parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8))) + (clobber (match_dup 2)) + (clobber (match_dup 3)) + (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) + (use (match_dup 4)) + (use (match_dup 5)) + (const_int 0)])] + " +{ + if (dead_or_set_p (curr_insn, operands[0])) + operands[7] = operands[0]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[7], operands[0])); + + if (dead_or_set_p (curr_insn, operands[1])) + operands[8] = operands[1]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[8], operands[1])); +}") + +(define_insn "movstrsi_postreload" + [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r")) + (mem:BLK (match_operand:SI 1 "register_operand" "r,r"))) + (clobber (match_operand:SI 2 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1 + (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2 + (clobber (match_dup 0)) + (clobber (match_dup 1)) + (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count + (use (match_operand:SI 5 "const_int_operand" "n,n")) ;alignment + (const_int 0)] + "!TARGET_64BIT && reload_completed" "* return output_block_move (operands, !which_alternative);" [(set_attr "type" "multi,multi")]) + +(define_expand "movstrdi" + [(parallel [(set (match_operand:BLK 0 "" "") + (match_operand:BLK 1 "" "")) + (clobber (match_dup 4)) + (clobber (match_dup 5)) + (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) + (use (match_operand:DI 2 "arith_operand" "")) + (use (match_operand:DI 3 "const_int_operand" ""))])] + "TARGET_64BIT && optimize > 0" + " +{ + int size, align; + + /* HP provides very fast block move library routine for the PA; + this routine includes: + + 4x4 byte at a time block moves, + 1x4 byte at a time with alignment checked at runtime with + attempts to align the source and destination as needed + 1x1 byte loop + + With that in mind, here's the heuristics to try and guess when + the inlined block move will be better than the library block + move: + + If the size isn't constant, then always use the library routines. + + If the size is large in respect to the known alignment, then use + the library routines. + + If the size is small in respect to the known alignment, then open + code the copy (since that will lead to better scheduling). + + Else use the block move pattern. */ + + /* Undetermined size, use the library routine. */ + if (GET_CODE (operands[2]) != CONST_INT) + FAIL; + + size = INTVAL (operands[2]); + align = INTVAL (operands[3]); + align = align > 8 ? 8 : align; + + /* If size/alignment is large, then use the library routines. */ + if (size / align > 16) + FAIL; + + /* This does happen, but not often enough to worry much about. */ + if (size / align < MOVE_RATIO) + FAIL; + + /* Fall through means we're going to use our block move pattern. */ + operands[0] + = replace_equiv_address (operands[0], + copy_to_mode_reg (DImode, XEXP (operands[0], 0))); + operands[1] + = replace_equiv_address (operands[1], + copy_to_mode_reg (DImode, XEXP (operands[1], 0))); + operands[4] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (DImode); + operands[6] = gen_reg_rtx (DImode); + operands[7] = gen_reg_rtx (DImode); + operands[8] = gen_reg_rtx (DImode); +}") + +;; The operand constraints are written like this to support both compile-time +;; and run-time determined byte counts. The expander and output_block_move +;; only support compile-time determined counts at this time. +;; +;; If the count is run-time determined, the register with the byte count +;; is clobbered by the copying code, and therefore it is forced to operand 2. +;; +;; We used to clobber operands 0 and 1. However, a change to regrename.c +;; broke this semantic for pseudo registers. We can't use match_scratch +;; as this requires two registers in the class R1_REGS when the MEMs for +;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are +;; forced to internally copy operands 0 and 1 to operands 7 and 8, +;; respectively. We then split or peephole optimize after reload. +(define_insn "movstrdi_prereload" + [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r")) + (mem:BLK (match_operand:DI 1 "register_operand" "r,r"))) + (clobber (match_operand:DI 2 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1 + (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2 + (clobber (match_operand:DI 7 "register_operand" "=&r,&r")) ;item tmp3 + (clobber (match_operand:DI 8 "register_operand" "=&r,&r")) ;item tmp4 + (use (match_operand:DI 4 "arith_operand" "J,2")) ;byte count + (use (match_operand:DI 5 "const_int_operand" "n,n"))] ;alignment + "TARGET_64BIT" + "#" + [(set_attr "type" "multi,multi")]) + +(define_split + [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" "")) + (mem:BLK (match_operand:DI 1 "register_operand" ""))) + (clobber (match_operand:DI 2 "register_operand" "")) + (clobber (match_operand:DI 3 "register_operand" "")) + (clobber (match_operand:DI 6 "register_operand" "")) + (clobber (match_operand:DI 7 "register_operand" "")) + (clobber (match_operand:DI 8 "register_operand" "")) + (use (match_operand:DI 4 "arith_operand" "")) + (use (match_operand:DI 5 "const_int_operand" ""))])] + "TARGET_64BIT && reload_completed && !flag_peephole2" + [(set (match_dup 7) (match_dup 0)) + (set (match_dup 8) (match_dup 1)) + (parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8))) + (clobber (match_dup 2)) + (clobber (match_dup 3)) + (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) + (use (match_dup 4)) + (use (match_dup 5)) + (const_int 0)])] + "") + +(define_peephole2 + [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" "")) + (mem:BLK (match_operand:DI 1 "register_operand" ""))) + (clobber (match_operand:DI 2 "register_operand" "")) + (clobber (match_operand:DI 3 "register_operand" "")) + (clobber (match_operand:DI 6 "register_operand" "")) + (clobber (match_operand:DI 7 "register_operand" "")) + (clobber (match_operand:DI 8 "register_operand" "")) + (use (match_operand:DI 4 "arith_operand" "")) + (use (match_operand:DI 5 "const_int_operand" ""))])] + "TARGET_64BIT" + [(parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8))) + (clobber (match_dup 2)) + (clobber (match_dup 3)) + (clobber (match_dup 6)) + (clobber (match_dup 7)) + (clobber (match_dup 8)) + (use (match_dup 4)) + (use (match_dup 5)) + (const_int 0)])] + " +{ + if (dead_or_set_p (curr_insn, operands[0])) + operands[7] = operands[0]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[7], operands[0])); + + if (dead_or_set_p (curr_insn, operands[1])) + operands[8] = operands[1]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[8], operands[1])); +}") + +(define_insn "movstrdi_postreload" + [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r")) + (mem:BLK (match_operand:DI 1 "register_operand" "r,r"))) + (clobber (match_operand:DI 2 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1 + (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2 + (clobber (match_dup 0)) + (clobber (match_dup 1)) + (use (match_operand:DI 4 "arith_operand" "J,2")) ;byte count + (use (match_operand:DI 5 "const_int_operand" "n,n")) ;alignment + (const_int 0)] + "TARGET_64BIT && reload_completed" + "* return output_block_move (operands, !which_alternative);" + [(set_attr "type" "multi,multi")]) + +(define_expand "clrstrsi" + [(parallel [(set (match_operand:BLK 0 "" "") + (const_int 0)) + (clobber (match_dup 3)) + (clobber (match_dup 4)) + (use (match_operand:SI 1 "arith_operand" "")) + (use (match_operand:SI 2 "const_int_operand" ""))])] + "!TARGET_64BIT && optimize > 0" + " +{ + int size, align; + + /* Undetermined size, use the library routine. */ + if (GET_CODE (operands[1]) != CONST_INT) + FAIL; + + size = INTVAL (operands[1]); + align = INTVAL (operands[2]); + align = align > 4 ? 4 : align; + + /* If size/alignment is large, then use the library routines. */ + if (size / align > 16) + FAIL; + + /* This does happen, but not often enough to worry much about. */ + if (size / align < MOVE_RATIO) + FAIL; + + /* Fall through means we're going to use our block clear pattern. */ + operands[0] + = replace_equiv_address (operands[0], + copy_to_mode_reg (SImode, XEXP (operands[0], 0))); + operands[3] = gen_reg_rtx (SImode); + operands[4] = gen_reg_rtx (SImode); +}") + +(define_insn "clrstrsi_prereload" + [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r")) + (const_int 0)) + (clobber (match_operand:SI 1 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_operand:SI 4 "register_operand" "=&r,&r")) ;tmp1 + (use (match_operand:SI 2 "arith_operand" "J,1")) ;byte count + (use (match_operand:SI 3 "const_int_operand" "n,n"))] ;alignment + "!TARGET_64BIT" + "#" + [(set_attr "type" "multi,multi")]) + +(define_split + [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" "")) + (const_int 0)) + (clobber (match_operand:SI 1 "register_operand" "")) + (clobber (match_operand:SI 4 "register_operand" "")) + (use (match_operand:SI 2 "arith_operand" "")) + (use (match_operand:SI 3 "const_int_operand" ""))])] + "!TARGET_64BIT && reload_completed && !flag_peephole2" + [(set (match_dup 4) (match_dup 0)) + (parallel [(set (mem:BLK (match_dup 4)) (const_int 0)) + (clobber (match_dup 1)) + (clobber (match_dup 4)) + (use (match_dup 2)) + (use (match_dup 3)) + (const_int 0)])] + "") + +(define_peephole2 + [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" "")) + (const_int 0)) + (clobber (match_operand:SI 1 "register_operand" "")) + (clobber (match_operand:SI 4 "register_operand" "")) + (use (match_operand:SI 2 "arith_operand" "")) + (use (match_operand:SI 3 "const_int_operand" ""))])] + "!TARGET_64BIT" + [(parallel [(set (mem:BLK (match_dup 4)) (const_int 0)) + (clobber (match_dup 1)) + (clobber (match_dup 4)) + (use (match_dup 2)) + (use (match_dup 3)) + (const_int 0)])] + " +{ + if (dead_or_set_p (curr_insn, operands[0])) + operands[4] = operands[0]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[4], operands[0])); +}") + +(define_insn "clrstrsi_postreload" + [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r")) + (const_int 0)) + (clobber (match_operand:SI 1 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_dup 0)) + (use (match_operand:SI 2 "arith_operand" "J,1")) ;byte count + (use (match_operand:SI 3 "const_int_operand" "n,n")) ;alignment + (const_int 0)] + "!TARGET_64BIT && reload_completed" + "* return output_block_clear (operands, !which_alternative);" + [(set_attr "type" "multi,multi")]) + +(define_expand "clrstrdi" + [(parallel [(set (match_operand:BLK 0 "" "") + (const_int 0)) + (clobber (match_dup 3)) + (clobber (match_dup 4)) + (use (match_operand:DI 1 "arith_operand" "")) + (use (match_operand:DI 2 "const_int_operand" ""))])] + "TARGET_64BIT && optimize > 0" + " +{ + int size, align; + + /* Undetermined size, use the library routine. */ + if (GET_CODE (operands[1]) != CONST_INT) + FAIL; + + size = INTVAL (operands[1]); + align = INTVAL (operands[2]); + align = align > 8 ? 8 : align; + + /* If size/alignment is large, then use the library routines. */ + if (size / align > 16) + FAIL; + + /* This does happen, but not often enough to worry much about. */ + if (size / align < MOVE_RATIO) + FAIL; + + /* Fall through means we're going to use our block clear pattern. */ + operands[0] + = replace_equiv_address (operands[0], + copy_to_mode_reg (DImode, XEXP (operands[0], 0))); + operands[3] = gen_reg_rtx (DImode); + operands[4] = gen_reg_rtx (DImode); +}") + +(define_insn "clrstrdi_prereload" + [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r")) + (const_int 0)) + (clobber (match_operand:DI 1 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_operand:DI 4 "register_operand" "=&r,&r")) ;item tmp1 + (use (match_operand:DI 2 "arith_operand" "J,1")) ;byte count + (use (match_operand:DI 3 "const_int_operand" "n,n"))] ;alignment + "TARGET_64BIT" + "#" + [(set_attr "type" "multi,multi")]) + +(define_split + [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" "")) + (const_int 0)) + (clobber (match_operand:DI 1 "register_operand" "")) + (clobber (match_operand:DI 4 "register_operand" "")) + (use (match_operand:DI 2 "arith_operand" "")) + (use (match_operand:DI 3 "const_int_operand" ""))])] + "TARGET_64BIT && reload_completed && !flag_peephole2" + [(set (match_dup 4) (match_dup 0)) + (parallel [(set (mem:BLK (match_dup 4)) (const_int 0)) + (clobber (match_dup 1)) + (clobber (match_dup 4)) + (use (match_dup 2)) + (use (match_dup 3)) + (const_int 0)])] + "") + +(define_peephole2 + [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" "")) + (const_int 0)) + (clobber (match_operand:DI 1 "register_operand" "")) + (clobber (match_operand:DI 4 "register_operand" "")) + (use (match_operand:DI 2 "arith_operand" "")) + (use (match_operand:DI 3 "const_int_operand" ""))])] + "TARGET_64BIT" + [(parallel [(set (mem:BLK (match_dup 4)) (const_int 0)) + (clobber (match_dup 1)) + (clobber (match_dup 4)) + (use (match_dup 2)) + (use (match_dup 3)) + (const_int 0)])] + " +{ + if (dead_or_set_p (curr_insn, operands[0])) + operands[4] = operands[0]; + else + emit_insn (gen_rtx_SET (VOIDmode, operands[4], operands[0])); +}") + +(define_insn "clrstrdi_postreload" + [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r")) + (const_int 0)) + (clobber (match_operand:DI 1 "register_operand" "=r,r")) ;loop cnt/tmp + (clobber (match_dup 0)) + (use (match_operand:DI 2 "arith_operand" "J,1")) ;byte count + (use (match_operand:DI 3 "const_int_operand" "n,n")) ;alignment + (const_int 0)] + "TARGET_64BIT && reload_completed" + "* return output_block_clear (operands, !which_alternative);" + [(set_attr "type" "multi,multi")]) ;; Floating point move insns @@ -3046,7 +3656,7 @@ "GET_CODE (operands[1]) == CONST_DOUBLE && operands[1] != CONST0_RTX (DFmode) && !TARGET_64BIT - && ! TARGET_SOFT_FLOAT" + && !TARGET_SOFT_FLOAT" "* return (which_alternative == 0 ? output_move_double (operands) : \"fldd%F1 %1,%0\");" [(set_attr "type" "move,fpload") @@ -3059,7 +3669,7 @@ " { if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT) - operands[1] = force_const_mem (DFmode, operands[1]); + operands[1] = force_const_mem (DFmode, operands[1]); if (emit_move_sequence (operands, DFmode, 0)) DONE; @@ -3099,16 +3709,16 @@ }") (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - "=f,*r,RQ,?o,?Q,f,*r,*r") + [(set (match_operand:DF 0 "move_dest_operand" + "=f,*r,Q,?o,?Q,f,*r,*r") (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" "fG,*rG,f,*r,*r,RQ,o,RQ"))] "(register_operand (operands[0], DFmode) || reg_or_0_operand (operands[1], DFmode)) - && ! (GET_CODE (operands[1]) == CONST_DOUBLE - && GET_CODE (operands[0]) == MEM) - && ! TARGET_64BIT - && ! TARGET_SOFT_FLOAT" + && !(GET_CODE (operands[1]) == CONST_DOUBLE + && GET_CODE (operands[0]) == MEM) + && !TARGET_64BIT + && !TARGET_SOFT_FLOAT" "* { if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]) @@ -3120,13 +3730,156 @@ (set_attr "length" "4,8,4,8,16,4,8,16")]) (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" + [(set (match_operand:DF 0 "indexed_memory_operand" "=R") + (match_operand:DF 1 "reg_or_0_operand" "f"))] + "!TARGET_SOFT_FLOAT + && !TARGET_DISABLE_INDEXING + && reload_completed" + "fstd%F0 %1,%0" + [(set_attr "type" "fpstore") + (set_attr "pa_combine_type" "addmove") + (set_attr "length" "4")]) + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 8)) + (match_operand:SI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 2 "register_operand" "") + (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 8)))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 8)) + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 2 "register_operand" "") + (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 8)))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:SI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:SI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:DI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DF (match_dup 0)) + (match_operand:DF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DF (plus:DI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:DF 0 "move_dest_operand" "=r,?o,?Q,r,r") (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" - "rG,r,r,o,Q"))] + "rG,r,r,o,RQ"))] "(register_operand (operands[0], DFmode) || reg_or_0_operand (operands[1], DFmode)) - && ! TARGET_64BIT + && !TARGET_64BIT && TARGET_SOFT_FLOAT" "* { @@ -3136,13 +3889,13 @@ (set_attr "length" "8,8,16,8,16")]) (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - "=r,r,r,r,r,Q,!*q,!f,f,*TR") - (match_operand:DF 1 "move_operand" - "r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))] + [(set (match_operand:DF 0 "move_dest_operand" + "=!*r,*r,*r,*r,*r,Q,!*q,f,f,T") + (match_operand:DF 1 "move_src_operand" + "!*r,J,N,K,RQ,*rM,!*rM,fM,RT,f"))] "(register_operand (operands[0], DFmode) || reg_or_0_operand (operands[1], DFmode)) - && ! TARGET_SOFT_FLOAT && TARGET_64BIT" + && !TARGET_SOFT_FLOAT && TARGET_64BIT" "@ copy %1,%0 ldi %1,%0 @@ -3158,50 +3911,15 @@ (set_attr "pa_combine_type" "addmove") (set_attr "length" "4,4,4,4,4,4,4,4,4,4")]) -(define_insn "" - [(set (match_operand:DF 0 "register_operand" "=fx") - (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{flddx|fldd} %2(%1),%0" - [(set_attr "type" "fpload") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:DF 0 "register_operand" "=fx") - (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{flddx|fldd} %1(%2),%0" - [(set_attr "type" "fpload") - (set_attr "length" "4")]) - -(define_insn "" - [(set (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))) - (match_operand:DF 0 "register_operand" "fx"))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fstdx|fstd} %0,%2(%1)" - [(set_attr "type" "fpstore") - (set_attr "length" "4")]) - -(define_insn "" - [(set (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))) - (match_operand:DF 0 "register_operand" "fx"))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fstdx|fstd} %0,%1(%2)" - [(set_attr "type" "fpstore") - (set_attr "length" "4")]) - + (define_expand "movdi" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "") + [(set (match_operand:DI 0 "general_operand" "") (match_operand:DI 1 "general_operand" ""))] "" " { if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT) - operands[1] = force_const_mem (DImode, operands[1]); + operands[1] = force_const_mem (DImode, operands[1]); if (emit_move_sequence (operands, DImode, 0)) DONE; @@ -3276,14 +3994,14 @@ (set_attr "length" "8")]) (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - "=r,o,Q,r,r,r,f,f,*TR") + [(set (match_operand:DI 0 "move_dest_operand" + "=r,o,Q,r,r,r,*f,*f,T") (match_operand:DI 1 "general_operand" - "rM,r,r,o*R,Q,i,fM,*TR,f"))] + "rM,r,r,o*R,Q,i,*fM,RT,*f"))] "(register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode)) - && ! TARGET_64BIT - && ! TARGET_SOFT_FLOAT" + && !TARGET_64BIT + && !TARGET_SOFT_FLOAT" "* { if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]) @@ -3295,13 +4013,13 @@ (set_attr "length" "8,8,16,8,16,16,4,4,4")]) (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - "=r,r,r,r,r,r,Q,!*q,!f,f,*TR") - (match_operand:DI 1 "move_operand" - "A,r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))] + [(set (match_operand:DI 0 "move_dest_operand" + "=r,r,r,r,r,r,Q,!*q,!*f,*f,T") + (match_operand:DI 1 "move_src_operand" + "A,r,J,N,K,RQ,rM,!rM,!*fM,RT,*f"))] "(register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode)) - && ! TARGET_SOFT_FLOAT && TARGET_64BIT" + && !TARGET_SOFT_FLOAT && TARGET_64BIT" "@ ldd RT'%A1,%0 copy %1,%0 @@ -3319,13 +4037,93 @@ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")]) (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" + [(set (match_operand:DI 0 "indexed_memory_operand" "=R") + (match_operand:DI 1 "register_operand" "f"))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && !TARGET_DISABLE_INDEXING + && reload_completed" + "fstd%F0 %1,%0" + [(set_attr "type" "fpstore") + (set_attr "pa_combine_type" "addmove") + (set_attr "length" "4")]) + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 8)) + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DI (match_dup 0)) + (match_operand:DI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DI (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 2 "register_operand" "") + (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 8)))) + (set (mem:DI (match_dup 0)) + (match_operand:DI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DI (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DI (match_dup 0)) + (match_operand:DI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DI (plus:DI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:DI (match_dup 0)) + (match_operand:DI 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:DI (plus:DI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:DI 0 "move_dest_operand" "=r,o,Q,r,r,r") (match_operand:DI 1 "general_operand" "rM,r,r,o,Q,i"))] "(register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode)) - && ! TARGET_64BIT + && !TARGET_64BIT && TARGET_SOFT_FLOAT" "* { @@ -3416,26 +4214,169 @@ }") (define_insn "" - [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand" - "=f,r,f,r,RQ,Q") + [(set (match_operand:SF 0 "move_dest_operand" + "=f,!*r,f,*r,Q,Q") (match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand" - "fG,rG,RQ,RQ,f,rG"))] + "fG,!*rG,RQ,RQ,f,*rG"))] "(register_operand (operands[0], SFmode) || reg_or_0_operand (operands[1], SFmode)) - && ! TARGET_SOFT_FLOAT" + && !TARGET_SOFT_FLOAT" "@ fcpy,sgl %f1,%0 copy %r1,%0 fldw%F1 %1,%0 ldw%M1 %1,%0 - fstw%F0 %r1,%0 + fstw%F0 %1,%0 stw%M0 %r1,%0" [(set_attr "type" "fpalu,move,fpload,load,fpstore,store") (set_attr "pa_combine_type" "addmove") (set_attr "length" "4,4,4,4,4,4")]) (define_insn "" - [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand" + [(set (match_operand:SF 0 "indexed_memory_operand" "=R") + (match_operand:SF 1 "register_operand" "f"))] + "!TARGET_SOFT_FLOAT + && !TARGET_DISABLE_INDEXING + && reload_completed" + "fstw%F0 %1,%0" + [(set_attr "type" "fpstore") + (set_attr "pa_combine_type" "addmove") + (set_attr "length" "4")]) + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 4)) + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 2 "register_operand" "") + (mult:SI (match_operand:SI 1 "register_operand" "") + (const_int 4)))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 4)) + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 2 "register_operand" "") + (mult:DI (match_operand:DI 1 "register_operand" "") + (const_int 4)))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4)) + (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:SI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:SI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[1]) + && (TARGET_NO_SPACE_REGS + || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:DI (match_dup 1) (match_dup 2))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] + "") + +(define_peephole2 + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" ""))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 3 "register_operand" ""))] + "!TARGET_SOFT_FLOAT + && TARGET_64BIT + && REG_OK_FOR_BASE_P (operands[2]) + && (TARGET_NO_SPACE_REGS + || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2]))) + && FP_REGNO_P (REGNO (operands[3]))" + [(set (mem:SF (plus:DI (match_dup 2) (match_dup 1))) + (match_dup 3)) + (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:SF 0 "move_dest_operand" "=r,r,Q") (match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand" "rG,RQ,rG"))] @@ -3450,41 +4391,6 @@ (set_attr "pa_combine_type" "addmove") (set_attr "length" "4,4,4")]) -(define_insn "" - [(set (match_operand:SF 0 "register_operand" "=fx") - (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fldwx|fldw} %2(%1),%0" - [(set_attr "type" "fpload") - (set_attr "length" "4")]) - -(define_insn "" - [(set (match_operand:SF 0 "register_operand" "=fx") - (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fldwx|fldw} %1(%2),%0" - [(set_attr "type" "fpload") - (set_attr "length" "4")]) - -(define_insn "" - [(set (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r") - (match_operand:SI 2 "register_operand" "r"))) - (match_operand:SF 0 "register_operand" "fx"))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fstwx|fstw} %0,%2(%1)" - [(set_attr "type" "fpstore") - (set_attr "length" "4")]) - -(define_insn "" - [(set (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "basereg_operand" "r"))) - (match_operand:SF 0 "register_operand" "fx"))] - "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT" - "{fstwx|fstw} %0,%1(%2)" - [(set_attr "type" "fpstore") - (set_attr "length" "4")]) ;;- zero extension instructions @@ -3493,24 +4399,6 @@ ;; memory operands. This gives us better overall code than just ;; having a pattern that does or does not accept memory operands. -(define_expand "zero_extendhisi2" - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI - (match_operand:HI 1 "register_operand" "")))] - "" - "") - -(define_insn "" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (zero_extend:SI - (match_operand:HI 1 "move_operand" "r,RQ")))] - "GET_CODE (operands[1]) != CONST_INT" - "@ - {extru|extrw,u} %1,31,16,%0 - ldh%M1 %1,%0" - [(set_attr "type" "shift,load") - (set_attr "length" "4,4")]) - (define_expand "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI @@ -3521,7 +4409,7 @@ (define_insn "" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI - (match_operand:QI 1 "move_operand" "r,RQ")))] + (match_operand:QI 1 "move_src_operand" "r,RQ")))] "GET_CODE (operands[1]) != CONST_INT" "@ {extru|extrw,u} %1,31,8,%0 @@ -3539,7 +4427,7 @@ (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r,r") (zero_extend:SI - (match_operand:QI 1 "move_operand" "r,RQ")))] + (match_operand:QI 1 "move_src_operand" "r,RQ")))] "GET_CODE (operands[1]) != CONST_INT" "@ {extru|extrw,u} %1,31,8,%0 @@ -3547,29 +4435,77 @@ [(set_attr "type" "shift,load") (set_attr "length" "4,4")]) -(define_insn "zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))] +(define_expand "zero_extendhisi2" + [(set (match_operand:SI 0 "register_operand" "") + (zero_extend:SI + (match_operand:HI 1 "register_operand" "")))] + "" + "") + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (zero_extend:SI + (match_operand:HI 1 "move_src_operand" "r,RQ")))] + "GET_CODE (operands[1]) != CONST_INT" + "@ + {extru|extrw,u} %1,31,16,%0 + ldh%M1 %1,%0" + [(set_attr "type" "shift,load") + (set_attr "length" "4,4")]) + +(define_expand "zero_extendqidi2" + [(set (match_operand:DI 0 "register_operand" "") + (zero_extend:DI + (match_operand:QI 1 "register_operand" "")))] "TARGET_64BIT" - "extrd,u %1,63,8,%0" - [(set_attr "type" "shift") - (set_attr "length" "4")]) + "") -(define_insn "zero_extendhidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))] +(define_insn "" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (zero_extend:DI + (match_operand:QI 1 "move_src_operand" "r,RQ")))] + "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT" + "@ + extrd,u %1,63,8,%0 + ldb%M1 %1,%0" + [(set_attr "type" "shift,load") + (set_attr "length" "4,4")]) + +(define_expand "zero_extendhidi2" + [(set (match_operand:DI 0 "register_operand" "") + (zero_extend:DI + (match_operand:HI 1 "register_operand" "")))] "TARGET_64BIT" - "extrd,u %1,63,16,%0" - [(set_attr "type" "shift") - (set_attr "length" "4")]) + "") -(define_insn "zero_extendsidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))] +(define_insn "" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (zero_extend:DI + (match_operand:HI 1 "move_src_operand" "r,RQ")))] + "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT" + "@ + extrd,u %1,63,16,%0 + ldh%M1 %1,%0" + [(set_attr "type" "shift,load") + (set_attr "length" "4,4")]) + +(define_expand "zero_extendsidi2" + [(set (match_operand:DI 0 "register_operand" "") + (zero_extend:DI + (match_operand:SI 1 "register_operand" "")))] "TARGET_64BIT" - "extrd,u %1,63,32,%0" - [(set_attr "type" "shift") - (set_attr "length" "4")]) + "") + +(define_insn "" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (zero_extend:DI + (match_operand:SI 1 "move_src_operand" "r,RQ")))] + "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT" + "@ + extrd,u %1,63,32,%0 + ldw%M1 %1,%0" + [(set_attr "type" "shift,load") + (set_attr "length" "4,4")]) ;;- sign extension instructions @@ -3874,7 +4810,7 @@ (match_operand:DI 2 "arith_operand" "r,J")))] "TARGET_64BIT" "@ - {addl|add,l} %1,%2,%0 + add,l %1,%2,%0 ldo %2(%1),%0" [(set_attr "type" "binary,binary") (set_attr "pa_combine_type" "addmove") @@ -4039,8 +4975,8 @@ ;; The mulsi3 insns set up registers for the millicode call. (define_expand "mulsi3" - [(set (reg:SI 26) (match_operand:SI 1 "move_operand" "")) - (set (reg:SI 25) (match_operand:SI 2 "move_operand" "")) + [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" "")) + (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" "")) (parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25))) (clobber (match_dup 3)) (clobber (reg:SI 26)) @@ -4051,14 +4987,15 @@ " { operands[4] = gen_rtx_REG (SImode, TARGET_64BIT ? 2 : 31); - if (TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT) + if (TARGET_PA_11 && !TARGET_DISABLE_FPREGS && !TARGET_SOFT_FLOAT) { rtx scratch = gen_reg_rtx (DImode); operands[1] = force_reg (SImode, operands[1]); operands[2] = force_reg (SImode, operands[2]); emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2])); - emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_SUBREG (SImode, scratch, GET_MODE_SIZE (SImode)))); + emit_insn (gen_movsi (operands[0], + gen_rtx_SUBREG (SImode, scratch, + GET_MODE_SIZE (SImode)))); DONE; } operands[3] = gen_reg_rtx (SImode); @@ -4163,8 +5100,8 @@ ;;; Division and mod. (define_expand "divsi3" - [(set (reg:SI 26) (match_operand:SI 1 "move_operand" "")) - (set (reg:SI 25) (match_operand:SI 2 "move_operand" "")) + [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" "")) + (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" "")) (parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25))) (clobber (match_dup 3)) (clobber (match_dup 4)) @@ -4219,8 +5156,8 @@ (set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))]) (define_expand "udivsi3" - [(set (reg:SI 26) (match_operand:SI 1 "move_operand" "")) - (set (reg:SI 25) (match_operand:SI 2 "move_operand" "")) + [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" "")) + (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" "")) (parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25))) (clobber (match_dup 3)) (clobber (match_dup 4)) @@ -4276,8 +5213,8 @@ (set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))]) (define_expand "modsi3" - [(set (reg:SI 26) (match_operand:SI 1 "move_operand" "")) - (set (reg:SI 25) (match_operand:SI 2 "move_operand" "")) + [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" "")) + (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" "")) (parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25))) (clobber (match_dup 3)) (clobber (match_dup 4)) @@ -4328,8 +5265,8 @@ (set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))]) (define_expand "umodsi3" - [(set (reg:SI 26) (match_operand:SI 1 "move_operand" "")) - (set (reg:SI 25) (match_operand:SI 2 "move_operand" "")) + [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" "")) + (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" "")) (parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25))) (clobber (match_dup 3)) (clobber (match_dup 4)) @@ -4385,15 +5322,25 @@ (define_expand "anddi3" [(set (match_operand:DI 0 "register_operand" "") - (and:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] + (and:DI (match_operand:DI 1 "and_operand" "") + (match_operand:DI 2 "and_operand" "")))] "" " { - if (! register_operand (operands[1], DImode) - || ! register_operand (operands[2], DImode)) - /* Let GCC break this into word-at-a-time operations. */ - FAIL; + if (TARGET_64BIT) + { + /* One operand must be a register operand. */ + if (!register_operand (operands[1], DImode) + && !register_operand (operands[2], DImode)) + FAIL; + } + else + { + /* Both operands must be register operands. */ + if (!register_operand (operands[1], DImode) + || !register_operand (operands[2], DImode)) + FAIL; + } }") (define_insn "" @@ -4454,15 +5401,25 @@ (define_expand "iordi3" [(set (match_operand:DI 0 "register_operand" "") - (ior:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] + (ior:DI (match_operand:DI 1 "ior_operand" "") + (match_operand:DI 2 "ior_operand" "")))] "" " { - if (! register_operand (operands[1], DImode) - || ! register_operand (operands[2], DImode)) - /* Let GCC break this into word-at-a-time operations. */ - FAIL; + if (TARGET_64BIT) + { + /* One operand must be a register operand. */ + if (!register_operand (operands[1], DImode) + && !register_operand (operands[2], DImode)) + FAIL; + } + else + { + /* Both operands must be register operands. */ + if (!register_operand (operands[1], DImode) + || !register_operand (operands[2], DImode)) + FAIL; + } }") (define_insn "" @@ -4525,15 +5482,11 @@ (define_expand "xordi3" [(set (match_operand:DI 0 "register_operand" "") - (xor:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] + (xor:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "register_operand" "")))] "" " { - if (! register_operand (operands[1], DImode) - || ! register_operand (operands[2], DImode)) - /* Let GCC break this into word-at-a-time operations. */ - FAIL; }") (define_insn "" @@ -4595,12 +5548,10 @@ (define_expand "one_cmpldi2" [(set (match_operand:DI 0 "register_operand" "") - (not:DI (match_operand:DI 1 "arith_double_operand" "")))] + (not:DI (match_operand:DI 1 "register_operand" "")))] "" " { - if (! register_operand (operands[1], DImode)) - FAIL; }") (define_insn "" @@ -5695,35 +6646,48 @@ DONE; }") -;; Special because we use the value placed in %r2 by the bl instruction -;; from within its delay slot to set the value for the 2nd parameter to -;; the call. -(define_insn "call_profiler" - [(call (mem:SI (match_operand 0 "call_operand_address" "")) - (match_operand 1 "" "")) - (use (match_operand 2 "" "")) - (use (reg:SI 25)) - (use (reg:SI 26)) - (clobber (reg:SI 2))] +; Used by hppa_profile_hook to load the starting address of the current +; function; operand 1 contains the address of the label in operand 3 +(define_insn "load_offset_label_address" + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_operand:SI 1 "register_operand" "r") + (minus:SI (match_operand:SI 2 "" "") + (label_ref:SI (match_operand 3 "" "")))))] "" + "ldo %2-%l3(%1),%0" + [(set_attr "type" "multi") + (set_attr "length" "4")]) + +; Output a code label and load its address. +(define_insn "lcla1" + [(set (match_operand:SI 0 "register_operand" "=r") + (label_ref:SI (match_operand 1 "" ""))) + (const_int 0)] + "!TARGET_PA_20" "* { - rtx xoperands[3]; - - output_arg_descriptor (insn); - - xoperands[0] = operands[0]; - xoperands[1] = operands[2]; - xoperands[2] = gen_label_rtx (); - output_asm_insn (\"{bl|b,l} %0,%%r2\;ldo %1-%2(%%r2),%%r25\", xoperands); - + output_asm_insn (\"bl .+8,%0\;depi 0,31,2,%0\", operands); (*targetm.asm_out.internal_label) (asm_out_file, \"L\", - CODE_LABEL_NUMBER (xoperands[2])); + CODE_LABEL_NUMBER (operands[1])); return \"\"; }" [(set_attr "type" "multi") (set_attr "length" "8")]) +(define_insn "lcla2" + [(set (match_operand:SI 0 "register_operand" "=r") + (label_ref:SI (match_operand 1 "" ""))) + (const_int 0)] + "TARGET_PA_20" + "* +{ + (*targetm.asm_out.internal_label) (asm_out_file, \"L\", + CODE_LABEL_NUMBER (operands[1])); + return \"mfia %0\"; +}" + [(set_attr "type" "move") + (set_attr "length" "4")]) + (define_insn "blockage" [(unspec_volatile [(const_int 2)] 0)] "" @@ -5735,9 +6699,6 @@ "" "* { - if (GET_MODE (insn) == SImode) - return \"b %l0%#\"; - /* An unconditional branch which can reach its target. */ if (get_attr_length (insn) != 24 && get_attr_length (insn) != 16) @@ -5761,6 +6722,24 @@ (const_int 24))] (const_int 4)))]) +;;; Hope this is only within a function... +(define_insn "indirect_jump" + [(set (pc) (match_operand 0 "register_operand" "r"))] + "GET_MODE (operands[0]) == word_mode" + "bv%* %%r0(%0)" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +;;; This jump is used in branch tables where the insn length is fixed. +;;; The length of this insn is adjusted if the delay slot is not filled. +(define_insn "short_jump" + [(set (pc) (label_ref (match_operand 0 "" ""))) + (const_int 0)] + "" + "b%* %l0%#" + [(set_attr "type" "btable_branch") + (set_attr "length" "4")]) + ;; Subroutines of "casesi". ;; operand 0 is index ;; operand 1 is the minimum bound @@ -5782,14 +6761,13 @@ if (operands[1] != const0_rtx) { - rtx reg = gen_reg_rtx (SImode); + rtx index = gen_reg_rtx (SImode); operands[1] = GEN_INT (-INTVAL (operands[1])); if (!INT_14_BITS (operands[1])) operands[1] = force_reg (SImode, operands[1]); - emit_insn (gen_addsi3 (reg, operands[0], operands[1])); - - operands[0] = reg; + emit_insn (gen_addsi3 (index, operands[0], operands[1])); + operands[0] = index; } /* In 64bit mode we must make sure to wipe the upper bits of the register @@ -5797,38 +6775,118 @@ high part of the register. */ if (TARGET_64BIT) { - rtx reg = gen_reg_rtx (DImode); - emit_insn (gen_extendsidi2 (reg, operands[0])); - operands[0] = gen_rtx_SUBREG (SImode, reg, 4); + rtx index = gen_reg_rtx (DImode); + + emit_insn (gen_extendsidi2 (index, operands[0])); + operands[0] = gen_rtx_SUBREG (SImode, index, 4); } if (!INT_5_BITS (operands[2])) operands[2] = force_reg (SImode, operands[2]); + /* This branch prevents us finding an insn for the delay slot of the + following vectored branch. It might be possible to use the delay + slot if an index value of -1 was used to transfer to the out-of-range + label. In order to do this, we would have to output the -1 vector + element after the delay insn. The casesi output code would have to + check if the casesi insn is in a delay branch sequence and output + the delay insn if one is found. If this was done, then it might + then be worthwhile to split the casesi patterns to improve scheduling. + However, it's not clear that all this extra complexity is worth + the effort. */ emit_insn (gen_cmpsi (operands[0], operands[2])); emit_jump_insn (gen_bgtu (operands[4])); + if (TARGET_BIG_SWITCH) { - rtx temp = gen_reg_rtx (SImode); - emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[0], operands[0])); - operands[0] = temp; + if (TARGET_64BIT) + { + rtx tmp1 = gen_reg_rtx (DImode); + rtx tmp2 = gen_reg_rtx (DImode); + + emit_jump_insn (gen_casesi64p (operands[0], operands[3], + tmp1, tmp2)); + } + else + { + rtx tmp1 = gen_reg_rtx (SImode); + + if (flag_pic) + { + rtx tmp2 = gen_reg_rtx (SImode); + + emit_jump_insn (gen_casesi32p (operands[0], operands[3], + tmp1, tmp2)); + } + else + emit_jump_insn (gen_casesi32 (operands[0], operands[3], tmp1)); + } } - emit_jump_insn (gen_casesi0 (operands[0], operands[3])); + else + emit_jump_insn (gen_casesi0 (operands[0], operands[3])); DONE; }") +;;; The rtl for this pattern doesn't accurately describe what the insn +;;; actually does, particularly when case-vector elements are exploded +;;; in pa_reorg. However, the initial SET in these patterns must show +;;; the connection of the insn to the following jump table. (define_insn "casesi0" - [(set (pc) (plus:SI - (mem:SI (plus:SI (pc) - (match_operand:SI 0 "register_operand" "r"))) - (label_ref (match_operand 1 "" ""))))] + [(set (pc) (mem:SI (plus:SI + (mult:SI (match_operand:SI 0 "register_operand" "r") + (const_int 4)) + (label_ref (match_operand 1 "" "")))))] "" - "blr %0,%%r0\;nop" + "blr,n %0,%%r0\;nop" [(set_attr "type" "multi") (set_attr "length" "8")]) -;; Need nops for the calls because execution is supposed to continue -;; past; we don't want to nullify an instruction that we need. +;;; 32-bit code, absolute branch table. +(define_insn "casesi32" + [(set (pc) (mem:SI (plus:SI + (mult:SI (match_operand:SI 0 "register_operand" "r") + (const_int 4)) + (label_ref (match_operand 1 "" ""))))) + (clobber (match_operand:SI 2 "register_operand" "=&r"))] + "!TARGET_64BIT && TARGET_BIG_SWITCH" + "ldil L'%l1,%2\;ldo R'%l1(%2),%2\;{ldwx|ldw},s %0(%2),%2\;bv,n %%r0(%2)" + [(set_attr "type" "multi") + (set_attr "length" "16")]) + +;;; 32-bit code, relative branch table. +(define_insn "casesi32p" + [(set (pc) (mem:SI (plus:SI + (mult:SI (match_operand:SI 0 "register_operand" "r") + (const_int 4)) + (label_ref (match_operand 1 "" ""))))) + (clobber (match_operand:SI 2 "register_operand" "=&a")) + (clobber (match_operand:SI 3 "register_operand" "=&r"))] + "!TARGET_64BIT && TARGET_BIG_SWITCH" + "{bl .+8,%2\;depi 0,31,2,%2|mfia %2}\;ldo {16|20}(%2),%2\;\ +{ldwx|ldw},s %0(%2),%3\;{addl|add,l} %2,%3,%3\;bv,n %%r0(%3)" + [(set_attr "type" "multi") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_PA_20") (const_int 0)) + (const_int 20) + (const_int 24)))]) + +;;; 64-bit code, 32-bit relative branch table. +(define_insn "casesi64p" + [(set (pc) (mem:DI (plus:DI + (mult:DI (sign_extend:DI + (match_operand:SI 0 "register_operand" "r")) + (const_int 8)) + (label_ref (match_operand 1 "" ""))))) + (clobber (match_operand:DI 2 "register_operand" "=&r")) + (clobber (match_operand:DI 3 "register_operand" "=&r"))] + "TARGET_64BIT && TARGET_BIG_SWITCH" + "mfia %2\;ldo 24(%2),%2\;ldw,s %0(%2),%3\;extrd,s %3,63,32,%3\;\ +add,l %2,%3,%3\;bv,n %%r0(%3)" + [(set_attr "type" "multi") + (set_attr "length" "24")]) + + +;; Call patterns. ;;- jump to subroutine (define_expand "call" @@ -7137,14 +8195,6 @@ DONE; }") -;;; Hope this is only within a function... -(define_insn "indirect_jump" - [(set (pc) (match_operand 0 "register_operand" "r"))] - "GET_MODE (operands[0]) == word_mode" - "bv%* %%r0(%0)" - [(set_attr "type" "branch") - (set_attr "length" "4")]) - ;;; Operands 2 and 3 are assumed to be CONST_INTs. (define_expand "extzv" [(set (match_operand 0 "register_operand" "") @@ -7718,11 +8768,11 @@ ;; Clean up turds left by reload. (define_peephole - [(set (match_operand 0 "reg_or_nonsymb_mem_operand" "") + [(set (match_operand 0 "move_dest_operand" "") (match_operand 1 "register_operand" "fr")) (set (match_operand 2 "register_operand" "fr") (match_dup 0))] - "! TARGET_SOFT_FLOAT + "!TARGET_SOFT_FLOAT && GET_CODE (operands[0]) == MEM && ! MEM_VOLATILE_P (operands[0]) && GET_MODE (operands[0]) == GET_MODE (operands[1]) @@ -7758,10 +8808,10 @@ (define_peephole [(set (match_operand 0 "register_operand" "fr") - (match_operand 1 "reg_or_nonsymb_mem_operand" "")) + (match_operand 1 "move_src_operand" "")) (set (match_operand 2 "register_operand" "fr") (match_dup 1))] - "! TARGET_SOFT_FLOAT + "!TARGET_SOFT_FLOAT && GET_CODE (operands[1]) == MEM && ! MEM_VOLATILE_P (operands[1]) && GET_MODE (operands[0]) == GET_MODE (operands[1]) @@ -7792,29 +8842,59 @@ return \"\"; }") -;; Flush the I and D cache line found at the address in operand 0. +;; Flush the I and D cache lines from the start address (operand0) +;; to the end address (operand1). No lines are flushed if the end +;; address is less than the start address (unsigned). +;; +;; Because the range of memory flushed is variable and the size of +;; a MEM can only be a CONST_INT, the patterns specify that they +;; perform an unspecified volatile operation on all memory. +;; +;; The address range for an icache flush must lie within a single +;; space on targets with non-equivalent space registers. +;; ;; This is used by the trampoline code for nested functions. -;; So long as the trampoline itself is less than 32 bytes this -;; is sufficient. - +;; +;; Operand 0 contains the start address. +;; Operand 1 contains the end address. +;; Operand 2 contains the line length to use. +;; Operand 3 contains the start address (clobbered). +;; Operands 4 and 5 (icacheflush) are clobbered scratch registers. (define_insn "dcacheflush" - [(unspec_volatile [(const_int 1)] 0) - (use (mem:SI (match_operand 0 "pmode_register_operand" "r"))) - (use (mem:SI (match_operand 1 "pmode_register_operand" "r")))] + [(const_int 1) + (unspec_volatile [(mem:BLK (scratch))] 0) + (use (match_operand 0 "pmode_register_operand" "r")) + (use (match_operand 1 "pmode_register_operand" "r")) + (use (match_operand 2 "pmode_register_operand" "r")) + (clobber (match_scratch 3 "=&0"))] "" - "fdc 0(%0)\;fdc 0(%1)\;sync" + "* +{ + if (TARGET_64BIT) + return \"cmpb,*<<=,n %3,%1,.\;fdc,m %2(%3)\;sync\"; + else + return \"cmpb,<<=,n %3,%1,.\;fdc,m %2(%3)\;sync\"; +}" [(set_attr "type" "multi") (set_attr "length" "12")]) (define_insn "icacheflush" - [(unspec_volatile [(const_int 2)] 0) - (use (mem:SI (match_operand 0 "pmode_register_operand" "r"))) - (use (mem:SI (match_operand 1 "pmode_register_operand" "r"))) + [(const_int 2) + (unspec_volatile [(mem:BLK (scratch))] 0) + (use (match_operand 0 "pmode_register_operand" "r")) + (use (match_operand 1 "pmode_register_operand" "r")) (use (match_operand 2 "pmode_register_operand" "r")) - (clobber (match_operand 3 "pmode_register_operand" "=&r")) - (clobber (match_operand 4 "pmode_register_operand" "=&r"))] + (clobber (match_scratch 3 "=&0")) + (clobber (match_operand 4 "pmode_register_operand" "=&r")) + (clobber (match_operand 5 "pmode_register_operand" "=&r"))] "" - "mfsp %%sr0,%4\;ldsid (%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop" + "* +{ + if (TARGET_64BIT) + return \"mfsp %%sr0,%5\;ldsid (%3),%4\;mtsp %4,%%sr0\;cmpb,*<<=,n %3,%1,.\;fic,m %2(%%sr0,%3)\;sync\;mtsp %5,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop\"; + else + return \"mfsp %%sr0,%5\;ldsid (%3),%4\;mtsp %4,%%sr0\;cmpb,<<=,n %3,%1,.\;fic,m %2(%%sr0,%3)\;sync\;mtsp %5,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop\"; +}" [(set_attr "type" "multi") (set_attr "length" "52")]) diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h index fae73922a98..ae52cd0a30e 100644 --- a/gcc/config/pa/som.h +++ b/gcc/config/pa/som.h @@ -234,7 +234,7 @@ do { \ #define EXTRA_SECTION_FUNCTIONS \ extern void readonly_data (void); \ void \ -readonly_data () \ +readonly_data (void) \ { \ if (in_section != in_readonly_data) \ { \ @@ -332,8 +332,8 @@ readonly_data () \ #define DO_GLOBAL_DTORS_BODY \ do { \ - extern void __gcc_plt_call (); \ - void (*reference)() = &__gcc_plt_call; \ + extern void __gcc_plt_call (void); \ + void (*reference)(void) = &__gcc_plt_call; \ func_ptr *p; \ __asm__ ("" : : "r" (reference)); \ for (p = __DTOR_LIST__ + 1; *p; ) \ diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h index c29d8d30fee..33e91d15135 100644 --- a/gcc/config/ptx4.h +++ b/gcc/config/ptx4.h @@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -#undef DWARF_DEBUGGING_INFO #define DWARF2_DEBUGGING_INFO 1 /* Cpp, assembler, linker, library, and startfile spec's. */ diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 97897b88ca7..e6d8e1f1c86 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -241,3 +241,8 @@ /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION ; + +/* No version of AIX fully supports AltiVec or 64-bit instructions in + 32-bit mode. */ +#define OS_MISSING_POWERPC64 1 +#define OS_MISSING_ALTIVEC 1 diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index d7718fee98b..c98d6ea3743 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -1094,7 +1094,7 @@ vec_vcmpgtub (vector unsigned char a1, vector unsigned char a2) inline vector signed int vec_cmple (vector float a1, vector float a2) { - return (vector signed int) __builtin_altivec_vcmpgefp ((vector float) a1, (vector float) a2); + return (vector signed int) __builtin_altivec_vcmpgefp ((vector float) a2, (vector float) a1); } /* vec_cmplt */ @@ -5526,7 +5526,7 @@ vec_all_nlt (vector float a1, vector float a2) inline int vec_all_numeric (vector float a1) { - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1); + return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1); } /* vec_any_eq */ @@ -6521,7 +6521,7 @@ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ ((vector signed char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \ __altivec_link_error_invalid_argument ()) -#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a1), (a2)) +#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a2), (a1)) #define vec_cmplt(a2, a1) \ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ @@ -8343,7 +8343,7 @@ __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \ #define vec_all_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)) -#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)) +#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)) #define vec_any_eq(a1, a2) \ __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \ diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 329e3b9b5b6..73d0417771d 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -113,26 +113,10 @@ (define_split [(set (match_operand:V4SI 0 "nonimmediate_operand" "") (match_operand:V4SI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64 + "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") - -(define_split - [(set (match_operand:V4SI 0 "nonimmediate_operand" "") - (match_operand:V4SI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64 - && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] -"{ - rs6000_split_multireg_move (operands); -}") + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_split [(set (match_operand:V4SI 0 "altivec_register_operand" "") @@ -175,26 +159,10 @@ (define_split [(set (match_operand:V8HI 0 "nonimmediate_operand" "") (match_operand:V8HI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64 + "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") - -(define_split - [(set (match_operand:V8HI 0 "nonimmediate_operand" "") - (match_operand:V8HI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64 - && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] -"{ - rs6000_split_multireg_move (operands); -}") + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_split [(set (match_operand:V8HI 0 "altivec_register_operand" "") @@ -237,26 +205,10 @@ (define_split [(set (match_operand:V16QI 0 "nonimmediate_operand" "") (match_operand:V16QI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64 + "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") - -(define_split - [(set (match_operand:V16QI 0 "nonimmediate_operand" "") - (match_operand:V16QI 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64 - && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] -"{ - rs6000_split_multireg_move (operands); -}") + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_split [(set (match_operand:V16QI 0 "altivec_register_operand" "") @@ -299,26 +251,10 @@ (define_split [(set (match_operand:V4SF 0 "nonimmediate_operand" "") (match_operand:V4SF 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64 - && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") - -(define_split - [(set (match_operand:V4SF 0 "nonimmediate_operand" "") - (match_operand:V4SF 1 "input_operand" ""))] - "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64 + "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] -"{ - rs6000_split_multireg_move (operands); -}") + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_insn "get_vrsave_internal" [(set (match_operand:SI 0 "register_operand" "=r") @@ -670,7 +606,7 @@ (match_operand:V16QI 2 "register_operand" "v") (match_operand:V4SI 3 "register_operand" "v")] 66))] "TARGET_ALTIVEC" - "vmsumubm %0,%1,%2,%3" + "vmsummbm %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) (define_insn "altivec_vmsumuhm" diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 15e3f24c336..c77279d2142 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -71,6 +71,7 @@ #define SUBTARGET_OVERRIDE_OPTIONS \ do { \ rs6000_altivec_abi = 1; \ + rs6000_altivec_vrsave = 1; \ if (DEFAULT_ABI == ABI_DARWIN) \ { \ if (MACHO_DYNAMIC_NO_PIC_P) \ @@ -97,9 +98,14 @@ do { \ %{static: %{Zdynamic: %e conflicting code gen style switches are used}}\ %{!static:%{!mdynamic-no-pic:-fPIC}}" +/* It's virtually impossible to predict all the possible combinations + of -mcpu and -maltivec and whatnot, so just supply + -force_cpusubtype_ALL if any are seen. Radar 3492132 against the + assembler is asking for a .machine directive so we could get this + really right. */ #define ASM_SPEC "-arch ppc \ %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ - %{!Zforce_cpusubtype_ALL:%{faltivec:-force_cpusubtype_ALL}}" + %{!Zforce_cpusubtype_ALL:%{maltivec|mcpu=*|mpowerpc64:-force_cpusubtype_ALL}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 63471ea7b1f..338143c2dfc 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -74,17 +74,17 @@ rs6000_current_abi = ABI_AIX; \ error (INVALID_64BIT, "call"); \ } \ - if (TARGET_RELOCATABLE) \ + if (target_flags & MASK_RELOCATABLE) \ { \ target_flags &= ~MASK_RELOCATABLE; \ error (INVALID_64BIT, "relocatable"); \ } \ - if (TARGET_EABI) \ + if (target_flags & MASK_EABI) \ { \ target_flags &= ~MASK_EABI; \ error (INVALID_64BIT, "eabi"); \ } \ - if (TARGET_PROTOTYPE) \ + if (target_flags & MASK_PROTOTYPE) \ { \ target_flags &= ~MASK_PROTOTYPE; \ error (INVALID_64BIT, "prototype"); \ diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 35af1676152..79679f44a6c 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -125,7 +125,7 @@ extern int mfcr_operation (rtx, enum machine_mode); extern int mtcrf_operation (rtx, enum machine_mode); extern int lmw_operation (rtx, enum machine_mode); extern struct rtx_def *create_TOC_reference (rtx); -extern void rs6000_split_multireg_move (rtx *); +extern void rs6000_split_multireg_move (rtx, rtx); extern void rs6000_emit_move (rtx, rtx, enum machine_mode); extern rtx rs6000_legitimize_address (rtx, rtx, enum machine_mode); extern rtx rs6000_legitimize_reload_address (rtx, enum machine_mode, @@ -134,6 +134,7 @@ extern int rs6000_legitimate_address (enum machine_mode, rtx, int); extern bool rs6000_mode_dependent_address (rtx); extern rtx rs6000_return_addr (int, rtx); extern void rs6000_output_symbol_ref (FILE*, rtx); +extern HOST_WIDE_INT rs6000_initial_elimination_offset (int, int); extern rtx rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg); @@ -166,10 +167,8 @@ extern enum direction function_arg_padding (enum machine_mode, tree); extern void optimization_options (int, int); extern void rs6000_override_options (const char *); extern int direct_return (void); -extern union tree_node *rs6000_build_va_list (void); extern int first_reg_to_save (void); extern int first_fp_reg_to_save (void); -extern rs6000_stack_t *rs6000_stack_info (void); extern void output_ascii (FILE *, const char *, int); extern void rs6000_gen_section_name (char **, const char *, const char *); extern void output_function_profiler (FILE *, int); @@ -188,7 +187,7 @@ extern void rs6000_emit_prologue (void); extern void rs6000_emit_load_toc_table (int); extern void rs6000_aix_emit_builtin_unwind_init (void); extern void rs6000_emit_epilogue (int); -extern void debug_stack_info (rs6000_stack_t *); +extern void rs6000_emit_eh_reg_restore (rtx, rtx); extern const char * output_isel (rtx *); extern int vrsave_operation (rtx, enum machine_mode); extern int rs6000_register_move_cost (enum machine_mode, @@ -202,4 +201,8 @@ extern int rs6000_tls_symbol_ref (rtx, enum machine_mode); extern void rs6000_pragma_longcall (struct cpp_reader *); extern void rs6000_cpu_cpp_builtins (struct cpp_reader *); +#if TARGET_MACHO +char *output_call (rtx, rtx *, int, int); +#endif + #endif /* rs6000-protos.h */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2387ea7d367..53c8b36a86d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -70,6 +70,49 @@ #define min(A,B) ((A) < (B) ? (A) : (B)) #define max(A,B) ((A) > (B) ? (A) : (B)) +/* Structure used to define the rs6000 stack */ +typedef struct rs6000_stack { + int first_gp_reg_save; /* first callee saved GP register used */ + int first_fp_reg_save; /* first callee saved FP register used */ + int first_altivec_reg_save; /* first callee saved AltiVec register used */ + int lr_save_p; /* true if the link reg needs to be saved */ + int cr_save_p; /* true if the CR reg needs to be saved */ + unsigned int vrsave_mask; /* mask of vec registers to save */ + int toc_save_p; /* true if the TOC needs to be saved */ + int push_p; /* true if we need to allocate stack space */ + int calls_p; /* true if the function makes any calls */ + enum rs6000_abi abi; /* which ABI to use */ + int gp_save_offset; /* offset to save GP regs from initial SP */ + int fp_save_offset; /* offset to save FP regs from initial SP */ + int altivec_save_offset; /* offset to save AltiVec regs from initial SP */ + int lr_save_offset; /* offset to save LR from initial SP */ + int cr_save_offset; /* offset to save CR from initial SP */ + int vrsave_save_offset; /* offset to save VRSAVE from initial SP */ + int spe_gp_save_offset; /* offset to save spe 64-bit gprs */ + int toc_save_offset; /* offset to save the TOC pointer */ + int varargs_save_offset; /* offset to save the varargs registers */ + int ehrd_offset; /* offset to EH return data */ + int reg_size; /* register size (4 or 8) */ + int varargs_size; /* size to hold V.4 args passed in regs */ + HOST_WIDE_INT vars_size; /* variable save area size */ + int parm_size; /* outgoing parameter size */ + int save_size; /* save area size */ + int fixed_size; /* fixed size of stack frame */ + int gp_size; /* size of saved GP registers */ + int fp_size; /* size of saved FP registers */ + int altivec_size; /* size of saved AltiVec registers */ + int cr_size; /* size to hold CR if not in save_size */ + int lr_size; /* size to hold LR if not in save_size */ + int vrsave_size; /* size to hold VRSAVE if not in save_size */ + int altivec_padding_size; /* size of altivec alignment padding if + not in save_size */ + int spe_gp_size; /* size of 64-bit GPR save size for SPE */ + int spe_padding_size; + int toc_size; /* size to hold TOC if not in save_size */ + HOST_WIDE_INT total_size; /* total bytes allocated for stack */ + int spe_64bit_regs_used; +} rs6000_stack_t; + /* Target cpu type */ enum processor_type rs6000_cpu; @@ -222,7 +265,7 @@ static void rs6000_frame_related (rtx, rtx, HOST_WIDE_INT, rtx, rtx); static rtx spe_synthesize_frame_save (rtx); static bool spe_func_has_64bit_regs_p (void); static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int, - int, int); + int, HOST_WIDE_INT); static rtx gen_frame_mem_offset (enum machine_mode, rtx, int); static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int); static unsigned rs6000_hash_constant (rtx); @@ -235,6 +278,7 @@ static bool legitimate_small_data_p (enum machine_mode, rtx); static bool legitimate_offset_address_p (enum machine_mode, rtx, int); static bool legitimate_indexed_address_p (rtx, int); static bool legitimate_indirect_address_p (rtx, int); +static bool macho_lo_sum_memory_operand (rtx x, enum machine_mode mode); static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int); static struct machine_function * rs6000_init_machine_status (void); static bool rs6000_assemble_integer (rtx, unsigned int, int); @@ -316,6 +360,8 @@ static rtx spe_expand_builtin (tree, rtx, bool *); static rtx spe_expand_predicate_builtin (enum insn_code, tree, rtx); static rtx spe_expand_evsel_builtin (enum insn_code, tree, rtx); static int rs6000_emit_int_cmove (rtx, rtx, rtx, rtx); +static rs6000_stack_t *rs6000_stack_info (void); +static void debug_stack_info (rs6000_stack_t *); static rtx altivec_expand_builtin (tree, rtx, bool *); static rtx altivec_expand_ld_builtin (tree, rtx, bool *); @@ -347,9 +393,20 @@ 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_mixed_function_arg (CUMULATIVE_ARGS *, + enum machine_mode, tree, int); +static void rs6000_move_block_from_reg(int regno, rtx x, int nregs); static void setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); +#if TARGET_MACHO +static void macho_branch_islands (void); +static void add_compiler_branch_island (tree, tree, int); +static int no_previous_def (tree function_name); +static tree get_prev_label (tree function_name); +#endif + +static tree rs6000_build_builtin_va_list (void); /* Hash table stuff for keeping track of TOC entries. */ @@ -554,6 +611,9 @@ static const char alt_reg_names[][8] = #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; /* Override command line options. Mostly we process the processor @@ -564,138 +624,79 @@ rs6000_override_options (const char *default_cpu) { size_t i, j; struct rs6000_cpu_select *ptr; + int set_masks; + + /* Simplifications for entries below. */ - /* Simplify the entries below by making a mask for any POWER - variant and any PowerPC variant. */ + enum { + POWERPC_BASE_MASK = MASK_POWERPC | MASK_NEW_MNEMONICS, + POWERPC_7400_MASK = POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_ALTIVEC + }; -#define POWER_MASKS (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING) -#define POWERPC_MASKS (MASK_POWERPC | MASK_PPC_GPOPT \ - | MASK_PPC_GFXOPT | MASK_POWERPC64) -#define POWERPC_OPT_MASKS (MASK_PPC_GPOPT | MASK_PPC_GFXOPT) + /* This table occasionally claims that a processor does not support + a particular feature even though it does, but the feature is slower + than the alternative. Thus, it shouldn't be relied on as a + complete description of the processor's support. + Please keep this list in order, and don't forget to update the + documentation in invoke.texi when adding a new processor or + flag. */ static struct ptt { const char *const name; /* Canonical processor name. */ const enum processor_type processor; /* Processor type enum value. */ const int target_enable; /* Target flags to enable. */ - const int target_disable; /* Target flags to disable. */ } const processor_target_table[] - = {{"common", PROCESSOR_COMMON, MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_MASKS}, - {"power", PROCESSOR_POWER, - MASK_POWER | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"power2", PROCESSOR_POWER, - MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING, - POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"power3", PROCESSOR_PPC630, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS}, - {"power4", PROCESSOR_POWER4, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS}, - {"powerpc", PROCESSOR_POWERPC, - MASK_POWERPC | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"powerpc64", PROCESSOR_POWERPC64, - MASK_POWERPC | MASK_POWERPC64 | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS}, - {"rios", PROCESSOR_RIOS1, - MASK_POWER | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"rios1", PROCESSOR_RIOS1, - MASK_POWER | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"rsc", PROCESSOR_PPC601, - MASK_POWER | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"rsc1", PROCESSOR_PPC601, - MASK_POWER | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"rios2", PROCESSOR_RIOS2, - MASK_POWER | MASK_MULTIPLE | MASK_STRING | MASK_POWER2, - POWERPC_MASKS | MASK_NEW_MNEMONICS}, - {"rs64a", PROCESSOR_RS64A, - MASK_POWERPC | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS}, - {"401", PROCESSOR_PPC403, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, + = {{"401", PROCESSOR_PPC403, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"403", PROCESSOR_PPC403, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"405", PROCESSOR_PPC405, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"405fp", PROCESSOR_PPC405, - MASK_POWERPC | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"440", PROCESSOR_PPC440, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"440fp", PROCESSOR_PPC440, - MASK_POWERPC | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"505", PROCESSOR_MPCCORE, - MASK_POWERPC | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_STRICT_ALIGN}, + {"405", PROCESSOR_PPC405, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"405fp", PROCESSOR_PPC405, POWERPC_BASE_MASK}, + {"440", PROCESSOR_PPC440, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"440fp", PROCESSOR_PPC440, POWERPC_BASE_MASK}, + {"505", PROCESSOR_MPCCORE, POWERPC_BASE_MASK}, {"601", PROCESSOR_PPC601, - MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"602", PROCESSOR_PPC603, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"603", PROCESSOR_PPC603, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"603e", PROCESSOR_PPC603, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"ec603e", PROCESSOR_PPC603, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"604", PROCESSOR_PPC604, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"604e", PROCESSOR_PPC604e, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"620", PROCESSOR_PPC620, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS}, - {"630", PROCESSOR_PPC630, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS}, - {"740", PROCESSOR_PPC750, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"750", PROCESSOR_PPC750, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"7400", PROCESSOR_PPC7400, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"7450", PROCESSOR_PPC7450, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"8540", PROCESSOR_PPC8540, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"801", PROCESSOR_MPCCORE, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"821", PROCESSOR_MPCCORE, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"823", PROCESSOR_MPCCORE, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"860", PROCESSOR_MPCCORE, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, + MASK_POWER | POWERPC_BASE_MASK | MASK_MULTIPLE | MASK_STRING}, + {"602", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"603", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"603e", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"604", PROCESSOR_PPC604, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"604e", PROCESSOR_PPC604e, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"620", PROCESSOR_PPC620, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"630", PROCESSOR_PPC630, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"740", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"7400", PROCESSOR_PPC7400, POWERPC_7400_MASK}, + {"7450", PROCESSOR_PPC7450, POWERPC_7400_MASK}, + {"750", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"970", PROCESSOR_POWER4, - MASK_POWERPC | POWERPC_OPT_MASKS | MASK_NEW_MNEMONICS, - POWER_MASKS}}; + POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, + {"common", PROCESSOR_COMMON, MASK_NEW_MNEMONICS}, + {"ec603e", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, + {"G3", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"G4", PROCESSOR_PPC7450, POWERPC_7400_MASK}, + {"G5", PROCESSOR_POWER4, + POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, + {"power", PROCESSOR_POWER, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, + {"power2", PROCESSOR_POWER, + MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING}, + {"power3", PROCESSOR_PPC630, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"power4", PROCESSOR_POWER4, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK}, + {"powerpc64", PROCESSOR_POWERPC64, + POWERPC_BASE_MASK | MASK_POWERPC64}, + {"rios", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, + {"rios1", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, + {"rios2", PROCESSOR_RIOS2, + MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING}, + {"rsc", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, + {"rsc1", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, + {"rs64a", PROCESSOR_RS64A, POWERPC_BASE_MASK}, + }; const size_t ptt_size = ARRAY_SIZE (processor_target_table); @@ -704,6 +705,28 @@ rs6000_override_options (const char *default_cpu) /* Save current -mstring/-mno-string status. */ int string = TARGET_STRING; + /* Some OSs don't support saving the high part of 64-bit registers on + context switch. Other OSs don't support saving Altivec registers. + On those OSs, we don't touch the MASK_POWERPC64 or MASK_ALTIVEC + settings; if the user wants either, the user must explicitly specify + them and we won't interfere with the user's specification. */ + + enum { + POWER_MASKS = MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING, + POWERPC_MASKS = (POWERPC_BASE_MASK | MASK_PPC_GPOPT + | MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_ALTIVEC + | MASK_MFCRF) + }; + set_masks = POWER_MASKS | POWERPC_MASKS | MASK_SOFT_FLOAT; +#ifdef OS_MISSING_POWERPC64 + if (OS_MISSING_POWERPC64) + set_masks &= ~MASK_POWERPC64; +#endif +#ifdef OS_MISSING_ALTIVEC + if (OS_MISSING_ALTIVEC) + set_masks &= ~MASK_ALTIVEC; +#endif + /* Identify the processor type. */ rs6000_select[0].string = default_cpu; rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT; @@ -721,8 +744,9 @@ rs6000_override_options (const char *default_cpu) if (ptr->set_arch_p) { - target_flags |= processor_target_table[j].target_enable; - target_flags &= ~processor_target_table[j].target_disable; + target_flags &= ~set_masks; + target_flags |= (processor_target_table[j].target_enable + & set_masks); } break; } @@ -2130,6 +2154,7 @@ reg_or_mem_operand (rtx op, enum machine_mode mode) { return (gpc_reg_operand (op, mode) || memory_operand (op, mode) + || macho_lo_sum_memory_operand (op, mode) || volatile_mem_operand (op, mode)); } @@ -2423,7 +2448,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) case DFmode: case DImode: - if (TARGET_32BIT) + if (mode == DFmode || !TARGET_POWERPC64) extra = 4; else if (offset & 3) return false; @@ -2431,7 +2456,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) case TFmode: case TImode: - if (TARGET_32BIT) + if (mode == TFmode || !TARGET_POWERPC64) extra = 12; else if (offset & 3) return false; @@ -2471,6 +2496,25 @@ legitimate_indirect_address_p (rtx x, int strict) return GET_CODE (x) == REG && INT_REG_OK_FOR_BASE_P (x, strict); } +static bool +macho_lo_sum_memory_operand (rtx x, enum machine_mode mode) +{ + if (!TARGET_MACHO || !flag_pic + || mode != SImode || GET_CODE(x) != MEM) + return false; + x = XEXP (x, 0); + + if (GET_CODE (x) != LO_SUM) + return false; + if (GET_CODE (XEXP (x, 0)) != REG) + return false; + if (!INT_REG_OK_FOR_BASE_P (XEXP (x, 0), 0)) + return false; + x = XEXP (x, 1); + + return CONSTANT_P (x); +} + static bool legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict) { @@ -2482,7 +2526,7 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict) return false; x = XEXP (x, 1); - if (TARGET_ELF) + if (TARGET_ELF || TARGET_MACHO) { if (DEFAULT_ABI != ABI_AIX && flag_pic) return false; @@ -2606,8 +2650,8 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, || ((TARGET_HARD_FLOAT && TARGET_FPRS) && mode == DFmode))) { rtx reg = gen_reg_rtx (Pmode); - emit_insn (gen_elf_high (reg, (x))); - return gen_rtx_LO_SUM (Pmode, reg, (x)); + emit_insn (gen_elf_high (reg, x)); + return gen_rtx_LO_SUM (Pmode, reg, x); } else if (TARGET_MACHO && TARGET_32BIT && TARGET_NO_TOC && ! flag_pic @@ -2622,8 +2666,8 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && mode != TImode) { rtx reg = gen_reg_rtx (Pmode); - emit_insn (gen_macho_high (reg, (x))); - return gen_rtx_LO_SUM (Pmode, reg, (x)); + emit_insn (gen_macho_high (reg, x)); + return gen_rtx_LO_SUM (Pmode, reg, x); } else if (TARGET_TOC && constant_pool_expr_p (x) @@ -2863,6 +2907,9 @@ rs6000_tls_symbol_ref (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) bool rs6000_tls_referenced_p (rtx x) { + if (! TARGET_HAVE_TLS) + return false; + return for_each_rtx (&x, &rs6000_tls_symbol_ref_1, 0); } @@ -3207,7 +3254,7 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) || (ud4 == 0 && ud3 == 0 && ud2 == 0 && ! (ud1 & 0x8000))) { if (ud1 & 0x8000) - emit_move_insn (dest, GEN_INT (((ud1 ^ 0x8000) - 0x8000))); + emit_move_insn (dest, GEN_INT (((ud1 ^ 0x8000) - 0x8000))); else emit_move_insn (dest, GEN_INT (ud1)); } @@ -3368,7 +3415,26 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* Handle the case of CONSTANT_P_RTX. */ if (GET_CODE (operands[1]) == CONSTANT_P_RTX) goto emit_set; - + + /* 128-bit constant floating-point values on Darwin should really be + loaded as two parts. */ + if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128 + && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE) + { + /* DImode is used, not DFmode, because simplify_gen_subreg doesn't + know how to get a DFmode SUBREG of a TFmode. */ + rs6000_emit_move (simplify_gen_subreg (DImode, operands[0], mode, 0), + simplify_gen_subreg (DImode, operands[1], mode, 0), + DImode); + rs6000_emit_move (simplify_gen_subreg (DImode, operands[0], mode, + GET_MODE_SIZE (DImode)), + simplify_gen_subreg (DImode, operands[1], mode, + GET_MODE_SIZE (DImode)), + DImode); + return; + } + /* FIXME: In the long term, this switch statement should go away and be replaced by a sequence of tests based on things like mode == Pmode. */ @@ -3603,6 +3669,19 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); } +/* Nonzero if we can use a floating-point register to pass this arg. */ +#define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ + (GET_MODE_CLASS (MODE) == MODE_FLOAT \ + && (CUM)->fregno <= FP_ARG_MAX_REG \ + && TARGET_HARD_FLOAT && TARGET_FPRS) + +/* Nonzero if we can use an AltiVec register to pass this arg. */ +#define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE,NAMED) \ + (ALTIVEC_VECTOR_MODE (MODE) \ + && (CUM)->vregno <= ALTIVEC_ARG_MAX_REG \ + && TARGET_ALTIVEC_ABI \ + && (NAMED)) + /* Return a nonzero value to say to return the function value in memory, just as large structures are always returned. TYPE will be the data type of the value, and FNTYPE will be the type of the @@ -3787,23 +3866,35 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) { - if (named && cum->vregno <= ALTIVEC_ARG_MAX_REG) + if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) cum->vregno++; - else + + /* In variable-argument functions, vector arguments get GPRs allocated + even if they are going to be passed in a vector register. */ + if (cum->stdarg && DEFAULT_ABI != ABI_V4) { int align; - /* Vector parameters must be 16-byte aligned. This places them at - 2 mod 4 in terms of words (on both ABIs). */ - align = ((6 - (cum->words & 3)) & 3); + /* Vector parameters must be 16-byte aligned. This places + them at 2 mod 4 in terms of words in 32-bit mode, since + the parameter save area starts at offset 24 from the + stack. In 64-bit mode, they just have to start on an + even word, since the parameter save area is 16-byte + aligned. Space for GPRs is reserved even if the argument + will be passed in memory. */ + if (TARGET_32BIT) + align = ((6 - (cum->words & 3)) & 3); + else + align = cum->words & 1; cum->words += align + RS6000_ARG_SIZE (mode, type); - + if (TARGET_DEBUG_ARG) { fprintf (stderr, "function_adv: words = %2d, align=%d, ", cum->words, align); fprintf (stderr, "nargs = %4d, proto = %d, mode = %4s\n", - cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode)); + cum->nargs_prototype, cum->prototype, + GET_MODE_NAME (mode)); } } } @@ -3890,6 +3981,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, } /* Determine where to put a SIMD argument on the SPE. */ + static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type) @@ -3915,17 +4007,121 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r2)); } else - return NULL; + return NULL_RTX; } else { if (cum->sysv_gregno <= GP_ARG_MAX_REG) return gen_rtx_REG (mode, cum->sysv_gregno); else - return NULL; + return NULL_RTX; } } +/* Determine where to place an argument in 64-bit mode with 32-bit ABI. */ + +static rtx +rs6000_mixed_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int align_words) +{ + if (mode == DFmode) + { + /* -mpowerpc64 with 32bit ABI splits up a DFmode argument + in vararg list into zero, one or two GPRs */ + if (align_words >= GP_ARG_NUM_REG) + return gen_rtx_PARALLEL (DFmode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + NULL_RTX, const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, + cum->fregno), + const0_rtx))); + else if (align_words + RS6000_ARG_SIZE (mode, type) + > GP_ARG_NUM_REG) + /* If this is partially on the stack, then we only + include the portion actually in registers here. */ + return gen_rtx_PARALLEL (DFmode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words), + const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, + cum->fregno), + const0_rtx))); + + /* split a DFmode arg into two GPRs */ + return gen_rtx_PARALLEL (DFmode, + gen_rtvec (3, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words), + const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words + 1), + GEN_INT (4)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, cum->fregno), + const0_rtx))); + } + /* -mpowerpc64 with 32bit ABI splits up a DImode argument into one + or two GPRs */ + else if (mode == DImode) + { + if (align_words < GP_ARG_NUM_REG - 1) + return gen_rtx_PARALLEL (DImode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words), + const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words + 1), + GEN_INT (4)))); + else if (align_words == GP_ARG_NUM_REG - 1) + return gen_rtx_PARALLEL (DImode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + NULL_RTX, const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words), + const0_rtx))); + } + else if (mode == BLKmode && align_words <= (GP_ARG_NUM_REG - 1)) + { + int k; + int size = int_size_in_bytes (type); + int no_units = ((size - 1) / 4) + 1; + int max_no_words = GP_ARG_NUM_REG - align_words; + int rtlvec_len = no_units < max_no_words ? no_units : max_no_words; + rtx *rtlvec = (rtx *) alloca (rtlvec_len * sizeof (rtx)); + + memset ((char *) rtlvec, 0, rtlvec_len * sizeof (rtx)); + + for (k=0; k < rtlvec_len; k++) + rtlvec[k] = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_MIN_REG + + align_words + k), + k == 0 ? const0_rtx : GEN_INT (k*4)); + + return gen_rtx_PARALLEL (BLKmode, gen_rtvec_v (k, rtlvec)); + } + + return NULL_RTX; +} + /* 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. @@ -3979,40 +4175,43 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, return GEN_INT (cum->call_cookie); } - if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) + return gen_rtx_REG (mode, cum->vregno); + else if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) { - if (named && cum->vregno <= ALTIVEC_ARG_MAX_REG) - return gen_rtx_REG (mode, cum->vregno); - else if (named || abi == ABI_V4) + if (named || abi == ABI_V4) return NULL_RTX; else { /* Vector parameters to varargs functions under AIX or Darwin get passed in memory and possibly also in GPRs. */ int align, align_words; - rtx reg; + enum machine_mode part_mode = mode; /* Vector parameters must be 16-byte aligned. This places them at - 2 mod 4 in terms of words. */ - align = ((6 - (cum->words & 3)) & 3); + 2 mod 4 in terms of words in 32-bit mode, since the parameter + save area starts at offset 24 from the stack. In 64-bit mode, + they just have to start on an even word, since the parameter + save area is 16-byte aligned. */ + if (TARGET_32BIT) + align = ((6 - (cum->words & 3)) & 3); + else + align = cum->words & 1; align_words = cum->words + align; /* Out of registers? Memory, then. */ if (align_words >= GP_ARG_NUM_REG) return NULL_RTX; - /* The vector value goes in both memory and GPRs. Varargs - vector regs will always be saved in R5-R8 or R9-R12. */ - reg = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); - - return gen_rtx_PARALLEL (mode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - NULL_RTX, - const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - reg, - const0_rtx))); + /* The vector value goes in GPRs. Only the part of the + value in GPRs is reported here. */ + if (align_words + CLASS_MAX_NREGS (mode, GENERAL_REGS) + > GP_ARG_NUM_REG) + /* Fortunately, there are only two possibilities, the value + is either wholly in GPRs or half in GPRs and half not. */ + part_mode = DImode; + + return gen_rtx_REG (part_mode, GP_ARG_MIN_REG + align_words); } } else if (TARGET_SPE_ABI && TARGET_SPE && SPE_VECTOR_MODE (mode)) @@ -4025,7 +4224,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (cum->fregno <= FP_ARG_V4_MAX_REG) return gen_rtx_REG (mode, cum->fregno); else - return NULL; + return NULL_RTX; } else { @@ -4047,7 +4246,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (gregno + n_words - 1 <= GP_ARG_MAX_REG) return gen_rtx_REG (mode, gregno); else - return NULL; + return NULL_RTX; } } else @@ -4059,7 +4258,11 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) return NULL_RTX; - if (USE_FP_FOR_ARG_P (*cum, mode, type)) + if (TARGET_32BIT && TARGET_POWERPC64 + && (mode == DFmode || mode == DImode || mode == BLKmode)) + return rs6000_mixed_function_arg (cum, mode, type, align_words); + + if (USE_FP_FOR_ARG_P (cum, mode, type)) { if (! type || ((cum->nargs_prototype > 0) @@ -4071,53 +4274,6 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, || (align_words < GP_ARG_NUM_REG)))) return gen_rtx_REG (mode, cum->fregno); - if (TARGET_32BIT && TARGET_POWERPC64 && mode == DFmode) - { - /* -mpowerpc64 with 32bit ABI splits up a DFmode argument - in vararg list into zero, one or two GPRs */ - if (align_words >= GP_ARG_NUM_REG) - return gen_rtx_PARALLEL (DFmode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - NULL_RTX, const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (mode, - cum->fregno), - const0_rtx))); - else if (align_words + RS6000_ARG_SIZE (mode, type) - > GP_ARG_NUM_REG) - /* If this is partially on the stack, then we only - include the portion actually in registers here. */ - return gen_rtx_PARALLEL (DFmode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words), - const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (mode, - cum->fregno), - const0_rtx))); - - /* split a DFmode arg into two GPRs */ - return gen_rtx_PARALLEL (DFmode, - gen_rtvec (3, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words), - const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words + 1), - GEN_INT (4)), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (mode, cum->fregno), - const0_rtx))); - } - return gen_rtx_PARALLEL (mode, gen_rtvec (2, gen_rtx_EXPR_LIST (VOIDmode, @@ -4138,37 +4294,6 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, gen_rtx_REG (mode, cum->fregno), const0_rtx))); } - /* -mpowerpc64 with 32bit ABI splits up a DImode argument into one - or two GPRs */ - else if (TARGET_32BIT && TARGET_POWERPC64 && mode == DImode - && align_words < GP_ARG_NUM_REG - 1) - { - return gen_rtx_PARALLEL (DImode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words), - const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words + 1), - GEN_INT (4)))); - } - else if (TARGET_32BIT && TARGET_POWERPC64 && mode == DImode - && align_words == GP_ARG_NUM_REG - 1) - { - return gen_rtx_PARALLEL (DImode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - NULL_RTX, const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (SImode, - GP_ARG_MIN_REG - + align_words), - const0_rtx))); - } else if (align_words < GP_ARG_NUM_REG) return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); else @@ -4182,13 +4307,13 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, int function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named ATTRIBUTE_UNUSED) + tree type, int named) { if (DEFAULT_ABI == ABI_V4) return 0; - if (USE_FP_FOR_ARG_P (*cum, mode, type) - || USE_ALTIVEC_FOR_ARG_P (*cum, mode, type)) + if (USE_FP_FOR_ARG_P (cum, mode, type) + || USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) { if (cum->nargs_prototype >= 0) return 0; @@ -4234,6 +4359,37 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, } return type && int_size_in_bytes (type) < 0; } + +static void +rs6000_move_block_from_reg(int regno, rtx x, int nregs) +{ + int i; + enum machine_mode reg_mode = TARGET_32BIT ? SImode : DImode; + + if (nregs == 0) + return; + + for (i = 0; i < nregs; i++) + { + rtx tem = adjust_address_nv (x, reg_mode, i*GET_MODE_SIZE(reg_mode)); + if (reload_completed) + { + if (! strict_memory_address_p (reg_mode, XEXP (tem, 0))) + tem = NULL_RTX; + else + tem = simplify_gen_subreg (reg_mode, x, BLKmode, + i * GET_MODE_SIZE(reg_mode)); + } + else + tem = replace_equiv_address (tem, XEXP (tem, 0)); + + if (tem == NULL_RTX) + abort (); + + emit_move_insn (tem, gen_rtx_REG (reg_mode, regno + i)); + } +} + /* Perform any needed actions needed for a function that is receiving a variable number of arguments. @@ -4257,19 +4413,10 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, int reg_size = TARGET_32BIT ? 4 : 8; rtx save_area = NULL_RTX, mem; int first_reg_offset, set; - tree fntype; - int stdarg_p; - - fntype = TREE_TYPE (current_function_decl); - stdarg_p = (TYPE_ARG_TYPES (fntype) != 0 - && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) - != void_type_node)); - /* For varargs, we do not want to skip the dummy va_dcl argument. - For stdargs, we do want to skip the last named argument. */ + /* Skip the last named argument. */ next_cum = *cum; - if (stdarg_p) - function_arg_advance (&next_cum, mode, type, 1); + function_arg_advance (&next_cum, mode, type, 1); if (DEFAULT_ABI == ABI_V4) { @@ -4300,8 +4447,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, set_mem_alias_set (mem, set); set_mem_align (mem, BITS_PER_WORD); - move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem, - GP_ARG_NUM_REG - first_reg_offset); + rs6000_move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem, + GP_ARG_NUM_REG - first_reg_offset); } /* Save FP registers if needed. */ @@ -4338,8 +4485,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, /* Create the va_list data type. */ -tree -rs6000_build_va_list (void) +static tree +rs6000_build_builtin_va_list (void) { tree f_gpr, f_fpr, f_res, f_ovf, f_sav, record, type_decl; @@ -5335,10 +5482,7 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, } static rtx -altivec_expand_lv_builtin (icode, arglist, target) - enum insn_code icode; - tree arglist; - rtx target; +altivec_expand_lv_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat, addr; tree arg0 = TREE_VALUE (arglist); @@ -8135,7 +8279,8 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2) enum reg_class secondary_reload_class (enum reg_class class, - enum machine_mode mode ATTRIBUTE_UNUSED, rtx in) + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx in) { int regno; @@ -9840,73 +9985,72 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1) emit_move_insn (dest, target); } -/* Called by splitter for multireg moves. - Input: - operands[0] : Destination of move - operands[1] : Source of move +/* Emit instructions to move SRC to DST. Called by splitters for + multi-register moves. It will emit at most one instruction for + each register that is accessed; that is, it won't emit li/lis pairs + (or equivalent for 64-bit code). One of SRC or DST must be a hard + register. */ - Output: - operands[2-n] : Destination slots - operands[n-m] : Source slots - where n = 2 + HARD_REGNO_NREGS (reg, GET_MODE (operands[0])) - m = 2 + 2 * HARD_REGNO_NREGS (reg, GET_MODE (operands[0])) - 1 - - Splits the move of operands[1] to operands[0]. - This is done, if GPRs are one of the operands. In this case - a sequence of simple move insns has to be issued. The sequence of these - move insns has to be done in correct order to avoid early clobber of the - base register or destructive overlap of registers. -*/ - void -rs6000_split_multireg_move (rtx *operands) +rs6000_split_multireg_move (rtx dst, rtx src) { - int nregs, reg, i, j, used_update = 0; - enum machine_mode mode; - rtx dst = operands[0]; - rtx src = operands[1]; - rtx insn = 0; - - /* Calculate number to move (2/4 for 32/64 bit mode). */ - - reg = REG_P (operands[0]) ? REGNO (operands[0]) : REGNO (operands[1]); - mode = GET_MODE (operands[0]); - nregs = HARD_REGNO_NREGS (reg, mode); + /* The register number of the first register being moved. */ + int reg; + /* The mode that is to be moved. */ + enum machine_mode mode; + /* The mode that the move is being done in, and its size. */ + enum machine_mode reg_mode; + int reg_mode_size; + /* The number of registers that will be moved. */ + int nregs; + + reg = REG_P (dst) ? REGNO (dst) : REGNO (src); + mode = GET_MODE (dst); + nregs = HARD_REGNO_NREGS (reg, mode); + if (FP_REGNO_P (reg)) + reg_mode = DFmode; + else if (ALTIVEC_REGNO_P (reg)) + reg_mode = V16QImode; + else + reg_mode = word_mode; + reg_mode_size = GET_MODE_SIZE (reg_mode); - if (REG_P (operands[1]) - && REG_P (operands[0]) - && (REGNO (operands[1]) < REGNO (operands[0]))) - { - /* Move register range backwards, if we have destructive overlap. */ - - j = nregs; - for (i = 0; i < nregs; i++) - { - j--; - operands[i+2] = operand_subword (operands[0], j, 0, mode); - operands[i+2+nregs] = - operand_subword (operands[1], j, 0, mode); - } - } + if (reg_mode_size * nregs != GET_MODE_SIZE (mode)) + abort (); + + if (REG_P (src) && REG_P (dst) && (REGNO (src) < REGNO (dst))) + { + /* Move register range backwards, if we might have destructive + overlap. */ + int i; + for (i = nregs - 1; i >= 0; i--) + emit_insn (gen_rtx_SET (VOIDmode, + simplify_gen_subreg (reg_mode, dst, mode, + i * reg_mode_size), + simplify_gen_subreg (reg_mode, src, mode, + i * reg_mode_size))); + } else { - j = -1; + int i; + int j = -1; + bool used_update = false; - if (GET_CODE (operands[1]) == MEM) + if (GET_CODE (src) == MEM && INT_REGNO_P (reg)) { rtx breg; - if (GET_CODE (XEXP (operands[1], 0)) == PRE_INC - || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC) + if (GET_CODE (XEXP (src, 0)) == PRE_INC + || GET_CODE (XEXP (src, 0)) == PRE_DEC) { rtx delta_rtx; - breg = XEXP (XEXP (operands[1], 0), 0); - delta_rtx = GET_CODE (XEXP (operands[1], 0)) == PRE_INC - ? GEN_INT (GET_MODE_SIZE (GET_MODE (operands[1]))) - : GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[1]))); - insn = emit_insn (TARGET_32BIT - ? gen_addsi3 (breg, breg, delta_rtx) - : gen_adddi3 (breg, breg, delta_rtx)); + breg = XEXP (XEXP (src, 0), 0); + delta_rtx = GET_CODE (XEXP (src, 0)) == PRE_INC + ? GEN_INT (GET_MODE_SIZE (GET_MODE (src))) + : GEN_INT (-GET_MODE_SIZE (GET_MODE (src))); + emit_insn (TARGET_32BIT + ? gen_addsi3 (breg, breg, delta_rtx) + : gen_adddi3 (breg, breg, delta_rtx)); src = gen_rtx_MEM (mode, breg); } @@ -9926,35 +10070,34 @@ rs6000_split_multireg_move (rtx *operands) j = REGNO (breg) - REGNO (dst); } - if (GET_CODE (operands[0]) == MEM) + if (GET_CODE (dst) == MEM && INT_REGNO_P (reg)) { rtx breg; - if (GET_CODE (XEXP (operands[0], 0)) == PRE_INC - || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) + if (GET_CODE (XEXP (dst, 0)) == PRE_INC + || GET_CODE (XEXP (dst, 0)) == PRE_DEC) { rtx delta_rtx; - breg = XEXP (XEXP (operands[0], 0), 0); - delta_rtx = GET_CODE (XEXP (operands[0], 0)) == PRE_INC - ? GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))) - : GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[0]))); + breg = XEXP (XEXP (dst, 0), 0); + delta_rtx = GET_CODE (XEXP (dst, 0)) == PRE_INC + ? GEN_INT (GET_MODE_SIZE (GET_MODE (dst))) + : GEN_INT (-GET_MODE_SIZE (GET_MODE (dst))); /* We have to update the breg before doing the store. Use store with update, if available. */ if (TARGET_UPDATE) { - insn = emit_insn (TARGET_32BIT - ? gen_movsi_update (breg, breg, delta_rtx, - operand_subword (src, 0, 0, mode)) - : gen_movdi_update (breg, breg, delta_rtx, - operand_subword (src, 0, 0, mode))); - used_update = 1; + rtx nsrc = simplify_gen_subreg (reg_mode, src, mode, 0); + emit_insn (TARGET_32BIT + ? gen_movsi_update (breg, breg, delta_rtx, nsrc) + : gen_movdi_update (breg, breg, delta_rtx, nsrc)); + used_update = true; } else - insn = emit_insn (TARGET_32BIT - ? gen_addsi3 (breg, breg, delta_rtx) - : gen_adddi3 (breg, breg, delta_rtx)); + emit_insn (TARGET_32BIT + ? gen_addsi3 (breg, breg, delta_rtx) + : gen_adddi3 (breg, breg, delta_rtx)); dst = gen_rtx_MEM (mode, breg); } } @@ -9966,15 +10109,16 @@ rs6000_split_multireg_move (rtx *operands) if (j == nregs) j = 0; - operands[i+2] = operand_subword (dst, j, 0, mode); - operands[i+2+nregs] = operand_subword (src, j, 0, mode); - + /* If compiler already emited move of first word by + store with update, no need to do anything. */ if (j == 0 && used_update) - { - /* Already emited move of first word by - store with update -> emit dead insn instead (r := r). */ - operands[i+2] = operands[i+2+nregs]; - } + continue; + + emit_insn (gen_rtx_SET (VOIDmode, + simplify_gen_subreg (reg_mode, dst, mode, + j * reg_mode_size), + simplify_gen_subreg (reg_mode, src, mode, + j * reg_mode_size))); } } } @@ -10066,7 +10210,7 @@ compute_vrsave_mask (void) them in again. More importantly, the mask we compute here is used to generate CLOBBERs in the set_vrsave insn, and we do not wish the argument registers to die. */ - for (i = cfun->args_info.vregno; i >= ALTIVEC_ARG_MIN_REG; --i) + for (i = cfun->args_info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i) mask &= ~ALTIVEC_REG_BIT (i); /* Similarly, remove the return value from the set. */ @@ -10186,14 +10330,14 @@ is_altivec_return_reg (rtx reg, void *xyes) #define ABI_STACK_BOUNDARY STACK_BOUNDARY #endif -rs6000_stack_t * +static rs6000_stack_t * rs6000_stack_info (void) { static rs6000_stack_t info, zero_info; rs6000_stack_t *info_ptr = &info; int reg_size = TARGET_POWERPC64 ? 8 : 4; int ehrd_size; - int total_raw_size; + HOST_WIDE_INT total_raw_size; /* Zero all fields portably. */ info = zero_info; @@ -10525,7 +10669,7 @@ spe_func_has_64bit_regs_p (void) return false; } -void +static void debug_stack_info (rs6000_stack_t *info) { const char *abi_string; @@ -10614,13 +10758,15 @@ debug_stack_info (rs6000_stack_t *info) fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset); if (info->total_size) - fprintf (stderr, "\ttotal_size = %5d\n", info->total_size); + fprintf (stderr, "\ttotal_size = "HOST_WIDE_INT_PRINT_DEC"\n", + info->total_size); if (info->varargs_size) fprintf (stderr, "\tvarargs_size = %5d\n", info->varargs_size); if (info->vars_size) - fprintf (stderr, "\tvars_size = %5d\n", info->vars_size); + fprintf (stderr, "\tvars_size = "HOST_WIDE_INT_PRINT_DEC"\n", + info->vars_size); if (info->parm_size) fprintf (stderr, "\tparm_size = %5d\n", info->parm_size); @@ -10736,11 +10882,7 @@ rs6000_ra_ever_killed (void) rtx reg; rtx insn; - /* Irritatingly, there are two kinds of thunks -- those created with - TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go - through the regular part of the compiler. This is a very hacky - way to tell them apart. */ - if (current_function_is_thunk && !no_new_pseudos) + if (current_function_is_thunk) return 0; /* regs_ever_live has LR marked as used if any sibcalls are present, @@ -10893,6 +11035,42 @@ rs6000_emit_load_toc_table (int fromprolog) abort (); } +/* Emit instructions to restore the link register after determining where + its value has been stored. */ + +void +rs6000_emit_eh_reg_restore (rtx source, rtx scratch) +{ + rs6000_stack_t *info = rs6000_stack_info (); + rtx operands[2]; + + operands[0] = source; + operands[1] = scratch; + + if (info->lr_save_p) + { + rtx frame_rtx = stack_pointer_rtx; + HOST_WIDE_INT sp_offset = 0; + rtx tmp; + + if (frame_pointer_needed + || current_function_calls_alloca + || info->total_size > 32767) + { + emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx)); + frame_rtx = operands[1]; + } + else if (info->push_p) + sp_offset = info->total_size; + + tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset); + tmp = gen_rtx_MEM (Pmode, tmp); + emit_move_insn (tmp, operands[0]); + } + else + emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]); +} + int get_TOC_alias_set (void) { @@ -10908,7 +11086,7 @@ get_TOC_alias_set (void) load_toc_* patterns. */ int -uses_TOC () +uses_TOC (void) { rtx insn; @@ -11291,7 +11469,7 @@ generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep) static void emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, - unsigned int regno, int offset, int total_size) + unsigned int regno, int offset, HOST_WIDE_INT total_size) { rtx reg, offset_rtx, insn, mem, addr, int_rtx; rtx replacea, replaceb; @@ -11361,7 +11539,7 @@ rs6000_emit_prologue (void) rtx sp_reg_rtx = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM); rtx frame_ptr_rtx = gen_rtx_REG (Pmode, 12); rtx frame_reg_rtx = sp_reg_rtx; - rtx cr_save_rtx = NULL; + rtx cr_save_rtx = NULL_RTX; rtx insn; int saving_FPRs_inline; int using_store_multiple; @@ -12234,7 +12412,8 @@ rs6000_output_function_epilogue (FILE *file, } } -#if TARGET_OBJECT_FORMAT == OBJECT_MACHO +#if TARGET_MACHO + macho_branch_islands (); /* Mach-O doesn't support labels at the end of objects, so if it looks like we might want one, insert a NOP. */ { @@ -12313,8 +12492,7 @@ rs6000_output_function_epilogue (FILE *file, official way to get this info, so we use language_string. C is 0. C++ is 9. No number defined for Obj-C, so use the value for C for now. There is no official value for Java, - although IBM appears to be using 13. There is no official value - for Chill, so we've chosen 44 pseudo-randomly. */ + although IBM appears to be using 13. */ if (! strcmp (language_string, "GNU C") || ! strcmp (language_string, "GNU Objective-C")) i = 0; @@ -12328,8 +12506,6 @@ rs6000_output_function_epilogue (FILE *file, i = 9; else if (! strcmp (language_string, "GNU Java")) i = 13; - else if (! strcmp (language_string, "GNU CHILL")) - i = 44; else abort (); fprintf (file, "%d,", i); @@ -13418,7 +13594,7 @@ rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn ATTRIBUTE_UNUSED, } /* The function returns a true if INSN is microcoded. - Return false ptherwise. */ + Return false otherwise. */ static bool is_microcoded_insn (rtx insn) @@ -13442,7 +13618,7 @@ is_microcoded_insn (rtx insn) return false; } -/* The function returns a non-zero value if INSN can be scheduled only +/* The function returns a nonzero value if INSN can be scheduled only as the first insn in a dispatch group ("dispatch-slot restricted"). In this case, the returned value indicates how many dispatch slots the insn occupies (at the beginning of the group). @@ -13805,7 +13981,7 @@ get_next_active_insn (rtx insn, rtx tail) return next_insn; } -/* Return whether the presence of INSN causes a dispatch group terminatation +/* Return whether the presence of INSN causes a dispatch group termination of group WHICH_GROUP. If WHICH_GROUP == current_group, this function will return true if INSN @@ -13847,7 +14023,7 @@ insn_terminates_group_p (rtx insn, enum group_termination which_group) return false; } -/* Return true if it is recommended to keep NEXT_INSN "far" (in a seperate +/* Return true if it is recommended to keep NEXT_INSN "far" (in a separate dispatch group) from the insns in GROUP_INSNS. Return false otherwise. */ static bool @@ -13885,7 +14061,7 @@ is_costly_group (rtx *group_insns, rtx next_insn) one of the following schemes, depending on the value of the flag -minsert_sched_nops = X: (1) X == sched_finish_regroup_exact: insert exactly as many nops as needed - in order to force NEXT_INSN into a seperate group. + in order to force NEXT_INSN into a separate group. (2) X < sched_finish_regroup_exact: insert exactly X nops. GROUP_END, CAN_ISSUE_MORE and GROUP_COUNT record the state after nop insertion (has a group just ended, how many vacant issue slots remain in the @@ -14167,9 +14343,7 @@ pad_groups (FILE *dump, int sched_verbose, rtx prev_head_insn, rtx tail) After reload, it inserts nops at insn group bundling. */ static void -rs6000_sched_finish (dump, sched_verbose) - FILE *dump; - int sched_verbose; +rs6000_sched_finish (FILE *dump, int sched_verbose) { int n_groups; @@ -14523,83 +14697,118 @@ symbolic_operand (rtx op) } #endif -#ifdef RS6000_LONG_BRANCH +#if TARGET_MACHO -static tree stub_list = 0; +static tree branch_island_list = 0; -/* ADD_COMPILER_STUB adds the compiler generated stub for handling - procedure calls to the linked list. */ +/* Remember to generate a branch island for far calls to the given + function. */ -void -add_compiler_stub (tree label_name, tree function_name, int line_number) +static void +add_compiler_branch_island (tree label_name, tree function_name, int line_number) { - tree stub = build_tree_list (function_name, label_name); - TREE_TYPE (stub) = build_int_2 (line_number, 0); - TREE_CHAIN (stub) = stub_list; - stub_list = stub; + tree branch_island = build_tree_list (function_name, label_name); + TREE_TYPE (branch_island) = build_int_2 (line_number, 0); + TREE_CHAIN (branch_island) = branch_island_list; + branch_island_list = branch_island; } -#define STUB_LABEL_NAME(STUB) TREE_VALUE (STUB) -#define STUB_FUNCTION_NAME(STUB) TREE_PURPOSE (STUB) -#define STUB_LINE_NUMBER(STUB) TREE_INT_CST_LOW (TREE_TYPE (STUB)) - -/* OUTPUT_COMPILER_STUB outputs the compiler generated stub for - handling procedure calls from the linked list and initializes the - linked list. */ - -void -output_compiler_stub (void) -{ - char tmp_buf[256]; - char label_buf[256]; - tree stub; +#define BRANCH_ISLAND_LABEL_NAME(BRANCH_ISLAND) TREE_VALUE (BRANCH_ISLAND) +#define BRANCH_ISLAND_FUNCTION_NAME(BRANCH_ISLAND) TREE_PURPOSE (BRANCH_ISLAND) +#define BRANCH_ISLAND_LINE_NUMBER(BRANCH_ISLAND) \ + TREE_INT_CST_LOW (TREE_TYPE (BRANCH_ISLAND)) - if (!flag_pic) - for (stub = stub_list; stub; stub = TREE_CHAIN (stub)) - { - fprintf (asm_out_file, - "%s:\n", IDENTIFIER_POINTER(STUB_LABEL_NAME(stub))); +/* Generate far-jump branch islands for everything on the + branch_island_list. Invoked immediately after the last instruction + of the epilogue has been emitted; the branch-islands must be + appended to, and contiguous with, the function body. Mach-O stubs + are generated in machopic_output_stub(). */ +static void +macho_branch_islands (void) +{ + char tmp_buf[512]; + tree branch_island; + + for (branch_island = branch_island_list; + branch_island; + branch_island = TREE_CHAIN (branch_island)) + { + const char *label = + IDENTIFIER_POINTER (BRANCH_ISLAND_LABEL_NAME (branch_island)); + const char *name = + darwin_strip_name_encoding ( + IDENTIFIER_POINTER (BRANCH_ISLAND_FUNCTION_NAME (branch_island))); + char name_buf[512]; + /* Cheap copy of the details from the Darwin ASM_OUTPUT_LABELREF(). */ + if (name[0] == '*' || name[0] == '&') + strcpy (name_buf, name+1); + else + { + name_buf[0] = '_'; + strcpy (name_buf+1, name); + } + strcpy (tmp_buf, "\n"); + strcat (tmp_buf, label); #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) - if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) - fprintf (asm_out_file, "\t.stabd 68,0,%d\n", STUB_LINE_NUMBER(stub)); + if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) + fprintf (asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n", + BRANCH_ISLAND_LINE_NUMBER(branch_island)); #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */ - - if (IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub))[0] == '*') - strcpy (label_buf, - IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub))+1); - else - { - label_buf[0] = '_'; - strcpy (label_buf+1, - IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub))); - } - - strcpy (tmp_buf, "lis r12,hi16("); - strcat (tmp_buf, label_buf); - strcat (tmp_buf, ")\n\tori r12,r12,lo16("); - strcat (tmp_buf, label_buf); - strcat (tmp_buf, ")\n\tmtctr r12\n\tbctr"); - output_asm_insn (tmp_buf, 0); - + if (flag_pic) + { + strcat (tmp_buf, ":\n\tmflr r0\n\tbcl 20,31,"); + strcat (tmp_buf, label); + strcat (tmp_buf, "_pic\n"); + strcat (tmp_buf, label); + strcat (tmp_buf, "_pic:\n\tmflr r11\n"); + + strcat (tmp_buf, "\taddis r11,r11,ha16("); + strcat (tmp_buf, name_buf); + strcat (tmp_buf, " - "); + strcat (tmp_buf, label); + strcat (tmp_buf, "_pic)\n"); + + strcat (tmp_buf, "\tmtlr r0\n"); + + strcat (tmp_buf, "\taddi r12,r11,lo16("); + strcat (tmp_buf, name_buf); + strcat (tmp_buf, " - "); + strcat (tmp_buf, label); + strcat (tmp_buf, "_pic)\n"); + + strcat (tmp_buf, "\tmtctr r12\n\tbctr\n"); + } + else + { + strcat (tmp_buf, ":\nlis r12,hi16("); + strcat (tmp_buf, name_buf); + strcat (tmp_buf, ")\n\tori r12,r12,lo16("); + strcat (tmp_buf, name_buf); + strcat (tmp_buf, ")\n\tmtctr r12\n\tbctr"); + } + output_asm_insn (tmp_buf, 0); #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) - if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) - fprintf(asm_out_file, "\t.stabd 68,0,%d\n", STUB_LINE_NUMBER (stub)); + if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) + fprintf(asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n", + BRANCH_ISLAND_LINE_NUMBER (branch_island)); #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */ - } + } - stub_list = 0; + branch_island_list = 0; } /* NO_PREVIOUS_DEF checks in the link list whether the function name is already there or not. */ -int +static int no_previous_def (tree function_name) { - tree stub; - for (stub = stub_list; stub; stub = TREE_CHAIN (stub)) - if (function_name == STUB_FUNCTION_NAME (stub)) + tree branch_island; + for (branch_island = branch_island_list; + branch_island; + branch_island = TREE_CHAIN (branch_island)) + if (function_name == BRANCH_ISLAND_FUNCTION_NAME (branch_island)) return 0; return 1; } @@ -14607,13 +14816,15 @@ no_previous_def (tree function_name) /* GET_PREV_LABEL gets the label name from the previous definition of the function. */ -tree +static tree get_prev_label (tree function_name) { - tree stub; - for (stub = stub_list; stub; stub = TREE_CHAIN (stub)) - if (function_name == STUB_FUNCTION_NAME (stub)) - return STUB_LABEL_NAME (stub); + tree branch_island; + for (branch_island = branch_island_list; + branch_island; + branch_island = TREE_CHAIN (branch_island)) + if (function_name == BRANCH_ISLAND_FUNCTION_NAME (branch_island)) + return BRANCH_ISLAND_LABEL_NAME (branch_island); return 0; } @@ -14623,13 +14834,14 @@ get_prev_label (tree function_name) CALL_DEST is the routine we are calling. */ char * -output_call (rtx insn, rtx call_dest, int operand_number) +output_call (rtx insn, rtx *operands, int dest_operand_number, int cookie_operand_number) { static char buf[256]; - if (GET_CODE (call_dest) == SYMBOL_REF && TARGET_LONG_BRANCH && !flag_pic) + if (GET_CODE (operands[dest_operand_number]) == SYMBOL_REF + && (INTVAL (operands[cookie_operand_number]) & CALL_LONG)) { tree labelname; - tree funname = get_identifier (XSTR (call_dest, 0)); + tree funname = get_identifier (XSTR (operands[dest_operand_number], 0)); if (no_previous_def (funname)) { @@ -14643,23 +14855,25 @@ output_call (rtx insn, rtx call_dest, int operand_number) for (; insn && GET_CODE (insn) != NOTE; insn = PREV_INSN (insn)); if (insn) line_number = NOTE_LINE_NUMBER (insn); - add_compiler_stub (labelname, funname, line_number); + add_compiler_branch_island (labelname, funname, line_number); } else labelname = get_prev_label (funname); + /* "jbsr foo, L42" is Mach-O for "Link as 'bl foo' if a 'bl' + instruction will reach 'foo', otherwise link as 'bl L42'". + "L42" should be a 'branch island', that will do a far jump to + 'foo'. Branch islands are generated in + macho_branch_islands(). */ sprintf (buf, "jbsr %%z%d,%.246s", - operand_number, IDENTIFIER_POINTER (labelname)); - return buf; + dest_operand_number, IDENTIFIER_POINTER (labelname)); } else - { - sprintf (buf, "bl %%z%d", operand_number); - return buf; - } + sprintf (buf, "bl %%z%d", dest_operand_number); + return buf; } -#endif /* RS6000_LONG_BRANCH */ +#endif /* TARGET_MACHO */ /* Generate PIC and indirect symbol stubs. */ @@ -14746,9 +14960,13 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, if (GET_CODE (XEXP (orig, 0)) == PLUS) { + /* Use a different reg for the intermediate value, as + it will be marked UNCHANGING. */ + rtx reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode); + base = rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0), - Pmode, reg); + Pmode, reg_temp); offset = rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, reg); @@ -14791,14 +15009,8 @@ toc_section (void) static unsigned int rs6000_elf_section_type_flags (tree decl, const char *name, int reloc) { - unsigned int flags - = default_section_type_flags_1 (decl, name, reloc, - flag_pic || DEFAULT_ABI == ABI_AIX); - - if (TARGET_RELOCATABLE) - flags |= SECTION_WRITE; - - return flags; + return default_section_type_flags_1 (decl, name, reloc, + flag_pic || DEFAULT_ABI == ABI_AIX); } /* Record an element in the table of global constructors. SYMBOL is @@ -15452,7 +15664,7 @@ rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) if ((INTEGRAL_TYPE_P (valtype) && TYPE_PRECISION (valtype) < BITS_PER_WORD) || POINTER_TYPE_P (valtype)) - mode = word_mode; + mode = TARGET_32BIT ? SImode : DImode; else mode = TYPE_MODE (valtype); @@ -15490,6 +15702,28 @@ rs6000_libcall_value (enum machine_mode mode) return gen_rtx_REG (mode, regno); } +/* Define the offset between two registers, FROM to be eliminated and its + replacement TO, at the start of a routine. */ +HOST_WIDE_INT +rs6000_initial_elimination_offset (int from, int to) +{ + rs6000_stack_t *info = rs6000_stack_info (); + HOST_WIDE_INT offset; + + if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) + offset = info->push_p ? 0 : -info->total_size; + else if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM) + offset = info->total_size; + else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) + offset = info->push_p ? info->total_size : 0; + else if (from == RS6000_PIC_OFFSET_TABLE_REGNUM) + offset = 0; + else + abort (); + + return offset; +} + /* Return true if TYPE is of type __ev64_opaque__. */ static bool diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 3665b0a3fb5..761873dc63e 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -84,11 +84,15 @@ %{mcpu=740: -mppc} \ %{mcpu=7400: -mppc} \ %{mcpu=7450: -mppc} \ +%{mcpu=G4: -mppc} \ %{mcpu=750: -mppc} \ +%{mcpu=G3: -mppc} \ %{mcpu=801: -mppc} \ %{mcpu=821: -mppc} \ %{mcpu=823: -mppc} \ %{mcpu=860: -mppc} \ +%{mcpu=970: -mpower4} \ +%{mcpu=G5: -mpower4} \ %{mcpu=8540: -me500} \ %{maltivec: -maltivec}" @@ -183,7 +187,10 @@ extern int target_flags; /* Return small structures in memory (as the AIX ABI requires). */ #define MASK_AIX_STRUCT_RET 0x00040000 -/* The only remaining free bits are 0x00780000. sysv4.h uses +/* Use single field mfcr instruction. */ +#define MASK_MFCRF 0x00080000 + +/* The only remaining free bits are 0x00700000. sysv4.h uses 0x00800000 -> 0x40000000, and 0x80000000 is not available because target_flags is signed. */ @@ -206,6 +213,17 @@ extern int target_flags; #define TARGET_ALTIVEC (target_flags & MASK_ALTIVEC) #define TARGET_AIX_STRUCT_RET (target_flags & MASK_AIX_STRUCT_RET) +/* Define TARGET_MFCRF if the target assembler supports the optional + field operand for mfcr and the target processor supports the + instruction. */ + +#ifdef HAVE_AS_MFCRF +#define TARGET_MFCRF (target_flags & MASK_MFCRF) +#else +#define TARGET_MFCRF 0 +#endif + + #define TARGET_32BIT (! TARGET_64BIT) #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) #define TARGET_UPDATE (! TARGET_NO_UPDATE) @@ -255,19 +273,19 @@ extern int target_flags; {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ N_("Use PowerPC General Purpose group optional instructions")},\ {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ - N_("Don't use PowerPC General Purpose group optional instructions")},\ + N_("Do not use PowerPC General Purpose group optional instructions")},\ {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ N_("Use PowerPC Graphics group optional instructions")},\ {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ - N_("Don't use PowerPC Graphics group optional instructions")},\ + N_("Do not use PowerPC Graphics group optional instructions")},\ {"powerpc64", MASK_POWERPC64, \ N_("Use PowerPC-64 instruction set")}, \ {"no-powerpc64", - MASK_POWERPC64, \ - N_("Don't use PowerPC-64 instruction set")}, \ + N_("Do not use PowerPC-64 instruction set")}, \ {"altivec", MASK_ALTIVEC , \ N_("Use AltiVec instructions")}, \ {"no-altivec", - MASK_ALTIVEC , \ - N_("Don't use AltiVec instructions")}, \ + N_("Do not use AltiVec instructions")}, \ {"new-mnemonics", MASK_NEW_MNEMONICS, \ N_("Use new mnemonics for PowerPC architecture")},\ {"old-mnemonics", -MASK_NEW_MNEMONICS, \ @@ -278,11 +296,11 @@ extern int target_flags; {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ N_("Place floating point constants in TOC")}, \ {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ - N_("Don't place floating point constants in TOC")},\ + N_("Do not place floating point constants in TOC")},\ {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ N_("Place symbol+offset constants in TOC")}, \ {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ - N_("Don't place symbol+offset constants in TOC")},\ + N_("Do not place symbol+offset constants in TOC")},\ {"minimal-toc", MASK_MINIMAL_TOC, \ "Use only one TOC entry per procedure"}, \ {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ @@ -290,9 +308,9 @@ extern int target_flags; {"no-minimal-toc", - MASK_MINIMAL_TOC, \ N_("Place variable addresses in the regular TOC")},\ {"hard-float", - MASK_SOFT_FLOAT, \ - N_("Use hardware fp")}, \ + N_("Use hardware floating point")}, \ {"soft-float", MASK_SOFT_FLOAT, \ - N_("Do not use hardware fp")}, \ + N_("Do not use hardware floating point")}, \ {"multiple", MASK_MULTIPLE, \ N_("Generate load/store multiple instructions")}, \ {"no-multiple", - MASK_MULTIPLE, \ @@ -308,11 +326,11 @@ extern int target_flags; {"fused-madd", - MASK_NO_FUSED_MADD, \ N_("Generate fused multiply/add instructions")},\ {"no-fused-madd", MASK_NO_FUSED_MADD, \ - N_("Don't generate fused multiply/add instructions")},\ + N_("Do not generate fused multiply/add instructions")},\ {"sched-prolog", MASK_SCHED_PROLOG, \ ""}, \ {"no-sched-prolog", -MASK_SCHED_PROLOG, \ - N_("Don't schedule the start and end of the procedure")},\ + N_("Do not schedule the start and end of the procedure")},\ {"sched-epilog", MASK_SCHED_PROLOG, \ ""}, \ {"no-sched-epilog", -MASK_SCHED_PROLOG, \ @@ -322,9 +340,13 @@ extern int target_flags; {"svr4-struct-return", - MASK_AIX_STRUCT_RET, \ N_("Return small structures in registers (SVR4 default)")},\ {"no-aix-struct-return", - MASK_AIX_STRUCT_RET, \ - ""},\ + ""}, \ {"no-svr4-struct-return", MASK_AIX_STRUCT_RET, \ - ""},\ + ""}, \ + {"mfcrf", MASK_MFCRF, \ + N_("Generate single field mfcr instruction")}, \ + {"no-mfcrf", - MASK_MFCRF, \ + N_("Do not generate single field mfcr instruction")},\ SUBTARGET_SWITCHES \ {"", TARGET_DEFAULT | MASK_SCHED_PROLOG, \ ""}} @@ -525,16 +547,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; #define DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME \ (rs6000_cpu == PROCESSOR_POWER4 ? sched_finish_regroup_exact : sched_finish_none) -/* Define TARGET_MFCRF if the target assembler supports the optional - field operand for mfcr and the target processor supports the - instruction. */ - -#ifdef HAVE_AS_MFCRF -#define TARGET_MFCRF (rs6000_cpu == PROCESSOR_POWER4) -#else -#define TARGET_MFCRF 0 -#endif - #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128) #define TARGET_ALTIVEC_ABI rs6000_altivec_abi #define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave @@ -551,7 +563,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; 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 + Do not use this macro to turn on various extra optimizations for `-O'. That is what `OPTIMIZATION_OPTIONS' is for. On the RS/6000 this is used to define the target cpu type. */ @@ -604,7 +616,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ - (MODE) = word_mode; + (MODE) = TARGET_32BIT ? SImode : DImode; /* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */ @@ -625,7 +637,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; #define MAX_BITS_PER_WORD 64 /* Width of a word, in units (bytes). */ -#define UNITS_PER_WORD (TARGET_32BIT ? 4 : 8) +#define UNITS_PER_WORD (! TARGET_POWERPC64 ? 4 : 8) #ifdef IN_LIBGCC2 #define MIN_UNITS_PER_WORD UNITS_PER_WORD #else @@ -988,8 +1000,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; POWER and PowerPC GPRs hold 32 bits worth; PowerPC64 GPRs and FPRs point register holds 64 bits worth. */ -#define UNITS_PER_GPR_WORD (! TARGET_POWERPC64 ? 4 : 8) - #define HARD_REGNO_NREGS(REGNO, MODE) \ (FP_REGNO_P (REGNO) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ @@ -997,7 +1007,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; ? ((GET_MODE_SIZE (MODE) + UNITS_PER_SPE_WORD - 1) / UNITS_PER_SPE_WORD) \ : ALTIVEC_REGNO_P (REGNO) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD) \ - : ((GET_MODE_SIZE (MODE) + UNITS_PER_GPR_WORD - 1) / UNITS_PER_GPR_WORD)) + : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ ((TARGET_32BIT && TARGET_POWERPC64 \ @@ -1042,7 +1052,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops; : SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE) ? 1 \ : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \ : XER_REGNO_P (REGNO) ? (MODE) == PSImode \ - : GET_MODE_SIZE (MODE) <= UNITS_PER_GPR_WORD) + : GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) /* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. @@ -1465,16 +1475,19 @@ enum reg_class #define CLASS_MAX_NREGS(CLASS, MODE) \ (((CLASS) == FLOAT_REGS) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ - : ((GET_MODE_SIZE (MODE) + UNITS_PER_GPR_WORD - 1) / UNITS_PER_GPR_WORD)) + : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) /* Return a class of registers that cannot change FROM mode to TO mode. */ -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \ +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) \ + && GET_MODE_SIZE (FROM) >= 8 && GET_MODE_SIZE (TO) >= 8) \ + ? 0 \ + : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ + ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \ : (TARGET_SPE && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1) \ - ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ + ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ : 0) /* Stack layout; function entry, exit and calling. */ @@ -1489,49 +1502,6 @@ enum rs6000_abi { extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ -/* Structure used to define the rs6000 stack */ -typedef struct rs6000_stack { - int first_gp_reg_save; /* first callee saved GP register used */ - int first_fp_reg_save; /* first callee saved FP register used */ - int first_altivec_reg_save; /* first callee saved AltiVec register used */ - int lr_save_p; /* true if the link reg needs to be saved */ - int cr_save_p; /* true if the CR reg needs to be saved */ - unsigned int vrsave_mask; /* mask of vec registers to save */ - int toc_save_p; /* true if the TOC needs to be saved */ - int push_p; /* true if we need to allocate stack space */ - int calls_p; /* true if the function makes any calls */ - enum rs6000_abi abi; /* which ABI to use */ - int gp_save_offset; /* offset to save GP regs from initial SP */ - int fp_save_offset; /* offset to save FP regs from initial SP */ - int altivec_save_offset; /* offset to save AltiVec regs from initial SP */ - int lr_save_offset; /* offset to save LR from initial SP */ - int cr_save_offset; /* offset to save CR from initial SP */ - int vrsave_save_offset; /* offset to save VRSAVE from initial SP */ - int spe_gp_save_offset; /* offset to save spe 64-bit gprs */ - int toc_save_offset; /* offset to save the TOC pointer */ - int varargs_save_offset; /* offset to save the varargs registers */ - int ehrd_offset; /* offset to EH return data */ - int reg_size; /* register size (4 or 8) */ - int varargs_size; /* size to hold V.4 args passed in regs */ - int vars_size; /* variable save area size */ - int parm_size; /* outgoing parameter size */ - int save_size; /* save area size */ - int fixed_size; /* fixed size of stack frame */ - int gp_size; /* size of saved GP registers */ - int fp_size; /* size of saved FP registers */ - int altivec_size; /* size of saved AltiVec registers */ - int cr_size; /* size to hold CR if not in save_size */ - int lr_size; /* size to hold LR if not in save_size */ - int vrsave_size; /* size to hold VRSAVE if not in save_size */ - int altivec_padding_size; /* size of altivec alignment padding if - not in save_size */ - int spe_gp_size; /* size of 64-bit GPR save size for SPE */ - int spe_padding_size; - int toc_size; /* size to hold TOC if not in save_size */ - int total_size; /* total bytes allocated for stack */ - int spe_64bit_regs_used; -} rs6000_stack_t; - /* Define this if pushing a word on the stack makes the stack pointer a smaller address. */ #define STACK_GROWS_DOWNWARD @@ -1766,10 +1736,12 @@ typedef struct rs6000_args /* Define intermediate macro to compute the size (in registers) of an argument for the RS/6000. */ +#define UNITS_PER_ARG (TARGET_32BIT ? 4 : 8) + #define RS6000_ARG_SIZE(MODE, TYPE) \ ((MODE) != BLKmode \ - ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ - : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) + ? (GET_MODE_SIZE (MODE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG \ + : (int_size_in_bytes (TYPE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG) /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. @@ -1796,18 +1768,6 @@ typedef struct rs6000_args #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ function_arg_advance (&CUM, MODE, TYPE, NAMED) -/* Nonzero if we can use a floating-point register to pass this arg. */ -#define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ - (GET_MODE_CLASS (MODE) == MODE_FLOAT \ - && (CUM).fregno <= FP_ARG_MAX_REG \ - && TARGET_HARD_FLOAT && TARGET_FPRS) - -/* Nonzero if we can use an AltiVec register to pass this arg. */ -#define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE) \ - (ALTIVEC_VECTOR_MODE (MODE) \ - && (CUM).vregno <= ALTIVEC_ARG_MAX_REG \ - && TARGET_ALTIVEC_ABI) - /* 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. @@ -1871,10 +1831,6 @@ typedef struct rs6000_args the ABIs at the moment. For now, only AIX gets fixed. */ #define SPLIT_COMPLEX_ARGS (DEFAULT_ABI == ABI_AIX) -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = rs6000_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ rs6000_va_start (valist, nextarg) @@ -1996,21 +1952,8 @@ typedef struct rs6000_args /* 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) \ -{ \ - rs6000_stack_t *info = rs6000_stack_info (); \ - \ - if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ - (OFFSET) = (info->push_p) ? 0 : - info->total_size; \ - else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ - (OFFSET) = info->total_size; \ - else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ - (OFFSET) = (info->push_p) ? info->total_size : 0; \ - else if ((FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM) \ - (OFFSET) = 0; \ - else \ - abort (); \ -} +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + ((OFFSET) = rs6000_initial_elimination_offset(FROM, TO)) /* Addressing modes, and classification of registers for them. */ @@ -2288,6 +2231,9 @@ do { \ between pointers and any other objects of this machine mode. */ #define Pmode (TARGET_32BIT ? SImode : DImode) +/* Supply definition of STACK_SIZE_MODE for allocate_dynamic_stack_space. */ +#define STACK_SIZE_MODE (TARGET_32BIT ? SImode : DImode) + /* Mode of a function address in a call instruction (for indexing purposes). Doesn't matter on RS/6000. */ #define FUNCTION_MODE SImode diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 73a87871733..3ab0465a316 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1020,7 +1020,7 @@ (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r,r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ {cax.|add.} %3,%1,%2 {ai.|addic.} %3,%1,%2 @@ -1035,7 +1035,7 @@ (match_operand:SI 2 "reg_or_short_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (plus:SI (match_dup 1) (match_dup 2))) @@ -1052,7 +1052,7 @@ (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") (plus:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ {cax.|add.} %0,%1,%2 {ai.|addic.} %0,%1,%2 @@ -1068,7 +1068,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (plus:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2))) @@ -1109,7 +1109,7 @@ (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:SI 2 "=r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ nor. %2,%1,%1 #" @@ -1121,7 +1121,7 @@ (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 2 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 2) (not:SI (match_dup 1))) (set (match_dup 0) @@ -1135,7 +1135,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (not:SI (match_dup 1)))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ nor. %0,%1,%1 #" @@ -1148,7 +1148,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (not:SI (match_dup 1)))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (not:SI (match_dup 1))) (set (match_dup 2) @@ -1191,7 +1191,7 @@ (match_operand:SI 2 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] - "TARGET_POWERPC && ! TARGET_POWERPC64" + "TARGET_POWERPC && TARGET_32BIT" "@ subf. %3,%2,%1 #" @@ -1204,7 +1204,7 @@ (match_operand:SI 2 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2))) @@ -1235,7 +1235,7 @@ (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC && ! TARGET_POWERPC64" + "TARGET_POWERPC && TARGET_32BIT" "@ subf. %0,%2,%1 #" @@ -1250,7 +1250,7 @@ (set (match_operand:SI 0 "gpc_reg_operand" "") (minus:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2))) @@ -1563,7 +1563,7 @@ (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:SI 2 "=r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ neg. %2,%1 #" @@ -1575,7 +1575,7 @@ (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 2 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 2) (neg:SI (match_dup 1))) (set (match_dup 0) @@ -1589,7 +1589,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (neg:SI (match_dup 1)))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ neg. %0,%1 #" @@ -1602,7 +1602,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (neg:SI (match_dup 1)))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (neg:SI (match_dup 1))) (set (match_dup 2) @@ -2225,7 +2225,7 @@ (const_int 0))) (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r")) (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ and. %3,%1,%2 {andil.|andi.} %3,%1,%b2 @@ -2304,7 +2304,7 @@ (and:SI (match_dup 1) (match_dup 2))) (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ and. %0,%1,%2 {andil.|andi.} %0,%1,%b2 @@ -2516,7 +2516,7 @@ (match_operand:SI 2 "gpc_reg_operand" "r,r")]) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %3,%1,%2 #" @@ -2530,7 +2530,7 @@ (match_operand:SI 2 "gpc_reg_operand" "")]) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (compare:CC (match_dup 3) @@ -2545,7 +2545,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 4))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %0,%1,%2 #" @@ -2560,7 +2560,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 4))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (match_dup 4)) (set (match_dup 3) (compare:CC (match_dup 0) @@ -2604,7 +2604,7 @@ (match_operand:SI 2 "gpc_reg_operand" "r,r")]) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %3,%2,%1 #" @@ -2618,7 +2618,7 @@ (match_operand:SI 2 "gpc_reg_operand" "")]) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (compare:CC (match_dup 3) @@ -2633,7 +2633,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 4))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %0,%2,%1 #" @@ -2648,7 +2648,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 4))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (match_dup 4)) (set (match_dup 3) (compare:CC (match_dup 0) @@ -2670,7 +2670,7 @@ (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))]) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %3,%1,%2 #" @@ -2684,7 +2684,7 @@ (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))]) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (compare:CC (match_dup 3) @@ -2699,7 +2699,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 4))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ %q4. %0,%1,%2 #" @@ -2714,7 +2714,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 4))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (match_dup 4)) (set (match_dup 3) (compare:CC (match_dup 0) @@ -3618,7 +3618,7 @@ (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] - "! TARGET_POWER && ! TARGET_POWERPC64" + "! TARGET_POWER && TARGET_32BIT" "@ {sl|slw}%I2. %3,%1,%h2 #" @@ -3631,7 +3631,7 @@ (match_operand:SI 2 "reg_or_cint_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed" + "! TARGET_POWER && TARGET_32BIT && reload_completed" [(set (match_dup 3) (ashift:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) @@ -3680,7 +3680,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (ashift:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWER && ! TARGET_POWERPC64" + "! TARGET_POWER && TARGET_32BIT" "@ {sl|slw}%I2. %0,%1,%h2 #" @@ -3694,7 +3694,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (ashift:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed" + "! TARGET_POWER && TARGET_32BIT && reload_completed" [(set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2))) (set (match_dup 3) @@ -3851,7 +3851,7 @@ (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri")) (const_int 0))) (clobber (match_scratch:SI 3 "=X,r,X,r"))] - "! TARGET_POWER && ! TARGET_POWERPC64" + "! TARGET_POWER && TARGET_32BIT" "@ mr. %1,%1 {sr|srw}%I2. %3,%1,%h2 @@ -3866,7 +3866,7 @@ (match_operand:SI 2 "reg_or_cint_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] - "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed" + "! TARGET_POWER && TARGET_32BIT && reload_completed" [(set (match_dup 3) (lshiftrt:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) @@ -3917,7 +3917,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") (lshiftrt:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWER && ! TARGET_POWERPC64" + "! TARGET_POWER && TARGET_32BIT" "@ mr. %0,%1 {sr|srw}%I2. %0,%1,%h2 @@ -3933,7 +3933,7 @@ (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (lshiftrt:SI (match_dup 1) (match_dup 2)))] - "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed" + "! TARGET_POWER && TARGET_32BIT && reload_completed" [(set (match_dup 0) (lshiftrt:SI (match_dup 1) (match_dup 2))) (set (match_dup 3) @@ -7739,7 +7739,7 @@ (compare:CC (match_operand:SI 1 "gpc_reg_operand" "0,r,r") (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r") (match_dup 1))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ {cmpi|cmpwi} %2,%0,0 mr. %0,%1 @@ -7752,7 +7752,7 @@ (compare:CC (match_operand:SI 1 "gpc_reg_operand" "") (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 0) (match_dup 1)) (set (match_dup 2) (compare:CC (match_dup 0) @@ -8159,16 +8159,18 @@ [(set_attr "type" "*,load,store,*,*,*") (set_attr "length" "8,8,8,8,12,16")]) +; ld/std require word-aligned displacements, so use offsettable constraint. +; List o->r and r->o before r->r for reload. (define_insn "*movdf_hardfloat64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,f,f,m,!cl,!r,!r,!r,!r") - (match_operand:DF 1 "input_operand" "r,m,r,f,m,f,r,h,G,H,F"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=o,??r,!r,f,f,m,!cl,!r,!r,!r,!r") + (match_operand:DF 1 "input_operand" "r,o,r,f,m,f,r,h,G,H,F"))] "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && (gpc_reg_operand (operands[0], DFmode) || gpc_reg_operand (operands[1], DFmode))" "@ - mr %0,%1 - ld%U1%X1 %0,%1 std%U0%X0 %1,%0 + ld%U1%X1 %0,%1 + mr %0,%1 fmr %0,%1 lfd%U1%X1 %0,%1 stfd%U0%X0 %1,%0 @@ -8181,8 +8183,8 @@ (set_attr "length" "4,4,4,4,4,4,4,4,8,12,16")]) (define_insn "*movdf_softfloat64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r") - (match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r,*h") + (match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F,0"))] "TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS) && (gpc_reg_operand (operands[0], DFmode) || gpc_reg_operand (operands[1], DFmode))" @@ -8194,127 +8196,39 @@ std%U0%X0 %1,%0 # # - #" - [(set_attr "type" "*,*,*,load,store,*,*,*") - (set_attr "length" "4,4,4,4,4,8,12,16")]) + # + nop" + [(set_attr "type" "*,*,*,load,store,*,*,*,*") + (set_attr "length" "4,4,4,4,4,8,12,16,4")]) (define_expand "movtf" [(set (match_operand:TF 0 "general_operand" "") (match_operand:TF 1 "any_operand" ""))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }") -(define_insn "*movtf_internal" - [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r") - (match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128 +; It's important to list the o->f and f->o moves before f->f because +; otherwise reload, given m->f, will try to pick f->f and reload it, +; which doesn't make progress. +(define_insn_and_split "*movtf_internal" + [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,rm,r") + (match_operand:TF 1 "input_operand" "f,o,f,r,mGHF"))] + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128 && (gpc_reg_operand (operands[0], TFmode) || gpc_reg_operand (operands[1], TFmode))" - "* -{ - switch (which_alternative) - { - default: - abort (); - case 0: - /* We normally copy the low-numbered register first. However, if - the first register operand 0 is the same as the second register of - operand 1, we must copy in the opposite order. */ - if (REGNO (operands[0]) == REGNO (operands[1]) + 1) - return \"fmr %L0,%L1\;fmr %0,%1\"; - else - return \"fmr %0,%1\;fmr %L0,%L1\"; - case 1: - return \"lfd %0,%1\;lfd %L0,%Y1\"; - case 2: - return \"stfd %1,%0\;stfd %L1,%Y0\"; - case 3: - case 4: - case 5: - return \"#\"; - } -}" - [(set_attr "type" "fp,fpload,fpstore,*,*,*") - (set_attr "length" "8,8,8,12,16,20")]) - -(define_split - [(set (match_operand:TF 0 "gpc_reg_operand" "") - (match_operand:TF 1 "easy_fp_constant" ""))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_POWERPC64 - && TARGET_LONG_DOUBLE_128 && reload_completed - && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31) - || (GET_CODE (operands[0]) == SUBREG - && GET_CODE (SUBREG_REG (operands[0])) == REG - && REGNO (SUBREG_REG (operands[0])) <= 31))" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] - " -{ - long l[4]; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]); - REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, l); - - operands[2] = operand_subword (operands[0], 0, 0, TFmode); - operands[3] = operand_subword (operands[0], 1, 0, TFmode); - operands[4] = operand_subword (operands[0], 2, 0, TFmode); - operands[5] = operand_subword (operands[0], 3, 0, TFmode); - operands[6] = gen_int_mode (l[0], SImode); - operands[7] = gen_int_mode (l[1], SImode); - operands[8] = gen_int_mode (l[2], SImode); - operands[9] = gen_int_mode (l[3], SImode); -}") - -(define_split - [(set (match_operand:TF 0 "gpc_reg_operand" "") - (match_operand:TF 1 "easy_fp_constant" ""))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_POWERPC64 - && TARGET_LONG_DOUBLE_128 && reload_completed - && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31) - || (GET_CODE (operands[0]) == SUBREG - && GET_CODE (SUBREG_REG (operands[0])) == REG - && REGNO (SUBREG_REG (operands[0])) <= 31))" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] - " -{ - long l[4]; - REAL_VALUE_TYPE rv; -#if HOST_BITS_PER_WIDE_INT >= 64 - HOST_WIDE_INT val; -#endif - - REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]); - REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, l); - - operands[2] = gen_lowpart (DImode, operands[0]); - operands[3] = gen_highpart (DImode, operands[0]); -#if HOST_BITS_PER_WIDE_INT >= 64 - val = ((HOST_WIDE_INT)(unsigned long)l[0] << 32 - | ((HOST_WIDE_INT)(unsigned long)l[1])); - operands[4] = gen_int_mode (val, DImode); - - val = ((HOST_WIDE_INT)(unsigned long)l[2] << 32 - | ((HOST_WIDE_INT)(unsigned long)l[3])); - operands[5] = gen_int_mode (val, DImode); -#else - operands[4] = immed_double_const (l[1], l[0], DImode); - operands[5] = immed_double_const (l[3], l[2], DImode); -#endif -}") + "#" + "reload_completed" + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; } + [(set_attr "length" "8,8,8,20,20")]) (define_insn "extenddftf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { if (REGNO (operands[0]) == REGNO (operands[1])) @@ -8327,8 +8241,8 @@ (define_insn "extendsftf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { if (REGNO (operands[0]) == REGNO (operands[1])) @@ -8341,8 +8255,8 @@ (define_insn "trunctfdf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "fadd %0,%1,%L1" [(set_attr "type" "fp") (set_attr "length" "8")]) @@ -8351,8 +8265,8 @@ [(set (match_operand:SF 0 "gpc_reg_operand" "=f") (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f"))) (clobber (match_scratch:DF 2 "=f"))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT - && TARGET_FPRS && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" [(set (match_dup 2) @@ -8365,7 +8279,8 @@ [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (float:TF (match_operand:DI 1 "gpc_reg_operand" "*f"))) (clobber (match_scratch:DF 2 "=f"))] - "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64 + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" @@ -8379,8 +8294,8 @@ [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (float:TF (match_operand:SI 1 "gpc_reg_operand" "r"))) (clobber (match_scratch:DF 2 "=f"))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" [(set (match_dup 2) @@ -8393,7 +8308,8 @@ [(set (match_operand:DI 0 "gpc_reg_operand" "=*f") (fix:DI (match_operand:TF 1 "gpc_reg_operand" "f"))) (clobber (match_scratch:DF 2 "=f"))] - "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64 + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" @@ -8407,8 +8323,8 @@ [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:TF 1 "gpc_reg_operand" "f"))) (clobber (match_scratch:DF 2 "=f"))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" [(set (match_dup 2) @@ -8420,8 +8336,8 @@ (define_insn "negtf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { if (REGNO (operands[0]) == REGNO (operands[1]) + 1) @@ -8435,8 +8351,8 @@ (define_insn "abstf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { if (REGNO (operands[0]) == REGNO (operands[1]) + 1) @@ -8450,8 +8366,8 @@ (define_insn "" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { if (REGNO (operands[0]) == REGNO (operands[1]) + 1) @@ -8523,32 +8439,13 @@ #endif }") -(define_split - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (match_operand:DI 1 "const_double_operand" ""))] - "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] - " -{ - operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0, - DImode); - operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0, - DImode); - operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); -}") - (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "input_operand" ""))] "reload_completed && !TARGET_POWERPC64 && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_split [(set (match_operand:TI 0 "gpc_reg_operand" "") @@ -8777,28 +8674,10 @@ (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") (match_operand:TI 1 "input_operand" ""))] - "reload_completed && TARGET_POWERPC64 - && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] -"{ - rs6000_split_multireg_move (operands); -}") - -(define_split - [(set (match_operand:TI 0 "nonimmediate_operand" "") - (match_operand:TI 1 "input_operand" ""))] - "reload_completed && !TARGET_POWERPC64 + "reload_completed && gpr_or_gpr_p (operands[0], operands[1])" - [(set (match_dup 2) (match_dup 6)) - (set (match_dup 3) (match_dup 7)) - (set (match_dup 4) (match_dup 8)) - (set (match_dup 5) (match_dup 9))] -"{ - rs6000_split_multireg_move (operands); -}") - - + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_expand "load_multiple" [(match_par_dup 3 [(set (match_operand:SI 0 "" "") @@ -10270,7 +10149,7 @@ if (GET_CODE (operands[0]) != SYMBOL_REF || (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[0])) - || (INTVAL (operands[2]) & CALL_LONG) != 0) + || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[2]) & CALL_LONG) != 0)) { if (INTVAL (operands[2]) & CALL_LONG) operands[0] = rs6000_longcall_ref (operands[0]); @@ -10318,7 +10197,7 @@ if (GET_CODE (operands[1]) != SYMBOL_REF || (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[1])) - || (INTVAL (operands[3]) & CALL_LONG) != 0) + || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[3]) & CALL_LONG) != 0)) { if (INTVAL (operands[3]) & CALL_LONG) operands[1] = rs6000_longcall_ref (operands[1]); @@ -10573,9 +10452,9 @@ (match_operand 1 "" "g,g")) (use (match_operand:SI 2 "immediate_operand" "O,n")) (clobber (match_scratch:SI 3 "=l,l"))] - "(DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - && (INTVAL (operands[2]) & CALL_LONG) == 0" + "(DEFAULT_ABI == ABI_DARWIN + || (DEFAULT_ABI == ABI_V4 + && (INTVAL (operands[2]) & CALL_LONG) == 0))" { if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS) output_asm_insn ("crxor 6,6,6", operands); @@ -10583,7 +10462,11 @@ else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn ("creqv 6,6,6", operands); +#if TARGET_MACHO + return output_call(insn, operands, 0, 2); +#else return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@plt" : "bl %z0"; +#endif } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10614,9 +10497,9 @@ (match_operand 2 "" "g,g"))) (use (match_operand:SI 3 "immediate_operand" "O,n")) (clobber (match_scratch:SI 4 "=l,l"))] - "(DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - && (INTVAL (operands[3]) & CALL_LONG) == 0" + "(DEFAULT_ABI == ABI_DARWIN + || (DEFAULT_ABI == ABI_V4 + && (INTVAL (operands[3]) & CALL_LONG) == 0))" { if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS) output_asm_insn ("crxor 6,6,6", operands); @@ -10624,7 +10507,11 @@ else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn ("creqv 6,6,6", operands); +#if TARGET_MACHO + return output_call(insn, operands, 1, 3); +#else return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@plt" : "bl %z1"; +#endif } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10977,8 +10864,8 @@ (define_expand "cmptf" [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "") (match_operand:TF 1 "gpc_reg_operand" "")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT - && TARGET_FPRS && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" " { rs6000_compare_op0 = operands[0]; @@ -11343,8 +11230,8 @@ [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f") (match_operand:TF 2 "gpc_reg_operand" "f")))] - "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS - && TARGET_LONG_DOUBLE_128" + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2" [(set_attr "type" "fpcompare") (set_attr "length" "12")]) @@ -11401,7 +11288,7 @@ (const_int 0))) (set (match_operand:SI 3 "gpc_reg_operand" "=r,r") (match_op_dup 1 [(match_dup 2) (const_int 0)]))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "@ mfcr %3%Q2\;{rlinm.|rlwinm.} %3,%3,%J1,1 #" @@ -11416,7 +11303,7 @@ (const_int 0))) (set (match_operand:SI 3 "gpc_reg_operand" "") (match_op_dup 1 [(match_dup 2) (const_int 0)]))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(set (match_dup 3) (match_op_dup 1 [(match_dup 2) (const_int 0)])) (set (match_dup 0) @@ -12133,7 +12020,7 @@ [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") (match_operand:SI 2 "reg_or_short_operand" "rI")))] - "! TARGET_POWERPC64" + "TARGET_32BIT" "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0" [(set_attr "length" "12")]) @@ -12207,21 +12094,6 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC - (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "reg_or_short_operand" "rI,rI")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (leu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0 - #" - [(set_attr "type" "compare") - (set_attr "length" "12,16")]) - (define_insn "" [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") @@ -14299,7 +14171,7 @@ (const_int -1))) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:SI 4 ""))] - "! TARGET_POWERPC64 && reload_completed" + "TARGET_32BIT && reload_completed" [(parallel [(set (match_dup 3) (compare:CC (plus:SI (match_dup 1) (const_int -1)) @@ -14325,7 +14197,7 @@ (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:SI 4 ""))] - "! TARGET_POWERPC64 && reload_completed + "TARGET_32BIT && reload_completed && ! gpc_reg_operand (operands[0], SImode)" [(parallel [(set (match_dup 3) (compare:CC (plus:SI (match_dup 1) @@ -14397,63 +14269,6 @@ " { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], const0_rtx); }") - -; These two are for 64-bit hardware running 32-bit mode. -; We don't use the add. instruction in this mode. -(define_split - [(set (pc) - (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:SI 1 "gpc_reg_operand" "") - (const_int 1)]) - (match_operand 5 "" "") - (match_operand 6 "" ""))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:SI 4 ""))] - "TARGET_POWERPC64 && TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (plus:SI (match_dup 1) - (const_int -1))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0))) - (set (pc) (if_then_else (match_dup 7) - (match_dup 5) - (match_dup 6)))] - " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") - -(define_split - [(set (pc) - (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:SI 1 "gpc_reg_operand" "") - (const_int 1)]) - (match_operand 5 "" "") - (match_operand 6 "" ""))) - (set (match_operand:SI 0 "nonimmediate_operand" "") - (plus:SI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:SI 4 ""))] - "TARGET_POWERPC64 && TARGET_32BIT && reload_completed - && ! gpc_reg_operand (operands[0], SImode)" - [(set (match_dup 4) - (plus:SI (match_dup 1) - (const_int -1))) - (set (match_dup 3) - (compare:CC (match_dup 4) - (const_int 0))) - (set (match_dup 0) - (match_dup 4)) - (set (pc) (if_then_else (match_dup 7) - (match_dup 5) - (match_dup 6)))] - " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") - (define_insn "trap" [(trap_if (const_int 1) (const_int 0))] @@ -14698,30 +14513,7 @@ [(const_int 0)] " { - rs6000_stack_t *info = rs6000_stack_info (); - - if (info->lr_save_p) - { - rtx frame_rtx = stack_pointer_rtx; - int sp_offset = 0; - rtx tmp; - - if (frame_pointer_needed - || current_function_calls_alloca - || info->total_size > 32767) - { - emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx)); - frame_rtx = operands[1]; - } - else if (info->push_p) - sp_offset = info->total_size; - - tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset); - tmp = gen_rtx_MEM (Pmode, tmp); - emit_move_insn (tmp, operands[0]); - } - else - emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]); + rs6000_emit_eh_reg_restore (operands[0], operands[1]); DONE; }") diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 45928e4498b..a49a1ca6516 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -199,6 +199,8 @@ do { \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "netbsd")) \ rs6000_current_abi = ABI_V4; \ + else if (!strcmp (rs6000_abi_name, "openbsd")) \ + rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "i960-old")) \ { \ rs6000_current_abi = ABI_V4; \ @@ -389,6 +391,21 @@ do { \ #undef STACK_BOUNDARY #define STACK_BOUNDARY (TARGET_ALTIVEC_ABI ? 128 : 64) +/* Define this macro if you wish to preserve a certain alignment for + the stack pointer, greater than what the hardware enforces. The + definition is a C expression for the desired alignment (measured + in bits). This macro must evaluate to a value equal to or larger + than STACK_BOUNDARY. + For the SYSV ABI and variants the alignment of the stack pointer + is usually controlled manually in rs6000.c. However, to maintain + alignment across alloca () in all circumstances, + PREFERRED_STACK_BOUNDARY needs to be set as well. + This has the additional advantage of allowing a bigger maximum + alignment of user objects on the stack. */ + +#undef PREFERRED_STACK_BOUNDARY +#define PREFERRED_STACK_BOUNDARY 128 + /* Real stack boundary as mandated by the appropriate ABI. */ #define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128) @@ -453,7 +470,7 @@ do { \ #define TOC_SECTION_FUNCTION \ void \ -toc_section () \ +toc_section (void) \ { \ if (in_section != in_toc) \ { \ @@ -495,14 +512,14 @@ toc_section () \ } \ \ extern int in_toc_section (void); \ -int in_toc_section () \ +int in_toc_section (void) \ { \ return in_section == in_toc; \ } #define SDATA_SECTION_FUNCTION \ void \ -sdata_section () \ +sdata_section (void) \ { \ if (in_section != in_sdata) \ { \ @@ -513,7 +530,7 @@ sdata_section () \ #define SDATA2_SECTION_FUNCTION \ void \ -sdata2_section () \ +sdata2_section (void) \ { \ if (in_section != in_sdata2) \ { \ @@ -524,7 +541,7 @@ sdata2_section () \ #define SBSS_SECTION_FUNCTION \ void \ -sbss_section () \ +sbss_section (void) \ { \ if (in_section != in_sbss) \ { \ @@ -535,7 +552,7 @@ sbss_section () \ #define INIT_SECTION_FUNCTION \ void \ -init_section () \ +init_section (void) \ { \ if (in_section != in_init) \ { \ @@ -546,7 +563,7 @@ init_section () \ #define FINI_SECTION_FUNCTION \ void \ -fini_section () \ +fini_section (void) \ { \ if (in_section != in_fini) \ { \ @@ -793,6 +810,7 @@ extern int fixuplabelno; mcall-aixdesc | \ mcall-freebsd | \ mcall-netbsd | \ + mcall-openbsd | \ mcall-linux | \ mcall-gnu :-mbig; \ mcall-i960-old :-mlittle}" @@ -815,6 +833,7 @@ extern int fixuplabelno; mcall-aixdesc | \ mcall-freebsd | \ mcall-netbsd | \ + mcall-openbsd | \ mcall-linux | \ mcall-gnu : -mbig %(cc1_endian_big); \ mcall-i960-old : -mlittle %(cc1_endian_little); \ @@ -827,7 +846,8 @@ extern int fixuplabelno; %{mcall-i960-old: -meabi } \ %{mcall-linux: -mno-eabi } \ %{mcall-gnu: -mno-eabi } \ - %{mcall-netbsd: -mno-eabi }}} \ + %{mcall-netbsd: -mno-eabi } \ + %{mcall-openbsd: -mno-eabi }}} \ %{msdata: -msdata=default} \ %{mno-sdata: -msdata=none} \ %{profile: -p}" @@ -860,6 +880,7 @@ extern int fixuplabelno; mcall-linux : %(link_start_linux) ; \ mcall-gnu : %(link_start_gnu) ; \ mcall-netbsd : %(link_start_netbsd) ; \ + mcall-openbsd: %(link_start_openbsd) ; \ : %(link_start_default) }" #define LINK_START_DEFAULT_SPEC "" @@ -917,6 +938,7 @@ extern int fixuplabelno; mcall-linux : %(link_os_linux) ; \ mcall-gnu : %(link_os_gnu) ; \ mcall-netbsd : %(link_os_netbsd) ; \ + mcall-openbsd: %(link_os_openbsd) ; \ : %(link_os_default) }" #define LINK_OS_DEFAULT_SPEC "" @@ -933,6 +955,7 @@ extern int fixuplabelno; mcall-linux : %(cpp_os_linux) ; \ mcall-gnu : %(cpp_os_gnu) ; \ mcall-netbsd : %(cpp_os_netbsd) ; \ + mcall-openbsd: %(cpp_os_openbsd) ; \ : %(cpp_os_default) }" #define CPP_OS_DEFAULT_SPEC "" @@ -949,6 +972,7 @@ extern int fixuplabelno; mcall-linux : %(startfile_linux) ; \ mcall-gnu : %(startfile_gnu) ; \ mcall-netbsd : %(startfile_netbsd) ; \ + mcall-openbsd: %(startfile_openbsd) ; \ : %(startfile_default) }" #define STARTFILE_DEFAULT_SPEC "" @@ -965,6 +989,7 @@ extern int fixuplabelno; mcall-linux : %(lib_linux) ; \ mcall-gnu : %(lib_gnu) ; \ mcall-netbsd : %(lib_netbsd) ; \ + mcall-openbsd: %(lib_openbsd) ; \ : %(lib_default) }" #define LIB_DEFAULT_SPEC "" @@ -981,6 +1006,7 @@ extern int fixuplabelno; mcall-linux : crtsavres.o%s %(endfile_linux) ; \ mcall-gnu : crtsavres.o%s %(endfile_gnu) ; \ mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; \ + mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; \ : %(crtsavres_default) %(endfile_default) }" #define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s" @@ -1098,7 +1124,7 @@ extern int fixuplabelno; %{!ansi: \ %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ --Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" +-Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" /* GNU/Hurd support. */ #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \ @@ -1148,6 +1174,34 @@ ncrtn.o%s" #define CPP_OS_NETBSD_SPEC "\ -D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__" +/* OpenBSD support. */ +#ifndef LIB_OPENBSD_SPEC +#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}" +#endif + +#ifndef STARTFILE_OPENBSD_SPEC +#define STARTFILE_OPENBSD_SPEC "\ +%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \ +%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" +#endif + +#ifndef ENDFILE_OPENBSD_SPEC +#define ENDFILE_OPENBSD_SPEC "\ +%{!shared:crtend.o%s} %{shared:crtendS.o%s}" +#endif + +#ifndef LINK_START_OPENBSD_SPEC +#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074" +#endif + +#ifndef LINK_OS_OPENBSD_SPEC +#define LINK_OS_OPENBSD_SPEC "" +#endif + +#ifndef CPP_OS_OPENBSD_SPEC +#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" +#endif + /* WindISS support. */ #define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group" @@ -1180,6 +1234,7 @@ ncrtn.o%s" { "lib_gnu", LIB_GNU_SPEC }, \ { "lib_linux", LIB_LINUX_SPEC }, \ { "lib_netbsd", LIB_NETBSD_SPEC }, \ + { "lib_openbsd", LIB_OPENBSD_SPEC }, \ { "lib_windiss", LIB_WINDISS_SPEC }, \ { "lib_default", LIB_DEFAULT_SPEC }, \ { "startfile_ads", STARTFILE_ADS_SPEC }, \ @@ -1190,6 +1245,7 @@ ncrtn.o%s" { "startfile_gnu", STARTFILE_GNU_SPEC }, \ { "startfile_linux", STARTFILE_LINUX_SPEC }, \ { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ + { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \ { "startfile_windiss", STARTFILE_WINDISS_SPEC }, \ { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ { "endfile_ads", ENDFILE_ADS_SPEC }, \ @@ -1200,6 +1256,7 @@ ncrtn.o%s" { "endfile_gnu", ENDFILE_GNU_SPEC }, \ { "endfile_linux", ENDFILE_LINUX_SPEC }, \ { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ + { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \ { "endfile_windiss", ENDFILE_WINDISS_SPEC }, \ { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ { "link_path", LINK_PATH_SPEC }, \ @@ -1214,6 +1271,7 @@ ncrtn.o%s" { "link_start_gnu", LINK_START_GNU_SPEC }, \ { "link_start_linux", LINK_START_LINUX_SPEC }, \ { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \ + { "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \ { "link_start_windiss", LINK_START_WINDISS_SPEC }, \ { "link_start_default", LINK_START_DEFAULT_SPEC }, \ { "link_os", LINK_OS_SPEC }, \ @@ -1225,6 +1283,7 @@ ncrtn.o%s" { "link_os_linux", LINK_OS_LINUX_SPEC }, \ { "link_os_gnu", LINK_OS_GNU_SPEC }, \ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ + { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ { "link_os_windiss", LINK_OS_WINDISS_SPEC }, \ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \ @@ -1238,6 +1297,7 @@ ncrtn.o%s" { "cpp_os_gnu", CPP_OS_GNU_SPEC }, \ { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ + { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \ { "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \ { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \ SUBSUBTARGET_EXTRA_SPECS diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin index 7aca023302f..490b633ec3b 100644 --- a/gcc/config/rs6000/t-darwin +++ b/gcc/config/rs6000/t-darwin @@ -1,2 +1,3 @@ # Library code must include trampoline support. LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm + diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h index e7e3b2ed995..9a6db9d76c1 100644 --- a/gcc/config/s390/linux.h +++ b/gcc/config/s390/linux.h @@ -53,11 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_assert ("system=linux"); \ - builtin_assert ("system=unix"); \ - builtin_define ("__gnu_linux__"); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h index e99de323336..c45ff4dcd0f 100644 --- a/gcc/config/s390/s390-protos.h +++ b/gcc/config/s390/s390-protos.h @@ -30,7 +30,8 @@ extern void s390_emit_epilogue (void); extern void s390_function_profiler (FILE *, int); #ifdef RTX_CODE -extern int s390_extra_constraint (rtx, int); +extern int s390_extra_constraint_str (rtx, int, const char *); +extern int s390_const_ok_for_constraint_p (HOST_WIDE_INT, int, const char *); extern int const0_operand (rtx, enum machine_mode); extern int consttable_operand (rtx, enum machine_mode); extern int larl_operand (rtx, enum machine_mode); @@ -40,10 +41,8 @@ extern int shift_count_operand (rtx, enum machine_mode); extern int bras_sym_operand (rtx, enum machine_mode); extern int load_multiple_operation (rtx, enum machine_mode); extern int store_multiple_operation (rtx, enum machine_mode); -extern int s390_single_hi (rtx, enum machine_mode, int); -extern int s390_extract_hi (rtx, enum machine_mode, int); -extern int s390_single_qi (rtx, enum machine_mode, int); -extern int s390_extract_qi (rtx, enum machine_mode, int); +extern int s390_single_part (rtx, enum machine_mode, enum machine_mode, int); +extern unsigned HOST_WIDE_INT s390_extract_part (rtx, enum machine_mode, int); extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int); extern int tls_symbolic_operand (rtx); @@ -97,9 +96,9 @@ extern int s390_agen_dep_p (rtx, rtx); extern int s390_function_arg_pass_by_reference (enum machine_mode, tree); extern void s390_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern tree s390_build_va_list (void); #ifdef RTX_CODE extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern rtx s390_function_value (tree, enum machine_mode); extern void s390_va_start (tree, rtx); extern rtx s390_va_arg (tree, tree); #endif /* RTX_CODE */ diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 63c2208fbeb..b79a2675909 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -60,6 +60,7 @@ static void s390_select_rtx_section (enum machine_mode, rtx, static void s390_encode_section_info (tree, rtx, int); static bool s390_cannot_force_const_mem (rtx); static rtx s390_delegitimize_address (rtx); +static bool s390_return_in_memory (tree, tree); static void s390_init_builtins (void); static rtx s390_expand_builtin (tree, rtx, rtx, enum machine_mode, int); static void s390_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, @@ -76,6 +77,7 @@ static bool s390_rtx_costs (rtx, int, int, int *); static int s390_address_cost (rtx); static void s390_reorg (void); static bool s390_valid_pointer_mode (enum machine_mode); +static tree s390_build_builtin_va_list (void); #undef TARGET_ASM_ALIGNED_HI_OP #define TARGET_ASM_ALIGNED_HI_OP "\t.word\t" @@ -106,6 +108,9 @@ static bool s390_valid_pointer_mode (enum machine_mode); #undef TARGET_DELEGITIMIZE_ADDRESS #define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY s390_return_in_memory + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS s390_init_builtins #undef TARGET_EXPAND_BUILTIN @@ -140,6 +145,9 @@ static bool s390_valid_pointer_mode (enum machine_mode); #undef TARGET_VALID_POINTER_MODE #define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; extern int reload_completed; @@ -186,8 +194,7 @@ struct machine_function GTY(()) /* Set, if some of the fprs 8-15 need to be saved (64 bit abi). */ int save_fprs_p; - /* Set if return address needs to be saved because the current - function uses __builtin_return_addr (0). */ + /* Set if return address needs to be saved. */ bool save_return_addr_p; /* Number of first and last gpr to be saved, restored. */ @@ -216,12 +223,12 @@ static const char *get_some_local_dynamic_name (void); static int get_some_local_dynamic_name_1 (rtx *, void *); static int reg_used_in_mem_p (int, rtx); static int addr_generation_dependency_p (rtx, rtx); -static int s390_split_branches (rtx, bool *); +static int s390_split_branches (void); static void find_constant_pool_ref (rtx, rtx *); static void replace_constant_pool_ref (rtx *, rtx, rtx); static rtx find_ltrel_base (rtx); static void replace_ltrel_base (rtx *, rtx); -static void s390_optimize_prolog (bool, bool); +static void s390_optimize_prolog (bool); static int find_unused_clobbered_reg (void); static void s390_frame_info (void); static rtx save_fpr (rtx, int, int); @@ -365,7 +372,7 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) case EQ: case NE: if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (XEXP (op0, 1)), 'K')) + && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K")) return CCAPmode; if ((GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS || GET_CODE (op1) == NEG) @@ -401,7 +408,7 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) case GE: case GT: if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (XEXP (op0, 1)), 'K')) + && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K")) { if (INTVAL (XEXP((op0), 1)) < 0) return CCANmode; @@ -751,198 +758,68 @@ s390_branch_condition_mnemonic (rtx code, int inv) return mnemonic[mask]; } -/* If OP is an integer constant of mode MODE with exactly one - HImode subpart unequal to DEF, return the number of that - subpart. As a special case, all HImode subparts of OP are - equal to DEF, return zero. Otherwise, return -1. */ - -int -s390_single_hi (rtx op, enum machine_mode mode, int def) -{ - if (GET_CODE (op) == CONST_INT) - { - unsigned HOST_WIDE_INT value = 0; - int n_parts = GET_MODE_SIZE (mode) / 2; - int i, part = -1; - - for (i = 0; i < n_parts; i++) - { - if (i == 0) - value = (unsigned HOST_WIDE_INT) INTVAL (op); - else - value >>= 16; - - if ((value & 0xffff) != (unsigned)(def & 0xffff)) - { - if (part != -1) - return -1; - else - part = i; - } - } - - return part == -1 ? 0 : (n_parts - 1 - part); - } - - else if (GET_CODE (op) == CONST_DOUBLE - && GET_MODE (op) == VOIDmode) - { - unsigned HOST_WIDE_INT value = 0; - int n_parts = GET_MODE_SIZE (mode) / 2; - int i, part = -1; - - for (i = 0; i < n_parts; i++) - { - if (i == 0) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); - else if (i == HOST_BITS_PER_WIDE_INT / 16) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op); - else - value >>= 16; - - if ((value & 0xffff) != (unsigned)(def & 0xffff)) - { - if (part != -1) - return -1; - else - part = i; - } - } - - return part == -1 ? 0 : (n_parts - 1 - part); - } - - return -1; -} - -/* Extract the HImode part number PART from integer - constant OP of mode MODE. */ +/* Return the part of op which has a value different from def. + The size of the part is determined by mode. + Use this function only if you already know that op really + contains such a part. */ -int -s390_extract_hi (rtx op, enum machine_mode mode, int part) +unsigned HOST_WIDE_INT +s390_extract_part (rtx op, enum machine_mode mode, int def) { - int n_parts = GET_MODE_SIZE (mode) / 2; - if (part < 0 || part >= n_parts) - abort(); - else - part = n_parts - 1 - part; - - if (GET_CODE (op) == CONST_INT) - { - unsigned HOST_WIDE_INT value = (unsigned HOST_WIDE_INT) INTVAL (op); - return ((value >> (16 * part)) & 0xffff); - } - else if (GET_CODE (op) == CONST_DOUBLE - && GET_MODE (op) == VOIDmode) + unsigned HOST_WIDE_INT value = 0; + int max_parts = HOST_BITS_PER_WIDE_INT / GET_MODE_BITSIZE (mode); + int part_bits = GET_MODE_BITSIZE (mode); + unsigned HOST_WIDE_INT part_mask = (1 << part_bits) - 1; + int i; + + for (i = 0; i < max_parts; i++) { - unsigned HOST_WIDE_INT value; - if (part < HOST_BITS_PER_WIDE_INT / 16) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); + if (i == 0) + value = (unsigned HOST_WIDE_INT) INTVAL (op); else - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op), - part -= HOST_BITS_PER_WIDE_INT / 16; - - return ((value >> (16 * part)) & 0xffff); + value >>= part_bits; + + if ((value & part_mask) != (def & part_mask)) + return value & part_mask; } - + abort (); } /* If OP is an integer constant of mode MODE with exactly one - QImode subpart unequal to DEF, return the number of that - subpart. As a special case, all QImode subparts of OP are - equal to DEF, return zero. Otherwise, return -1. */ + part of mode PART_MODE unequal to DEF, return the number of that + part. Otherwise, return -1. */ int -s390_single_qi (rtx op, enum machine_mode mode, int def) -{ - if (GET_CODE (op) == CONST_INT) - { - unsigned HOST_WIDE_INT value = 0; - int n_parts = GET_MODE_SIZE (mode); - int i, part = -1; - - for (i = 0; i < n_parts; i++) - { - if (i == 0) - value = (unsigned HOST_WIDE_INT) INTVAL (op); - else - value >>= 8; - - if ((value & 0xff) != (unsigned)(def & 0xff)) - { - if (part != -1) - return -1; - else - part = i; - } - } - - return part == -1 ? 0 : (n_parts - 1 - part); - } - - else if (GET_CODE (op) == CONST_DOUBLE - && GET_MODE (op) == VOIDmode) - { - unsigned HOST_WIDE_INT value = 0; - int n_parts = GET_MODE_SIZE (mode); - int i, part = -1; - - for (i = 0; i < n_parts; i++) - { - if (i == 0) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); - else if (i == HOST_BITS_PER_WIDE_INT / 8) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op); - else - value >>= 8; - - if ((value & 0xff) != (unsigned)(def & 0xff)) - { - if (part != -1) - return -1; - else - part = i; - } - } - - return part == -1 ? 0 : (n_parts - 1 - part); - } - - return -1; -} - -/* Extract the QImode part number PART from integer - constant OP of mode MODE. */ - -int -s390_extract_qi (rtx op, enum machine_mode mode, int part) -{ - int n_parts = GET_MODE_SIZE (mode); - if (part < 0 || part >= n_parts) - abort(); - else - part = n_parts - 1 - part; - - if (GET_CODE (op) == CONST_INT) - { - unsigned HOST_WIDE_INT value = (unsigned HOST_WIDE_INT) INTVAL (op); - return ((value >> (8 * part)) & 0xff); - } - else if (GET_CODE (op) == CONST_DOUBLE - && GET_MODE (op) == VOIDmode) - { - unsigned HOST_WIDE_INT value; - if (part < HOST_BITS_PER_WIDE_INT / 8) - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); +s390_single_part (rtx op, + enum machine_mode mode, + enum machine_mode part_mode, + int def) +{ + unsigned HOST_WIDE_INT value = 0; + int n_parts = GET_MODE_SIZE (mode) / GET_MODE_SIZE (part_mode); + unsigned HOST_WIDE_INT part_mask = (1 << GET_MODE_BITSIZE (part_mode)) - 1; + int i, part = -1; + + if (GET_CODE (op) != CONST_INT) + return -1; + + for (i = 0; i < n_parts; i++) + { + if (i == 0) + value = (unsigned HOST_WIDE_INT) INTVAL (op); else - value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op), - part -= HOST_BITS_PER_WIDE_INT / 8; - - return ((value >> (8 * part)) & 0xff); + value >>= GET_MODE_BITSIZE (part_mode); + + if ((value & part_mask) != (def & part_mask)) + { + if (part != -1) + return -1; + else + part = i; + } } - - abort (); + return part == -1 ? -1 : n_parts - 1 - part; } /* Check whether we can (and want to) split a double-word @@ -1344,10 +1221,13 @@ s390_short_displacement (rtx disp) /* Return true if OP is a valid operand for a C constraint. */ int -s390_extra_constraint (rtx op, int c) +s390_extra_constraint_str (rtx op, int c, const char * str) { struct s390_address addr; + if (c != str[0]) + abort (); + switch (c) { case 'Q': @@ -1433,6 +1313,78 @@ s390_extra_constraint (rtx op, int c) return 1; } +/* Return true if VALUE matches the constraint STR. */ + +int +s390_const_ok_for_constraint_p (HOST_WIDE_INT value, + int c, + const char * str) +{ + enum machine_mode mode, part_mode; + int def; + unsigned char part; + + if (c != str[0]) + abort (); + + switch (str[0]) + { + case 'I': + return (unsigned int)value < 256; + + case 'J': + return (unsigned int)value < 4096; + + case 'K': + return value >= -32768 && value < 32768; + + case 'L': + return (TARGET_LONG_DISPLACEMENT ? + (value >= -524288 && value <= 524287) + : (value >= 0 && value <= 4095)); + case 'M': + return value == 2147483647; + + case 'N': + part = str[1] - '0'; + + switch (str[2]) + { + case 'H': part_mode = HImode; break; + case 'Q': part_mode = QImode; break; + default: return 0; + } + + switch (str[3]) + { + case 'H': mode = HImode; break; + case 'S': mode = SImode; break; + case 'D': mode = DImode; break; + default: return 0; + } + + switch (str[4]) + { + case '0': def = 0; break; + case 'F': def = -1; break; + default: return 0; + } + + if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode)) + return 0; + + if (s390_single_part (GEN_INT (value), mode, part_mode, def) != part) + return 0; + + break; + + default: + return 0; + } + + return 1; +} + /* Compute a (partial) cost for rtx X. Return true if the complete cost has been computed, and false if subexpressions should be scanned. In either case, *TOTAL contains the cost result. */ @@ -1857,12 +1809,12 @@ legitimate_reload_constant_p (register rtx op) /* Accept l(g)hi operands. */ if (GET_CODE (op) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (op), 'K')) + && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K")) return 1; /* Accept lliXX operands. */ if (TARGET_ZARCH - && s390_single_hi (op, DImode, 0) >= 0) + && s390_single_part (op, DImode, HImode, 0) >= 0) return 1; /* Accept larl operands. */ @@ -3484,7 +3436,9 @@ print_operand_address (FILE *file, rtx addr) 'b': print integer X as if it's an unsigned byte. 'x': print integer X as if it's an unsigned word. - 'h': print integer X as if it's a signed word. */ + 'h': print integer X as if it's a signed word. + 'i': print the first nonzero HImode part of X. + 'j': print the first HImode part unequal to 0xffff of X. */ void print_operand (FILE *file, rtx x, int code) @@ -3600,6 +3554,12 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffff); else if (code == 'h') fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((INTVAL (x) & 0xffff) ^ 0x8000) - 0x8000); + else if (code == 'i') + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + s390_extract_part (x, HImode, 0)); + else if (code == 'j') + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + s390_extract_part (x, HImode, -1)); else fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x)); break; @@ -3878,15 +3838,12 @@ s390_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED, /* Split all branches that exceed the maximum distance. - Returns true if this created a new literal pool entry. - - Code generated by this routine is allowed to use - TEMP_REG as temporary scratch register. If this is - done, TEMP_USED is set to true. */ + Returns true if this created a new literal pool entry. */ static int -s390_split_branches (rtx temp_reg, bool *temp_used) +s390_split_branches (void) { + rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); int new_literal = 0; rtx insn, pat, tmp, target; rtx *label; @@ -3924,19 +3881,14 @@ s390_split_branches (rtx temp_reg, bool *temp_used) else continue; - if (get_attr_length (insn) <= (TARGET_CPU_ZARCH ? 6 : 4)) + if (get_attr_length (insn) <= 4) continue; - *temp_used = 1; + /* We are going to use the return register as scratch register, + make sure it will be saved/restored by the prologue/epilogue. */ + cfun->machine->save_return_addr_p = 1; - if (TARGET_CPU_ZARCH) - { - tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, *label), insn); - INSN_ADDRESSES_NEW (tmp, -1); - - target = temp_reg; - } - else if (!flag_pic) + if (!flag_pic) { new_literal = 1; tmp = force_const_mem (Pmode, *label); @@ -5019,12 +4971,10 @@ s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode, /* Rework the prolog/epilog to avoid saving/restoring registers unnecessarily. BASE_USED specifies whether - the literal pool base register needs to be saved, - TEMP_USED specifies whether the return register needs - to be saved. */ + the literal pool base register needs to be saved. */ static void -s390_optimize_prolog (bool base_used, bool temp_used) +s390_optimize_prolog (bool base_used) { int save_first, save_last, restore_first, restore_last; int i, j; @@ -5032,17 +4982,9 @@ s390_optimize_prolog (bool base_used, bool temp_used) /* Recompute regs_ever_live data for special registers. */ regs_ever_live[BASE_REGISTER] = base_used; - regs_ever_live[RETURN_REGNUM] = temp_used; + regs_ever_live[RETURN_REGNUM] = cfun->machine->save_return_addr_p; regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; - /* In non-leaf functions, the prolog/epilog code relies - on RETURN_REGNUM being saved in any case. We also need - to save the return register if __builtin_return_address (0) - was used in the current function. */ - if (!current_function_is_leaf - || cfun->machine->save_return_addr_p) - regs_ever_live[RETURN_REGNUM] = 1; - /* Find first and last gpr to be saved. */ @@ -5089,7 +5031,7 @@ s390_optimize_prolog (bool base_used, bool temp_used) /* If all special registers are in fact used, there's nothing we can do, so no point in walking the insn list. */ if (i <= BASE_REGISTER && j >= BASE_REGISTER - && i <= RETURN_REGNUM && j >= RETURN_REGNUM) + && (TARGET_CPU_ZARCH || (i <= RETURN_REGNUM && j >= RETURN_REGNUM))) return; @@ -5104,10 +5046,9 @@ s390_optimize_prolog (bool base_used, bool temp_used) if (GET_CODE (insn) != INSN) continue; - if (GET_CODE (PATTERN (insn)) != PARALLEL) - continue; - if (store_multiple_operation (PATTERN (insn), VOIDmode)) + if (GET_CODE (PATTERN (insn)) == PARALLEL + && store_multiple_operation (PATTERN (insn), VOIDmode)) { set = XVECEXP (PATTERN (insn), 0, 0); first = REGNO (SET_SRC (set)); @@ -5118,9 +5059,31 @@ s390_optimize_prolog (bool base_used, bool temp_used) if (GET_CODE (base) != REG || off < 0) continue; - if (first > BASE_REGISTER && first > RETURN_REGNUM) + if (first > BASE_REGISTER || last < BASE_REGISTER) continue; - if (last < BASE_REGISTER && last < RETURN_REGNUM) + + if (save_first != -1) + { + new_insn = save_gprs (base, off, save_first, save_last); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } + + remove_insn (insn); + continue; + } + + if (GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == REG + && REGNO (SET_SRC (PATTERN (insn))) == BASE_REGISTER + && GET_CODE (SET_DEST (PATTERN (insn))) == MEM) + { + set = PATTERN (insn); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); + off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD; + + if (GET_CODE (base) != REG || off < 0) continue; if (save_first != -1) @@ -5131,9 +5094,11 @@ s390_optimize_prolog (bool base_used, bool temp_used) } remove_insn (insn); + continue; } - if (load_multiple_operation (PATTERN (insn), VOIDmode)) + if (GET_CODE (PATTERN (insn)) == PARALLEL + && load_multiple_operation (PATTERN (insn), VOIDmode)) { set = XVECEXP (PATTERN (insn), 0, 0); first = REGNO (SET_DEST (set)); @@ -5144,9 +5109,31 @@ s390_optimize_prolog (bool base_used, bool temp_used) if (GET_CODE (base) != REG || off < 0) continue; - if (first > BASE_REGISTER && first > RETURN_REGNUM) + if (first > BASE_REGISTER || last < BASE_REGISTER) continue; - if (last < BASE_REGISTER && last < RETURN_REGNUM) + + if (restore_first != -1) + { + new_insn = restore_gprs (base, off, restore_first, restore_last); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } + + remove_insn (insn); + continue; + } + + if (GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_DEST (PATTERN (insn))) == REG + && REGNO (SET_DEST (PATTERN (insn))) == BASE_REGISTER + && GET_CODE (SET_SRC (PATTERN (insn))) == MEM) + { + set = PATTERN (insn); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); + off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD; + + if (GET_CODE (base) != REG || off < 0) continue; if (restore_first != -1) @@ -5157,6 +5144,7 @@ s390_optimize_prolog (bool base_used, bool temp_used) } remove_insn (insn); + continue; } } } @@ -5166,9 +5154,7 @@ s390_optimize_prolog (bool base_used, bool temp_used) static void s390_reorg (void) { - rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER); - bool temp_used = false; bool base_used = false; bool pool_overflow = false; @@ -5234,8 +5220,9 @@ s390_reorg (void) /* Split out-of-range branches. If this has created new literal pool entries, cancel current chunk list and - recompute it. */ - if (s390_split_branches (temp_reg, &temp_used)) + recompute it. zSeries machines have large branch + instructions, so we never need to split a branch. */ + if (!TARGET_CPU_ZARCH && s390_split_branches ()) { if (pool_overflow) s390_chunkify_cancel (pool); @@ -5259,7 +5246,7 @@ s390_reorg (void) break; } - s390_optimize_prolog (base_used, temp_used); + s390_optimize_prolog (base_used); } @@ -5305,7 +5292,6 @@ find_unused_clobbered_reg (void) static void s390_frame_info (void) { - char gprs_ever_live[16]; int i, j; HOST_WIDE_INT fsize = get_frame_size (); @@ -5332,31 +5318,42 @@ s390_frame_info (void) || current_function_stdarg) cfun->machine->frame_size += STARTING_FRAME_OFFSET; + /* If we use the return register, we'll need to make sure + it is going to be saved/restored. */ + + if (!current_function_is_leaf + || regs_ever_live[RETURN_REGNUM]) + cfun->machine->save_return_addr_p = 1; + /* Find first and last gpr to be saved. Note that at this point, - we assume the return register and the base register always - need to be saved. This is done because the usage of these + we assume the base register and -on S/390- the return register + always need to be saved. This is done because the usage of these register might change even after the prolog was emitted. If it turns out later that we really don't need them, the prolog/epilog code is modified again. */ - for (i = 0; i < 16; i++) - gprs_ever_live[i] = regs_ever_live[i] && !global_regs[i]; - - if (flag_pic) - gprs_ever_live[PIC_OFFSET_TABLE_REGNUM] = - regs_ever_live[PIC_OFFSET_TABLE_REGNUM]; - gprs_ever_live[BASE_REGISTER] = 1; - gprs_ever_live[RETURN_REGNUM] = 1; - gprs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; + regs_ever_live[BASE_REGISTER] = 1; + if (!TARGET_CPU_ZARCH || cfun->machine->save_return_addr_p) + regs_ever_live[RETURN_REGNUM] = 1; + regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; for (i = 6; i < 16; i++) - if (gprs_ever_live[i]) - break; + if (regs_ever_live[i]) + if (!global_regs[i] + || i == STACK_POINTER_REGNUM + || i == RETURN_REGNUM + || i == BASE_REGISTER + || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM)) + break; for (j = 15; j > i; j--) - if (gprs_ever_live[j]) - break; - + if (regs_ever_live[j]) + if (!global_regs[j] + || j == STACK_POINTER_REGNUM + || j == RETURN_REGNUM + || j == BASE_REGISTER + || (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM)) + break; /* Save / Restore from gpr i to j. */ cfun->machine->first_save_gpr = i; @@ -5648,7 +5645,7 @@ s390_emit_prologue (void) } else { - if (!CONST_OK_FOR_LETTER_P (INTVAL (frame_off), 'K')) + if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K")) frame_off = force_const_mem (Pmode, frame_off); insn = emit_insn (gen_add2_insn (stack_pointer_rtx, frame_off)); @@ -5843,7 +5840,7 @@ s390_emit_epilogue (void) } else { - if (!CONST_OK_FOR_LETTER_P (INTVAL (frame_off), 'K')) + if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K")) frame_off = force_const_mem (Pmode, frame_off); insn = emit_insn (gen_add2_insn (frame_pointer, frame_off)); @@ -5907,7 +5904,9 @@ s390_emit_epilogue (void) /* Fetch return address from stack before load multiple, this will do good for scheduling. */ - if (!current_function_is_leaf) + if (cfun->machine->save_return_addr_p + || (cfun->machine->first_restore_gpr < BASE_REGISTER + && cfun->machine->last_save_gpr > RETURN_REGNUM)) { int return_regnum = find_unused_clobbered_reg(); if (!return_regnum) @@ -5967,6 +5966,10 @@ s390_function_arg_size (enum machine_mode mode, tree type) static bool s390_function_arg_float (enum machine_mode mode, tree type) { + int size = s390_function_arg_size (mode, type); + if (size > 8) + return false; + /* Soft-float changes the ABI: no floating-point registers are used. */ if (TARGET_SOFT_FLOAT) return false; @@ -6001,6 +6004,39 @@ s390_function_arg_float (enum machine_mode mode, tree type) return TREE_CODE (type) == REAL_TYPE; } +/* Return true if a function argument of type TYPE and mode MODE + is to be passed in an integer register, or a pair of integer + registers, if available. */ + +static bool +s390_function_arg_integer (enum machine_mode mode, tree type) +{ + int size = s390_function_arg_size (mode, type); + if (size > 8) + return false; + + /* No type info available for some library calls ... */ + if (!type) + return GET_MODE_CLASS (mode) == MODE_INT + || (TARGET_SOFT_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT); + + /* We accept small integral (and similar) types. */ + if (INTEGRAL_TYPE_P (type) + || POINTER_TYPE_P (type) + || TREE_CODE (type) == OFFSET_TYPE + || (TARGET_SOFT_FLOAT && TREE_CODE (type) == REAL_TYPE)) + return true; + + /* We also accept structs of size 1, 2, 4, 8 that are not + passed in floating-point registers. */ + if (AGGREGATE_TYPE_P (type) + && exact_log2 (size) >= 0 + && !s390_function_arg_float (mode, type)) + return true; + + return false; +} + /* Return 1 if a function argument of type TYPE and mode MODE is to be passed by reference. The ABI specifies that only structures of size 1, 2, 4, or 8 bytes are passed by value, @@ -6011,15 +6047,16 @@ int s390_function_arg_pass_by_reference (enum machine_mode mode, tree type) { int size = s390_function_arg_size (mode, type); + if (size > 8) + return true; if (type) { - if (AGGREGATE_TYPE_P (type) && - size != 1 && size != 2 && size != 4 && size != 8 - && !s390_function_arg_float (mode, type)) + if (AGGREGATE_TYPE_P (type) && exact_log2 (size) < 0) return 1; - if (TREE_CODE (type) == COMPLEX_TYPE) + if (TREE_CODE (type) == COMPLEX_TYPE + || TREE_CODE (type) == VECTOR_TYPE) return 1; } @@ -6044,11 +6081,13 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, { cum->fprs += 1; } - else + else if (s390_function_arg_integer (mode, type)) { int size = s390_function_arg_size (mode, type); cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD); } + else + abort (); } /* Define where to put the arguments to a function. @@ -6084,7 +6123,7 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else return gen_rtx (REG, mode, cum->fprs + 16); } - else + else if (s390_function_arg_integer (mode, type)) { int size = s390_function_arg_size (mode, type); int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD; @@ -6094,6 +6133,68 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else return gen_rtx (REG, mode, cum->gprs + 2); } + + /* After the real arguments, expand_call calls us once again + with a void_type_node type. Whatever we return here is + passed as operand 2 to the call expanders. + + We don't need this feature ... */ + else if (type == void_type_node) + return const0_rtx; + + abort (); +} + +/* Return true if return values of type TYPE should be returned + in a memory buffer whose address is passed by the caller as + hidden first argument. */ + +static bool +s390_return_in_memory (tree type, tree fundecl ATTRIBUTE_UNUSED) +{ + /* We accept small integral (and similar) types. */ + if (INTEGRAL_TYPE_P (type) + || POINTER_TYPE_P (type) + || TREE_CODE (type) == OFFSET_TYPE + || TREE_CODE (type) == REAL_TYPE) + return int_size_in_bytes (type) > 8; + + /* Aggregates and similar constructs are always returned + in memory. */ + if (AGGREGATE_TYPE_P (type) + || TREE_CODE (type) == COMPLEX_TYPE + || TREE_CODE (type) == VECTOR_TYPE) + return true; + + /* ??? We get called on all sorts of random stuff from + aggregate_value_p. We can't abort, but it's not clear + what's safe to return. Pretend it's a struct I guess. */ + return true; +} + +/* Define where to return a (scalar) value of type TYPE. + If TYPE is null, define where to return a (scalar) + value of mode MODE from a libcall. */ + +rtx +s390_function_value (tree type, enum machine_mode mode) +{ + if (type) + { + int unsignedp = TREE_UNSIGNED (type); + mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1); + } + + if (GET_MODE_CLASS (mode) != MODE_INT + && GET_MODE_CLASS (mode) != MODE_FLOAT) + abort (); + if (GET_MODE_SIZE (mode) > 8) + abort (); + + if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + return gen_rtx_REG (mode, 16); + else + return gen_rtx_REG (mode, 2); } @@ -6107,7 +6208,6 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, long __fpr; void *__overflow_arg_area; void *__reg_save_area; - } va_list[1]; where __gpr and __fpr hold the number of general purpose @@ -6119,8 +6219,8 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, saves all registers used for argument passing into this area if the function uses variable arguments. */ -tree -s390_build_va_list (void) +static tree +s390_build_builtin_va_list (void) { tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl; @@ -6749,9 +6849,9 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, { /* Setup literal pool pointer if required. */ if ((!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_LETTER_P (delta, 'K')) + && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) || (!DISP_IN_RANGE (vcall_offset) - && !CONST_OK_FOR_LETTER_P (vcall_offset, 'K'))) + && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))) { op[5] = gen_label_rtx (); output_asm_insn ("larl\t%4,%5", op); @@ -6760,11 +6860,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Add DELTA to this pointer. */ if (delta) { - if (CONST_OK_FOR_LETTER_P (delta, 'J')) + if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J")) output_asm_insn ("la\t%1,%2(%1)", op); else if (DISP_IN_RANGE (delta)) output_asm_insn ("lay\t%1,%2(%1)", op); - else if (CONST_OK_FOR_LETTER_P (delta, 'K')) + else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) output_asm_insn ("aghi\t%1,%2", op); else { @@ -6781,7 +6881,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, output_asm_insn ("lg\t%4,0(%1)", op); output_asm_insn ("ag\t%1,%3(%4)", op); } - else if (CONST_OK_FOR_LETTER_P (vcall_offset, 'K')) + else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")) { output_asm_insn ("lghi\t%4,%3", op); output_asm_insn ("ag\t%4,0(%1)", op); @@ -6824,9 +6924,9 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Setup base pointer if required. */ if (!vcall_offset || (!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_LETTER_P (delta, 'K')) + && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) || (!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_LETTER_P (vcall_offset, 'K'))) + && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))) { op[5] = gen_label_rtx (); output_asm_insn ("basr\t%4,0", op); @@ -6837,11 +6937,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Add DELTA to this pointer. */ if (delta) { - if (CONST_OK_FOR_LETTER_P (delta, 'J')) + if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J")) output_asm_insn ("la\t%1,%2(%1)", op); else if (DISP_IN_RANGE (delta)) output_asm_insn ("lay\t%1,%2(%1)", op); - else if (CONST_OK_FOR_LETTER_P (delta, 'K')) + else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) output_asm_insn ("ahi\t%1,%2", op); else { @@ -6853,7 +6953,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Perform vcall adjustment. */ if (vcall_offset) { - if (CONST_OK_FOR_LETTER_P (vcall_offset, 'J')) + if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'J', "J")) { output_asm_insn ("lg\t%4,0(%1)", op); output_asm_insn ("a\t%1,%3(%4)", op); @@ -6863,7 +6963,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, output_asm_insn ("lg\t%4,0(%1)", op); output_asm_insn ("ay\t%1,%3(%4)", op); } - else if (CONST_OK_FOR_LETTER_P (vcall_offset, 'K')) + else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")) { output_asm_insn ("lhi\t%4,%3", op); output_asm_insn ("a\t%4,0(%1)", op); diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 1463b5035b6..cbe02d657f8 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -313,7 +313,7 @@ if (INTEGRAL_MODE_P (MODE) && \ GPRs 6-15 are always call-saved. GPR 12 is fixed if used as GOT pointer. GPR 13 is always fixed (as literal pool pointer). - GPR 14 is always fixed (as return address). + GPR 14 is always fixed on S/390 machines (as return address). GPR 15 is always fixed (as stack pointer). The 'fake' hard registers are call-clobbered and fixed. @@ -364,6 +364,11 @@ do \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } \ + if (TARGET_CPU_ZARCH) \ + { \ + fixed_regs[RETURN_REGNUM] = 0; \ + call_used_regs[RETURN_REGNUM] = 0; \ + } \ if (TARGET_64BIT) \ { \ for (i = 24; i < 32; i++) \ @@ -378,7 +383,7 @@ do \ /* Preferred register allocation order. */ #define REG_ALLOC_ORDER \ -{ 1, 2, 3, 4, 5, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, \ +{ 1, 2, 3, 4, 5, 0, 13, 12, 11, 10, 9, 8, 7, 6, 14, \ 16, 17, 18, 19, 20, 21, 22, 23, \ 24, 25, 26, 27, 28, 29, 30, 31, \ 15, 32, 33, 34 } @@ -531,21 +536,20 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; (C) == 'd' ? GENERAL_REGS : \ (C) == 'f' ? FP_REGS : NO_REGS) -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'I' ? (unsigned long) (VALUE) < 256 : \ - (C) == 'J' ? (unsigned long) (VALUE) < 4096 : \ - (C) == 'K' ? (VALUE) >= -32768 && (VALUE) < 32768 : \ - (C) == 'L' ? (unsigned long) (VALUE) < 65536 : 0) +#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ + s390_const_ok_for_constraint_p ((VALUE), (C), (STR)) -#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1 +#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR) 1 -#define EXTRA_CONSTRAINT(OP, C) \ - s390_extra_constraint ((OP), (C)) +#define EXTRA_CONSTRAINT_STR(OP, C, STR) \ + s390_extra_constraint_str ((OP), (C), (STR)) #define EXTRA_MEMORY_CONSTRAINT(C, STR) \ ((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T') #define EXTRA_ADDRESS_CONSTRAINT(C, STR) \ ((C) == 'U' || (C) == 'W' || (C) == 'Y') +#define CONSTRAINT_LEN(C, STR) \ + ((C) == 'N' ? 5 : DEFAULT_CONSTRAINT_LEN ((C), (STR))) /* Stack layout and calling conventions. */ @@ -702,34 +706,15 @@ CUMULATIVE_ARGS; /* Scalar return values. */ -/* We return scalars in general purpose register 2 for integral values, - and floating point register 0 for fp values. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \ - && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ - || POINTER_TYPE_P (VALTYPE) \ - ? word_mode : TYPE_MODE (VALTYPE), \ - TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 16 : 2) - -/* Define how to find the value returned by a library function assuming - the value has mode MODE. */ -#define RET_REG(MODE) ((GET_MODE_CLASS (MODE) == MODE_INT \ - || TARGET_SOFT_FLOAT ) ? 2 : 16) -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, RET_REG (MODE)) +#define FUNCTION_VALUE(VALTYPE, FUNC) \ + s390_function_value ((VALTYPE), VOIDmode) + +#define LIBCALL_VALUE(MODE) \ + s390_function_value (NULL, (MODE)) /* Only gpr 2 and fpr 0 are ever used as return registers. */ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16) - -/* Aggregate return values. */ - -/* The definition of this macro implies that there are cases where - a scalar value cannot be returned in registers. */ -#define RETURN_IN_MEMORY(type) \ - (TYPE_MODE (type) == BLKmode || \ - GET_MODE_CLASS (TYPE_MODE (type)) == MODE_COMPLEX_INT || \ - GET_MODE_CLASS (TYPE_MODE (type)) == MODE_COMPLEX_FLOAT) - /* Structure value address is passed as invisible first argument (gpr 2). */ #define STRUCT_VALUE 0 @@ -750,9 +735,6 @@ CUMULATIVE_ARGS; /* Implementing the varargs macros. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = s390_build_va_list () - #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ s390_va_start (valist, nextarg) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 7cf926e5cae..215848b9f1d 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -28,17 +28,42 @@ ;; I -- An 8-bit constant (0..255). ;; J -- A 12-bit constant (0..4095). ;; K -- A 16-bit constant (-32768..32767). -;; Q -- A memory reference without index-register. -;; S -- Valid operand for the LARL instruction. +;; L -- Value appropriate as displacement. +;; (0..4095) for short displacement +;; (-524288..524287) for long displacement +;; M -- Constant integer with a value of 0x7fffffff. +;; N -- Multiple letter constraint followed by 4 parameter letters. +;; 0..9: number of the part counting from most to least significant +;; H,Q: mode of the part +;; D,S,H: mode of the containing operand +;; 0,F: value of the other parts (F - all bits set) +;; +;; The constraint matches if the specified part of a constant +;; has a value different from its other parts. +;; Q -- Memory reference without index register and with short displacement. +;; R -- Memory reference with index register and short displacement. +;; S -- Memory reference without index register but with long displacement. +;; T -- Memory reference with index register and long displacement. +;; U -- Pointer with short displacement. +;; W -- Pointer with long displacement. +;; Y -- Shift count operand. ;; ;; Special formats used for outputting 390 instructions. ;; -;; %b -- Print a constant byte integer. xy -;; %h -- Print a signed 16-bit. wxyz -;; %N -- Print next register (second word of a DImode reg) or next word. -;; %M -- Print next register (second word of a TImode reg) or next word. -;; %O -- Print the offset of a memory reference (PLUS (REG) (CONST_INT)). -;; %R -- Print the register of a memory reference (PLUS (REG) (CONST_INT)). +;; %C: print opcode suffix for branch condition. +;; %D: print opcode suffix for inverse branch condition. +;; %J: print tls_load/tls_gdcall/tls_ldcall suffix +;; %O: print only the displacement of a memory reference. +;; %R: print only the base register of a memory reference. +;; %N: print the second word of a DImode operand. +;; %M: print the second word of a TImode operand. + +;; %b: print integer X as if it's an unsigned byte. +;; %x: print integer X as if it's an unsigned word. +;; %h: print integer X as if it's a signed word. +;; %i: print the first nonzero HImode part of X +;; %j: print the first HImode part unequal to 0xffff of X + ;; ;; We have a special constraint for pattern matching. ;; @@ -79,6 +104,9 @@ (UNSPEC_TP 510) (UNSPEC_TLSLDM_NTPOFF 511) (UNSPEC_TLS_LOAD 512) + + ; String Functions + (UNSPEC_SRST 600) ]) ;; @@ -430,10 +458,10 @@ (match_operand:DI 1 "immediate_operand" "n,n")) (match_operand:DI 2 "immediate_operand" "n,n")))] "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_qi (operands[1], DImode, 0) >= 0" + && s390_single_part (operands[1], DImode, QImode, 0) >= 0" { - int part = s390_single_qi (operands[1], DImode, 0); - operands[1] = GEN_INT (s390_extract_qi (operands[1], DImode, part)); + int part = s390_single_part (operands[1], DImode, QImode, 0); + operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); operands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), part)); @@ -447,10 +475,10 @@ (match_operand:SI 1 "immediate_operand" "n,n")) (match_operand:SI 2 "immediate_operand" "n,n")))] "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_qi (operands[1], SImode, 0) >= 0" + && s390_single_part (operands[1], SImode, QImode, 0) >= 0" { - int part = s390_single_qi (operands[1], SImode, 0); - operands[1] = GEN_INT (s390_extract_qi (operands[1], SImode, part)); + int part = s390_single_part (operands[1], SImode, QImode, 0); + operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); operands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), part)); @@ -464,10 +492,10 @@ (match_operand:SI 1 "immediate_operand" "n,n")) (match_operand:SI 2 "immediate_operand" "n,n")))] "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_qi (operands[1], HImode, 0) >= 0" + && s390_single_part (operands[1], HImode, QImode, 0) >= 0" { - int part = s390_single_qi (operands[1], HImode, 0); - operands[1] = GEN_INT (s390_extract_qi (operands[1], HImode, part)); + int part = s390_single_part (operands[1], HImode, QImode, 0); + operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); operands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), part)); @@ -488,45 +516,30 @@ (define_insn "*tmdi_reg" [(set (reg 33) - (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d") - (match_operand:DI 1 "immediate_operand" "n")) - (match_operand:DI 2 "immediate_operand" "n")))] + (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d") + (match_operand:DI 1 "immediate_operand" + "N0HD0,N1HD0,N2HD0,N3HD0")) + (match_operand:DI 2 "immediate_operand" "n,n,n,n")))] "TARGET_64BIT && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) - && s390_single_hi (operands[1], DImode, 0) >= 0" -{ - int part = s390_single_hi (operands[1], DImode, 0); - operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part)); - - switch (part) - { - case 0: return "tmhh\t%0,%x1"; - case 1: return "tmhl\t%0,%x1"; - case 2: return "tmlh\t%0,%x1"; - case 3: return "tmll\t%0,%x1"; - default: abort (); - } -} + && s390_single_part (operands[1], DImode, HImode, 0) >= 0" + "@ + tmhh\t%0,%i1 + tmhl\t%0,%i1 + tmlh\t%0,%i1 + tmll\t%0,%i1" [(set_attr "op_type" "RI")]) (define_insn "*tmsi_reg" [(set (reg 33) - (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d") - (match_operand:SI 1 "immediate_operand" "n")) - (match_operand:SI 2 "immediate_operand" "n")))] + (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d") + (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0")) + (match_operand:SI 2 "immediate_operand" "n,n")))] "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) - && s390_single_hi (operands[1], SImode, 0) >= 0" -{ - int part = s390_single_hi (operands[1], SImode, 0); - operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part)); - - switch (part) - { - case 0: return "tmh\t%0,%x1"; - case 1: return "tml\t%0,%x1"; - default: abort (); - } -} + && s390_single_part (operands[1], SImode, HImode, 0) >= 0" + "@ + tmh\t%0,%i1 + tml\t%0,%i1" [(set_attr "op_type" "RI")]) (define_insn "*tmhi_full" @@ -1039,47 +1052,6 @@ operands[1] = force_const_mem (DImode, operands[1]); }) -(define_insn "*movdi_lhi" - [(set (match_operand:DI 0 "register_operand" "=d") - (match_operand:DI 1 "immediate_operand" "K"))] - "TARGET_64BIT - && GET_CODE (operands[1]) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K') - && !FP_REG_P (operands[0])" - "lghi\t%0,%h1" - [(set_attr "op_type" "RI")]) - -(define_insn "*movdi_lli" - [(set (match_operand:DI 0 "register_operand" "=d") - (match_operand:DI 1 "immediate_operand" "n"))] - "TARGET_64BIT && s390_single_hi (operands[1], DImode, 0) >= 0 - && !FP_REG_P (operands[0])" -{ - int part = s390_single_hi (operands[1], DImode, 0); - operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part)); - - switch (part) - { - case 0: return "llihh\t%0,%x1"; - case 1: return "llihl\t%0,%x1"; - case 2: return "llilh\t%0,%x1"; - case 3: return "llill\t%0,%x1"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - -(define_insn "*movdi_lay" - [(set (match_operand:DI 0 "register_operand" "=d") - (match_operand:DI 1 "address_operand" "p"))] - "TARGET_64BIT - && TARGET_LONG_DISPLACEMENT - && GET_CODE (operands[1]) == CONST_INT - && !FP_REG_P (operands[0])" - "lay\t%0,%a1" - [(set_attr "op_type" "RXY") - (set_attr "type" "la")]) - (define_insn "*movdi_larl" [(set (match_operand:DI 0 "register_operand" "=d") (match_operand:DI 1 "larl_operand" "X"))] @@ -1090,10 +1062,18 @@ (set_attr "type" "larl")]) (define_insn "*movdi_64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!*f,!R,!T,?Q") - (match_operand:DI 1 "general_operand" "d,m,d,*f,R,T,*f,*f,?Q"))] + [(set (match_operand:DI 0 "nonimmediate_operand" + "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q") + (match_operand:DI 1 "general_operand" + "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))] "TARGET_64BIT" "@ + lghi\t%0,%h1 + llihh\t%0,%i1 + llihl\t%0,%i1 + llilh\t%0,%i1 + llill\t%0,%i1 + lay\t%0,%a1 lgr\t%0,%1 lg\t%0,%1 stg\t%1,%0 @@ -1103,8 +1083,9 @@ std\t%1,%0 stdy\t%1,%0 mvc\t%O0(8,%R0),%1" - [(set_attr "op_type" "RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "lr,load,store,floadd,floadd,floadd,fstored,fstored,cs")]) + [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS") + (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd, + fstored,fstored,cs")]) (define_insn "*movdi_31" [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q") @@ -1224,43 +1205,6 @@ operands[1] = force_const_mem (SImode, operands[1]); }) -(define_insn "*movsi_lhi" - [(set (match_operand:SI 0 "register_operand" "=d") - (match_operand:SI 1 "immediate_operand" "K"))] - "GET_CODE (operands[1]) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K') - && !FP_REG_P (operands[0])" - "lhi\t%0,%h1" - [(set_attr "op_type" "RI")]) - -(define_insn "*movsi_lli" - [(set (match_operand:SI 0 "register_operand" "=d") - (match_operand:SI 1 "immediate_operand" "n"))] - "TARGET_ZARCH && s390_single_hi (operands[1], SImode, 0) >= 0 - && !FP_REG_P (operands[0])" -{ - int part = s390_single_hi (operands[1], SImode, 0); - operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part)); - - switch (part) - { - case 0: return "llilh\t%0,%x1"; - case 1: return "llill\t%0,%x1"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - -(define_insn "*movsi_lay" - [(set (match_operand:SI 0 "register_operand" "=d") - (match_operand:SI 1 "address_operand" "p"))] - "TARGET_LONG_DISPLACEMENT - && GET_CODE (operands[1]) == CONST_INT - && !FP_REG_P (operands[0])" - "lay\t%0,%a1" - [(set_attr "op_type" "RXY") - (set_attr "type" "la")]) - (define_insn "*movsi_larl" [(set (match_operand:SI 0 "register_operand" "=d") (match_operand:SI 1 "larl_operand" "X"))] @@ -1270,11 +1214,17 @@ [(set_attr "op_type" "RIL") (set_attr "type" "larl")]) -(define_insn "*movsi" - [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q") - (match_operand:SI 1 "general_operand" "d,R,T,d,d,*f,R,T,*f,*f,?Q"))] - "" +(define_insn "*movsi_zarch" + [(set (match_operand:SI 0 "nonimmediate_operand" + "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q") + (match_operand:SI 1 "general_operand" + "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))] + "TARGET_ZARCH" "@ + lhi\t%0,%h1 + llilh\t%0,%i1 + llill\t%0,%i1 + lay\t%0,%a1 lr\t%0,%1 l\t%0,%1 ly\t%0,%1 @@ -1286,8 +1236,24 @@ ste\t%1,%0 stey\t%1,%0 mvc\t%O0(4,%R0),%1" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")]) + [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") + (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")]) + +(define_insn "*movsi_esa" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q") + (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))] + "!TARGET_ZARCH" + "@ + lhi\t%0,%h1 + lr\t%0,%1 + l\t%0,%1 + st\t%1,%0 + ler\t%0,%1 + le\t%0,%1 + ste\t%1,%0 + mvc\t%O0(4,%R0),%1" + [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS") + (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")]) (define_peephole2 [(set (match_operand:SI 0 "register_operand" "") @@ -1313,7 +1279,8 @@ always sign-extends (at least) to SImode. */ if (optimize && !no_new_pseudos && register_operand (operands[0], VOIDmode) - && memory_operand (operands[1], VOIDmode)) + && GET_CODE (operands[1]) == MEM + && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF) { rtx tmp = gen_reg_rtx (SImode); rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]); @@ -1360,7 +1327,8 @@ is just as fast as a QImode load. */ if (TARGET_ZARCH && optimize && !no_new_pseudos && register_operand (operands[0], VOIDmode) - && memory_operand (operands[1], VOIDmode)) + && GET_CODE (operands[1]) == MEM + && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF) { rtx tmp = gen_reg_rtx (word_mode); rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]); @@ -1768,6 +1736,82 @@ ;; String instructions. ;; +; +; strlenM instruction pattern(s). +; + +(define_expand "strlendi" + [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) + (parallel + [(set (match_dup 4) + (unspec:DI [(const_int 0) + (match_operand:BLK 1 "memory_operand" "") + (reg:QI 0) + (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) + (clobber (scratch:DI)) + (clobber (reg:CC 33))]) + (parallel + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (match_dup 4) (match_dup 5))) + (clobber (reg:CC 33))])] + "TARGET_64BIT" +{ + operands[4] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (DImode); + emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); + operands[1] = replace_equiv_address (operands[1], operands[5]); +}) + +(define_insn "*strlendi" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 2 "general_operand" "0") + (mem:BLK (match_operand:DI 3 "register_operand" "1")) + (reg:QI 0) + (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) + (clobber (match_scratch:DI 1 "=a")) + (clobber (reg:CC 33))] + "TARGET_64BIT" + "srst\t%0,%1\;jo\t.-4" + [(set_attr "op_type" "NN") + (set_attr "type" "vs") + (set_attr "length" "8")]) + +(define_expand "strlensi" + [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) + (parallel + [(set (match_dup 4) + (unspec:SI [(const_int 0) + (match_operand:BLK 1 "memory_operand" "") + (reg:QI 0) + (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) + (clobber (scratch:SI)) + (clobber (reg:CC 33))]) + (parallel + [(set (match_operand:SI 0 "register_operand" "") + (minus:SI (match_dup 4) (match_dup 5))) + (clobber (reg:CC 33))])] + "!TARGET_64BIT" +{ + operands[4] = gen_reg_rtx (SImode); + operands[5] = gen_reg_rtx (SImode); + emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); + operands[1] = replace_equiv_address (operands[1], operands[5]); +}) + +(define_insn "*strlensi" + [(set (match_operand:SI 0 "register_operand" "=a") + (unspec:SI [(match_operand:SI 2 "general_operand" "0") + (mem:BLK (match_operand:SI 3 "register_operand" "1")) + (reg:QI 0) + (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) + (clobber (match_scratch:SI 1 "=a")) + (clobber (reg:CC 33))] + "!TARGET_64BIT" + "srst\t%0,%1\;jo\t.-4" + [(set_attr "op_type" "NN") + (set_attr "type" "vs") + (set_attr "length" "8")]) + ; ; movstrM instruction pattern(s). ; @@ -2115,9 +2159,10 @@ (use (match_dup 2)) (use (match_dup 3))] "TARGET_64BIT" - "clcl\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "vs")]) + "clcle\t%0,%1,0\;jo\t.-4" + [(set_attr "op_type" "NN") + (set_attr "type" "vs") + (set_attr "length" "8")]) (define_insn "*cmpmem_long_31" [(clobber (match_operand:DI 0 "register_operand" "=d")) @@ -2128,9 +2173,10 @@ (use (match_dup 2)) (use (match_dup 3))] "!TARGET_64BIT" - "clcl\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "vs")]) + "clcle\t%0,%1,0\;jo\t.-4" + [(set_attr "op_type" "NN") + (set_attr "type" "vs") + (set_attr "length" "8")]) ; Convert condition code to integer in range (-1, 0, 1) @@ -2155,13 +2201,13 @@ "TARGET_64BIT" { output_asm_insn ("lghi\t%0,1", operands); - output_asm_insn ("jh\t.+12", operands); - output_asm_insn ("jl\t.+6", operands); + output_asm_insn ("jh\t.+16", operands); + output_asm_insn ("jl\t.+8", operands); output_asm_insn ("sgr\t%0,%0", operands); return "lcgr\t%0,%0"; } [(set_attr "op_type" "NN") - (set_attr "length" "22") + (set_attr "length" "20") (set_attr "type" "other")]) @@ -2501,14 +2547,12 @@ llgt\t%0,%1" [(set_attr "op_type" "RRE,RXE")]) -(define_insn_and_split "*llgt_sisi_split" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m") +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (and:SI (match_operand:SI 1 "nonimmediate_operand" "") (const_int 2147483647))) (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" + "TARGET_64BIT && reload_completed" [(set (match_dup 0) (and:SI (match_dup 1) (const_int 2147483647)))] @@ -2524,14 +2568,12 @@ llgt\t%0,%N1" [(set_attr "op_type" "RRE,RXE")]) -(define_insn_and_split "*llgt_didi_split" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (and:DI (match_operand:DI 1 "nonimmediate_operand" "") (const_int 2147483647))) (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" + "TARGET_64BIT && reload_completed" [(set (match_dup 0) (and:DI (match_dup 1) (const_int 2147483647)))] @@ -3191,7 +3233,7 @@ (plus:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && s390_match_ccmode (insn, CCAmode) - && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')" + && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")" "aghi\t%0,%h2" [(set_attr "op_type" "RI")]) @@ -3419,7 +3461,7 @@ (set (match_operand:SI 0 "register_operand" "=d") (plus:SI (match_dup 1) (match_dup 2)))] "s390_match_ccmode (insn, CCAmode) - && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')" + && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")" "ahi\t%0,%h2" [(set_attr "op_type" "RI")]) @@ -5007,37 +5049,23 @@ ng\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*anddi3_ni" - [(set (match_operand:DI 0 "register_operand" "=d") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "0") - (match_operand:DI 2 "immediate_operand" "n"))) - (clobber (reg:CC 33))] - "TARGET_64BIT && s390_single_hi (operands[2], DImode, -1) >= 0" -{ - int part = s390_single_hi (operands[2], DImode, -1); - operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part)); - - switch (part) - { - case 0: return "nihh\t%0,%x2"; - case 1: return "nihl\t%0,%x2"; - case 2: return "nilh\t%0,%x2"; - case 3: return "nill\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - (define_insn "anddi3" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - ngr\t%0,%2 - ng\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) + [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d") + (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" + "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m"))) + (clobber (reg:CC 33))] + "TARGET_64BIT" + "@ + # + # + nihh\t%0,%j2 + nihl\t%0,%j2 + nilh\t%0,%j2 + nill\t%0,%j2 + ngr\t%0,%2 + ng\t%0,%2" + [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")]) (define_insn "*anddi3_ss" [(set (match_operand:DI 0 "s_operand" "=Q") @@ -5088,36 +5116,41 @@ ny\t%0,%2" [(set_attr "op_type" "RR,RX,RXY")]) -(define_insn "*andsi3_ni" - [(set (match_operand:SI 0 "register_operand" "=d") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:SI 2 "immediate_operand" "n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH && s390_single_hi (operands[2], SImode, -1) >= 0" -{ - int part = s390_single_hi (operands[2], SImode, -1); - operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part)); - - switch (part) - { - case 0: return "nilh\t%0,%x2"; - case 1: return "nill\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) +(define_expand "andsi3" + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (and:SI (match_operand:SI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "general_operand" ""))) + (clobber (reg:CC 33))])] + "" + "") -(define_insn "andsi3" - [(set (match_operand:SI 0 "register_operand" "=d,d,d") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T"))) +(define_insn "*andsi3_zarch" + [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d") + (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0") + (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T"))) (clobber (reg:CC 33))] - "" + "TARGET_ZARCH" "@ + # + # + nilh\t%0,%j2 + nill\t%0,%j2 nr\t%0,%2 n\t%0,%2 ny\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")]) + +(define_insn "*andsi3_esa" + [(set (match_operand:SI 0 "register_operand" "=d,d") + (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") + (match_operand:SI 2 "general_operand" "d,R"))) + (clobber (reg:CC 33))] + "!TARGET_ZARCH" + "@ + nr\t%0,%2 + n\t%0,%2" + [(set_attr "op_type" "RR,RX")]) (define_insn "*andsi3_ss" [(set (match_operand:SI 0 "s_operand" "=Q") @@ -5261,37 +5294,20 @@ og\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*iordi3_oi" - [(set (match_operand:DI 0 "register_operand" "=d") - (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0") - (match_operand:DI 2 "immediate_operand" "n"))) - (clobber (reg:CC 33))] - "TARGET_64BIT && s390_single_hi (operands[2], DImode, 0) >= 0" -{ - int part = s390_single_hi (operands[2], DImode, 0); - operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part)); - - switch (part) - { - case 0: return "oihh\t%0,%x2"; - case 1: return "oihl\t%0,%x2"; - case 2: return "oilh\t%0,%x2"; - case 3: return "oill\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - (define_insn "iordi3" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m"))) + [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d") + (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m"))) (clobber (reg:CC 33))] "TARGET_64BIT" "@ + oihh\t%0,%i2 + oihl\t%0,%i2 + oilh\t%0,%i2 + oill\t%0,%i2 ogr\t%0,%2 og\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) + [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")]) (define_insn "*iordi3_ss" [(set (match_operand:DI 0 "s_operand" "=Q") @@ -5342,36 +5358,39 @@ oy\t%0,%2" [(set_attr "op_type" "RR,RX,RXY")]) -(define_insn "*iorsi3_oi" - [(set (match_operand:SI 0 "register_operand" "=d") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:SI 2 "immediate_operand" "n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH && s390_single_hi (operands[2], SImode, 0) >= 0" -{ - int part = s390_single_hi (operands[2], SImode, 0); - operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part)); - - switch (part) - { - case 0: return "oilh\t%0,%x2"; - case 1: return "oill\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) +(define_expand "iorsi3" + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (ior:SI (match_operand:SI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "general_operand" ""))) + (clobber (reg:CC 33))])] + "" + "") -(define_insn "iorsi3" - [(set (match_operand:SI 0 "register_operand" "=d,d,d") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T"))) +(define_insn "iorsi3_zarch" + [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") + (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0") + (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T"))) (clobber (reg:CC 33))] - "" + "TARGET_ZARCH" "@ + oilh\t%0,%i2 + oill\t%0,%i2 or\t%0,%2 o\t%0,%2 oy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RI,RI,RR,RX,RXY")]) + +(define_insn "iorsi3_esa" + [(set (match_operand:SI 0 "register_operand" "=d,d") + (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") + (match_operand:SI 2 "general_operand" "d,R"))) + (clobber (reg:CC 33))] + "!TARGET_ZARCH" + "@ + or\t%0,%2 + o\t%0,%2" + [(set_attr "op_type" "RR,RX")]) (define_insn "*iorsi3_ss" [(set (match_operand:SI 0 "s_operand" "=Q") @@ -6596,6 +6615,8 @@ return "#"; else if (get_attr_length (insn) == 4) return "brct\t%1,%l0"; + else if (TARGET_CPU_ZARCH) + return "ahi\t%1,-1\;jgne\t%l0"; else abort (); } @@ -6675,37 +6696,13 @@ else if (get_attr_length (insn) == 4) return "brctg\t%1,%l0"; else - abort (); + return "aghi\t%1,-1\;jgne\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) - (const_int 4) (const_int 12)))]) - -(define_insn "*doloop_di_long" - [(set (pc) - (if_then_else - (ne (match_operand:DI 1 "register_operand" "d,d") - (const_int 1)) - (match_operand 0 "address_operand" "U,U") - (pc))) - (set (match_operand:DI 2 "register_operand" "=1,?*m*d") - (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:DI 3 "=X,&d")) - (clobber (reg:CC 33))] - "" -{ - if (get_attr_op_type (insn) == OP_TYPE_RRE) - return "bctgr\t%1,%0"; - else - return "bctg\t%1,%a0"; -} - [(set (attr "op_type") - (if_then_else (match_operand 0 "register_operand" "") - (const_string "RRE") (const_string "RXE"))) - (set_attr "type" "branch") - (set_attr "atype" "agen")]) + (const_int 4) (const_int 10)))]) (define_split [(set (pc) @@ -7499,7 +7496,7 @@ ;; Instruction definition to extend a 31-bit pointer into a 64-bit -;; pointer. This is used for compatability. +;; pointer. This is used for compatibility. (define_expand "ptr_extend" [(set (match_operand:DI 0 "register_operand" "=r") diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h index da423516b16..d28e0c24680 100644 --- a/gcc/config/sh/linux.h +++ b/gcc/config/sh/linux.h @@ -57,6 +57,8 @@ do { \ builtin_define_std ("unix"); \ builtin_define ("__gnu_linux__"); \ builtin_define_std ("linux"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } while (0) diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h index a9c2cb58e6f..975feb0f7dd 100644 --- a/gcc/config/sh/netbsd-elf.h +++ b/gcc/config/sh/netbsd-elf.h @@ -93,6 +93,8 @@ Boston, MA 02111-1307, USA. */ #define TARGET_DEFAULT \ (TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT) +/* Define because we use the label and we do not need them. */ +#define NO_PROFILE_COUNTERS #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(STREAM,LABELNO) \ diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index 81501b07d4b..ec723bda127 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -97,16 +97,13 @@ extern int sh_insn_length_adjustment (rtx); extern int sh_can_redirect_branch (rtx, rtx); extern void sh_expand_unop_v2sf (enum rtx_code, rtx, rtx); extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx); +extern int sh_expand_t_scc (enum rtx_code code, rtx target); #ifdef TREE_CODE extern void sh_va_start (tree, rtx); extern rtx sh_va_arg (tree, tree); #endif /* TREE_CODE */ #endif /* RTX_CODE */ -#ifdef TREE_CODE -extern tree sh_build_va_list (void); -#endif /* TREE_CODE */ - extern const char *output_jump_label_table (void); extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *); extern struct rtx_def *get_fpscr_rtx (void); @@ -142,5 +139,6 @@ extern rtx sh_get_pr_initial_val (void); extern rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree); +extern const char *sh_pch_valid_p (const void *data_p, size_t sz); #endif /* ! GCC_SH_PROTOS_H */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 4207719dc44..0015f7029a4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */ #include "basic-block.h" #include "ra.h" #include "cfglayout.h" +#include "intl.h" int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch; @@ -246,6 +247,7 @@ static rtx sh_builtin_saveregs (void); static void sh_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); static bool sh_strict_argument_naming (CUMULATIVE_ARGS *); static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *); +static tree sh_build_builtin_va_list (void); /* Initialize the GCC target structure. */ @@ -345,6 +347,12 @@ static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *); #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED sh_pretend_outgoing_varargs_named +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list + +#undef TARGET_PCH_VALID_P +#define TARGET_PCH_VALID_P sh_pch_valid_p + struct gcc_target targetm = TARGET_INITIALIZER; /* Print the operand address in x to the stream. */ @@ -5911,8 +5919,8 @@ sh_builtin_saveregs (void) /* Define the `__builtin_va_list' type for the ABI. */ -tree -sh_build_va_list (void) +static tree +sh_build_builtin_va_list (void) { tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; tree record; @@ -5921,7 +5929,7 @@ sh_build_va_list (void) || TARGET_HITACHI || sh_cfun_attr_renesas_p ()) return ptr_type_node; - record = make_node (RECORD_TYPE); + record = (*lang_hooks.types.make_type) (RECORD_TYPE); f_next_o = build_decl (FIELD_DECL, get_identifier ("__va_next_o"), ptr_type_node); @@ -6833,6 +6841,90 @@ sh_cfun_interrupt_handler_p (void) DECL_ATTRIBUTES (current_function_decl)) != NULL_TREE); } + +/* ??? target_switches in toplev.c is static, hence we have to duplicate it. */ +static const struct +{ + const char *const name; + const int value; + const char *const description; +} +sh_target_switches[] = TARGET_SWITCHES; +#define target_switches sh_target_switches + +/* Like default_pch_valid_p, but take flag_mask into account. */ +const char * +sh_pch_valid_p (const void *data_p, size_t len) +{ + const char *data = (const char *)data_p; + const char *flag_that_differs = NULL; + size_t i; + int old_flags; + int flag_mask + = (SH1_BIT | SH2_BIT | SH3_BIT | SH_E_BIT | HARD_SH4_BIT | FPU_SINGLE_BIT + | SH4_BIT | HITACHI_BIT | LITTLE_ENDIAN_BIT); + + /* -fpic and -fpie also usually make a PCH invalid. */ + if (data[0] != flag_pic) + return _("created and used with different settings of -fpic"); + if (data[1] != flag_pie) + return _("created and used with different settings of -fpie"); + data += 2; + + /* Check target_flags. */ + memcpy (&old_flags, data, sizeof (target_flags)); + if (((old_flags ^ target_flags) & flag_mask) != 0) + { + for (i = 0; i < ARRAY_SIZE (target_switches); i++) + { + int bits; + + bits = target_switches[i].value; + if (bits < 0) + bits = -bits; + bits &= flag_mask; + if ((target_flags & bits) != (old_flags & bits)) + { + flag_that_differs = target_switches[i].name; + goto make_message; + } + } + abort (); + } + data += sizeof (target_flags); + len -= sizeof (target_flags); + + /* Check string options. */ +#ifdef TARGET_OPTIONS + for (i = 0; i < ARRAY_SIZE (target_options); i++) + { + const char *str = *target_options[i].variable; + size_t l; + if (! str) + str = ""; + l = strlen (str) + 1; + if (len < l || memcmp (data, str, l) != 0) + { + flag_that_differs = target_options[i].prefix; + goto make_message; + } + data += l; + len -= l; + } +#endif + + return NULL; + + make_message: + { + char *r; + asprintf (&r, _("created and used with differing settings of `-m%s'"), + flag_that_differs); + if (r == NULL) + return _("out of memory"); + return r; + } +} /* Predicates used by the templates. */ @@ -8806,6 +8898,15 @@ sh_register_operand (rtx op, enum machine_mode mode) return register_operand (op, mode); } +int +cmpsi_operand (rtx op, enum machine_mode mode) +{ + if (GET_CODE (op) == REG && REGNO (op) == T_REG + && GET_MODE (op) == SImode) + return 1; + return arith_operand (op, mode); +} + static rtx emit_load_ptr (rtx, rtx); static rtx @@ -9037,4 +9138,33 @@ sh_get_pr_initial_val (void) return val; } +int +sh_expand_t_scc (enum rtx_code code, rtx target) +{ + rtx result = target; + HOST_WIDE_INT val; + + if (GET_CODE (sh_compare_op0) != REG || REGNO (sh_compare_op0) != T_REG + || GET_CODE (sh_compare_op1) != CONST_INT) + return 0; + if (GET_CODE (result) != REG) + result = gen_reg_rtx (SImode); + val = INTVAL (sh_compare_op1); + if ((code == EQ && val == 1) || (code == NE && val == 0)) + emit_insn (gen_movt (result)); + else if ((code == EQ && val == 0) || (code == NE && val == 1)) + { + emit_insn (gen_rtx_CLOBBER (VOIDmode, result)); + emit_insn (gen_subc (result, result, result)); + emit_insn (gen_addsi3 (result, result, GEN_INT (1))); + } + else if (code == EQ || code == NE) + emit_insn (gen_move_insn (result, GEN_INT (code == NE))); + else + return 0; + if (result != target) + emit_move_insn (target, result); + return 1; +} + #include "gt-sh.h" diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 4ccff4b3531..9c73b9e714d 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2033,10 +2033,6 @@ struct sh_args { /* Perform any needed actions needed for a function that is receiving a variable number of arguments. */ -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = sh_build_va_list () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ sh_va_start (valist, nextarg) @@ -2879,7 +2875,7 @@ struct sh_args { used to use the encodings 245..260, but that doesn't make sense: PR_REG and PR_MEDIA_REG are actually the same register, and likewise the FP registers stay the same when switching between compact and media - mode. Hence, we also need to use the same dwarf frame coloumns. + mode. Hence, we also need to use the same dwarf frame columns. Likewise, we need to support unwind information for SHmedia registers even in compact code. */ #define SH_DBX_REGISTER_NUMBER(REGNO) \ @@ -3149,6 +3145,7 @@ extern int rtx_equal_function_value_matters; {"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \ {"binary_float_operator", {PLUS, MINUS, MULT, DIV}}, \ {"binary_logical_operator", {AND, IOR, XOR}}, \ + {"cmpsi_operand", {SUBREG, REG, CONST_INT}}, \ {"commutative_float_operator", {PLUS, MULT}}, \ {"equality_comparison_operator", {EQ,NE}}, \ {"extend_reg_operand", {SUBREG, REG, TRUNCATE}}, \ @@ -3246,7 +3243,8 @@ extern int rtx_equal_function_value_matters; : FP_MODE_NONE) #define MODE_AFTER(MODE, INSN) \ - (recog_memoized (INSN) >= 0 \ + (TARGET_HITACHI \ + && recog_memoized (INSN) >= 0 \ && get_attr_fp_set (INSN) != FP_SET_NONE \ ? get_attr_fp_set (INSN) \ : (MODE)) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index bad8c66edc9..aa63209dbf6 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -705,11 +705,14 @@ (define_expand "cmpsi" [(set (reg:SI T_REG) - (compare (match_operand:SI 0 "arith_operand" "") + (compare (match_operand:SI 0 "cmpsi_operand" "") (match_operand:SI 1 "arith_operand" "")))] "TARGET_SH1" " { + if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == T_REG + && GET_CODE (operands[1]) != CONST_INT) + operands[0] = copy_to_mode_reg (SImode, operands[0]); sh_compare_op0 = operands[0]; sh_compare_op1 = operands[1]; DONE; @@ -1167,7 +1170,9 @@ (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) (set (reg:SI T_REG) - (gtu:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 1)))] + (gtu:SI (minus:SI (minus:SI (match_dup 1) (match_dup 2)) + (reg:SI T_REG)) + (match_dup 1)))] "TARGET_SH1" "subc %2,%0" [(set_attr "type" "arith")]) @@ -3163,7 +3168,7 @@ (define_expand "extendhisi2" [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") - (sign_extend:SI (match_operand:HI 1 "general_extend_operand" "r,m")))] + (sign_extend:SI (match_operand:HI 1 "general_extend_operand" "r,m")))] "" "") @@ -3173,7 +3178,7 @@ "TARGET_SH1" "@ exts.w %1,%0 - mov.w %1,%0" + mov.w %1,%0" [(set_attr "type" "arith,load")]) (define_insn "*extendhisi2_media" @@ -3277,7 +3282,7 @@ (truncate:QI (match_operand:DI 1 "register_operand" "r,r")))] "TARGET_SHMEDIA" "@ - and %1, 255, %0 + andi %1, 255, %0 st%M0.b %m0, %1" [(set_attr "type" "arith_media,store")]) @@ -4395,7 +4400,7 @@ [(set (match_operand:SF 0 "register_operand" "") (match_operand:SF 1 "register_operand" "")) (use (match_operand:PSI 2 "fpscr_operand" "")) - (clobber (match_scratch:SI 3 "X"))] + (clobber (match_scratch:SI 3 ""))] "TARGET_SH2E && reload_completed && true_regnum (operands[0]) == true_regnum (operands[1])" [(set (match_dup 0) (match_dup 0))] @@ -4406,7 +4411,7 @@ [(set (match_operand:DF 0 "register_operand" "") (match_operand:DF 1 "register_operand" "")) (use (match_operand:PSI 2 "fpscr_operand" "")) - (clobber (match_scratch:SI 3 "X"))] + (clobber (match_scratch:SI 3 ""))] "TARGET_SH4 && ! TARGET_FMOVD && reload_completed && FP_OR_XD_REGISTER_P (true_regnum (operands[0])) && FP_OR_XD_REGISTER_P (true_regnum (operands[1]))" @@ -4801,7 +4806,7 @@ i * GET_MODE_SIZE (V2SFmode))); else { - x = gen_rtx_SUBREG (V2SFmode, operands[0], i * 2); + x = gen_rtx_SUBREG (V2SFmode, operands[0], i * 8); alter_subreg (&x); } @@ -4811,7 +4816,7 @@ i * GET_MODE_SIZE (V2SFmode))); else { - y = gen_rtx_SUBREG (V2SFmode, operands[1], i * 2); + y = gen_rtx_SUBREG (V2SFmode, operands[1], i * 8); alter_subreg (&y); } @@ -7446,6 +7451,10 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (sh_expand_t_scc (EQ, operands[0])) + DONE; + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (EQ); }") @@ -7492,6 +7501,8 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LT); }") @@ -7594,6 +7605,8 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GT); }") @@ -7646,6 +7659,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT) { if (TARGET_IEEE) @@ -7685,6 +7700,8 @@ mov.l\\t1f,r0\\n\\ sh_compare_op0, sh_compare_op1)); DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GTU); }") @@ -7709,6 +7726,8 @@ mov.l\\t1f,r0\\n\\ sh_compare_op1, sh_compare_op0)); DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LTU); }") @@ -7738,6 +7757,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LEU); }") @@ -7768,6 +7789,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GEU); }") @@ -7815,8 +7838,12 @@ mov.l\\t1f,r0\\n\\ DONE; } - operands[1] = prepare_scc_operands (EQ); - operands[2] = gen_reg_rtx (SImode); + if (sh_expand_t_scc (NE, operands[0])) + DONE; + if (! rtx_equal_function_value_matters) + FAIL; + operands[1] = prepare_scc_operands (EQ); + operands[2] = gen_reg_rtx (SImode); }") (define_expand "sunordered" @@ -9450,9 +9477,10 @@ mov.l\\t1f,r0\\n\\ if (unit_size < 2) { if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (elt1) == CONST_INT) - operands[1] = GEN_INT (TARGET_LITTLE_ENDIAN - ? INTVAL (operands[1]) + (INTVAL (elt1) << 8) - : (INTVAL (operands[1]) << 8) + INTVAL (elt1)); + operands[1] + = GEN_INT (TARGET_LITTLE_ENDIAN + ? (INTVAL (operands[1]) & 0xff) + (INTVAL (elt1) << 8) + : (INTVAL (operands[1]) << 8) + (INTVAL (elt1) & 0xff)); else { operands[0] = gen_rtx_REG (V2QImode, true_regnum (operands[0])); @@ -10560,7 +10588,7 @@ mov.l\\t1f,r0\\n\\ (vec_select:SF (mult:V4SF (match_dup 1) (match_dup 2)) (parallel [(const_int 3)])))))] "TARGET_SHMEDIA" - "fipr %1, %2, %0" + "fipr.s %1, %2, %0" [(set_attr "type" "fparith_media")]) (define_insn "fsrra_s" @@ -10586,7 +10614,7 @@ mov.l\\t1f,r0\\n\\ (const_int 14) (const_int 3)])) (vec_select:V4SF (match_dup 2) (parallel [(const_int 1) (const_int 2) - (const_int 3) (const_int 0)])))) + (const_int 3) (const_int 0)])))) (plus:V4SF (mult:V4SF (vec_select:V4SF (match_dup 1) @@ -10603,7 +10631,7 @@ mov.l\\t1f,r0\\n\\ (parallel [(const_int 3) (const_int 0) (const_int 1) (const_int 2)]))))))] "TARGET_SHMEDIA" - "ftrv %1, %2, %0" + "ftrv.s %1, %2, %0" [(set_attr "type" "fparith_media")]) (define_insn "nsb" @@ -10689,6 +10717,19 @@ mov.l\\t1f,r0\\n\\ "byterev %1, %0" [(set_attr "type" "arith_media")]) +(define_insn "prefetch" + [(prefetch (match_operand:QI 0 "address_operand" "p") + (match_operand:SI 1 "const_int_operand" "n") + (match_operand:SI 2 "const_int_operand" "n"))] + "TARGET_SHMEDIA" + "* +{ + operands[0] = gen_rtx_MEM (QImode, operands[0]); + output_asm_insn (\"ld%M0.b %m0,r63\", operands); + return \"\"; +}" + [(set_attr "type" "other")]) + ;; The following description models the ;; SH4 pipeline using the DFA based scheduler. ;; The DFA based description is better way to model diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 49dc1ce2ae4..8728cb79274 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -119,8 +119,8 @@ Boston, MA 02111-1307, USA. */ #undef STARTFILE_ARCH_SPEC #define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC -#undef LINK_ARCH32_SPEC -#define LINK_ARCH32_SPEC \ +#undef LINK_ARCH32_SPEC_BASE +#define LINK_ARCH32_SPEC_BASE \ "%{G:-G} \ %{YP,*} \ %{R*} \ @@ -132,6 +132,9 @@ Boston, MA 02111-1307, USA. */ %{!YP,*:%{p|pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}}" +#undef LINK_ARCH32_SPEC +#define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE + #undef LINK_ARCH_SPEC #define LINK_ARCH_SPEC LINK_ARCH32_SPEC diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h index ac1cc12ad3b..8af7c5a0259 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("unix"); \ builtin_define_std ("linux"); \ builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } \ diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index c7c45dcdd98..2969880edad 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("linux"); \ builtin_define ("_LONGLONG"); \ builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } \ @@ -264,10 +265,6 @@ Boston, MA 02111-1307, USA. */ #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(REGNO) (REGNO) -/* System V Release 4 uses DWARF debugging info. Buf DWARF1 doesn't do - 64-bit anything, so we use DWARF2. */ - -#undef DWARF_DEBUGGING_INFO #define DWARF2_DEBUGGING_INFO 1 #define DBX_DEBUGGING_INFO 1 diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h index b33690727b3..49a2089b211 100644 --- a/gcc/config/sparc/liteelf.h +++ b/gcc/config/sparc/liteelf.h @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ /* Default to dwarf2 in ELF. */ -#define DWARF_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 #undef PREFERRED_DEBUGGING_TYPE diff --git a/gcc/config/sparc/sol2-bi.h b/gcc/config/sparc/sol2-bi.h index 7b6ee855272..0a763748d85 100644 --- a/gcc/config/sparc/sol2-bi.h +++ b/gcc/config/sparc/sol2-bi.h @@ -133,7 +133,7 @@ * This should be the same as in sol2.h, except with "/sparcv9" * appended to the paths and /usr/ccs/lib is no longer necessary */ -#define LINK_ARCH64_SPEC \ +#define LINK_ARCH64_SPEC_BASE \ "%{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} \ %{G:-G} \ %{YP,*} \ @@ -146,12 +146,30 @@ %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \ %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}" +#define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE + #undef LINK_ARCH_SPEC +#if DISABLE_MULTILIB +#if DEFAULT_ARCH32_P +#define LINK_ARCH_SPEC "\ +%{m32:%(link_arch32)} \ +%{m64:%edoes not support multilib} \ +%{!m32:%{!m64:%(link_arch_default)}} \ +" +#else +#define LINK_ARCH_SPEC "\ +%{m32:%edoes not support multilib} \ +%{m64:%(link_arch64)} \ +%{!m32:%{!m64:%(link_arch_default)}} \ +" +#endif +#else #define LINK_ARCH_SPEC "\ %{m32:%(link_arch32)} \ %{m64:%(link_arch64)} \ %{!m32:%{!m64:%(link_arch_default)}} \ " +#endif #define LINK_ARCH_DEFAULT_SPEC \ (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC) diff --git a/gcc/config/sparc/sol2-gld-bi.h b/gcc/config/sparc/sol2-gld-bi.h index eab63a9a7c7..aa9a40bdfcb 100644 --- a/gcc/config/sparc/sol2-gld-bi.h +++ b/gcc/config/sparc/sol2-gld-bi.h @@ -1,9 +1,34 @@ /* Definitions of target machine for GCC, for bi-arch SPARC running Solaris 2 using the GNU linker. */ +#undef LINK_ARCH32_SPEC +#define LINK_ARCH32_SPEC \ + LINK_ARCH32_SPEC_BASE "%{!static: -rpath-link %R/usr/lib}" + +#undef LINK_ARCH64_SPEC +#define LINK_ARCH64_SPEC \ + LINK_ARCH64_SPEC_BASE "%{!static: -rpath-link %R/usr/lib/sparcv9}" + #undef LINK_ARCH_SPEC +#if DISABLE_MULTILIB +#if DEFAULT_ARCH32_P #define LINK_ARCH_SPEC "\ %{m32:-m elf32_sparc %(link_arch32)} \ +%{m64:%edoes not support multilib} \ +%{!m32:%{!m64:%(link_arch_default)}} \ +" +#else +#define LINK_ARCH_SPEC "\ +%{m32:%edoes not support multilib} \ %{m64:-m elf64_sparc %(link_arch64)} \ %{!m32:%{!m64:%(link_arch_default)}} \ " +#endif +#else +#define LINK_ARCH_SPEC "\ +%{m32:-m elf32_sparc %(link_arch32)} \ +%{m64:-m elf64_sparc %(link_arch64)} \ +%{!m32:%{!m64:%(link_arch_default)}} \ +" +#endif + diff --git a/gcc/config/sparc/sol2-gld.h b/gcc/config/sparc/sol2-gld.h index aed94e5c475..eb422cb8667 100644 --- a/gcc/config/sparc/sol2-gld.h +++ b/gcc/config/sparc/sol2-gld.h @@ -4,3 +4,6 @@ /* Undefine this so that attribute((init_priority)) works. */ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP + +#undef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY 1 diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 47204f4710e..53c364daade 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -98,6 +98,10 @@ Boston, MA 02111-1307, USA. */ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) #endif + +/* The Solaris linker doesn't understand constructor priorities. */ +#undef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY 0 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h. Instead, it is enabled here, because it does work under Solaris. */ diff --git a/gcc/config/sparc/sol26-sld.h b/gcc/config/sparc/sol26-sld.h index 74b54335011..2e7fed9424c 100644 --- a/gcc/config/sparc/sol26-sld.h +++ b/gcc/config/sparc/sol26-sld.h @@ -1,6 +1,5 @@ -/* Up through Solaris 2.6, the system linker does not work with DWARF - or DWARF2, since it does not have working support for relocations - to unaligned data. */ +/* Up through Solaris 2.6, the system linker does not work with DWARF2 + since it does not have working support for relocations to unaligned + data. */ -#undef DWARF_DEBUGGING_INFO #undef DWARF2_DEBUGGING_INFO diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h index 04ed624cf72..593400d0dd2 100644 --- a/gcc/config/sparc/sp86x-elf.h +++ b/gcc/config/sparc/sp86x-elf.h @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ /* Default to dwarf2 in ELF. */ -#define DWARF_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 #undef PREFERRED_DEBUGGING_TYPE diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 4b9582d96b8..12c5d2d8969 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -1,7 +1,7 @@ -/* Prototypes of target machine for GCC, for Sun SPARC. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Prototypes of target machine for SPARC. + Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). - 64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, + 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, at Cygnus Support. This file is part of GCC. @@ -51,19 +51,15 @@ extern enum direction function_arg_padding (enum machine_mode, tree); extern void load_pic_register (void); extern void order_regs_for_local_alloc (void); -extern int compute_frame_size (int, int); +extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int); extern int check_pic (int); extern int short_branch (int, int); extern int sparc_flat_epilogue_delay_slots (void); -extern unsigned long sparc_flat_compute_frame_size (int); +extern HOST_WIDE_INT sparc_flat_compute_frame_size (HOST_WIDE_INT); extern void sparc_profile_hook (int); extern void sparc_override_options (void); extern int leaf_return_peephole_ok (void); extern void sparc_output_scratch_registers (FILE *); -extern void sparc_flat_save_restore (FILE *, const char *, - unsigned int, unsigned long, - unsigned long, const char *, - const char *, unsigned long); #ifdef RTX_CODE extern enum machine_mode select_cc_mode (enum rtx_code, rtx, rtx); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 82244d8daba..a3fdcc6cdb2 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -67,8 +67,8 @@ Boston, MA 02111-1307, USA. */ scheduling (to see what can go in a delay slot). APPARENT_FSIZE is the size of the stack less the register save area and less the outgoing argument area. It is used when saving call preserved regs. */ -static int apparent_fsize; -static int actual_fsize; +static HOST_WIDE_INT apparent_fsize; +static HOST_WIDE_INT actual_fsize; /* Number of live general or floating point registers needed to be saved (as 4-byte quantities). */ @@ -131,12 +131,12 @@ struct machine_function GTY(()) too big for reg+constant addressing. */ static const char *frame_base_name; -static int frame_base_offset; +static HOST_WIDE_INT frame_base_offset; static void sparc_init_modes (void); -static int save_regs (FILE *, int, int, const char *, int, int, int); +static int save_regs (FILE *, int, int, const char *, int, int, HOST_WIDE_INT); static int restore_regs (FILE *, int, int, const char *, int, int); -static void build_big_number (FILE *, int, const char *); +static void build_big_number (FILE *, HOST_WIDE_INT, const char *); static int function_arg_slotno (const CUMULATIVE_ARGS *, enum machine_mode, tree, int, int, int *, int *); @@ -155,6 +155,10 @@ static void sparc_output_function_prologue (FILE *, HOST_WIDE_INT); static void sparc_output_function_epilogue (FILE *, HOST_WIDE_INT); static void sparc_flat_function_epilogue (FILE *, HOST_WIDE_INT); static void sparc_flat_function_prologue (FILE *, HOST_WIDE_INT); +static void sparc_flat_save_restore (FILE *, const char *, int, + unsigned long, unsigned long, + const char *, const char *, + HOST_WIDE_INT); static void sparc_nonflat_function_epilogue (FILE *, HOST_WIDE_INT, int); static void sparc_nonflat_function_prologue (FILE *, HOST_WIDE_INT, int); #ifdef OBJECT_FORMAT_ELF @@ -3994,7 +3998,7 @@ sparc_init_modes (void) static int save_regs (FILE *file, int low, int high, const char *base, - int offset, int n_regs, int real_offset) + int offset, int n_regs, HOST_WIDE_INT real_offset) { int i; @@ -4101,8 +4105,8 @@ restore_regs (FILE *file, int low, int high, const char *base, /* Compute the frame size required by the function. This function is called during the reload pass and also by output_function_prologue(). */ -int -compute_frame_size (int size, int leaf_function) +HOST_WIDE_INT +compute_frame_size (HOST_WIDE_INT size, int leaf_function) { int n_regs = 0, i; int outgoing_args_size = (current_function_outgoing_args_size @@ -4156,32 +4160,97 @@ compute_frame_size (int size, int leaf_function) return SPARC_STACK_ALIGN (actual_fsize); } -/* Build a (32 bit) big number in a register. */ -/* ??? We may be able to use the set macro here too. */ +/* Build big number NUM in register REG and output the result to FILE. + REG is guaranteed to be the only clobbered register. The function + will very likely emit several instructions, so it must not be called + from within a delay slot. */ static void -build_big_number (FILE *file, int num, const char *reg) +build_big_number (FILE *file, HOST_WIDE_INT num, const char *reg) { - if (num >= 0 || ! TARGET_ARCH64) +#if HOST_BITS_PER_WIDE_INT == 64 + HOST_WIDE_INT high_bits = (num >> 32) & 0xffffffff; + + if (high_bits == 0 +#else + if (num >= 0 +#endif + || ! TARGET_ARCH64) { - fprintf (file, "\tsethi\t%%hi(%d), %s\n", num, reg); + /* We don't use the 'set' macro because it appears to be broken + in the Solaris 7 assembler. */ + fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", + num, reg); if ((num & 0x3ff) != 0) - fprintf (file, "\tor\t%s, %%lo(%d), %s\n", reg, num, reg); + fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n", + reg, num, reg); } +#if HOST_BITS_PER_WIDE_INT == 64 + else if (high_bits == 0xffffffff) /* && TARGET_ARCH64 */ +#else else /* num < 0 && TARGET_ARCH64 */ +#endif { /* Sethi does not sign extend, so we must use a little trickery to use it for negative numbers. Invert the constant before loading it in, then use xor immediate to invert the loaded bits (along with the upper 32 bits) to the desired constant. This works because the sethi and immediate fields overlap. */ - int asize = num; - int inv = ~asize; - int low = -0x400 + (asize & 0x3FF); + HOST_WIDE_INT inv = ~num; + HOST_WIDE_INT low = -0x400 + (num & 0x3ff); - fprintf (file, "\tsethi\t%%hi(%d), %s\n\txor\t%s, %d, %s\n", - inv, reg, reg, low, reg); + fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", + inv, reg); + fprintf (file, "\txor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", + reg, low, reg); + } +#if HOST_BITS_PER_WIDE_INT == 64 + else /* TARGET_ARCH64 */ + { + /* We don't use the 'setx' macro because if requires a scratch register. + This is the translation of sparc_emit_set_const64_longway into asm. + Hopefully we will soon have prologue/epilogue emitted as RTL. */ + HOST_WIDE_INT low1 = (num >> (32 - 12)) & 0xfff; + HOST_WIDE_INT low2 = (num >> (32 - 12 - 12)) & 0xfff; + HOST_WIDE_INT low3 = (num >> (32 - 12 - 12 - 8)) & 0x0ff; + int to_shift = 12; + + /* We don't use the 'set' macro because it appears to be broken + in the Solaris 7 assembler. */ + fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", + high_bits, reg); + if ((high_bits & 0x3ff) != 0) + fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n", + reg, high_bits, reg); + + if (low1 != 0) + { + fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); + fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", + reg, low1, reg); + to_shift = 12; + } + else + { + to_shift += 12; + } + if (low2 != 0) + { + fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); + fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", + reg, low2, reg); + to_shift = 8; + } + else + { + to_shift += 8; + } + fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); + if (low3 != 0) + fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", + reg, low3, reg); } +#endif } /* Output any necessary .register pseudo-ops. */ @@ -4266,11 +4335,13 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size, else if (! leaf_function) { if (actual_fsize <= 4096) - fprintf (file, "\tsave\t%%sp, -%d, %%sp\n", actual_fsize); + fprintf (file, "\tsave\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", + actual_fsize); else if (actual_fsize <= 8192) { fprintf (file, "\tsave\t%%sp, -4096, %%sp\n"); - fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096); + fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", + actual_fsize - 4096); } else { @@ -4281,11 +4352,13 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size, else /* leaf function */ { if (actual_fsize <= 4096) - fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize); + fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", + actual_fsize); else if (actual_fsize <= 8192) { fprintf (file, "\tadd\t%%sp, -4096, %%sp\n"); - fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096); + fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", + actual_fsize - 4096); } else { @@ -4322,7 +4395,8 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size, /* Call saved registers are saved just above the outgoing argument area. */ if (num_gfregs) { - int offset, real_offset, n_regs; + HOST_WIDE_INT offset, real_offset; + int n_regs; const char *base; real_offset = -apparent_fsize; @@ -4356,7 +4430,8 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size, static void output_restore_regs (FILE *file, int leaf_function ATTRIBUTE_UNUSED) { - int offset, n_regs; + HOST_WIDE_INT offset; + int n_regs; const char *base; offset = -apparent_fsize + frame_base_offset; @@ -4518,16 +4593,16 @@ sparc_nonflat_function_epilogue (FILE *file, else if (actual_fsize == 0) fprintf (file, "\t%s\n\tnop\n", ret); else if (actual_fsize <= 4096) - fprintf (file, "\t%s\n\tsub\t%%sp, -%d, %%sp\n", ret, actual_fsize); + fprintf (file, "\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", + ret, actual_fsize); else if (actual_fsize <= 8192) - fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -%d, %%sp\n", + fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", ret, actual_fsize - 4096); - else if ((actual_fsize & 0x3ff) == 0) - fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n", - actual_fsize, ret); - else - fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\tor\t%%g1, %%lo(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n", - actual_fsize, actual_fsize, ret); + else + { + build_big_number (file, actual_fsize, "%g1"); + fprintf (file, "\t%s\n\tadd\t%%sp, %%g1, %%sp\n", ret); + } output_vectors: sparc_output_deferred_case_vectors (); @@ -4575,7 +4650,7 @@ output_sibcall (rtx insn, rtx call_operand) #else int spare_slot = ((TARGET_ARCH32 || TARGET_CM_MEDLOW) && ! flag_pic); #endif - int size = 0; + HOST_WIDE_INT size = 0; if ((actual_fsize || ! spare_slot) && delay_slot) { @@ -4598,15 +4673,9 @@ output_sibcall (rtx insn, rtx call_operand) fputs ("\tsub\t%sp, -4096, %sp\n", asm_out_file); size = actual_fsize - 4096; } - else if ((actual_fsize & 0x3ff) == 0) - fprintf (asm_out_file, - "\tsethi\t%%hi(%d), %%g1\n\tadd\t%%sp, %%g1, %%sp\n", - actual_fsize); else { - fprintf (asm_out_file, - "\tsethi\t%%hi(%d), %%g1\n\tor\t%%g1, %%lo(%d), %%g1\n", - actual_fsize, actual_fsize); + build_big_number (asm_out_file, actual_fsize, "%g1"); fputs ("\tadd\t%%sp, %%g1, %%sp\n", asm_out_file); } } @@ -4615,14 +4684,14 @@ output_sibcall (rtx insn, rtx call_operand) output_asm_insn ("sethi\t%%hi(%a0), %%g1", operands); output_asm_insn ("jmpl\t%%g1 + %%lo(%a0), %%g0", operands); if (size) - fprintf (asm_out_file, "\t sub\t%%sp, -%d, %%sp\n", size); + fprintf (asm_out_file, "\t sub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size); else if (! delay_slot) fputs ("\t nop\n", asm_out_file); } else { if (size) - fprintf (asm_out_file, "\tsub\t%%sp, -%d, %%sp\n", size); + fprintf (asm_out_file, "\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size); /* Use or with rs2 %%g0 instead of mov, so that as/ld can optimize it into branch if possible. */ output_asm_insn ("or\t%%o7, %%g0, %%g1", operands); @@ -5433,9 +5502,15 @@ function_arg_partial_nregs (const struct sparc_args *cum, || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT && ! (TARGET_FPU && named))) { + /* The complex types are passed as packed types. */ + if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD) + return 0; + if (GET_MODE_ALIGNMENT (mode) == 128) { slotno += slotno & 1; + + /* ??? The mode needs 3 slots? */ if (slotno == SPARC_INT_ARG_MAX - 2) return 1; } @@ -5476,7 +5551,8 @@ function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED, else { return ((type && TREE_CODE (type) == ARRAY_TYPE) - /* Consider complex values as aggregates, so care for TCmode. */ + /* Consider complex values as aggregates, so care + for CTImode and TCmode. */ || GET_MODE_SIZE (mode) > 16 || (type && AGGREGATE_TYPE_P (type) @@ -5521,14 +5597,6 @@ function_arg_advance (struct sparc_args *cum, enum machine_mode mode, else /* passed by reference */ ++cum->words; } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT) - { - cum->words += 2; - } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) - { - cum->words += GET_MODE_SIZE (mode) / UNITS_PER_WORD; - } else { cum->words += (mode != BLKmode @@ -5661,17 +5729,19 @@ sparc_va_arg (tree valist, tree type) if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD) align = 2 * UNITS_PER_WORD; - if (AGGREGATE_TYPE_P (type)) + /* Consider complex values as aggregates, so care + for CTImode and TCmode. */ + if ((unsigned HOST_WIDE_INT) size > 16) { - if ((unsigned HOST_WIDE_INT) size > 16) - { - indirect = 1; - size = rsize = UNITS_PER_WORD; - align = 0; - } - /* SPARC v9 ABI states that structures up to 8 bytes in size are - given one 8 byte slot. */ - else if (size == 0) + indirect = 1; + size = rsize = UNITS_PER_WORD; + align = 0; + } + else if (AGGREGATE_TYPE_P (type)) + { + /* SPARC-V9 ABI states that structures up to 16 bytes in size + are given whole slots as needed. */ + if (size == 0) size = rsize = UNITS_PER_WORD; else size = rsize; @@ -6529,7 +6599,7 @@ mems_ok_for_ldd_peep (rtx mem1, rtx mem2, rtx dependent_reg_rtx) { rtx addr1, addr2; unsigned int reg1; - int offset1; + HOST_WIDE_INT offset1; /* The mems cannot be volatile. */ if (MEM_VOLATILE_P (mem1) || MEM_VOLATILE_P (mem2)) @@ -6651,7 +6721,7 @@ print_operand (FILE *file, rtx x, int code) /* Print out what we are using as the frame pointer. This might be %fp, or might be %sp+offset. */ /* ??? What if offset is too big? Perhaps the caller knows it isn't? */ - fprintf (file, "%s+%d", frame_base_name, frame_base_offset); + fprintf (file, "%s+"HOST_WIDE_INT_PRINT_DEC, frame_base_name, frame_base_offset); return; case '&': /* Print some local dynamic TLS name. */ @@ -7086,7 +7156,7 @@ sparc_type_code (register tree type) void sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) { - /* SPARC 32 bit trampoline: + /* SPARC 32-bit trampoline: sethi %hi(fn), %g1 sethi %hi(static), %g2 @@ -7096,10 +7166,6 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) SETHI i,r = 00rr rrr1 00ii iiii iiii iiii iiii iiii JMPL r+i,d = 10dd ddd1 1100 0rrr rr1i iiii iiii iiii */ -#ifdef TRANSFER_FROM_TRAMPOLINE - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, tramp, Pmode); -#endif emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)), @@ -7138,21 +7204,25 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) && sparc_cpu != PROCESSOR_ULTRASPARC3) emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, plus_constant (tramp, 8))))); + + /* Call __enable_execute_stack after writing onto the stack to make sure + the stack address is accessible. */ +#ifdef TRANSFER_FROM_TRAMPOLINE + emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + LCT_NORMAL, VOIDmode, 1, tramp, Pmode); +#endif + } -/* The 64 bit version is simpler because it makes more sense to load the +/* The 64-bit version is simpler because it makes more sense to load the values as "immediate" data out of the trampoline. It's also easier since we can read the PC without clobbering a register. */ void sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) { -#ifdef TRANSFER_FROM_TRAMPOLINE - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, tramp, Pmode); -#endif + /* SPARC 64-bit trampoline: - /* rd %pc, %g1 ldx [%g1+24], %g5 jmp %g5 @@ -7175,6 +7245,13 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) if (sparc_cpu != PROCESSOR_ULTRASPARC && sparc_cpu != PROCESSOR_ULTRASPARC3) emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8))))); + + /* Call __enable_execute_stack after writing onto the stack to make sure + the stack address is accessible. */ +#ifdef TRANSFER_FROM_TRAMPOLINE + emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + LCT_NORMAL, VOIDmode, 1, tramp, Pmode); +#endif } /* Subroutines to support a flat (single) register window calling @@ -7243,16 +7320,16 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) struct sparc_frame_info { - unsigned long total_size; /* # bytes that the entire frame takes up. */ - unsigned long var_size; /* # bytes that variables take up. */ - unsigned long args_size; /* # bytes that outgoing arguments take up. */ - unsigned long extra_size; /* # bytes of extra gunk. */ - unsigned int gp_reg_size; /* # bytes needed to store gp regs. */ - unsigned int fp_reg_size; /* # bytes needed to store fp regs. */ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */ + HOST_WIDE_INT var_size; /* # bytes that variables take up. */ + int args_size; /* # bytes that outgoing arguments take up. */ + int extra_size; /* # bytes of extra gunk. */ + int gp_reg_size; /* # bytes needed to store gp regs. */ + int fp_reg_size; /* # bytes needed to store fp regs. */ unsigned long gmask; /* Mask of saved gp registers. */ unsigned long fmask; /* Mask of saved fp registers. */ - unsigned long reg_offset; /* Offset from new sp to store regs. */ - int initialized; /* Nonzero if frame size already calculated. */ + int reg_offset; /* Offset from new sp to store regs. */ + int initialized; /* Nonzero if frame size already calculated. */ }; /* Current frame information calculated by sparc_flat_compute_frame_size. */ @@ -7297,20 +7374,20 @@ sparc_flat_must_save_register_p (int regno) /* Return the bytes needed to compute the frame pointer from the current stack pointer. */ -unsigned long -sparc_flat_compute_frame_size (int size) +HOST_WIDE_INT +sparc_flat_compute_frame_size (HOST_WIDE_INT size) /* # of var. bytes allocated. */ { int regno; - unsigned long total_size; /* # bytes that the entire frame takes up. */ - unsigned long var_size; /* # bytes that variables take up. */ - unsigned long args_size; /* # bytes that outgoing arguments take up. */ - unsigned long extra_size; /* # extra bytes. */ - unsigned int gp_reg_size; /* # bytes needed to store gp regs. */ - unsigned int fp_reg_size; /* # bytes needed to store fp regs. */ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */ + HOST_WIDE_INT var_size; /* # bytes that variables take up. */ + int args_size; /* # bytes that outgoing arguments take up. */ + int extra_size; /* # extra bytes. */ + int gp_reg_size; /* # bytes needed to store gp regs. */ + int fp_reg_size; /* # bytes needed to store fp regs. */ unsigned long gmask; /* Mask of saved gp registers. */ unsigned long fmask; /* Mask of saved fp registers. */ - unsigned long reg_offset; /* Offset to register save area. */ + int reg_offset; /* Offset to register save area. */ int need_aligned_p; /* 1 if need the save area 8 byte aligned. */ /* This is the size of the 16 word reg save area, 1 word struct addr @@ -7416,12 +7493,11 @@ sparc_flat_compute_frame_size (int size) WORD_OP is either "st" for save, "ld" for restore. DOUBLEWORD_OP is either "std" for save, "ldd" for restore. */ -void -sparc_flat_save_restore (FILE *file, const char *base_reg, - unsigned int offset, long unsigned int gmask, - long unsigned int fmask, const char *word_op, - const char *doubleword_op, - long unsigned int base_offset) +static void +sparc_flat_save_restore (FILE *file, const char *base_reg, int offset, + unsigned long gmask, unsigned long fmask, + const char *word_op, const char *doubleword_op, + HOST_WIDE_INT base_offset) { int regno; @@ -7525,7 +7601,8 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) /* This is only for the human reader. */ fprintf (file, "\t%s#PROLOGUE# 0\n", ASM_COMMENT_START); - fprintf (file, "\t%s# vars= %ld, regs= %d/%d, args= %d, extra= %ld\n", + fprintf (file, "\t%s# vars= "HOST_WIDE_INT_PRINT_DEC", " + "regs= %d/%d, args= %d, extra= %d\n", ASM_COMMENT_START, current_frame_info.var_size, current_frame_info.gp_reg_size / 4, @@ -7556,7 +7633,7 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) after %i7 so gdb won't have to look too far to find it. */ if (size > 0) { - unsigned int reg_offset = current_frame_info.reg_offset; + int reg_offset = current_frame_info.reg_offset; const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM]; static const char *const t1_str = "%g1"; @@ -7572,26 +7649,26 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) the gdb folk first. */ /* Is the entire register save area offsettable from %sp? */ - if (reg_offset < 4096 - 64 * (unsigned) UNITS_PER_WORD) + if (reg_offset < 4096 - 64 * UNITS_PER_WORD) { if (size <= 4096) { - fprintf (file, "\tadd\t%s, %d, %s\n", - sp_str, (int) -size, sp_str); + fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", + sp_str, size, sp_str); if (gmask & HARD_FRAME_POINTER_MASK) { fprintf (file, "\tst\t%s, [%s+%d]\n", fp_str, sp_str, reg_offset); - fprintf (file, "\tsub\t%s, %d, %s\t%s# set up frame pointer\n", - sp_str, (int) -size, fp_str, ASM_COMMENT_START); + fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" + "\t%s# set up frame pointer\n", + sp_str, size, fp_str, ASM_COMMENT_START); reg_offset += 4; } } else { - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC - ", %s\n\tsub\t%s, %s, %s\n", - size, t1_str, sp_str, t1_str, sp_str); + build_big_number (file, size, t1_str); + fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); if (gmask & HARD_FRAME_POINTER_MASK) { fprintf (file, "\tst\t%s, [%s+%d]\n", @@ -7629,33 +7706,40 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) else { /* Subtract %sp in two steps, but make sure there is always a - 64 byte register save area, and %sp is properly aligned. */ + 64-byte register save area, and %sp is properly aligned. */ + /* Amount to decrement %sp by, the first time. */ - unsigned HOST_WIDE_INT size1 = ((size - reg_offset + 64) + 15) & -16; - /* Offset to register save area from %sp. */ - unsigned HOST_WIDE_INT offset = size1 - (size - reg_offset); + HOST_WIDE_INT size1 = ((size - reg_offset + 64) + 15) & -16; + + /* Amount to decrement %sp by, the second time. */ + HOST_WIDE_INT size2 = size - size1; + + /* Offset to register save area from %sp after first decrement. */ + int offset = (int)(size1 - (size - reg_offset)); if (size1 <= 4096) { - fprintf (file, "\tadd\t%s, %d, %s\n", - sp_str, (int) -size1, sp_str); + fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", + sp_str, size1, sp_str); if (gmask & HARD_FRAME_POINTER_MASK) { - fprintf (file, "\tst\t%s, [%s+%d]\n\tsub\t%s, %d, %s\t%s# set up frame pointer\n", - fp_str, sp_str, (int) offset, sp_str, (int) -size1, + fprintf (file, "\tst\t%s, [%s+%d]\n" + "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" + "\t%s# set up frame pointer\n", + fp_str, sp_str, offset, sp_str, size1, fp_str, ASM_COMMENT_START); offset += 4; } } else { - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC - ", %s\n\tsub\t%s, %s, %s\n", - size1, t1_str, sp_str, t1_str, sp_str); + build_big_number (file, size1, t1_str); + fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); if (gmask & HARD_FRAME_POINTER_MASK) { - fprintf (file, "\tst\t%s, [%s+%d]\n\tadd\t%s, %s, %s\t%s# set up frame pointer\n", - fp_str, sp_str, (int) offset, sp_str, t1_str, + fprintf (file, "\tst\t%s, [%s+%d]\n" + "\tadd\t%s, %s, %s\t%s# set up frame pointer\n", + fp_str, sp_str, offset, sp_str, t1_str, fp_str, ASM_COMMENT_START); offset += 4; } @@ -7675,7 +7759,7 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) if (gmask & RETURN_ADDR_MASK) { fprintf (file, "\tst\t%s, [%s+%d]\n", - reg_names[RETURN_ADDR_REGNUM], sp_str, (int) offset); + reg_names[RETURN_ADDR_REGNUM], sp_str, offset); if (dwarf2out_do_frame ()) /* offset - size1 == reg_offset - size if reg_offset were updated above like offset. */ @@ -7686,9 +7770,14 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) gmask & ~(HARD_FRAME_POINTER_MASK | RETURN_ADDR_MASK), current_frame_info.fmask, "st", "std", -size1); - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC - ", %s\n\tsub\t%s, %s, %s\n", - size - size1, t1_str, sp_str, t1_str, sp_str); + if (size2 <= 4096) + fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", + sp_str, size2, sp_str); + else + { + build_big_number (file, size2, t1_str); + fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); + } if (dwarf2out_do_frame ()) if (! (gmask & HARD_FRAME_POINTER_MASK)) dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, size); @@ -7734,8 +7823,8 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) if (!noepilogue) { - unsigned HOST_WIDE_INT reg_offset = current_frame_info.reg_offset; - unsigned HOST_WIDE_INT size1; + int reg_offset = current_frame_info.reg_offset; + int reg_offset1; const char *const sp_str = reg_names[STACK_POINTER_REGNUM]; const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM]; static const char *const t1_str = "%g1"; @@ -7744,37 +7833,43 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) slots for most of the loads, also see if we can fill the final delay slot if not otherwise filled by the reload sequence. */ - if (size > 4095) - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC ", %s\n", - size, t1_str); + if (size > 4096) + build_big_number (file, size, t1_str); if (frame_pointer_needed) { - if (size > 4095) + if (size > 4096) fprintf (file,"\tsub\t%s, %s, %s\t\t%s# sp not trusted here\n", fp_str, t1_str, sp_str, ASM_COMMENT_START); else - fprintf (file,"\tsub\t%s, %d, %s\t\t%s# sp not trusted here\n", - fp_str, (int) size, sp_str, ASM_COMMENT_START); + fprintf (file,"\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" + "\t\t%s# sp not trusted here\n", + fp_str, size, sp_str, ASM_COMMENT_START); } /* Is the entire register save area offsettable from %sp? */ - if (reg_offset < 4096 - 64 * (unsigned) UNITS_PER_WORD) + if (reg_offset < 4096 - 64 * UNITS_PER_WORD) { - size1 = 0; + reg_offset1 = 0; } else { /* Restore %sp in two steps, but make sure there is always a - 64 byte register save area, and %sp is properly aligned. */ + 64-byte register save area, and %sp is properly aligned. */ + /* Amount to increment %sp by, the first time. */ - size1 = ((reg_offset - 64 - 16) + 15) & -16; + reg_offset1 = ((reg_offset - 64 - 16) + 15) & -16; + /* Offset to register save area from %sp. */ - reg_offset = size1 - reg_offset; + reg_offset = reg_offset1 - reg_offset; - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC - ", %s\n\tadd\t%s, %s, %s\n", - size1, t1_str, sp_str, t1_str, sp_str); + if (reg_offset1 > 4096) + { + build_big_number (file, reg_offset1, t1_str); + fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str); + } + else + fprintf (file, "\tsub\t%s, -%d, %s\n", sp_str, reg_offset1, sp_str); } /* We must restore the frame pointer and return address reg first @@ -7782,13 +7877,13 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) if (current_frame_info.gmask & HARD_FRAME_POINTER_MASK) { fprintf (file, "\tld\t[%s+%d], %s\n", - sp_str, (int) reg_offset, fp_str); + sp_str, reg_offset, fp_str); reg_offset += 4; } if (current_frame_info.gmask & RETURN_ADDR_MASK) { fprintf (file, "\tld\t[%s+%d], %s\n", - sp_str, (int) reg_offset, reg_names[RETURN_ADDR_REGNUM]); + sp_str, reg_offset, reg_names[RETURN_ADDR_REGNUM]); reg_offset += 4; } @@ -7800,12 +7895,11 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) /* If we had to increment %sp in two steps, record it so the second restoration in the epilogue finishes up. */ - if (size1 > 0) + if (reg_offset1 > 0) { - size -= size1; - if (size > 4095) - fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC ", %s\n", - size, t1_str); + size -= reg_offset1; + if (size > 4096) + build_big_number (file, size, t1_str); } if (current_function_returns_struct) @@ -7825,11 +7919,12 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1); } - else if (size > 4095) + else if (size > 4096) fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str); else if (size > 0) - fprintf (file, "\tadd\t%s, %d, %s\n", sp_str, (int) size, sp_str); + fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", + sp_str, size, sp_str); else fprintf (file, "\tnop\n"); @@ -8990,10 +9085,17 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, if (!SPARC_SIMM13_P (delta)) { rtx scratch = gen_rtx_REG (Pmode, 1); - if (TARGET_ARCH64) - sparc_emit_set_const64 (scratch, delta_rtx); + + if (input_operand (delta_rtx, GET_MODE (scratch))) + emit_insn (gen_rtx_SET (VOIDmode, scratch, delta_rtx)); else - sparc_emit_set_const32 (scratch, delta_rtx); + { + if (TARGET_ARCH64) + sparc_emit_set_const64 (scratch, delta_rtx); + else + sparc_emit_set_const32 (scratch, delta_rtx); + } + delta_rtx = scratch; } diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index d2a37f3cd60..06fd5ee328a 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -34,13 +34,13 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("sparc"); \ if (TARGET_64BIT) \ { \ - builtin_assert ("cpu=sparc"); \ - builtin_assert ("machine=sparc"); \ + builtin_assert ("cpu=sparc64"); \ + builtin_assert ("machine=sparc64"); \ } \ else \ { \ - builtin_assert ("cpu=sparc64"); \ - builtin_assert ("machine=sparc64"); \ + builtin_assert ("cpu=sparc"); \ + builtin_assert ("machine=sparc"); \ } \ } \ while (0) diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 46bd35809a9..b3a7dfaf447 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -7686,7 +7686,7 @@ emit_insn (gen_rtx_USE (VOIDmode, valreg2)); /* Construct the return. */ - expand_null_return (); + expand_naked_return (); DONE; }) @@ -8641,7 +8641,7 @@ "TARGET_TLS && TARGET_ARCH64" "xor\\t%1, %%tle_lox10(%a2), %0") -;; Now patterns combinding tldo_add{32,64} with some integer loads or stores +;; Now patterns combining tldo_add{32,64} with some integer loads or stores (define_insn "*tldo_ldub_sp32" [(set (match_operand:QI 0 "register_operand" "=r") (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r") diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h index 70e63633855..ac47238fbc8 100644 --- a/gcc/config/stormy16/stormy16-protos.h +++ b/gcc/config/stormy16/stormy16-protos.h @@ -39,7 +39,6 @@ extern rtx xstormy16_function_arg # endif extern void xstormy16_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int *); -extern tree xstormy16_build_va_list (void); #endif #if defined (TREE_CODE) && defined (RTX_CODE) diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 1961f0a9d01..de60b0005f5 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1251,8 +1251,8 @@ xstormy16_setup_incoming_varargs (CUMULATIVE_ARGS cum ATTRIBUTE_UNUSED, for arguments that have not been passed in registers. To keep the layout nice, the pointer is first in the structure. */ -tree -xstormy16_build_va_list (void) +static tree +xstormy16_build_builtin_va_list (void) { tree f_1, f_2, record, type_decl; @@ -2211,4 +2211,7 @@ xstormy16_expand_builtin(tree exp, rtx target, #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST xstormy16_address_cost +#undef TARGET_BUILD_BUILTIN_VA_LIST_TYPE +#define TARGET_BUILD_BUILTIN_VA_LIST_TYPE xstormy16_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h index 3d1ab50756f..088c7eb5cea 100644 --- a/gcc/config/stormy16/stormy16.h +++ b/gcc/config/stormy16/stormy16.h @@ -496,11 +496,6 @@ enum reg_class if (! SECOND_TIME) \ xstormy16_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE) -/* Build up the stdarg/varargs va_list type tree, assigning it to NODE. If not - defined, it is assumed that va_list is a void * pointer. */ -#define BUILD_VA_LIST_TYPE(NODE) \ - ((NODE) = xstormy16_build_va_list ()) - /* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this is stdarg.h instead of varargs.h. VALIST is the tree of the va_list variable to initialize. NEXTARG is the machine independent notion of the diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin index 8743fc1fa6d..a7076ab295d 100644 --- a/gcc/config/t-darwin +++ b/gcc/config/t-darwin @@ -20,3 +20,5 @@ $(T)crt2$(objext): $(srcdir)/config/darwin-crt2.c $(GCC_PASSES) \ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c + +TARGET_LIBGCC2_CFLAGS = -fPIC diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind index be50bc481c5..2204ae316d7 100644 --- a/gcc/config/t-libunwind +++ b/gcc/config/t-libunwind @@ -1 +1,5 @@ -LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c +# Override the default value from t-slibgcc-elf-ver and mention -lunwind +# so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for +# libunwind. +SHLIB_LC = -lunwind -lc +LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c diff --git a/gcc/config/t-slibgcc-darwin b/gcc/config/t-slibgcc-darwin new file mode 100644 index 00000000000..f27fae4948c --- /dev/null +++ b/gcc/config/t-slibgcc-darwin @@ -0,0 +1,30 @@ +# Build a shared libgcc library with the darwin linker. +SHLIB_MINOR = 1 +SHLIB_REVISION = 0 +SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION) +SHLIB_EXT = .dylib +SHLIB_SOLINK = @shlib_base_name@.dylib +SHLIB_SONAME = @shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib +SHLIB_NAME = @shlib_dir@@shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib +SHLIB_MAP = @shlib_map_file@ +SHLIB_OBJS = @shlib_objs@ +SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ + +SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \ + -Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \ + -Wl,-flat_namespace -o $(SHLIB_NAME) \ + $(SHLIB_VERSTRING) \ + @multilib_flags@ $(SHLIB_OBJS) -lc && \ + rm -f $(SHLIB_SOLINK) && \ + $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK) +# $(slibdir) double quoted to protect it from expansion while building +# libgcc.mk. We want this delayed until actual install time. +SHLIB_INSTALL = \ + $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $(INSTALL_DATA) $(SHLIB_NAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ + rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ + $(LN_S) $(SHLIB_SONAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) +SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk +SHLIB_MAPFILES = $(srcdir)/libgcc-darwin.ver diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 6c6cece5be9..5163c377eb4 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -2270,7 +2270,7 @@ v850_encode_data_area (tree decl, rtx symbol) { int flags; - /* Map explict sections into the appropriate attribute */ + /* Map explicit sections into the appropriate attribute */ if (v850_get_data_area (decl) == DATA_AREA_NORMAL) { if (DECL_SECTION_NAME (decl)) @@ -3155,8 +3155,8 @@ pattern_is_ok_for_prepare (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return 0; /* If the register is being pushed somewhere other than the stack - space just aquired by the first operand then abandon this quest. - Note: the test is <= becuase both values are negative. */ + space just acquired by the first operand then abandon this quest. + Note: the test is <= because both values are negative. */ if (INTVAL (XEXP (plus, 1)) <= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1))) return 0; diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 4d681d41b9d..76f0920fda7 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -1349,7 +1349,7 @@ zbss_section () \ can appear in the "ghs section" pragma. These names are used to index into the GHS_default_section_names[] and GHS_current_section_names[] that are defined in v850.c, and so the ordering of each must remain - consistant. + consistent. These arrays give the default and current names for each kind of section defined by the GHS pragmas. The current names can be changed diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md index ba058a45e76..b359c723002 100644 --- a/gcc/config/v850/v850.md +++ b/gcc/config/v850/v850.md @@ -368,7 +368,11 @@ (sign_extend:SI (match_operand:HI 1 "register_operand" "")) (sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))] "" - "") + "if (GET_CODE (operands[2]) == CONST_INT) + { + emit_insn (gen_mulhisi3_internal2 (operands[0], operands[1], operands[2])); + DONE; + }") (define_insn "*mulhisi3_internal1" [(set (match_operand:SI 0 "register_operand" "=r") @@ -381,13 +385,11 @@ (set_attr "cc" "none_0hit") (set_attr "type" "mult")]) -;; ??? Sign extending constants isn't valid. Fix? - -(define_insn "*mulhisi3_internal2" +(define_insn "mulhisi3_internal2" [(set (match_operand:SI 0 "register_operand" "=r,r") (mult:SI (sign_extend:SI (match_operand:HI 1 "register_operand" "%0,r")) - (sign_extend:SI (match_operand 2 "const_int_operand" "J,K"))))] + (match_operand:HI 2 "const_int_operand" "J,K")))] "" "@ mulh %2,%0 @@ -1714,7 +1716,7 @@ "TARGET_V850E && !TARGET_DISABLE_CALLT" ;; The CALLT instruction stores the next address of CALLT to CTPC register ;; without saving its previous value. So if the interrupt handler - ;; or its caller could possibily execute the CALLT insn, save_interrupt + ;; or its caller could possibly execute the CALLT insn, save_interrupt ;; MUST NOT be called via CALLT. "* { diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index dd22e33bbf7..f572652fade 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */ #include "optabs.h" #include "flags.h" #include "debug.h" +#include "toplev.h" #include "tm_p.h" #include "target.h" #include "target-def.h" @@ -152,7 +153,7 @@ static void vax_init_libfuncs (void) { set_optab_libfunc (udiv_optab, SImode, TARGET_ELF ? "*__udiv" : "*udiv"); - set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__umod" : "*umod"); + set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__urem" : "*urem"); } /* This is like nonimmediate_operand with a restriction on the type of MEM. */ diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index 0bbcc277724..35d865d0f8a 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. VAX version. Copyright (C) 1987, 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -933,6 +933,12 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Control the assembler format that we output. */ +/* A C string constant describing how to begin a comment in the target + assembler language. The compiler assumes that the comment will end at + the end of the line. */ + +#define ASM_COMMENT_START "#" + /* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */ @@ -1106,7 +1112,13 @@ VAX operand formatting codes: /* The purpose of D is to get around a quirk or bug in VAX assembler whereby -1 in a 64-bit immediate operand means 0x00000000ffffffff, - which is not a 64-bit minus one. */ + which is not a 64-bit minus one. As a workaround, we output negative + values in hex. */ +#if HOST_BITS_PER_WIDE_INT == 64 +# define NEG_HWI_PRINT_HEX16 HOST_WIDE_INT_PRINT_HEX +#else +# define NEG_HWI_PRINT_HEX16 "0xffffffff%08lx" +#endif #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ((CODE) == '#' || (CODE) == '|') @@ -1118,7 +1130,7 @@ VAX operand formatting codes: else if (CODE == 'C') \ fputs (rev_cond_name (X), FILE); \ else if (CODE == 'D' && GET_CODE (X) == CONST_INT && INTVAL (X) < 0) \ - fprintf (FILE, "$0xffffffff%08x", INTVAL (X)); \ + fprintf (FILE, "$" NEG_HWI_PRINT_HEX16, INTVAL (X)); \ else if (CODE == 'P' && GET_CODE (X) == CONST_INT) \ fprintf (FILE, "$" HOST_WIDE_INT_PRINT_DEC, INTVAL (X) + 1); \ else if (CODE == 'N' && GET_CODE (X) == CONST_INT) \ diff --git a/gcc/config/vxlib.c b/gcc/config/vxlib.c index 89e0c3514d9..20a257e02c4 100644 --- a/gcc/config/vxlib.c +++ b/gcc/config/vxlib.c @@ -198,7 +198,7 @@ tsd_init (void) /* External interface */ /* Store in KEYP a value which can be passed to __gthread_setspecific/ - __gthread_getspecific to store and retrive a value which is + __gthread_getspecific to store and retrieve a value which is specific to each calling thread. If DTOR is not NULL, it will be called when a thread terminates with a non-NULL specific value for this key, with the value as its sole argument. */ diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 339acecc20c..085eb8ce648 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -62,4 +62,3 @@ Boston, MA 02111-1307, USA. */ /* Only supported debug format is Dwarf2. */ #undef DBX_DEBUGGING_INFO -#undef DWARF_DEBUGGING_INFO diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index 849be87edb0..1ef309bfa8c 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -21,7 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags -/* Don't assume anything about the header files. */ +/* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C #undef ASM_APP_ON diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index ef5aae04f63..0b3b077eca9 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -19,13 +19,7 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - builtin_define_std ("linux"); \ - builtin_define_std ("unix"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=posix"); \ - } while (0) +#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() #undef SUBTARGET_CPP_SPEC #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index 9c37c417991..cf7f09075c9 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -22,7 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef __XTENSA_PROTOS_H__ #define __XTENSA_PROTOS_H__ -/* Functions to test whether an immediate fits in a given field. */ +/* Functions to test whether an immediate fits in a given field. */ extern int xtensa_simm7 (int); extern int xtensa_simm8 (int); extern int xtensa_simm8x256 (int); @@ -96,7 +96,6 @@ extern int a7_overlap_mentioned_p (rtx); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree); extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern tree xtensa_build_va_list (void); #endif /* TREE_CODE */ extern int xtensa_mask_immediate (int); diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 23798b00191..e8926c9c1e3 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -205,6 +205,7 @@ static unsigned int xtensa_multibss_section_type_flags (tree, const char *, static void xtensa_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT); static bool xtensa_rtx_costs (rtx, int, int, int *); +static tree xtensa_build_builtin_va_list (void); static int current_function_arg_words; static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = @@ -233,6 +234,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_0 +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST xtensa_build_builtin_va_list + struct gcc_target targetm = TARGET_INITIALIZER; @@ -596,7 +600,7 @@ move_operand (rtx op, enum machine_mode mode) case SImode: if (TARGET_CONST16) return CONSTANT_P (op); - /* fall through */ + /* Fall through. */ case HImode: case QImode: @@ -648,12 +652,12 @@ constantpool_address_p (rtx addr) { rtx offset; - /* only handle (PLUS (SYM, OFFSET)) form */ + /* Only handle (PLUS (SYM, OFFSET)) form. */ addr = XEXP (addr, 0); if (GET_CODE (addr) != PLUS) return FALSE; - /* make sure the address is word aligned */ + /* Make sure the address is word aligned. */ offset = XEXP (addr, 1); if ((GET_CODE (offset) != CONST_INT) || ((INTVAL (offset) & 3) != 0)) @@ -724,7 +728,7 @@ xtensa_extend_reg (rtx dst, rtx src) rtx temp = gen_reg_rtx (SImode); rtx shift = GEN_INT (BITS_PER_WORD - GET_MODE_BITSIZE (GET_MODE (src))); - /* generate paradoxical subregs as needed so that the modes match */ + /* Generate paradoxical subregs as needed so that the modes match. */ src = simplify_gen_subreg (SImode, src, GET_MODE (src), 0); dst = simplify_gen_subreg (SImode, dst, GET_MODE (dst), 0); @@ -1076,14 +1080,14 @@ gen_conditional_move (rtx cmp) if (boolean_operator (cmp, VOIDmode)) { - /* swap the operands to make const0 second */ + /* Swap the operands to make const0 second. */ if (op0 == const0_rtx) { op0 = op1; op1 = const0_rtx; } - /* if not comparing against zero, emit a comparison (subtract) */ + /* If not comparing against zero, emit a comparison (subtract). */ if (op1 != const0_rtx) { op0 = expand_binop (SImode, sub_optab, op0, op1, @@ -1093,7 +1097,7 @@ gen_conditional_move (rtx cmp) } else if (branch_operator (cmp, VOIDmode)) { - /* swap the operands to make const0 second */ + /* Swap the operands to make const0 second. */ if (op0 == const0_rtx) { op0 = op1; @@ -1375,26 +1379,26 @@ xtensa_expand_block_move (rtx *operands) int align = XINT (operands[3], 0); int num_pieces, move_ratio; - /* If this is not a fixed size move, just call memcpy */ + /* If this is not a fixed size move, just call memcpy. */ if (!optimize || (GET_CODE (operands[2]) != CONST_INT)) return 0; - /* Anything to move? */ + /* Anything to move? */ if (bytes <= 0) return 1; if (align > MOVE_MAX) align = MOVE_MAX; - /* decide whether to expand inline based on the optimization level */ + /* Decide whether to expand inline based on the optimization level. */ move_ratio = 4; if (optimize > 2) move_ratio = LARGEST_MOVE_RATIO; - num_pieces = (bytes / align) + (bytes % align); /* close enough anyway */ + num_pieces = (bytes / align) + (bytes % align); /* Close enough anyway. */ if (num_pieces >= move_ratio) return 0; - /* make sure the memory addresses are valid */ + /* Make sure the memory addresses are valid. */ operands[0] = validize_mem (dest); operands[1] = validize_mem (src); @@ -1404,10 +1408,10 @@ xtensa_expand_block_move (rtx *operands) } -/* Emit a sequence of instructions to implement a block move, trying - to hide load delay slots as much as possible. Load N values into - temporary registers, store those N values, and repeat until the - complete block has been moved. N=delay_slots+1 */ +/* Emit a sequence of instructions to implement a block move, trying + to hide load delay slots as much as possible. Load N values into + temporary registers, store those N values, and repeat until the + complete block has been moved. N=delay_slots+1. */ struct meminsnbuf { @@ -1463,7 +1467,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots) if (bytes < item_size) { - /* find a smaller item_size which we can load & store */ + /* Find a smaller item_size which we can load & store. */ item_size = bytes; mode = xtensa_find_mode_for_size (item_size); item_size = GET_MODE_SIZE (mode); @@ -1471,7 +1475,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots) stname = xtensa_st_opcodes[(int) mode]; } - /* record the load instruction opcode and operands */ + /* Record the load instruction opcode and operands. */ addr = plus_constant (from_addr, offset); mem = gen_rtx_MEM (mode, addr); if (! memory_address_p (mode, addr)) @@ -1481,7 +1485,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots) ldinsns[n].operands[1] = mem; sprintf (ldinsns[n].template, "%s\t%%0, %%1", ldname); - /* record the store instruction opcode and operands */ + /* Record the store instruction opcode and operands. */ addr = plus_constant (to_addr, offset); mem = gen_rtx_MEM (mode, addr); if (! memory_address_p (mode, addr)) @@ -1495,7 +1499,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots) bytes -= item_size; } - /* now output the loads followed by the stores */ + /* Now output the loads followed by the stores. */ for (n = 0; n < chunk_size; n++) output_asm_insn (ldinsns[n].template, ldinsns[n].operands); for (n = 0; n < chunk_size; n++) @@ -1513,7 +1517,7 @@ xtensa_find_mode_for_size (unsigned item_size) { mode = VOIDmode; - /* find mode closest to but not bigger than item_size */ + /* Find mode closest to but not bigger than item_size. */ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT); tmode != VOIDmode; tmode = GET_MODE_WIDER_MODE (tmode)) if (GET_MODE_SIZE (tmode) <= item_size) @@ -1527,7 +1531,7 @@ xtensa_find_mode_for_size (unsigned item_size) && xtensa_st_opcodes[(int) mode]) break; - /* cannot load & store this mode; try something smaller */ + /* Cannot load & store this mode; try something smaller. */ item_size -= 1; } @@ -1541,8 +1545,8 @@ xtensa_expand_nonlocal_goto (rtx *operands) rtx goto_handler = operands[1]; rtx containing_fp = operands[3]; - /* generate a call to "__xtensa_nonlocal_goto" (in libgcc); the code - is too big to generate in-line */ + /* Generate a call to "__xtensa_nonlocal_goto" (in libgcc); the code + is too big to generate in-line. */ if (GET_CODE (containing_fp) != REG) containing_fp = force_reg (Pmode, containing_fp); @@ -1581,10 +1585,10 @@ xtensa_setup_frame_addresses (void) a comment showing where the end of the loop is. However, if there is a label or a branch at the end of the loop then we need to place a nop there. If the loop ends with a label we need the nop so that branches - targetting that label will target the nop (and thus remain in the loop), - instead of targetting the instruction after the loop (and thus exiting + targeting that label will target the nop (and thus remain in the loop), + instead of targeting the instruction after the loop (and thus exiting the loop). If the loop ends with a branch, we need the nop in case the - branch is targetting a location inside the loop. When the branch + branch is targeting a location inside the loop. When the branch executes it will cause the loop count to be decremented even if it is taken (because it is the last instruction in the loop), so we need to nop after the branch to prevent the loop count from being decremented @@ -1785,7 +1789,7 @@ override_options (void) if (!TARGET_BOOLEANS && TARGET_HARD_FLOAT) error ("boolean registers required for the floating-point option"); - /* set up the tables of ld/st opcode names for block moves */ + /* Set up the tables of ld/st opcode names for block moves. */ xtensa_ld_opcodes[(int) SImode] = "l32i"; xtensa_ld_opcodes[(int) HImode] = "l16ui"; xtensa_ld_opcodes[(int) QImode] = "l8ui"; @@ -2318,8 +2322,8 @@ xtensa_return_addr (int count, rtx frame) references argument word N for 0 <= N < 6, and __va_stk[N*4] references argument word N for N >= 6. */ -tree -xtensa_build_va_list (void) +static tree +xtensa_build_builtin_va_list (void) { tree f_stk, f_reg, f_ndx, record, type_decl; @@ -2362,7 +2366,7 @@ xtensa_builtin_saveregs (void) if (gp_left == 0) return const0_rtx; - /* allocate the general-purpose register space */ + /* Allocate the general-purpose register space. */ gp_regs = assign_stack_local (BLKmode, MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD, -1); set_mem_alias_set (gp_regs, get_varargs_alias_set ()); @@ -2658,8 +2662,8 @@ order_regs_for_local_alloc (void) int i, num_arg_regs; int nxt = 0; - /* use the AR registers in increasing order (skipping a0 and a1) - but save the incoming argument registers for a last resort */ + /* Use the AR registers in increasing order (skipping a0 and a1) + but save the incoming argument registers for a last resort. */ num_arg_regs = current_function_args_info.arg_words; if (num_arg_regs > MAX_ARGS_IN_REGISTERS) num_arg_regs = MAX_ARGS_IN_REGISTERS; @@ -2668,11 +2672,11 @@ order_regs_for_local_alloc (void) for (i = 0; i < num_arg_regs; i++) reg_alloc_order[nxt++] = GP_ARG_FIRST + i; - /* list the coprocessor registers in order */ + /* List the coprocessor registers in order. */ for (i = 0; i < BR_REG_NUM; i++) reg_alloc_order[nxt++] = BR_REG_FIRST + i; - /* list the FP registers in order for now */ + /* List the FP registers in order for now. */ for (i = 0; i < 16; i++) reg_alloc_order[nxt++] = FP_REG_FIRST + i; @@ -2817,7 +2821,7 @@ xtensa_rtx_costs (rtx x, int code, int outer_code, int *total) case LSHIFTRT: case ROTATE: case ROTATERT: - /* no way to tell if X is the 2nd operand so be conservative */ + /* No way to tell if X is the 2nd operand so be conservative. */ default: break; } if (xtensa_simm12b (INTVAL (x))) @@ -2944,7 +2948,7 @@ xtensa_rtx_costs (rtx x, int code, int outer_code, int *total) return true; } } - /* fall through */ + /* Fall through. */ case UDIV: case UMOD: diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 621dd5fbbb6..a7f470ec0b5 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -142,10 +142,10 @@ extern unsigned xtensa_current_frame_size; in instructions that operate on numbered bit-fields. */ #define BITS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0) -/* Define this if most significant byte of a word is the lowest numbered. */ +/* Define this if most significant byte of a word is the lowest numbered. */ #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0) -/* Define this if most significant word of a multiword number is the lowest. */ +/* Define this if most significant word of a multiword number is the lowest. */ #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0) #define MAX_BITS_PER_WORD 32 @@ -271,11 +271,11 @@ extern unsigned xtensa_current_frame_size; #define FIRST_PSEUDO_REGISTER 36 -/* Return the stabs register number to use for REGNO. */ +/* Return the stabs register number to use for REGNO. */ #define DBX_REGISTER_NUMBER(REGNO) xtensa_dbx_register_number (REGNO) /* 1 for registers that have pervasive standard uses - and are not available for the register allocator. */ + and are not available for the register allocator. */ #define FIXED_REGISTERS \ { \ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -326,18 +326,18 @@ extern unsigned xtensa_current_frame_size; giving preference to call-used registers. To minimize window overflows for the AR registers, we want to give preference to the lower-numbered AR registers. For other register files, which are - not windowed, we still prefer call-used registers, if there are any. */ + not windowed, we still prefer call-used registers, if there are any. */ extern const char xtensa_leaf_regs[FIRST_PSEUDO_REGISTER]; #define LEAF_REGISTERS xtensa_leaf_regs /* For Xtensa, no remapping is necessary, but this macro must be - defined if LEAF_REGISTERS is defined. */ + defined if LEAF_REGISTERS is defined. */ #define LEAF_REG_REMAP(REGNO) (REGNO) -/* this must be declared if LEAF_REGISTERS is set */ +/* This must be declared if LEAF_REGISTERS is set. */ extern int leaf_function; -/* Internal macros to classify a register number. */ +/* Internal macros to classify a register number. */ /* 16 address registers + fake registers */ #define GP_REG_FIRST 0 @@ -372,7 +372,7 @@ extern int leaf_function; ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) /* Value is 1 if hard register REGNO can hold a value of machine-mode - MODE. */ + MODE. */ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER]; #define HARD_REGNO_MODE_OK(REGNO, MODE) \ @@ -397,7 +397,7 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER]; /* The register number of the frame pointer register, which is used to access automatic variables in the stack frame. For Xtensa, this register never appears in the output. It is always eliminated to - either the stack pointer or the hard frame pointer. */ + either the stack pointer or the hard frame pointer. */ #define FRAME_POINTER_REGNUM (GP_REG_FIRST + 16) /* Value should be nonzero if functions must have frame pointers. @@ -518,7 +518,7 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER]; /* SMALL_REGISTER_CLASSES is required for Xtensa, because all of the 16 AR registers may be explicitly used in the RTL, as either - incoming or outgoing arguments. */ + incoming or outgoing arguments. */ #define SMALL_REGISTER_CLASSES 1 @@ -599,7 +599,7 @@ extern enum reg_class xtensa_char_to_class[256]; the meantime, the constraints are checked and none match. The solution seems to be to simply skip the offset check here. The address will be checked anyway because of the code in - GO_IF_LEGITIMATE_ADDRESS. */ + GO_IF_LEGITIMATE_ADDRESS. */ #define EXTRA_CONSTRAINT(OP, CODE) \ ((GET_CODE (OP) != MEM) ? \ @@ -714,7 +714,7 @@ extern enum reg_class xtensa_char_to_class[256]; /* Define how to find the value returned by a library function assuming the value has mode MODE. Because we have defined PROMOTE_FUNCTION_RETURN, we have to perform the same promotions as - PROMOTE_MODE. */ + PROMOTE_MODE. */ #define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \ gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ @@ -750,7 +750,7 @@ extern enum reg_class xtensa_char_to_class[256]; be recognized by this macro. If the machine has register windows, so that the caller and the called function use different registers for the return value, this macro should recognize only the caller's - register numbers. */ + register numbers. */ #define FUNCTION_VALUE_REGNO_P(N) \ ((N) == GP_RETURN) @@ -759,7 +759,7 @@ extern enum reg_class xtensa_char_to_class[256]; does *not* include implicit arguments such as the static chain and the structure-value address. On many machines, no registers can be used for this purpose since all function arguments are pushed on - the stack. */ + the stack. */ #define FUNCTION_ARG_REGNO_P(N) \ ((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST) @@ -767,14 +767,14 @@ extern enum reg_class xtensa_char_to_class[256]; during the scan of that argument list. This data type should hold all necessary information about the function itself and about the args processed so far, enough to enable macros - such as FUNCTION_ARG to determine where the next arg should go. */ + such as FUNCTION_ARG to determine where the next arg should go. */ typedef struct xtensa_args { int arg_words; /* # total words the arguments take */ } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. - For a library call, FNTYPE is 0. */ + For a library call, FNTYPE is 0. */ #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ init_cumulative_args (&CUM, FNTYPE, LIBNAME) @@ -816,7 +816,7 @@ typedef struct xtensa_args { This differs from the default in that it does not check if the padding and mode of the type are such that a copy into a register would put it - into the wrong part of the register. */ + into the wrong part of the register. */ #define MUST_PASS_IN_STACK(MODE, TYPE) \ ((TYPE) != 0 \ @@ -835,7 +835,7 @@ typedef struct xtensa_args { values contain window size information in the two most significant bits; we assume that _mcount will mask off those bits. The call to _mcount uses a window size of 8 to make sure that it doesn't clobber - any incoming argument values. */ + any incoming argument values. */ #define NO_PROFILE_COUNTERS 1 @@ -865,7 +865,7 @@ typedef struct xtensa_args { from the entry instruction at the target and the current frame is adjusted to match. The trampoline then transfers control to the instruction following the entry at the target. Note: this assumes - that the target begins with an entry instruction. */ + that the target begins with an entry instruction. */ /* minimum frame = reg save area (4 words) plus static chain (1 word) and the total number of words must be a multiple of 128 bits */ @@ -930,15 +930,11 @@ typedef struct xtensa_args { 0, VOIDmode, 1, addr, Pmode); \ } while (0) -/* Define the `__builtin_va_list' type for the ABI. */ -#define BUILD_VA_LIST_TYPE(VALIST) \ - (VALIST) = xtensa_build_va_list () - /* If defined, is a C expression that produces the machine-specific code for a call to '__builtin_saveregs'. This code will be moved to the very beginning of the function, before any parameter access are made. The return value of this function should be an RTX that - contains the value to use as the return of '__builtin_saveregs'. */ + contains the value to use as the return of '__builtin_saveregs'. */ #define EXPAND_BUILTIN_SAVEREGS \ xtensa_builtin_saveregs @@ -966,7 +962,7 @@ typedef struct xtensa_args { specify whether to start from the stack pointer or frame pointer. That would also allow us to skip the machine->accesses_prev_frame stuff that we currently need to ensure that there is a frame pointer when these - builtin functions are used. */ + builtin functions are used. */ #define SETUP_FRAME_ADDRESSES xtensa_setup_frame_addresses @@ -980,14 +976,14 @@ typedef struct xtensa_args { macro is used for continuing to walk back up the stack, so it must return the stack pointer address. Thus, there is some inconsistency here in that __builtin_frame_address will return the frame pointer - when count == 0 and the stack pointer when count > 0. */ + when count == 0 and the stack pointer when count > 0. */ #define DYNAMIC_CHAIN_ADDRESS(frame) \ gen_rtx (PLUS, Pmode, frame, \ gen_rtx_CONST_INT (VOIDmode, -3 * UNITS_PER_WORD)) /* Define this if the return address of a particular stack frame is - accessed from the frame pointer of the previous stack frame. */ + accessed from the frame pointer of the previous stack frame. */ #define RETURN_ADDR_IN_PREVIOUS_FRAME /* A C expression whose value is RTL representing the value of the @@ -1002,7 +998,7 @@ typedef struct xtensa_args { be either a suitable hard register or a pseudo register that has been allocated such a hard register. The difference between an index register and a base register is that the index register may - be scaled. */ + be scaled. */ #define REGNO_OK_FOR_BASE_P(NUM) \ (GP_REG_P (NUM) || GP_REG_P ((unsigned) reg_renumber[NUM])) @@ -1016,7 +1012,7 @@ typedef struct xtensa_args { must be controlled by `REG_OK_STRICT'. This usually requires two variant definitions, of which `REG_OK_STRICT' controls the one actually used. The difference between an index register and a base - register is that the index register may be scaled. */ + register is that the index register may be scaled. */ #ifdef REG_OK_STRICT @@ -1095,7 +1091,7 @@ typedef struct xtensa_args { || (GET_CODE (X) == CONST))) /* Nonzero if the constant value X is a legitimate general operand. - It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ + It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ #define LEGITIMATE_CONSTANT_P(X) 1 /* A C expression that is nonzero if X is a legitimate immediate @@ -1183,7 +1179,7 @@ typedef struct xtensa_args { #define SHIFT_COUNT_TRUNCATED 1 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits - is done just by pretending it is already truncated. */ + is done just by pretending it is already truncated. */ #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 /* Specify the machine mode that pointers have. @@ -1249,7 +1245,7 @@ typedef struct xtensa_args { /* Control the assembler format that we output. */ /* How to refer to registers in assembler output. - This sequence is indexed by compiler's hard-register-number (see above). */ + This sequence is indexed by compiler's hard-register-number (see above). */ #define REGISTER_NAMES \ { \ "a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7", \ @@ -1263,7 +1259,7 @@ typedef struct xtensa_args { /* If defined, a C initializer for an array of structures containing a name and a register number. This macro defines additional names for hard registers, thus allowing the 'asm' option in declarations - to refer to registers using alternate names. */ + to refer to registers using alternate names. */ #define ADDITIONAL_REGISTER_NAMES \ { \ { "a1", 1 + GP_REG_FIRST } \ @@ -1306,7 +1302,7 @@ typedef struct xtensa_args { LOCAL_LABEL_PREFIX, VALUE) /* This is how to output an element of a case-vector that is relative. - This is used for pc-relative code. */ + This is used for pc-relative code. */ #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ do { \ fprintf (STREAM, "%s%sL%u-%sL%u\n", integer_asm_op (4, TRUE), \ @@ -1336,7 +1332,7 @@ typedef struct xtensa_args { /* Define output to appear before the constant pool. If the function has been assigned to a specific ELF section, or if it goes into a unique section, set the name of that section to be the literal - prefix. */ + prefix. */ #define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \ do { \ tree fnsection; \ @@ -1371,7 +1367,7 @@ typedef struct xtensa_args { goto JUMPTO; \ } while (0) -/* How to start an assembler comment. */ +/* How to start an assembler comment. */ #define ASM_COMMENT_START "#" /* Exception handling TODO!! */ diff --git a/gcc/configure b/gcc/configure index e539c125d94..09b733dc1da 100755 --- a/gcc/configure +++ b/gcc/configure @@ -45,6 +45,8 @@ ac_help="$ac_help unused parts of the compiler. With LEVEL, specify optimization. Values are opt, noopt, default is noopt" +ac_help="$ac_help + --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering" ac_help="$ac_help --with-stabs arrange to use stabs instead of host debug format" ac_help="$ac_help @@ -657,7 +659,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:661: checking host system type" >&5 +echo "configure:663: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -678,7 +680,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:682: checking target system type" >&5 +echo "configure:684: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -696,7 +698,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:700: checking build system type" >&5 +echo "configure:702: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -775,7 +777,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6 -echo "configure:779: checking LIBRARY_PATH variable" >&5 +echo "configure:781: checking LIBRARY_PATH variable" >&5 case ${LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) library_path_setting="contains current directory" @@ -800,7 +802,7 @@ fi # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6 -echo "configure:804: checking GCC_EXEC_PREFIX variable" >&5 +echo "configure:806: checking GCC_EXEC_PREFIX variable" >&5 case ${GCC_EXEC_PREFIX} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) gcc_exec_prefix_setting="contains current directory" @@ -927,7 +929,7 @@ EOF fi echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6 -echo "configure:931: checking whether a default linker was specified" >&5 +echo "configure:933: checking whether a default linker was specified" >&5 if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6 @@ -971,7 +973,7 @@ EOF fi echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6 -echo "configure:975: checking whether a default assembler was specified" >&5 +echo "configure:977: checking whether a default assembler was specified" >&5 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6 @@ -990,7 +992,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:994: checking for $ac_word" >&5 +echo "configure:996: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1020,7 +1022,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1024: checking for $ac_word" >&5 +echo "configure:1026: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1071,7 +1073,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1075: checking for $ac_word" >&5 +echo "configure:1077: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1103,7 +1105,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1107: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1109: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1114,12 +1116,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1118 "configure" +#line 1120 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1145,12 +1147,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1151: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1154: checking whether we are using GNU C" >&5 +echo "configure:1156: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1159,7 +1161,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1178,7 +1180,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1182: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1184: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1211,10 +1213,10 @@ fi if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1215: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1217: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1218: checking whether cc understands -c and -o together" >&5 +echo "configure:1220: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1226,16 +1228,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1275,21 +1277,21 @@ fi # ------------------------- echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6 -echo "configure:1279: checking whether ${CC-cc} accepts -Wno-long-long" >&5 +echo "configure:1281: checking whether ${CC-cc} accepts -Wno-long-long" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_no_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="-Wno-long-long" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_prog_cc_no_long_long=yes else @@ -1305,7 +1307,7 @@ fi echo "$ac_t""$ac_cv_prog_cc_no_long_long" 1>&6 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1309: checking how to run the C preprocessor" >&5 +echo "configure:1311: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1320,13 +1322,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1337,13 +1339,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1354,13 +1356,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1385,21 +1387,21 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1389: checking for inline" >&5 +echo "configure:1391: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1426,19 +1428,19 @@ esac echo $ac_n "checking for long long int""... $ac_c" 1>&6 -echo "configure:1430: checking for long long int" >&5 +echo "configure:1432: checking for long long int" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_long=yes else @@ -1458,19 +1460,19 @@ EOF fi echo $ac_n "checking for __int64""... $ac_c" 1>&6 -echo "configure:1462: checking for __int64" >&5 +echo "configure:1464: checking for __int64" >&5 if eval "test \"`echo '$''{'ac_cv_c___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c___int64=yes else @@ -1491,19 +1493,19 @@ EOF fi echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6 -echo "configure:1495: checking for built-in _Bool" >&5 +echo "configure:1497: checking for built-in _Bool" >&5 if eval "test \"`echo '$''{'gcc_cv_c__bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_c__bool=yes else @@ -1527,13 +1529,13 @@ fi # sizeof(char) is 1 by definition. echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:1531: checking size of void *" >&5 +echo "configure:1533: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1543,7 +1545,7 @@ int main() { switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else @@ -1566,13 +1568,13 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1570: checking size of short" >&5 +echo "configure:1572: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1582,7 +1584,7 @@ int main() { switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else @@ -1605,13 +1607,13 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1609: checking size of int" >&5 +echo "configure:1611: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1621,7 +1623,7 @@ int main() { switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else @@ -1644,13 +1646,13 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1648: checking size of long" >&5 +echo "configure:1650: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1660,7 +1662,7 @@ int main() { switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else @@ -1684,13 +1686,13 @@ EOF if test $ac_cv_c_long_long = yes; then echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1688: checking size of long long" >&5 +echo "configure:1690: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1700,7 +1702,7 @@ int main() { switch (0) case 0: case (sizeof (long long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_long=$ac_size else @@ -1725,13 +1727,13 @@ EOF fi if test $ac_cv_c___int64 = yes; then echo $ac_n "checking size of __int64""... $ac_c" 1>&6 -echo "configure:1729: checking size of __int64" >&5 +echo "configure:1731: checking size of __int64" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -1741,7 +1743,7 @@ int main() { switch (0) case 0: case (sizeof (__int64) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof___int64=$ac_size else @@ -1777,10 +1779,11 @@ else fi + # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1784: checking for $ac_word" >&5 +echo "configure:1787: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1812,7 +1815,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1816: checking for $ac_word" >&5 +echo "configure:1819: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1844,77 +1847,43 @@ else fi fi -echo $ac_n "checking for compiler driver that understands Ada""... $ac_c" 1>&6 -echo "configure:1849: checking for compiler driver that understands Ada" >&5 -if eval "test \"`echo '$''{'gcc_cv_prog_adac'+set}'`\" = set"; then +echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 +echo "configure:1852: checking whether compiler driver understands Ada" >&5 +if eval "test \"`echo '$''{'gcc_cv_cc_supports_ada'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.adb <&1 || echo failure` - if test x"$errors" = x; then - gcc_cv_prog_adac=$cand - break - fi -done +gcc_cv_cc_supports_ada=no +# There is a bug in old released versions of GCC which causes the +# driver to exit successfully when the appropriate language module +# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1. +# Therefore we must check for the error message as well as an +# unsuccessful exit. +errors=`(${CC} -c conftest.adb) 2>&1 || echo failure` +if test x"$errors" = x; then + gcc_cv_cc_supports_ada=yes + break +fi rm -f conftest.* fi -echo "$ac_t""$gcc_cv_prog_adac" 1>&6 -ADAC=$gcc_cv_prog_adac - +echo "$ac_t""$gcc_cv_cc_supports_ada" 1>&6 -if test x$GNATBIND != xno && test x$ADAC != xno; then +if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then have_gnat=yes else have_gnat=no fi -if test x$have_gnat != xno ; then -echo $ac_n "checking whether ${ADAC} accepts -Wno-long-long""... $ac_c" 1>&6 -echo "configure:1892: checking whether ${ADAC} accepts -Wno-long-long" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_adac_no_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat >conftest.adb <&5 2>&5 ; then - ac_cv_prog_adac_no_long_long=yes -else - ac_cv_prog_adac_no_long_long=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_prog_adac_no_long_long" 1>&6 -else - ac_cv_prog_adac_no_long_long=yes -fi - # --------------------- # Warnings and checking # --------------------- strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes && \ - test $ac_cv_prog_adac_no_long_long = yes ; then +if test $ac_cv_prog_cc_no_long_long = yes ; then strict1_warn="-pedantic -Wno-long-long" fi @@ -2030,68 +1999,95 @@ EOF fi valgrind_path_defines= valgrind_command= + +ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6 +echo "configure:2006: checking for valgrind.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_valgrind_h=yes +else + echo "$ac_t""no" 1>&6 +have_valgrind_h=no +fi + + if test x$ac_checking_valgrind != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. - echo $ac_n "checking for VALGRIND_DISCARD in ""... $ac_c" 1>&6 -echo "configure:2038: checking for VALGRIND_DISCARD in " >&5 + echo $ac_n "checking for VALGRIND_DISCARD in ""... $ac_c" 1>&6 +echo "configure:2043: checking for VALGRIND_DISCARD in " >&5 cat > conftest.$ac_ext < +#include #ifndef VALGRIND_DISCARD #error VALGRIND_DISCARD not defined #endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* - gcc_cv_header_memcheck_h=yes + gcc_cv_header_valgrind_memcheck_h=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - gcc_cv_header_memcheck_h=no + gcc_cv_header_valgrind_memcheck_h=no fi rm -f conftest* - echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6 - ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6 -echo "configure:2064: checking for valgrind.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else + echo "$ac_t""$gcc_cv_header_valgrind_memcheck_h" 1>&6 + echo $ac_n "checking for VALGRIND_DISCARD in ""... $ac_c" 1>&6 +echo "configure:2068: checking for VALGRIND_DISCARD in " >&5 cat > conftest.$ac_ext < +#include +#ifndef VALGRIND_DISCARD +#error VALGRIND_DISCARD not defined +#endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + gcc_cv_header_memcheck_h=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + gcc_cv_header_memcheck_h=no fi rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_valgrind_h=yes -else - echo "$ac_t""no" 1>&6 -have_valgrind_h=no -fi - + echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6 # Prepare PATH_SEPARATOR. # The user is always right. @@ -2124,7 +2120,7 @@ rm -f conf$$.file # Extract the first word of "valgrind", so it can be a program name with args. set dummy valgrind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2128: checking for $ac_word" >&5 +echo "configure:2124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_valgrind_path'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2157,8 +2153,11 @@ else echo "$ac_t""no" 1>&6 fi - if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then - { echo "configure: error: *** Can't find both valgrind and valgrind.h/memcheck.h" 1>&2; exit 1; } + if test "x$valgrind_path" = "x" \ + || (test $have_valgrind_h = no \ + && test $gcc_cv_header_memcheck_h = no \ + && test $gcc_cv_header_valgrind_memcheck_h = no); then + { echo "configure: error: *** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h" 1>&2; exit 1; } fi valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"' valgrind_command="$valgrind_path -q" @@ -2166,6 +2165,12 @@ fi #define ENABLE_VALGRIND_CHECKING 1 EOF + if test $gcc_cv_header_valgrind_memcheck_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_VALGRIND_MEMCHECK_H 1 +EOF + + fi if test $gcc_cv_header_memcheck_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_MEMCHECK_H 1 @@ -2197,6 +2202,21 @@ fi +# Check whether --enable-gather-detailed-mem-stats or --disable-gather-detailed-mem-stats was given. +if test "${enable_gather_detailed_mem_stats+set}" = set; then + enableval="$enable_gather_detailed_mem_stats" + : +else + enable_gather_detailed_mem_stats=no +fi + +if test x$enable_gather_detailed_mem_stats = xyes ; then + cat >> confdefs.h <<\EOF +#define GATHER_STATISTICS 1 +EOF + +fi + # ------------------------------- # Miscenalleous configure options # ------------------------------- @@ -2350,7 +2370,7 @@ fi # ------------------------- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:2354: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:2374: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2383,7 +2403,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2387: checking for $ac_word" >&5 +echo "configure:2407: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2412,8 +2432,14 @@ fi test -n "$AWK" && break done +# We need awk to run opts.sh (to create options.c and options.h). +# Bail out if it's missing. +case ${AWK} in + "") { echo "configure: error: can't build without awk, bailing out" 1>&2; exit 1; } ;; +esac + echo $ac_n "checking whether ln works""... $ac_c" 1>&6 -echo "configure:2417: checking whether ln works" >&5 +echo "configure:2443: checking whether ln works" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2445,7 +2471,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:2449: checking whether ln -s works" >&5 +echo "configure:2475: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2479,7 +2505,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2483: checking for $ac_word" >&5 +echo "configure:2509: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2517,7 +2543,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2521: checking for a BSD compatible install" >&5 +echo "configure:2547: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2569,7 +2595,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # See if cmp has --ignore-initial. echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6 -echo "configure:2573: checking for cmp's capabilities" >&5 +echo "configure:2599: checking for cmp's capabilities" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2605,7 +2631,7 @@ make_compare_target=$gcc_cv_prog_cmp_skip # Extract the first word of "mktemp", so it can be a program name with args. set dummy mktemp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2609: checking for $ac_word" >&5 +echo "configure:2635: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2644,7 +2670,7 @@ else # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2648: checking for $ac_word" >&5 +echo "configure:2674: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2673,13 +2699,13 @@ fi if test -n "$MAKEINFO"; then # Found it, now check the version. echo $ac_n "checking for modern makeinfo""... $ac_c" 1>&6 -echo "configure:2677: checking for modern makeinfo" >&5 +echo "configure:2703: checking for modern makeinfo" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_makeinfo_modern'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:2683: version of makeinfo is $ac_prog_version" >&5 + echo "configure:2709: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[2-9]*) @@ -2707,7 +2733,7 @@ fi # Is pod2man recent enough to regenerate manpages? echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6 -echo "configure:2711: checking for recent Pod::Man" >&5 +echo "configure:2737: checking for recent Pod::Man" >&5 if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then echo "$ac_t""yes" 1>&6 GENERATED_MANPAGES=generated-manpages @@ -2723,7 +2749,7 @@ else # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2727: checking for $ac_word" >&5 +echo "configure:2753: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2760,7 +2786,7 @@ else # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2764: checking for $ac_word" >&5 +echo "configure:2790: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2794,12 +2820,12 @@ fi # -------------------- echo $ac_n "checking for GNU C library""... $ac_c" 1>&6 -echo "configure:2798: checking for GNU C library" >&5 +echo "configure:2824: checking for GNU C library" >&5 if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -2809,7 +2835,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_glibc=yes else @@ -2830,12 +2856,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2834: checking for ANSI C header files" >&5 +echo "configure:2860: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2843,7 +2869,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2860,7 +2886,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2878,7 +2904,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2899,7 +2925,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2910,7 +2936,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2934,12 +2960,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2938: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2964: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2948,7 +2974,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2969,19 +2995,19 @@ EOF fi echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6 -echo "configure:2973: checking for working stdbool.h" >&5 +echo "configure:2999: checking for working stdbool.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdbool_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { bool foo = false; ; return 0; } EOF -if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_stdbool_h=yes else @@ -3002,12 +3028,12 @@ EOF fi echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6 -echo "configure:3006: checking whether string.h and strings.h may both be included" >&5 +echo "configure:3032: checking whether string.h and strings.h may both be included" >&5 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3015,7 +3041,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_header_string=yes else @@ -3036,12 +3062,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3040: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3066: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3057,7 +3083,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3084,17 +3110,17 @@ for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3088: checking for $ac_hdr" >&5 +echo "configure:3114: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3124,17 +3150,17 @@ done # Check for thread headers. ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for thread.h""... $ac_c" 1>&6 -echo "configure:3128: checking for thread.h" >&5 +echo "configure:3154: checking for thread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3158,17 +3184,17 @@ fi ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pthread.h""... $ac_c" 1>&6 -echo "configure:3162: checking for pthread.h" >&5 +echo "configure:3188: checking for pthread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3193,12 +3219,12 @@ fi # These tests can't be done till we know if we have limits.h. echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6 -echo "configure:3197: checking for CHAR_BIT" >&5 +echo "configure:3223: checking for CHAR_BIT" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3223,7 +3249,7 @@ fi echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6 if test $gcc_cv_decl_char_bit = no; then echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6 -echo "configure:3227: checking number of bits in a byte" >&5 +echo "configure:3253: checking number of bits in a byte" >&5 if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3231,7 +3257,7 @@ else gcc_cv_c_nbby= while test $i -lt 65; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_c_nbby=$i; break else @@ -3266,14 +3292,14 @@ EOF fi fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3270: checking whether byte ordering is bigendian" >&5 +echo "configure:3296: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3284,11 +3310,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3299,7 +3325,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3319,7 +3345,7 @@ if test "$cross_compiling" = yes; then echo $ac_n "cross-compiling... " 2>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -3350,7 +3376,7 @@ fi echo "$ac_t""$ac_cv_c_bigendian" 1>&6 if test $ac_cv_c_bigendian = unknown; then echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 -echo "configure:3354: checking to probe for byte ordering" >&5 +echo "configure:3380: checking to probe for byte ordering" >&5 cat >conftest.c <&6 -echo "configure:3434: checking for collect2 libraries" >&5 +echo "configure:3460: checking for collect2 libraries" >&5 if eval "test \"`echo '$''{'gcc_cv_collect2_libs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3441,7 +3467,7 @@ for libs in '' -lld -lmld \ do LIBS="$libs" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gcc_cv_collect2_libs="$libs"; break else @@ -3478,14 +3504,14 @@ save_LIBS="$LIBS" LIBS= echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6 -echo "configure:3482: checking for library containing exc_resume" >&5 +echo "configure:3508: checking for library containing exc_resume" >&5 if eval "test \"`echo '$''{'ac_cv_search_exc_resume'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_exc_resume="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_exc_resume="none required" else @@ -3507,7 +3533,7 @@ rm -f conftest* test "$ac_cv_search_exc_resume" = "no" && for i in exc; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_exc_resume="-l$i" break @@ -3548,14 +3574,14 @@ save_LIBS="$LIBS" LIBS= echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6 -echo "configure:3552: checking for library containing ldexp" >&5 +echo "configure:3578: checking for library containing ldexp" >&5 if eval "test \"`echo '$''{'ac_cv_search_ldexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_ldexp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_ldexp="none required" else @@ -3577,7 +3603,7 @@ rm -f conftest* test "$ac_cv_search_ldexp" = "no" && for i in m; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_ldexp="-l$i" break @@ -3615,12 +3641,12 @@ LIBS="$save_LIBS" # Use only if it exists, # doesn't clash with , and declares intmax_t. echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6 -echo "configure:3619: checking for inttypes.h" >&5 +echo "configure:3645: checking for inttypes.h" >&5 if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3628,7 +3654,7 @@ int main() { intmax_t i = -1; ; return 0; } EOF -if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_header_inttypes_h=yes else @@ -3656,12 +3682,12 @@ for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \ setlocale do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3660: checking for $ac_func" >&5 +echo "configure:3686: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3711,7 +3737,7 @@ done if test x$ac_cv_func_mbstowcs = xyes; then echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6 -echo "configure:3715: checking whether mbstowcs works" >&5 +echo "configure:3741: checking whether mbstowcs works" >&5 if eval "test \"`echo '$''{'gcc_cv_func_mbstowcs_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3719,7 +3745,7 @@ else gcc_cv_func_mbstowcs_works=yes else cat > conftest.$ac_ext < int main() @@ -3728,7 +3754,7 @@ int main() return 0; } EOF -if { (eval echo configure:3732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_cv_func_mbstowcs_works=yes else @@ -3752,12 +3778,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:3756: checking for ssize_t" >&5 +echo "configure:3782: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3788,12 +3814,12 @@ fi # Try to determine the array type of the second argument of getgroups # for the target system (int or gid_t). echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3792: checking for uid_t in sys/types.h" >&5 +echo "configure:3818: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3822,7 +3848,7 @@ EOF fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:3826: checking type of array argument to getgroups" >&5 +echo "configure:3852: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3830,7 +3856,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -3869,7 +3895,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -3910,7 +3936,7 @@ fi echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6 -echo "configure:3914: checking whether the printf functions support %p" >&5 +echo "configure:3940: checking whether the printf functions support %p" >&5 if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3918,7 +3944,7 @@ else gcc_cv_func_printf_ptr=no else cat > conftest.$ac_ext < @@ -3931,7 +3957,7 @@ int main() return (p != q); } EOF -if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_cv_func_printf_ptr=yes else @@ -3961,7 +3987,7 @@ if test $ac_cv_header_sys_mman_h != yes \ gcc_cv_func_mmap_anon=no else echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6 -echo "configure:3965: checking whether read-only mmap of a plain file works" >&5 +echo "configure:3991: checking whether read-only mmap of a plain file works" >&5 if eval "test \"`echo '$''{'gcc_cv_func_mmap_file'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3971,7 +3997,7 @@ else # read() to the same fd. The only system known to have a problem here # is VMS, where text files have record structure. case "$host_os" in - vms*) + vms* | ultrix*) gcc_cv_func_mmap_file=no ;; *) gcc_cv_func_mmap_file=yes;; @@ -3980,7 +4006,7 @@ fi echo "$ac_t""$gcc_cv_func_mmap_file" 1>&6 echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6 -echo "configure:3984: checking whether mmap from /dev/zero works" >&5 +echo "configure:4010: checking whether mmap from /dev/zero works" >&5 if eval "test \"`echo '$''{'gcc_cv_func_mmap_dev_zero'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4006,12 +4032,12 @@ echo "$ac_t""$gcc_cv_func_mmap_dev_zero" 1>&6 # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6 -echo "configure:4010: checking for MAP_ANON(YMOUS)" >&5 +echo "configure:4036: checking for MAP_ANON(YMOUS)" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_map_anon'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4025,7 +4051,7 @@ int main() { int n = MAP_ANONYMOUS; ; return 0; } EOF -if { (eval echo configure:4029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_map_anon=yes else @@ -4043,7 +4069,7 @@ echo "$ac_t""$gcc_cv_decl_map_anon" 1>&6 gcc_cv_func_mmap_anon=no else echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6 -echo "configure:4047: checking whether mmap with MAP_ANON(YMOUS) works" >&5 +echo "configure:4073: checking whether mmap with MAP_ANON(YMOUS) works" >&5 if eval "test \"`echo '$''{'gcc_cv_func_mmap_anon'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4093,12 +4119,12 @@ case "${host}" in ;; esac echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:4097: checking for pid_t" >&5 +echo "configure:4123: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4127,17 +4153,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:4131: checking for vfork.h" >&5 +echo "configure:4157: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4162,18 +4188,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:4166: checking for working vfork" >&5 +echo "configure:4192: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:4172: checking for vfork" >&5 +echo "configure:4198: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -4218,7 +4244,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -4313,7 +4339,7 @@ main() { } } EOF -if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -4351,8 +4377,49 @@ if test "${with_libiconv_prefix+set}" = set; then fi + for ac_hdr in iconv.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4385: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:4356: checking for iconv" >&5 +echo "configure:4423: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4360,7 +4427,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include @@ -4370,7 +4437,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -4382,7 +4449,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" cat > conftest.$ac_ext < #include @@ -4392,7 +4459,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -4413,13 +4480,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:4417: checking for iconv declaration" >&5 +echo "configure:4484: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4438,7 +4505,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -4471,19 +4538,19 @@ LIBICONV_DEP= echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4475: checking for LC_MESSAGES" >&5 +echo "configure:4542: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4514,12 +4581,12 @@ for ac_func in getenv atol sbrk abort atof getcwd getwd \ do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:4518: checking whether $ac_func is declared" >&5 +echo "configure:4585: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -4638,12 +4705,12 @@ for ac_func in getrlimit setrlimit getrusage do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:4642: checking whether $ac_func is declared" >&5 +echo "configure:4709: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -4700,7 +4767,7 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -4730,12 +4797,12 @@ for ac_func in ldgetname do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:4734: checking whether $ac_func is declared" >&5 +echo "configure:4801: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -4789,12 +4856,12 @@ for ac_func in times do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:4793: checking whether $ac_func is declared" >&5 +echo "configure:4860: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -4846,13 +4913,13 @@ fi # More time-related stuff. echo $ac_n "checking for struct tms""... $ac_c" 1>&6 -echo "configure:4850: checking for struct tms" >&5 +echo "configure:4917: checking for struct tms" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tms=yes else @@ -4888,13 +4955,13 @@ fi # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE. # revisit after autoconf 2.50. echo $ac_n "checking for clock_t""... $ac_c" 1>&6 -echo "configure:4892: checking for clock_t" >&5 +echo "configure:4959: checking for clock_t" >&5 if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_type_clock_t=yes else @@ -4925,12 +4992,12 @@ EOF fi echo $ac_n "checking for uchar""... $ac_c" 1>&6 -echo "configure:4929: checking for uchar" >&5 +echo "configure:4996: checking for uchar" >&5 if eval "test \"`echo '$''{'gcc_cv_type_uchar'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_uchar=yes else @@ -4971,7 +5038,7 @@ if test "${enable_initfini_array+set}" = set; then else echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6 -echo "configure:4975: checking for .preinit_array/.init_array/.fini_array support" >&5 +echo "configure:5042: checking for .preinit_array/.init_array/.fini_array support" >&5 if eval "test \"`echo '$''{'gcc_cv_initfini_array'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4979,7 +5046,7 @@ else gcc_cv_initfini_array=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_cv_initfini_array=yes else @@ -5015,12 +5082,12 @@ fi # mkdir takes a single argument on some systems. echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6 -echo "configure:5019: checking if mkdir takes one argument" >&5 +echo "configure:5086: checking if mkdir takes one argument" >&5 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5037,7 +5104,7 @@ int main() { mkdir ("foo", 0); ; return 0; } EOF -if { (eval echo configure:5041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_mkdir_takes_one_arg=no else @@ -5078,7 +5145,7 @@ fi if test x$host = x$target; then echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6 -echo "configure:5082: checking for main in -lunwind" >&5 +echo "configure:5149: checking for main in -lunwind" >&5 ac_lib_var=`echo unwind'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5086,14 +5153,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lunwind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5407,7 +5474,7 @@ if test -f ../intl/config.intl; then . ../intl/config.intl fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:5411: checking whether NLS is requested" >&5 +echo "configure:5478: checking whether NLS is requested" >&5 if test x"$USE_NLS" != xyes; then echo "$ac_t""no" 1>&6 else @@ -5418,7 +5485,7 @@ EOF echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5422: checking for catalogs to be installed" >&5 +echo "configure:5489: checking for catalogs to be installed" >&5 # Look for .po and .gmo files in the source directory. CATALOGS= XLINGUAS= @@ -5468,7 +5535,7 @@ fi case $host_os in win32 | pe | cygwin* | mingw32* | uwin*) echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6 -echo "configure:5472: checking whether windows registry support is requested" >&5 +echo "configure:5539: checking whether windows registry support is requested" >&5 if test "x$enable_win32_registry" != xno; then cat >> confdefs.h <<\EOF #define ENABLE_WIN32_REGISTRY 1 @@ -5477,14 +5544,14 @@ EOF echo "$ac_t""yes" 1>&6 echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6 -echo "configure:5481: checking for library containing RegOpenKeyExA" >&5 +echo "configure:5548: checking for library containing RegOpenKeyExA" >&5 if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_RegOpenKeyExA="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_RegOpenKeyExA="none required" else @@ -5506,7 +5573,7 @@ rm -f conftest* test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_RegOpenKeyExA="-l$i" break @@ -5559,7 +5626,7 @@ esac if test "x$enable_win32_registry" != xno; then echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6 -echo "configure:5563: checking registry key on windows hosts" >&5 +echo "configure:5630: checking registry key on windows hosts" >&5 cat >> confdefs.h <target assembler and hope that it will have the same features # as the host->target assembler we'll be using. echo $ac_n "checking what assembler to use""... $ac_c" 1>&6 -echo "configure:5827: checking what assembler to use" >&5 +echo "configure:5894: checking what assembler to use" >&5 in_tree_gas=no gcc_cv_as= gcc_cv_gas_major_version= @@ -5947,7 +6014,7 @@ esac # build->target linker and hope that it will have the same features # as the host->target linker we'll be using. echo $ac_n "checking what linker to use""... $ac_c" 1>&6 -echo "configure:5951: checking what linker to use" >&5 +echo "configure:6018: checking what linker to use" >&5 in_tree_ld=no gcc_cv_ld= gcc_cv_gld_major_version= @@ -6055,7 +6122,7 @@ esac # Figure out what nm we will be using. gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils echo $ac_n "checking what nm to use""... $ac_c" 1>&6 -echo "configure:6059: checking what nm to use" >&5 +echo "configure:6126: checking what nm to use" >&5 in_tree_nm=no if test -x nm$host_exeext; then gcc_cv_nm=./nm$host_exeext @@ -6078,7 +6145,7 @@ esac # Figure out what objdump we will be using. echo $ac_n "checking what objdump to use""... $ac_c" 1>&6 -echo "configure:6082: checking what objdump to use" >&5 +echo "configure:6149: checking what objdump to use" >&5 in_tree_objdump=no if test -x objdump$host_exeext; then gcc_cv_objdump=./objdump$host_exeext @@ -6103,7 +6170,7 @@ esac # Figure out what assembler alignment features are present. echo $ac_n "checking assembler for .balign and .p2align""... $ac_c" 1>&6 -echo "configure:6107: checking assembler for .balign and .p2align" >&5 +echo "configure:6174: checking assembler for .balign and .p2align" >&5 if eval "test \"`echo '$''{'gcc_cv_as_balign_and_p2align'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6115,7 +6182,7 @@ fi elif test x$gcc_cv_as != x; then echo '.balign 4 .p2align 2' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_balign_and_p2align=yes else @@ -6135,7 +6202,7 @@ EOF fi echo $ac_n "checking assembler for .p2align with maximum skip""... $ac_c" 1>&6 -echo "configure:6139: checking assembler for .p2align with maximum skip" >&5 +echo "configure:6206: checking assembler for .p2align with maximum skip" >&5 if eval "test \"`echo '$''{'gcc_cv_as_max_skip_p2align'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6146,7 +6213,7 @@ else fi elif test x$gcc_cv_as != x; then echo '.p2align 4,,7' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_max_skip_p2align=yes else @@ -6166,7 +6233,7 @@ EOF fi echo $ac_n "checking assembler for working .subsection -1""... $ac_c" 1>&6 -echo "configure:6170: checking assembler for working .subsection -1" >&5 +echo "configure:6237: checking assembler for working .subsection -1" >&5 if eval "test \"`echo '$''{'gcc_cv_as_subsection_m1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6181,7 +6248,7 @@ fi .subsection -1 conftest_label2: .word 0 .previous' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if test x$gcc_cv_nm != x; then $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1 @@ -6209,7 +6276,7 @@ EOF fi echo $ac_n "checking assembler for .weak""... $ac_c" 1>&6 -echo "configure:6213: checking assembler for .weak" >&5 +echo "configure:6280: checking assembler for .weak" >&5 if eval "test \"`echo '$''{'gcc_cv_as_weak'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6220,7 +6287,7 @@ else fi elif test x$gcc_cv_as != x; then echo ' .weak foobar' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_weak=yes else @@ -6247,7 +6314,7 @@ fi # to be safe. # The gcc_GAS_CHECK_FEATURE call just sets a cache variable. echo $ac_n "checking assembler for .hidden""... $ac_c" 1>&6 -echo "configure:6251: checking assembler for .hidden" >&5 +echo "configure:6318: checking assembler for .hidden" >&5 if eval "test \"`echo '$''{'gcc_cv_as_hidden'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6260,7 +6327,7 @@ fi elif test x$gcc_cv_as != x; then echo ' .hidden foobar foobar:' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_hidden=yes else @@ -6275,7 +6342,7 @@ echo "$ac_t""$gcc_cv_as_hidden" 1>&6 echo $ac_n "checking linker for .hidden support""... $ac_c" 1>&6 -echo "configure:6279: checking linker for .hidden support" >&5 +echo "configure:6346: checking linker for .hidden support" >&5 if eval "test \"`echo '$''{'gcc_cv_ld_hidden'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6319,8 +6386,14 @@ else fi fi else - # non-GNU linkers don't seem to support .hidden yet - gcc_cv_ld_hidden=no + case "${target}" in + hppa64*-*-hpux*) + gcc_cv_ld_hidden=yes + ;; + *) + gcc_cv_ld_hidden=no + ;; + esac fi fi fi @@ -6338,7 +6411,7 @@ fi # Check if we have .[us]leb128, and support symbol arithmetic with it. echo $ac_n "checking assembler for .sleb128 and .uleb128""... $ac_c" 1>&6 -echo "configure:6342: checking assembler for .sleb128 and .uleb128" >&5 +echo "configure:6415: checking assembler for .sleb128 and .uleb128" >&5 if eval "test \"`echo '$''{'gcc_cv_as_leb128'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6355,7 +6428,7 @@ L1: .uleb128 1280 .sleb128 -1010 L2:' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then # GAS versions before 2.11 do not support uleb128, # despite appearing to. @@ -6391,7 +6464,7 @@ fi # GAS versions up to and including 2.11.0 may mis-optimize # .eh_frame data. echo $ac_n "checking assembler for eh_frame optimization""... $ac_c" 1>&6 -echo "configure:6395: checking assembler for eh_frame optimization" >&5 +echo "configure:6468: checking assembler for eh_frame optimization" >&5 if eval "test \"`echo '$''{'gcc_cv_as_eh_frame'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6434,7 +6507,7 @@ __FRAME_BEGIN__: .byte 0x4 .4byte .L1-.LFB1 .LEFDE1:' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then cat > conftest.lit < /dev/null 2>&1; } then gcc_cv_as_eh_frame=yes - elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then gcc_cv_as_eh_frame=buggy else # Uh oh, what do we do now? @@ -6480,7 +6553,7 @@ EOF fi echo $ac_n "checking assembler for section merging support""... $ac_c" 1>&6 -echo "configure:6484: checking assembler for section merging support" >&5 +echo "configure:6557: checking assembler for section merging support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_shf_merge'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6492,7 +6565,7 @@ else fi elif test x$gcc_cv_as != x; then echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s - if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_shf_merge=yes else @@ -6730,7 +6803,7 @@ if test -z "$tls_first_major"; then : # If we don't have a check, assume no support. else echo $ac_n "checking assembler for thread-local storage support""... $ac_c" 1>&6 -echo "configure:6734: checking assembler for thread-local storage support" >&5 +echo "configure:6807: checking assembler for thread-local storage support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_tls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6741,7 +6814,7 @@ else fi elif test x$gcc_cv_as != x; then echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_tls=yes else @@ -6767,7 +6840,7 @@ case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6 -echo "configure:6771: checking assembler for explicit relocation support" >&5 +echo "configure:6844: checking assembler for explicit relocation support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_alpha_explicit_relocs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6790,7 +6863,7 @@ fi ldah $1, d($29) !gprelhigh lda $1, d($1) !gprellow lda $29, 0($29) !gpdisp!3' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_alpha_explicit_relocs=yes else @@ -6812,14 +6885,14 @@ fi sparc*-*-*) echo $ac_n "checking assembler for .register""... $ac_c" 1>&6 -echo "configure:6816: checking assembler for .register" >&5 +echo "configure:6889: checking assembler for .register" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_register_op'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else gcc_cv_as_sparc_register_op=no if test x$gcc_cv_as != x; then echo '.register %g2, #scratch' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_sparc_register_op=yes else @@ -6839,14 +6912,14 @@ EOF fi echo $ac_n "checking assembler for -relax option""... $ac_c" 1>&6 -echo "configure:6843: checking assembler for -relax option" >&5 +echo "configure:6916: checking assembler for -relax option" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_relax'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else gcc_cv_as_sparc_relax=no if test x$gcc_cv_as != x; then echo '.text' > conftest.s - if { ac_try='$gcc_cv_as -relax -o conftest.o conftest.s >&5'; { (eval echo configure:6850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -relax -o conftest.o conftest.s >&5'; { (eval echo configure:6923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_sparc_relax=yes else @@ -6866,7 +6939,7 @@ EOF fi echo $ac_n "checking assembler for unaligned pcrel relocs""... $ac_c" 1>&6 -echo "configure:6870: checking assembler for unaligned pcrel relocs" >&5 +echo "configure:6943: checking assembler for unaligned pcrel relocs" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6879,7 +6952,7 @@ foo: .align 4 .byte 0 .uaword %r_disp32(foo)' > conftest.s - if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if test x$gcc_cv_ld != x \ && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then @@ -6902,7 +6975,7 @@ EOF echo $ac_n "checking assembler for unaligned pcrel relocs against hidden symbols""... $ac_c" 1>&6 -echo "configure:6906: checking assembler for unaligned pcrel relocs against hidden symbols" >&5 +echo "configure:6979: checking assembler for unaligned pcrel relocs against hidden symbols" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6917,7 +6990,7 @@ else .hidden foo foo: .skip 4' > conftest.s - if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \ && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \ @@ -6950,7 +7023,7 @@ fi fi # unaligned pcrel relocs echo $ac_n "checking assembler for offsetable %lo()""... $ac_c" 1>&6 -echo "configure:6954: checking assembler for offsetable %lo()" >&5 +echo "configure:7027: checking assembler for offsetable %lo()" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_offsetable_lo10'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6959,7 +7032,7 @@ else echo '.text or %g1, %lo(ab) + 12, %g1 or %g1, %lo(ab + 12), %g1' > conftest.s - if { ac_try='$gcc_cv_as -xarch=v9 -o conftest.o conftest.s >&5'; { (eval echo configure:6963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -xarch=v9 -o conftest.o conftest.s >&5'; { (eval echo configure:7036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if test x$gcc_cv_objdump != x \ && %gcc_cv_objdump -s -j .text conftest.o 2> /dev/null \ @@ -6985,7 +7058,7 @@ fi i[34567]86-*-* | x86_64-*-*) echo $ac_n "checking assembler for filds and fists mnemonics""... $ac_c" 1>&6 -echo "configure:6989: checking assembler for filds and fists mnemonics" >&5 +echo "configure:7062: checking assembler for filds and fists mnemonics" >&5 if eval "test \"`echo '$''{'gcc_cv_as_ix86_filds_fists'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6996,7 +7069,7 @@ else fi elif test x$gcc_cv_as != x; then echo 'filds mem; fists mem' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_ix86_filds_fists=yes else @@ -7016,14 +7089,14 @@ EOF fi echo $ac_n "checking assembler for cmov syntax""... $ac_c" 1>&6 -echo "configure:7020: checking assembler for cmov syntax" >&5 +echo "configure:7093: checking assembler for cmov syntax" >&5 if eval "test \"`echo '$''{'gcc_cv_as_ix86_cmov_sun_syntax'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else gcc_cv_as_ix86_cmov_sun_syntax=no if test x$gcc_cv_as != x; then echo 'cmovl.l %edx, %eax' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_ix86_cmov_sun_syntax=yes else @@ -7045,7 +7118,7 @@ fi # This one is used unconditionally by i386.[ch]; it is to be defined # to 1 if the feature is present, 0 otherwise. echo $ac_n "checking assembler for GOTOFF in data""... $ac_c" 1>&6 -echo "configure:7049: checking assembler for GOTOFF in data" >&5 +echo "configure:7122: checking assembler for GOTOFF in data" >&5 if eval "test \"`echo '$''{'gcc_cv_as_ix86_gotoff_in_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7060,7 +7133,7 @@ fi nop .data .long .L0@GOTOFF' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_ix86_gotoff_in_data=yes else @@ -7081,7 +7154,7 @@ EOF ia64*-*-*) echo $ac_n "checking assembler for ltoffx and ldxmov relocs""... $ac_c" 1>&6 -echo "configure:7085: checking assembler for ltoffx and ldxmov relocs" >&5 +echo "configure:7158: checking assembler for ltoffx and ldxmov relocs" >&5 if eval "test \"`echo '$''{'gcc_cv_as_ia64_ltoffx_ldxmov_relocs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7095,7 +7168,7 @@ fi addl r15 = @ltoffx(x#), gp ;; ld8.mov r16 = [r15], x#' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes else @@ -7125,7 +7198,7 @@ fi mfcr 3,128" echo $ac_n "checking assembler for mfcr field support""... $ac_c" 1>&6 -echo "configure:7129: checking assembler for mfcr field support" >&5 +echo "configure:7202: checking assembler for mfcr field support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_powerpc_mfcrf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7136,7 +7209,7 @@ else fi elif test x$gcc_cv_as != x; then echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_powerpc_mfcrf=yes else @@ -7158,7 +7231,7 @@ fi mips*-*-*) echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6 -echo "configure:7162: checking assembler for explicit relocation support" >&5 +echo "configure:7235: checking assembler for explicit relocation support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_mips_explicit_relocs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7169,7 +7242,7 @@ else fi elif test x$gcc_cv_as != x; then echo ' lw $4,%gp_rel(foo)($4)' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_mips_explicit_relocs=yes else @@ -7199,7 +7272,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \ - | xstormy16*-*-* | cris-*-*) + | xstormy16*-*-* | cris-*-* | xtensa-*-*) insn="nop" ;; ia64*-*-*) @@ -7215,7 +7288,7 @@ if test x"$insn" != x; then .loc 1 3 0 $insn" echo $ac_n "checking assembler for dwarf2 debug_line support""... $ac_c" 1>&6 -echo "configure:7219: checking assembler for dwarf2 debug_line support" >&5 +echo "configure:7292: checking assembler for dwarf2 debug_line support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_debug_line'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7227,7 +7300,7 @@ else fi elif test x$gcc_cv_as != x; then echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then # ??? This fails with non-gnu grep. Maybe use objdump? if grep debug_line conftest.o > /dev/null 2>&1; then @@ -7249,7 +7322,7 @@ echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6 # by DW_AT_decl_file. Approximate this test by testing if # the assembler bitches if the same index is assigned twice. echo $ac_n "checking assembler for buggy dwarf2 .file directive""... $ac_c" 1>&6 -echo "configure:7253: checking assembler for buggy dwarf2 .file directive" >&5 +echo "configure:7326: checking assembler for buggy dwarf2 .file directive" >&5 if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_file_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7257,7 +7330,7 @@ else if test x$gcc_cv_as != x; then echo ' .file 1 "foo.s" .file 1 "bar.s"' > conftest.s - if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_dwarf2_file_buggy=yes else @@ -7280,7 +7353,7 @@ EOF fi echo $ac_n "checking assembler for --gdwarf2 option""... $ac_c" 1>&6 -echo "configure:7284: checking assembler for --gdwarf2 option" >&5 +echo "configure:7357: checking assembler for --gdwarf2 option" >&5 if eval "test \"`echo '$''{'gcc_cv_as_gdwarf2_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7292,7 +7365,7 @@ else fi elif test x$gcc_cv_as != x; then echo "$insn" > conftest.s - if { ac_try='$gcc_cv_as --gdwarf2 -o conftest.o conftest.s >&5'; { (eval echo configure:7296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as --gdwarf2 -o conftest.o conftest.s >&5'; { (eval echo configure:7369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then gcc_cv_as_gdwarf2_flag=yes else @@ -7312,7 +7385,7 @@ EOF fi echo $ac_n "checking assembler for --gstabs option""... $ac_c" 1>&6 -echo "configure:7316: checking assembler for --gstabs option" >&5 +echo "configure:7389: checking assembler for --gstabs option" >&5 if eval "test \"`echo '$''{'gcc_cv_as_gstabs_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7324,12 +7397,12 @@ else fi elif test x$gcc_cv_as != x; then echo "$insn" > conftest.s - if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s >&5'; { (eval echo configure:7328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s >&5'; { (eval echo configure:7401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then # The native Solaris 9/Intel assembler doesn't understand --gstabs # and warns about it, but still exits successfully. So check for # this. - if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null'; { (eval echo configure:7333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null'; { (eval echo configure:7406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then : else gcc_cv_as_gstabs_flag=yes fi @@ -7351,7 +7424,7 @@ fi fi echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6 -echo "configure:7355: checking linker read-only and read-write section mixing" >&5 +echo "configure:7428: checking linker read-only and read-write section mixing" >&5 gcc_cv_ld_ro_rw_mix=unknown if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -7390,7 +7463,7 @@ fi echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6 echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6 -echo "configure:7394: checking linker PT_GNU_EH_FRAME support" >&5 +echo "configure:7467: checking linker PT_GNU_EH_FRAME support" >&5 gcc_cv_ld_eh_frame_hdr=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -7412,7 +7485,7 @@ fi echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6 echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6 -echo "configure:7416: checking linker position independent executable support" >&5 +echo "configure:7489: checking linker position independent executable support" >&5 gcc_cv_ld_pie=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -7433,39 +7506,6 @@ EOF fi echo "$ac_t""$gcc_cv_ld_pie" 1>&6 -# Miscellaneous target-specific checks. -case "$target" in - mips*-*-*) - echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6 -echo "configure:7441: checking whether libgloss uses STARTUP directives consistently" >&5 - gcc_cv_mips_libgloss_startup=no - gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_noncanonical/lib/idt.ld - do - if grep '^STARTUP' $f > /dev/null 2>&1; then - gcc_cv_mips_libgloss_startup=yes - break - fi - done - if test x"$gcc_cv_mips_libgloss_startup" = xyes; then - cat >> confdefs.h <<\EOF -#define HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES 1 -EOF - - fi - echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6 - ;; -esac - if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then cat >> confdefs.h <&6 -echo "configure:7643: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:7683: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -7759,9 +7799,9 @@ done rm -f Make-hooks touch Make-hooks target_list="all.build all.cross start.encap rest.encap tags \ - install-normal install-common install-info install-man \ + install-normal install-common install-man \ uninstall \ - mostlyclean clean distclean extraclean maintainer-clean \ + mostlyclean clean distclean maintainer-clean \ stage1 stage2 stage3 stage4 stageprofile stagefeedback" for t in $target_list do @@ -8103,7 +8143,6 @@ s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g s%@CPP@%$CPP%g s%@GNATBIND@%$GNATBIND%g -s%@ADAC@%$ADAC%g s%@strict1_warn@%$strict1_warn%g s%@warn_cflags@%$warn_cflags%g s%@WERROR@%$WERROR%g @@ -8453,9 +8492,9 @@ symbolic_link='$symbolic_link' EOF cat >> $CONFIG_STATUS <<\EOF -case x$CONFIG_HEADERS in -xauto-host.h:config.in) -echo > cstamp-h ;; +case ${CONFIG_HEADERS} in + *auto-host.h:config.in*) + echo > cstamp-h ;; esac # Make sure all the subdirs exist. for d in $subdirs diff --git a/gcc/configure.in b/gcc/configure.in index f424f03b6fc..9c071de7fe6 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -284,29 +284,12 @@ fi # See if GNAT has been installed gcc_AC_PROG_GNAT -if test x$have_gnat != xno ; then -AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long, -ac_cv_prog_adac_no_long_long, -[cat >conftest.adb <&5 2>&5 ; then - ac_cv_prog_adac_no_long_long=yes -else - ac_cv_prog_adac_no_long_long=no -fi -rm -f conftest*]) -else - ac_cv_prog_adac_no_long_long=yes -fi - # --------------------- # Warnings and checking # --------------------- strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes && \ - test $ac_cv_prog_adac_no_long_long = yes ; then +if test $ac_cv_prog_cc_no_long_long = yes ; then strict1_warn="-pedantic -Wno-long-long" fi AC_SUBST(strict1_warn) @@ -414,9 +397,24 @@ if test x$ac_fold_checking != x ; then fi valgrind_path_defines= valgrind_command= + +dnl # This check AC_REQUIREs various stuff, so it *must not* be inside +dnl # an if statement. This was the source of very frustrating bugs +dnl # in converting to autoconf 2.5x! +AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) + if test x$ac_checking_valgrind != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. + AC_MSG_CHECKING(for VALGRIND_DISCARD in ) + AC_TRY_CPP( + [#include +#ifndef VALGRIND_DISCARD +#error VALGRIND_DISCARD not defined +#endif], + [gcc_cv_header_valgrind_memcheck_h=yes], + [gcc_cv_header_valgrind_memcheck_h=no]) + AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h) AC_MSG_CHECKING(for VALGRIND_DISCARD in ) AC_TRY_CPP( [#include @@ -426,17 +424,23 @@ if test x$ac_checking_valgrind != x ; then [gcc_cv_header_memcheck_h=yes], gcc_cv_header_memcheck_h=no) AC_MSG_RESULT($gcc_cv_header_memcheck_h) - AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind, [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1]) - if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then - AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h/memcheck.h]) + if test "x$valgrind_path" = "x" \ + || (test $have_valgrind_h = no \ + && test $gcc_cv_header_memcheck_h = no \ + && test $gcc_cv_header_valgrind_memcheck_h = no); then + AC_MSG_ERROR([*** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h]) fi valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"' valgrind_command="$valgrind_path -q" AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1, [Define if you want to run subprograms and generated programs through valgrind (a memory checker). This is extremely expensive.]) + if test $gcc_cv_header_valgrind_memcheck_h = yes; then + AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1, + [Define if valgrind's valgrind/memcheck.h header is installed.]) + fi if test $gcc_cv_header_memcheck_h = yes; then AC_DEFINE(HAVE_MEMCHECK_H, 1, [Define if valgrind's memcheck.h header is installed.]) @@ -467,6 +471,14 @@ esac], [coverage_flags=""]) AC_SUBST(coverage_flags) +AC_ARG_ENABLE(gather-detailed-mem-stats, +[ --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering], [], +[enable_gather_detailed_mem_stats=no]) +if test x$enable_gather_detailed_mem_stats = xyes ; then + AC_DEFINE(GATHER_STATISTICS, 1, + [Define to enable detailed memory allocation stats gathering.]) +fi + # ------------------------------- # Miscenalleous configure options # ------------------------------- @@ -586,6 +598,12 @@ AC_PROG_MAKE_SET # Find some useful tools AC_PROG_AWK +# We need awk to run opts.sh (to create options.c and options.h). +# Bail out if it's missing. +case ${AWK} in + "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; +esac + gcc_AC_PROG_LN gcc_AC_PROG_LN_S AC_PROG_RANLIB @@ -1872,8 +1890,14 @@ changequote(,)dnl changequote([,])dnl fi else - # non-GNU linkers don't seem to support .hidden yet - gcc_cv_ld_hidden=no + case "${target}" in + hppa64*-*-hpux*) + gcc_cv_ld_hidden=yes + ;; + *) + gcc_cv_ld_hidden=no + ;; + esac fi fi]) libgcc_visibility=no @@ -2387,7 +2411,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \ - | xstormy16*-*-* | cris-*-*) + | xstormy16*-*-* | cris-*-* | xtensa-*-*) insn="nop" ;; ia64*-*-*) @@ -2523,36 +2547,6 @@ if test x"$gcc_cv_ld_pie" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_pie) -# Miscellaneous target-specific checks. -case "$target" in - mips*-*-*) - AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently) - gcc_cv_mips_libgloss_startup=no - gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_noncanonical/lib/idt.ld - do - if grep '^STARTUP' $f > /dev/null 2>&1; then - gcc_cv_mips_libgloss_startup=yes - break - fi - done - if test x"$gcc_cv_mips_libgloss_startup" = xyes; then - AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1, - [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.]) - fi - AC_MSG_RESULT($gcc_cv_mips_libgloss_startup) - ;; -esac - if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include", @@ -2844,7 +2838,7 @@ touch Make-hooks target_list="all.build all.cross start.encap rest.encap tags \ install-normal install-common install-man \ uninstall \ - mostlyclean clean distclean extraclean maintainer-clean \ + mostlyclean clean distclean maintainer-clean \ stage1 stage2 stage3 stage4 stageprofile stagefeedback" for t in $target_list do @@ -3029,9 +3023,9 @@ fi # and configure language subdirectories AC_OUTPUT($all_outputs, [ -case x$CONFIG_HEADERS in -xauto-host.h:config.in) -echo > cstamp-h ;; +case ${CONFIG_HEADERS} in + *auto-host.h:config.in*) + echo > cstamp-h ;; esac # Make sure all the subdirs exist. for d in $subdirs diff --git a/gcc/conflict.c b/gcc/conflict.c index c832b7df52c..a23bad35c19 100644 --- a/gcc/conflict.c +++ b/gcc/conflict.c @@ -435,9 +435,9 @@ conflict_graph_compute (regset regs, partition p) AND_REG_SET (live, regs); /* Walk the instruction stream backwards. */ - head = bb->head; - insn = bb->end; - for (insn = bb->end; insn != head; insn = PREV_INSN (insn)) + head = BB_HEAD (bb); + insn = BB_END (bb); + for (insn = BB_END (bb); insn != head; insn = PREV_INSN (insn)) { int born_reg; int live_reg; diff --git a/gcc/coverage.c b/gcc/coverage.c index b02c97c15d6..8b43d6af24e 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -154,7 +154,7 @@ read_counts_file (void) counts_entry_t *summaried = NULL; unsigned seen_summary = 0; gcov_unsigned_t tag; - int error = 0; + int is_error = 0; if (!gcov_open (da_file_name, 1)) return; @@ -250,17 +250,26 @@ read_counts_file (void) entry->summary.num = n_counts; entry->counts = xcalloc (n_counts, sizeof (gcov_type)); } - else if (entry->checksum != checksum - || entry->summary.num != n_counts) + else if (entry->checksum != checksum) { - warning ("coverage mismatch for function %u", fn_ident); + error ("coverage mismatch for function %u while reading execution counters.", + fn_ident); + error ("checksum is %x instead of %x", entry->checksum, checksum); + htab_delete (counts_hash); + break; + } + else if (entry->summary.num != n_counts) + { + error ("coverage mismatch for function %u while reading execution counters.", + fn_ident); + error ("number of counters is %d instead of %d", entry->summary.num, n_counts); htab_delete (counts_hash); break; } else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE) { - warning ("cannot merge separate %s counters for function %u", - ctr_names[elt.ctr], fn_ident); + error ("cannot merge separate %s counters for function %u", + ctr_names[elt.ctr], fn_ident); goto skip_merge; } @@ -278,14 +287,14 @@ read_counts_file (void) skip_merge:; } gcov_sync (offset, length); - if ((error = gcov_is_error ())) + if ((is_error = gcov_is_error ())) break; } if (!gcov_is_eof ()) { - warning (error < 0 ? "`%s' has overflowed" : "`%s' is corrupted", - da_file_name); + error (is_error < 0 ? "`%s' has overflowed" : "`%s' is corrupted", + da_file_name); htab_delete (counts_hash); } @@ -299,6 +308,7 @@ get_coverage_counts (unsigned counter, unsigned expected, const struct gcov_ctr_summary **summary) { counts_entry_t *entry, elt; + gcov_unsigned_t checksum = -1; /* No hash table, no counts. */ if (!counts_hash) @@ -306,8 +316,8 @@ get_coverage_counts (unsigned counter, unsigned expected, static int warned = 0; if (!warned++) - warning ("file %s not found, execution counts assumed to be zero", - da_file_name); + inform ("file %s not found, execution counts assumed to be zero", + da_file_name); return NULL; } @@ -321,12 +331,22 @@ get_coverage_counts (unsigned counter, unsigned expected, return 0; } - if (expected != entry->summary.num - || compute_checksum () != entry->checksum) + checksum = compute_checksum (); + if (entry->checksum != checksum) { - warning ("coverage mismatch for `%s'", IDENTIFIER_POINTER - (DECL_ASSEMBLER_NAME (current_function_decl))); - return NULL; + error ("coverage mismatch for function '%s' while reading counter '%s'.", + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), + ctr_names[counter]); + error ("checksum is %x instead of %x", entry->checksum, checksum); + return 0; + } + else if (entry->summary.num != expected) + { + error ("coverage mismatch for function '%s' while reading counter '%s'.", + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), + ctr_names[counter]); + error ("number of counters is %d instead of %d", entry->summary.num, expected); + return 0; } if (summary) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0b7e80975b9..919aefc0c6b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,753 @@ +2004-02-11 Mark Mitchell + + * repo.c (IDENTIFIER_REPO_USED): Use tree flag 5. + (IDENTIFIER_REPO_CHOSEN): Use tree flag 6. + (extract_string): Use double quotes, rather than single quotes, on + Windows. + +2003-11-05 Mark Mitchell + + * decl.c (cxx_push_function_context): Do not set + current_function_is_thunk. + * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the + actual function. + +2003-12-30 Nathan Sidwell + + PR c++/13507 + * decl.c (duplicate_decls): Use build_type_attribute_variant to + merge attributes. + + PR c++/13494 + * tree.c (build_cplus_array_type_1): Only build a minimal array + type for dependent types or domains. + +2003-12-29 Nathan Sidwell + + PR c++/12774 + * typeck.c (comp_array_types): Fold non-dependent domains for + ABI-1. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/13289 + * semantics.c (finish_id_expression): Only check if the type of + a template argument is integral or enumeration when it is not + dependent. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/12403 + * parser.c (cp_parser_template_declaration_after_export): Set up + template specialization scope in case of explicit specialization. + +2003-12-28 Mark Mitchell + + PR c++/13081 + * decl.c (duplicate_decls): Preserve inline-ness when redeclaring + a function template. + + PR c++/12613 + * decl.c (reshape_init): Reject GNU colon-style designated + initializers in arrays. + + PR c++/13009 + * call.c (build_special_member_call): Do not assume that we have a + pointer to the complete object in an assignment operator. + +2003-12-28 Roger Sayle + + PR c++/13070 + * decl.c (duplicate_decls): When setting the type of an anticipated + declaration, merge the existing type attributes. + +2003-12-25 Andrew Pinski + + PR c++/13268, c++/13339 + * class.c (add_method): Return early when method is error_mark_node. + * pt.c (tsubst_friend_function): Return early when new_friend is + error_mark_node. + +2003-12-23 Mark Mitchell + + * cp-lang.c (cp_expr_size): Return zero for empty classes. + + * cp-tree.h (warn_if_uknown_interface): Remove unused function. + * decl2.c (warn_if_unknown_interface): Likewise. + +2003-12-23 Nathan Sidwell + + PR c++/13387 + * cp-lang.c (cxx_get_alias_set): Correct logic for a base type. + +2003-12-22 Mark Mitchell + + * decl.c (start_function): Do not check + flag_alt_external_templates or flag_external_templates. + * decl2.c (warn_if_unknown_interface): Likewise. + * lex.c (extract_interface_info): Likewise. + * pt.c (lookup_template_class): Likewise. + + PR c++/12862 + * name-lookup.c (pushdecl): Look up all namespace-scope entities + in their corresponding namespace. + + PR c++/12397 + * typeck.c (finish_class_member_access_expr): Don't tree + IDENTIFIER_NODEs as non-dependent expressions. + +2003-12-22 Andrew Pinski + + PR c++/5050 + * tree.c (cp_start_inlining): Remove. + (cp_end_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. + * cp-tree.h (cp_start_inlining): Do not declare. + (cp_end_inlining): Do not declare. + +2003-12-22 Mark Mitchell + + PR c++/12479 + * parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;" + pedwarn when not in a system header. + +2003-12-21 Mark Mitchell + + * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE, + CPTI_UNION_TYPE, CPTI_ENUM_TYPE. + (record_type_node): Remove. + (union_type_node): Likewise. + (enum_type_node): Likewise. + * decl.c: Remove mention of above tree nodes in comment. + * lex.c (cxx_init): Do not assign to record_type_node, + union_type_node, or enum_type_node. Simplify handling of + class_type_node. + + PR c++/11554 + * init.c (sort_mem_initializers): Add warning. + +2003-12-21 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * error.c: Likewise. + * except.c: Likewise. + * init.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * semantics.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Kazu Hirata + + * cvt.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * decl.c: Likewise. + * decl2.c: Likewise. + * expr.c: Likewise. + * friend.c: Likewise. + * lex.c: Likewise. + * name-lookup.c: Likewise. + * repo.c: Likewise. + * search.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Mark Mitchell + + PR c++/12795 + * name-lookup.c (pushdecl): Do not treated any functions as being + "nested" in C++. + +2003-12-19 Jason Merrill + + PR c++/13371 + * typeck.c (build_modify_expr): Stabilize lhs if we're narrowing. + * cvt.c (convert_to_void): Don't warn about the RHS of a comma + being useless if TREE_NO_UNUSED_WARNING is set. + +2003-12-18 Richard Henderson + + * cp-tree.h (struct lang_type_header): Remove __extension__. + +2003-12-18 Jason Merrill + + PR c++/12253 + * init.c (build_vec_init): Initialization of an element from + an initializer list is also a full-expression. + + * parser.c, pt.c, semantics.c: Rename constant_expression_p + to integral_constant_expression_p. + +2003-12-18 Kriang Lerdsuwanakij + + PR c++/13262 + * pt.c (instantiate_decl): Wrap push_nested_class and + pop_nested_class around cp_finish_decl call for static member + variable. + +2003-12-18 Giovanni Bajo + + PR c++/9154 + * parser.c (cp_parser_template_argument): A type-id followed by '>>' + is just an user typo, and should be accepted as last resort if any + other parsing fails. + (cp_parser_enclosed_template_argument_list): If the argument list is + parsed correctly, but the next token is '>>', emit a diagnostic. + (cp_parser_next_token_ends_template_argument): Accept '>>' as + delimiter of template argument, it will be later detected as a typo. + +2003-12-17 Kelley Cook + + * Make-lang.in: Replace cp/g++.1 with $(docobjdir)/g++.1. + +2003-12-17 Mark Mitchell + + PR c++/10603 + PR c++/12827 + * parser.c (cp_parser_error): Help c_parse_error print good + messages if the next token is a keyword. + (cp_parser_parameter_declaration_list): When resynchronizing after + a bad parameter declaration, stop if a comma is found. + (cp_parser_parameter_declaration): Avoid backtracking. + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + +2003-12-16 Nathan Sidwell + + PR c++/9043 + C++ ABI change: Mangling array indices in templates. + * decl.c (compute_array_index_type): Reorganize for earlier + template errors. Use value_dependent_expression_p for abi-2. + * mangle.c (write_array_type): Check broken mangling for + expression indices on abi-1 + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + + PR c++/13275 + * lex.c (reswords): Add "__offsetof" and "__offsetof__". + * parser.c (cp_parser): Add in_offsetof_p. + (cp_parser_new): Initialize it. + (cp_parser_primary_expression): Handle __offsetof__ (...). + (cp_parser_postfix_expression): Allow casts to pointer type and + uses of "->" in a constant expression if implementing offsetof. + (cp_parser_unary_expression): Allow the use of "&" in a constant + expression if implementing offsetof. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-16 Giovanni Bajo + + * semantics.c (finish_id_expression): Refactor the code to handle + template parameters, and emit a more informative error message + when they are used within an integral constant expression. + +2003-12-16 Nathan Sidwell + + PR c++/13387 + * class.c (finish_struct_1): Compute mode and alias set for + CLASSTYPE_AS_BASE. + * call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial + assignment of a class, as necessary. + * cp-lang.c (cxx_get_alias_set): The alias set as a base is the + same as for the complete type. + + PR c++/13242 + C++ ABI change. Mangling template parameters of reference type + * mangle.c (write_template_args): Remove unreachable code. + (write_template_arg): Look through an argument of reference type. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-15 Mark Mitchell + + PR c++/10926 + * decl2.c (grokfield): Robustify. + + PR c++/11116 + * parser.c (cp_parser_throw_expression): Determine whether or not + an assignment-expression is present by doing one-token lookahead. + + PR c++/13269 + * parser.c (cp_parser_function_definition_after_declarator): Stop + scanning tokens when reaching EOF. + + PR c++/12989 + * typeck.c (cxx_sizeof_or_alignof_expr): Robustify. + + PR c++/13310 + * pt.c (dependent_template_p): Handle OVERLOADs. + +2003-12-15 Mark Mitchell + + PR c++/13243 + PR c++/12573 + * parser.c (cp_parser_postfix_expression): Tighten handling of + integral constant expressions. + (cp_parser_unary_expression): Likewise. + * pt.c (value_dependent_expression_p): Remove handling for + COMPONENT_REFs. + +2003-12-15 Nathan Sidwell + + * class.c (add_method): Disallow destructor for java classes. + * decl.c (xref_basetypes): Check java class inheritance. + * decl2.c (check_java_method): Skip artificial params. + + PR c++/13241 + C++ ABI change. Mangling of symbols in expressions. + * mangle.c (write_mangled_name): Add top_level flag. Rework for + nested and unnested mangling. Deal with abi version 1 and version + 2 differences. + (write_expression): Adjust write_mangled_name call. + (mangle_decl_string): Use write_mangled_name for all non-type decls. + +2003-12-14 Mark Mitchell + + PR c++/10779 + PR c++/12160 + * parser.c (struct cp_parser): Add in_template_argument_list_p. + (cp_parser_error): Use c_parse_error. + (cp_parser_name_lookup_error): New function. + (cp_parser_new): Initialize it. + (cp_parser_declarator): Add parenthesized_p parameter. + (cp_parser_nested_name_specifier_opt): Use + cp_parser_name_lookup_error. + (cp_parser_parenthesized_expression_list): Improve comments. + (cp_parser_condition): Adjust call to cp_parser_declarator. + (cp_parser_template_parameter): Adjust call to + cp_parser_parameter_declaration. + (cp_parser_template_argument_list): Set + in_template_argument_list_p. + (cp_parser_explicit_instantiation): Adjust call to + cp_parser_declarator. + (cp_parser_simple_type_specifier): Remove unncessary code. + (cp_parser_using_declaration): Use cp_parser_name_lookup_error. + (cp_parser_init_declarator): Handle member function definitions. + (cp_parser_direct_declarator): Adjust call to + cp_parser_declarator. + (cp_parser_type_id): Adjust call to cp_parser_declarator. + (cp_parser_parameter_declaration_list): Avoid backtracking where + possible. + (cp_parser_parameter_declaration): Add parenthesized_p parameter. + (cp_parser_function_definition): Remove. + (cp_parser_member_declaration): Do not backtrack to look for + function definitions. + (cp_parser_exception_declaration): Adjust call to + cp_parser_declarator. + (cp_parser_single_declaration): Handle function definitions via + cp_parser_init_declarator. + (cp_parser_save_member_function_body): New function. + +2003-12-14 Kriang Lerdsuwanakij + + PR c++/13106 + * decl.c (finish_function): Check if return type is dependent before + issuing no return statement warning. + +2003-12-12 Nathan Sidwell + + PR c++/13118 + * cp-tree.h (lang_decl_u): Add thunk_alias member. + (THUNK_VIRTUAL_OFFSET): Must be a FUNCTION_DECL. + (THUNK_ALIAS_P): Remove. + (THUNK_ALIAS): Adjust. + * class.c (update_vtable_entry_for_fn): Get the vbase within the + overriding function's return type. + (dump_thunk): Adjust THUNK_ALIAS printing. + (build_vtbl_initializer): Adjust THUNK_ALIAS use. + * method.c (make_thunk): Revert 12881 test change. Clear + THUNK_ALIAS. + (finish_thunk): Adjust THUNK_ALIAS setting. + (use_thunk): Adjust THUNK_ALIAS use. + * semantics.c (emit_associated_thunks): Likewise. + + PR c++/13114, c++/13115 + * class.c (layout_empty_base): Propagate the move of an empty base + to offset zero. + + PR c++/12881 + * method.c (make_thunk): Deal with thunk aliases when searching + for a thunk. Robustify assertion. + +2003-12-11 Nathan Sidwell + + * mangle.c (conv_type_names): Holds IDENTIFIER_NODEs only. + (hash_type): Use TYPE_UID of the identifier's type. + (compare_type): Adjust. + (mangle_conv_op_name_for_type): Store identifier nodes only, use + TYPE_UID has hash value. + +2003-12-10 Mark Mitchell + + * cp-tree.h (DECL_CONV_FN_P): Check that DECL_NAME is non-NULL. + +2003-12-08 Matt Austern + + PR c/13134 + * decl.c (duplicate_decls): Copy visibility flag when appropriate. + +2003-12-09 Giovanni Bajo + + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-08 Jason Merrill + + PR c++/11971 + * tree.c (build_local_temp): Split out from build_cplus_new. + (force_target_expr): New fn. + * call.c (call_builtin_trap): Call it. Take a type parm. + (convert_arg_to_ellipsis): Pass it. + (build_x_va_arg): Use call_builtin_trap. + + PR c++/11929 + * call.c (magic_varargs_p): New fn. + (build_over_call): Do no ellipsis conversions for arguments to + functions with magic varargs. + + * name-lookup.c, init.c, except.c: Revert Giovanni's patch from + yesterday. + + Give the anonymous namespace a null DECL_NAME. + * cp-tree.h: Don't declare anonymous_namespace_name. + * decl.c: Don't define it. + * dump.c (cp_dump_tree): Don't check for it. + * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise. + * error.c (dump_decl): Likewise. + * name-lookup.c: Define it here. + (push_namespace): Put it in DECL_ASSEMBLER_NAME instead. + * mangle.c (write_unqualified_name): Adjust. + +2003-12-07 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an + OVERLOAD unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-06 Mark Mitchell + + PR c++/13323 + * class.c (same_signature_p): Handle conversion operators + correctly. + (check_for_override): Likewise. + +2003-12-06 Kelley Cook + + * Make-lang.in (GXX_CROSS_NAME, CXX_CROSS_NAME): Delete. + (c++.install_common, cp/g++.1, c++.install-man): Adjust for above. + (c++.uninstall): Likewise. + +2003-12-05 Danny Smith + Mark Mitchell + + PR c++/13305 + * parser.c (cp_parser_elaborated_type_specifier): Accept + attributes. + +2003-12-05 Mark Mitchell + + PR c++/13314 + * parser.c (cp_parser_class_specifier): Match push_scope/pop_scope + calls. + (cp_parser_class_head): Likewise. + +2003-12-05 Kriang Lerdsuwanakij + + PR c++/13166 + * parser.c (cp_parser_late_parsing_default_args): Make sure the + context is a class before calling push_nested_class and + pop_nested_class. + +2003-12-03 James E Wilson + + * g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS + support. + +2003-12-03 Mark Mitchell + + PR c++/9127 + * cp-tree.h (at_namespace_scope_p): New function. + * parser.c (cp_parser_class_head): Handle invalid explicit + specializations. + * search.c (at_namespace_scope_p): New function. + + PR c++/13179 + * semantics.c (finish_handler_parms): Do not call eh_type_info for + types used in templates. + + PR c++/10771 + * parser.c (cp_parser_check_for_invalid_template_id): New + function. + (cp_parser_simple_type_specifier): Use it. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_class_head): Likewise. + +2003-12-02 Giovanni Bajo + + PR c++/10126 + * pt.c (convert_nontype_argument): Handle default conversions + while converting a pointer to member function. + +2003-12-02 Giovanni Bajo + + PR c++/12573 + * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by + looking into them recursively. + +2003-12-02 Richard Henderson + + * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. + * parser.c (struct cp_token): Likewise. + (struct cp_parser_token_tree_map_node): Likewise. + * lex.c (struct resword): Move const after ENUM_BITFIELD. + +2003-11-30 Mark Mitchell + + PR c++/9849 + * parser.c (cp_lexer_prev_token): New function. + (cp_parser_skip_to_closing_parenthesis): Add consume_paren + parameter. + (cp_parser_nested_name_specifier_opt): Add is_declaration + parameter. + (cp_parser_nested_name_specifier): Likewise. + (cp_parser_class_or_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_id_expression): Adjust calls to + cp_parser_nested_name_specifier_op, cp_parser_template_id, + cp_parser_class_name. + (cp_parser_unqualified_id): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_pseudo_destructor_name): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_mem_initializer_id): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_type_name): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_qualified_namespace_specifier): Likewise. + (cp_parser_using_declaration): Likewise. + (cp_parser_using_directive): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_declarator_id): Likewise. + (cp_parser_class_head): Likewise. + (cp_parser_base_specifier): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + (cp_parser_direct_declarator): Fix typo in comment. + (cp_parser_parenthesized_expression_list): Adjust call to + cp_parser_skip_to_closing_parenthesis. + (cp_parser_selection_statement): Likewise. + +2003-11-23 Kriang Lerdsuwanakij + + PR c++/12924 + * typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR + with OVERLOAD and DECL nodes as the first operand. + +2003-11-22 Kriang Lerdsuwanakij + + * pt.c (tsubst) : Remove erroneous argument to build_nt. + +2003-11-22 Kriang Lerdsuwanakij + + PR c++/5369 + * friend.c (is_friend): Handle member function of a class + template as template friend. + (do_friend): Likewise. + * decl2.c (check_classfn): Add template_header_p parameter. + * decl.c (start_decl): Adjust check_classfn call. + (grokfndecl): Likewise. + * pt.c (is_specialization_of_friend): New function. + (uses_template_parms_level): Likewise. + (push_template_decl_real): Use uses_template_parms_level. + (tsubst_friend_function): Adjust check_classfn call. + * cp-tree.h (check_classfn): Adjust declaration. + (uses_template_parms_level): Add declaration. + (is_specialization_of_friend): Likewise. + +2003-11-21 Mark Mitchell + + PR c++/12515 + * pt.c (build_non_dependent_expr): Handle GNU extension to ?: + operator. + +2003-11-21 Jan Hubicka + + * parser.c (cp_parser_postfix_expression): Initialize 's' to + NULL_TREE. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (c++.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (check-g++, lang_checks): Add. + +2003-11-18 Kriang Lerdsuwanakij + + PR c++/12932 + * class.c (currently_open_derived_class): Check if + current_class_type is NULL_TREE. + * semantics.c (finish_call_expr): Check if + currently_open_derived_class returns NULL_TREE. + * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT + parameter. + +2003-11-17 Jason Merrill + + * init.c (build_new_1): Preevaluate placement args. + * call.c (build_op_delete_call): Don't expose placement args to + overload resolution. + +2003-11-16 Jason Merrill + + * Make-lang.in (c++.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-15 Bernardo Innocenti + + PR c++/2294 + * name-lookup.c: Revert previous patch for PR c++/2294 to prevent + build failure on libjava. + +2003-11-14 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD + unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + +2003-11-14 Mark Mitchell + + PR c++/12762 + * parser.c (cp_parser_enclosed_template_argument_list): New + function. + (cp_parser_template_id): Use it. + (cp_parser_simple_type_specifier): Recognize invalid template + syntax. + +2003-11-14 Giovanni Bajo + + PR c++/2094 + * pt.c (unify): Add support for PTRMEM_CST and + FIELD_DECL unification. + +2003-11-13 Richard Earnshaw + + * decl.c (grokfndecl): Change OK to type tree. + +2003-11-12 Mark Mitchell + + * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like + CONSTRUCTOR. + + * decl.c (cp_make_fname_decl): When creating a top-level + __FUNCTION__-like symbol, do register it with pushdecl. + + * decl.c (finish_case_label): Do not check that we are within a + switch statement here. + * parser.c (struct cp_parser): Add in_iteration_statement_p and + in_switch_statement_p. + (cp_parser_new): Initialize them. + (cp_parser_labeled_statement): Check validity of case labels + here. + (cp_parser_selection_statement): Set in_switch_statement_p. + (cp_parser_iteration_statement): Set in_iteration_statement_p. + (cp_parser_jump_statement): Check validity of break/continue + statements here. + + PR c++/12735 + * cp-tree.h (duplicate_decls): Return a tree. + * decl.c (duplicate_decls): Clarify documentation. Return + error_mark_node to indicate a failed redeclaration. + * friend.c (do_friend): Handle that case. + * name-lookup.c (pushdecl): Likewise. + +2003-11-11 Jason Merrill + + * cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro. + * name-lookup.c (parse_using_directive): New fn. + (is_associated_namespace): New fn. + (arg_assoc_namespace): Also check associated namespaces. + * name-lookup.h: Declare new fns. + * pt.c (maybe_process_partial_specialization): Allow + specialization in associated namespace. + * parser.c (cp_parser_using_directive): Accept attributes. Use + parse_using_directive. + +2003-11-10 Richard Henderson + + * cvt.c (convert_to_void): Use void_zero_node after overload failure. + +2003-11-10 Gabriel Dos Reis + + PR c++/12832 + * name-lookup.c (supplement_binding): Gracefully handle names + used at non-class scope prior declaration. + +2003-11-06 Matt Austern + + * decl.c (duplicate_decls): copy DECL_VISIBILITY field. + * method.c (use_thunk): give thunk same visibility as function. + * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/11616 + * pt.c (instantiate_pending_templates): Save and restore + input_location. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/2019 + * friend.c (add_friend): Don't display previous declaration in + case of duplicate friend warning. + +2003-11-02 Kriang Lerdsuwanakij + + PR c++/9810 + * call.c (build_over_call): Check access using primary template + if FN is a member function template. + +2003-11-01 Kriang Lerdsuwanakij + + PR c++/12796 + * class.c (handle_using_decl): Set input_location before calling + error_not_base_type. + 2003-10-26 Kriang Lerdsuwanakij PR c++/10371 @@ -4591,7 +5341,7 @@ pointers to member functions. PR c++/8534 - * decl.c (build_ptrmemfunc_type): Do not allow default arugments + * decl.c (build_ptrmemfunc_type): Do not allow default arguments in pointer-to-member-function types. 2003-03-10 Gabriel Dos Reis @@ -17326,7 +18076,7 @@ * search.c (dfs_get_pure_virtuals): Use BV_FN. * semantics.c (emit_associated_thunks): New function. (expand_body): Use it. - * ir.texi: Adjust decriptions of thunks. + * ir.texi: Adjust descriptions of thunks. 2000-06-22 Jason Merrill diff --git a/gcc/cp/ChangeLog.1 b/gcc/cp/ChangeLog.1 index 4b4afd31526..01ef399698c 100644 --- a/gcc/cp/ChangeLog.1 +++ b/gcc/cp/ChangeLog.1 @@ -1386,7 +1386,7 @@ Wed May 10 00:55:59 1995 Jason Merrill Tue May 9 19:10:33 1995 Mike Stump * decl2.c: Add flag_new_for_scope for new -ffor-scope flag. - * parse.y (FOR): Conditionalize the pushing and poping of scope for + * parse.y (FOR): Conditionalize the pushing and popping of scope for the for-init-statement upon the new flag_new_for_scope. * parse.y (try_block): Simplify and use compstmt. @@ -7211,7 +7211,7 @@ Thu Mar 31 19:50:35 1994 Jason Merrill Thu Mar 31 16:20:16 1994 Kung Hsu * decl2.c (grok_func_init): Do not abort as rtl for pur virtual - fucntions. They can be defined somewhere else. + functions. They can be defined somewhere else. Sat Jan 23 23:23:26 1994 Stephen R. van den Berg diff --git a/gcc/cp/ChangeLog.2 b/gcc/cp/ChangeLog.2 index 26dc387a37e..7cb4adafa89 100644 --- a/gcc/cp/ChangeLog.2 +++ b/gcc/cp/ChangeLog.2 @@ -13405,7 +13405,7 @@ Tue Jan 27 16:42:21 1998 Mark Mitchell (classtype_mangled_name): Likewise. (lookup_template_class): Likewise. (tsubst): Likewise. - (more_specialized): Take explict template arguments as a + (more_specialized): Take explicit template arguments as a parameter. (most_specialized): Likewise. (get_bindings): Likewise. Check that return types match before @@ -13627,7 +13627,7 @@ Mon Jan 19 22:40:03 1998 Mark Mitchell (instantiate_template): Use retrieve_specialization. (do_decl_instantiation): Likewise. (instantiate_decl): Likewise. - (type_unification): Improve handling of explict template + (type_unification): Improve handling of explicit template arguments. * tree.c (mapcar): Return error_mark_node, rather than aborting, on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS. @@ -20213,7 +20213,7 @@ Tue Jan 16 11:39:40 1996 Jason Merrill Tue Jan 16 11:09:42 1996 Mike Stump - * decl.c (poplevel): When poping a level, don't give a warning for + * decl.c (poplevel): When popping a level, don't give a warning for any subblocks that already exist. Tue Jan 16 00:25:33 1996 Jason Merrill diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 8017bbba3a7..1947311a9a2 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -25,7 +25,7 @@ # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-normal, foo.install-common, foo.install-man, # foo.uninstall, -# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. @@ -42,10 +42,6 @@ GXX_INSTALL_NAME = `echo g++|sed '$(program_transform_name)'` CXX_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo c++|sed '$(program_transform_name)'` GXX_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo g++|sed '$(program_transform_name)'` -# Actual names to use when installing a cross-compiler. -CXX_CROSS_NAME = `echo c++|sed '$(program_transform_cross_name)'` -GXX_CROSS_NAME = `echo g++|sed '$(program_transform_cross_name)'` - # # Define the names for selecting c++ in LANGUAGES. # Note that it would be nice to move the dependency on g++ @@ -114,9 +110,14 @@ c++.start.encap: g++$(exeext) c++.rest.encap: c++.tags: force - cd $(srcdir)/cp; etags *.c *.h + cd $(srcdir)/cp; etags -o TAGS.sub *.c *.h --language=none \ + --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' cp-tree.def; \ + etags --include TAGS.sub --include ../TAGS.sub + +generated-manpages:: $(docobjdir)/g++.1 -generated-manpages:: cp/g++.1 +check-c++ : check-g++ +lang_checks += check-g++ # # Install hooks: @@ -128,14 +129,14 @@ c++.install-normal: # Install the driver program as $(target)-g++ # and also as either g++ (if native) or $(tooldir)/bin/g++. c++.install-common: installdirs + -rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext) + -$(INSTALL_PROGRAM) g++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext) + -chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext) + -rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext) + -( cd $(DESTDIR)$(bindir) && \ + $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) ) -if [ -f cc1plus$(exeext) ] ; then \ if [ -f g++-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(CXX_CROSS_NAME)$(exeext); \ - ( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GXX_CROSS_NAME)$(exeext) $(CXX_CROSS_NAME)$(exeext) ); \ if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \ rm -f $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \ $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \ @@ -144,12 +145,6 @@ c++.install-common: installdirs $(LN) g++$(exeext) c++$(exeext) ); \ else true; fi; \ else \ - rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) g++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ - rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext); \ - ( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) ); \ rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \ ( cd $(DESTDIR)$(bindir) && \ $(LN) $(GXX_INSTALL_NAME)$(exeext) $(GXX_TARGET_INSTALL_NAME)$(exeext) ); \ @@ -159,47 +154,33 @@ c++.install-common: installdirs fi ; \ fi -cp/g++.1: +$(docobjdir)/g++.1: -rm -f $@ - if [ "$(ALL)" = all.cross ]; then \ - echo ".so man1/$(GCC_CROSS_NAME).1" > $@ ; \ - else \ - echo ".so man1/$(GCC_INSTALL_NAME).1" > $@ ; \ - fi + -echo ".so man1/$(GCC_INSTALL_NAME).1" > $@ -c++.install-man: installdirs cp/g++.1 +c++.install-man: installdirs $(docobjdir)/g++.1 -if [ -f cc1plus$(exeext) ] ; then \ - if [ -f g++-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \ - $(INSTALL_DATA) cp/g++.1 $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \ - else \ - rm -f $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ - $(INSTALL_DATA) cp/g++.1 $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ - fi; \ + rm -f $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ + $(INSTALL_DATA) $(docobjdir)/g++.1 $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ + chmod a-x $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \ else true; fi c++.uninstall: -rm -rf $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(CXX_CROSS_NAME)$(exeext) -rm -rf $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext) -rm -rf $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) - -rm -rf $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext) # # Clean hooks: # A lot of the ancillary files are deleted by the main makefile. # We just have to delete files specific to us. c++.mostlyclean: - -rm -f cp/g++.1 + -rm -f $(docobjdir)/g++.1 -rm -f cp/*$(objext) -rm -f cp/*$(coverageexts) c++.clean: c++.distclean: -rm -f cp/config.status cp/Makefile -c++.extraclean: c++.maintainer-clean: # # Stage hooks: diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e7bbd22fc45..5e759259015 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -104,11 +104,12 @@ static tree direct_reference_binding (tree, tree); static bool promoted_arithmetic_type_p (tree); static tree conditional_conversion (tree, tree); static char *name_as_c_string (tree, tree, bool *); -static tree call_builtin_trap (void); +static tree call_builtin_trap (tree); static tree prep_operand (tree); static void add_candidates (tree, tree, tree, bool, tree, tree, int, struct z_candidate **); static tree merge_conversion_sequences (tree, tree); +static bool magic_varargs_p (tree); tree build_vfield_ref (tree datum, tree type) @@ -1743,7 +1744,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, type1 = type2; break; } - /* FALLTHROUGH */ + /* Fall through. */ case LT_EXPR: case GT_EXPR: case LE_EXPR: @@ -2036,7 +2037,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, case GT_EXPR: case GE_EXPR: enum_p = 1; - /* FALLTHROUGH */ + /* Fall through. */ default: ref1 = 0; @@ -3408,7 +3409,7 @@ prep_operand (tree operand) CANDIDATES. The ARGS are the arguments provided to the call, without any implicit object parameter. The EXPLICIT_TARGS are explicit template arguments provided. TEMPLATE_ONLY is true if - only template fucntions should be considered. CONVERSION_PATH, + only template functions should be considered. CONVERSION_PATH, ACCESS_PATH, and FLAGS are as for add_function_candidate. */ static void @@ -3824,10 +3825,6 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, /* Find the allocation function that is being called. */ call_expr = placement; - /* Sometimes we have a COMPOUND_EXPR, rather than a simple - CALL_EXPR. */ - while (TREE_CODE (call_expr) == COMPOUND_EXPR) - call_expr = TREE_OPERAND (call_expr, 1); /* Extract the function. */ alloc_fn = get_callee_fndecl (call_expr); my_friendly_assert (alloc_fn != NULL_TREE, 20020327); @@ -3910,7 +3907,15 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); - return build_function_call (fn, args); + if (placement) + { + /* The placement args might not be suitable for overload + resolution at this point, so build the call directly. */ + mark_used (fn); + return build_cxx_call (fn, args, args); + } + else + return build_function_call (fn, args); } /* If we are doing placement delete we do nothing if we don't find a @@ -4097,7 +4102,7 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, case RVALUE_CONV: if (! IS_AGGR_TYPE (totype)) return expr; - /* else fall through */ + /* Else fall through. */ case BASE_CONV: if (TREE_CODE (convs) == BASE_CONV && !NEED_TEMPORARY_P (convs)) { @@ -4187,16 +4192,18 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, LOOKUP_NORMAL|LOOKUP_NO_CONVERSION); } -/* Build a call to __builtin_trap which can be used in an expression. */ +/* Build a call to __builtin_trap which can be used as an expression of + type TYPE. */ static tree -call_builtin_trap (void) +call_builtin_trap (tree type) { tree fn = IDENTIFIER_GLOBAL_VALUE (get_identifier ("__builtin_trap")); my_friendly_assert (fn != NULL, 20030927); fn = build_call (fn, NULL_TREE); - fn = build (COMPOUND_EXPR, integer_type_node, fn, integer_zero_node); + fn = build (COMPOUND_EXPR, type, fn, error_mark_node); + fn = force_target_expr (type, fn); return fn; } @@ -4235,7 +4242,7 @@ convert_arg_to_ellipsis (tree arg) warning ("cannot pass objects of non-POD type `%#T' through `...'; \ call will abort at runtime", TREE_TYPE (arg)); - arg = call_builtin_trap (); + arg = call_builtin_trap (TREE_TYPE (arg)); } return arg; @@ -4257,8 +4264,10 @@ build_x_va_arg (tree expr, tree type) if (! pod_type_p (type)) { /* Undefined behavior [expr.call] 5.2.2/7. */ - warning ("cannot receive objects of non-POD type `%#T' through `...'", - type); + warning ("cannot receive objects of non-POD type `%#T' through `...'; \ +call will abort at runtime", + type); + return call_builtin_trap (type); } return build_va_arg (expr, type); @@ -4364,6 +4373,29 @@ convert_for_arg_passing (tree type, tree val) return val; } +/* Returns true iff FN is a function with magic varargs, i.e. ones for + which no conversions at all should be done. This is true for some + builtins which don't act like normal functions. */ + +static bool +magic_varargs_p (tree fn) +{ + if (DECL_BUILT_IN (fn)) + switch (DECL_FUNCTION_CODE (fn)) + { + case BUILT_IN_CLASSIFY_TYPE: + case BUILT_IN_CONSTANT_P: + case BUILT_IN_NEXT_ARG: + case BUILT_IN_STDARG_START: + case BUILT_IN_VA_START: + return true; + + default:; + } + + return false; +} + /* Subroutine of the various build_*_call functions. Overload resolution has chosen a winning candidate CAND; build up a CALL_EXPR accordingly. ARGS is a TREE_LIST of the unconverted arguments to the call. FLAGS is a @@ -4387,7 +4419,39 @@ build_over_call (struct z_candidate *cand, int flags) joust (cand, WRAPPER_ZC (TREE_VALUE (val)), 1); if (DECL_FUNCTION_MEMBER_P (fn)) - perform_or_defer_access_check (cand->access_path, fn); + { + /* If FN is a template function, two cases must be considered. + For example: + + struct A { + protected: + template void f(); + }; + template struct B { + protected: + void g(); + }; + struct C : A, B { + using A::f; // #1 + using B::g; // #2 + }; + + In case #1 where `A::f' is a member template, DECL_ACCESS is + recorded in the primary template but not in its specialization. + We check access of FN using its primary template. + + In case #2, where `B::g' has a DECL_TEMPLATE_INFO simply + because it is a member of class template B, DECL_ACCESS is + recorded in the specialization `B::g'. We cannot use its + primary template because `B::g' and `B::g' may have + different access. */ + if (DECL_TEMPLATE_INFO (fn) + && is_member_template (DECL_TI_TEMPLATE (fn))) + perform_or_defer_access_check (cand->access_path, + DECL_TI_TEMPLATE (fn)); + else + perform_or_defer_access_check (cand->access_path, fn); + } if (args && TREE_CODE (args) != TREE_LIST) args = build_tree_list (NULL_TREE, args); @@ -4481,10 +4545,14 @@ build_over_call (struct z_candidate *cand, int flags) /* Ellipsis */ for (; arg; arg = TREE_CHAIN (arg)) - converted_args - = tree_cons (NULL_TREE, - convert_arg_to_ellipsis (TREE_VALUE (arg)), - converted_args); + { + tree a = TREE_VALUE (arg); + if (magic_varargs_p (fn)) + /* Do no conversions for magic varargs. */; + else + a = convert_arg_to_ellipsis (a); + converted_args = tree_cons (NULL_TREE, a, converted_args); + } converted_args = nreverse (converted_args); @@ -4563,9 +4631,30 @@ build_over_call (struct z_candidate *cand, int flags) { tree to = stabilize_reference (build_indirect_ref (TREE_VALUE (converted_args), 0)); + tree type = TREE_TYPE (to); + tree as_base = CLASSTYPE_AS_BASE (type); arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0); - val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg); + if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base))) + val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg); + else + { + /* We must only copy the non-tail padding parts. Use + CLASSTYPE_AS_BASE for the bitwise copy. */ + tree to_as_base, arg_as_base, base_ptr_type; + + to = save_expr (to); + base_ptr_type = build_pointer_type (as_base); + to_as_base = build_indirect_ref + (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, to, 0)), 0); + arg_as_base = build_indirect_ref + (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, arg, 0)), 0); + + val = build (MODIFY_EXPR, as_base, to_as_base, arg_as_base); + val = build (COMPOUND_EXPR, type, convert_to_void (val, NULL), to); + TREE_USED (val) = 1; + } + return val; } @@ -4776,14 +4865,23 @@ build_special_member_call (tree instance, tree name, tree args, || name == deleting_dtor_identifier) my_friendly_assert (args == NULL_TREE, 20020712); - /* We must perform the conversion here so that we do not - subsequently check to see whether BINFO is an accessible - base. (It is OK for a constructor to call a constructor in - an inaccessible base as long as the constructor being called - is accessible.) */ + /* Convert to the base class, if necessary. */ if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (instance), BINFO_TYPE (binfo))) - instance = convert_to_base_statically (instance, binfo); + { + if (name != ansi_assopname (NOP_EXPR)) + /* For constructors and destructors, either the base is + non-virtual, or it is virtual but we are doing the + conversion from a constructor or destructor for the + complete object. In either case, we can convert + statically. */ + instance = convert_to_base_statically (instance, binfo); + else + /* However, for assignment operators, we must convert + dynamically if the base is virtual. */ + instance = build_base_path (PLUS_EXPR, instance, + binfo, /*nonnull=*/1); + } } my_friendly_assert (instance != NULL_TREE, 20020712); diff --git a/gcc/cp/class.c b/gcc/cp/class.c index a053956ad9a..2928dd33071 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -725,12 +725,18 @@ modify_vtable_entry (tree t, void add_method (tree type, tree method, int error_p) { - int using = (DECL_CONTEXT (method) != type); + int using; int len; int slot; tree method_vec; - int template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL - && DECL_TEMPLATE_CONV_FN_P (method)); + int template_conv_p; + + if (method == error_mark_node) + return; + + using = (DECL_CONTEXT (method) != type); + template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL + && DECL_TEMPLATE_CONV_FN_P (method)); if (!CLASSTYPE_METHOD_VEC (type)) /* Make a new method vector. We start with 8 entries. We must @@ -755,6 +761,12 @@ add_method (tree type, tree method, int error_p) { slot = CLASSTYPE_DESTRUCTOR_SLOT; TYPE_HAS_DESTRUCTOR (type) = 1; + + if (TYPE_FOR_JAVA (type)) + error (DECL_ARTIFICIAL (method) + ? "Java class '%T' cannot have an implicit non-trivial destructor" + : "Java class '%T' cannot have a destructor", + DECL_CONTEXT (method)); } else { @@ -1109,7 +1121,11 @@ handle_using_decl (tree using_decl, tree t) binfo = lookup_base (t, ctype, ba_any, NULL); if (! binfo) { + location_t saved_loc = input_location; + + input_location = DECL_SOURCE_LOCATION (using_decl); error_not_base_type (ctype, t); + input_location = saved_loc; return; } @@ -1173,7 +1189,7 @@ handle_using_decl (tree using_decl, tree t) return; } - /* Make type T see field decl FDECL with access ACCESS.*/ + /* Make type T see field decl FDECL with access ACCESS. */ if (flist) for (; flist; flist = OVL_NEXT (flist)) { @@ -1896,7 +1912,11 @@ same_signature_p (tree fndecl, tree base_fndecl) if (DECL_DESTRUCTOR_P (base_fndecl) || DECL_DESTRUCTOR_P (fndecl)) return 0; - if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl)) + if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl) + || (DECL_CONV_FN_P (fndecl) + && DECL_CONV_FN_P (base_fndecl) + && same_type_p (DECL_CONV_FN_TYPE (fndecl), + DECL_CONV_FN_TYPE (base_fndecl)))) { tree types, base_types; types = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); @@ -2160,13 +2180,22 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (DECL_THUNK_P (fn)) { + my_friendly_assert (DECL_RESULT_THUNK_P (fn), 20031211); fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn)); virtual_offset = THUNK_VIRTUAL_OFFSET (fn); } else fixed_offset = virtual_offset = NULL_TREE; - if (!virtual_offset) + if (virtual_offset) + /* Find the equivalent binfo within the return type of the + overriding function. We will want the vbase offset from + there. */ + virtual_offset = + TREE_VALUE (purpose_member + (BINFO_TYPE (virtual_offset), + CLASSTYPE_VBASECLASSES (TREE_TYPE (over_return)))); + else { /* There was no existing virtual thunk (which takes precedence). */ @@ -2435,7 +2464,8 @@ check_for_override (tree decl, tree ctype) override a virtual function from a base class. */ return; if ((DECL_DESTRUCTOR_P (decl) - || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl))) + || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)) + || DECL_CONV_FN_P (decl)) && look_for_overrides (ctype, decl) && !DECL_STATIC_FUNCTION_P (decl)) /* Set DECL_VINDEX to a value that is neither an INTEGER_CST nor @@ -3567,14 +3597,18 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) /* This routine should only be used for empty classes. */ my_friendly_assert (is_empty_class (basetype), 20000321); alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype)); - - if (abi_version_at_least (2)) - BINFO_OFFSET (binfo) = size_zero_node; - if (warn_abi && !integer_zerop (BINFO_OFFSET (binfo))) - warning ("offset of empty base `%T' may not be ABI-compliant and may" - "change in a future version of GCC", - BINFO_TYPE (binfo)); + if (!integer_zerop (BINFO_OFFSET (binfo))) + { + if (abi_version_at_least (2)) + propagate_binfo_offsets + (binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo))); + else if (warn_abi) + warning ("offset of empty base `%T' may not be ABI-compliant and may" + "change in a future version of GCC", + BINFO_TYPE (binfo)); + } + /* This is an empty base class. We first try to put it at offset zero. */ if (layout_conflict_p (binfo, @@ -5011,7 +5045,7 @@ finish_struct_1 (tree t) bases and members and add implicitly generated methods. */ check_bases_and_members (t); - /* Find the key method */ + /* Find the key method. */ if (TYPE_CONTAINS_VPTR_P (t)) { CLASSTYPE_KEY_METHOD (t) = key_method (t); @@ -5024,6 +5058,10 @@ finish_struct_1 (tree t) /* Layout the class itself. */ layout_class_type (t, &virtuals); + if (CLASSTYPE_AS_BASE (t) != t) + /* We use the base type for trivial assignments, and hence it + needs a mode. */ + compute_record_mode (CLASSTYPE_AS_BASE (t)); /* Make sure that we get our own copy of the vfield FIELD_DECL. */ vfield = TYPE_VFIELD (t); @@ -5581,6 +5619,9 @@ currently_open_derived_class (tree t) if (dependent_type_p (t)) return NULL_TREE; + if (!current_class_type) + return NULL_TREE; + if (DERIVED_FROM_P (t, current_class_type)) return current_class_type; @@ -6592,7 +6633,7 @@ dump_class_hierarchy_1 (FILE *stream, int flags, tree t) fprintf (stream, "\n"); } -/* Debug interface to heirarchy dumping. */ +/* Debug interface to hierarchy dumping. */ extern void debug_class (tree t) @@ -6699,11 +6740,7 @@ dump_thunk (FILE *stream, int indent, tree thunk) !DECL_THUNK_P (thunk) ? "function" : DECL_THIS_THUNK_P (thunk) ? "this-thunk" : "covariant-thunk", name ? IDENTIFIER_POINTER (name) : ""); - if (!DECL_THUNK_P (thunk)) - /*NOP*/; - else if (THUNK_ALIAS_P (thunk)) - fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk)); - else + if (DECL_THUNK_P (thunk)) { HOST_WIDE_INT fixed_adjust = THUNK_FIXED_OFFSET (thunk); tree virtual_adjust = THUNK_VIRTUAL_OFFSET (thunk); @@ -6718,6 +6755,8 @@ dump_thunk (FILE *stream, int indent, tree thunk) fprintf (stream, " vbase=" HOST_WIDE_INT_PRINT_DEC "(%s)", tree_low_cst (BINFO_VPTR_FIELD (virtual_adjust), 0), type_as_string (BINFO_TYPE (virtual_adjust), TFF_SCOPE)); + if (THUNK_ALIAS (thunk)) + fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk)); } fprintf (stream, "\n"); for (thunks = DECL_THUNKS (thunk); thunks; thunks = TREE_CHAIN (thunks)) @@ -7390,7 +7429,7 @@ build_vtbl_initializer (tree binfo, { if (!DECL_NAME (fn)) finish_thunk (fn); - if (THUNK_ALIAS_P (fn)) + if (THUNK_ALIAS (fn)) { fn = THUNK_ALIAS (fn); BV_FN (v) = fn; diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 92e6b914b3e..f1f5eedcc54 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -156,10 +156,6 @@ static void cxx_initialize_diagnostics (diagnostic_context *); #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p #undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p -#undef LANG_HOOKS_TREE_INLINING_START_INLINING -#define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining -#undef LANG_HOOKS_TREE_INLINING_END_INLINING -#define LANG_HOOKS_TREE_INLINING_END_INLINING cp_end_inlining #undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS #define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN @@ -296,6 +292,12 @@ ok_to_generate_alias_set_for_type (tree t) static HOST_WIDE_INT cxx_get_alias_set (tree t) { + if (TREE_CODE (t) == RECORD_TYPE + && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t)) + && CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t) + /* The base variant of a type must be in the same alias set as the + complete type. */ + return get_alias_set (TYPE_CONTEXT (t)); if (/* It's not yet safe to use alias sets for some classes in C++. */ !ok_to_generate_alias_set_for_type (t) @@ -345,7 +347,9 @@ cp_expr_size (tree exp) abort (); /* This would be wrong for a type with virtual bases, but they are caught by the abort above. */ - return CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)); + return (is_empty_class (TREE_TYPE (exp)) + ? size_zero_node + : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp))); } else /* Use the default code. */ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 06031600239..91e38f48223 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -521,9 +521,6 @@ enum cp_tree_index CPTI_BASE_DESC_TYPE, CPTI_CLASS_TYPE, - CPTI_RECORD_TYPE, - CPTI_UNION_TYPE, - CPTI_ENUM_TYPE, CPTI_UNKNOWN_TYPE, CPTI_VTBL_TYPE, CPTI_VTBL_PTR_TYPE, @@ -602,9 +599,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; #define base_desc_type_node cp_global_trees[CPTI_BASE_DESC_TYPE] #define class_type_node cp_global_trees[CPTI_CLASS_TYPE] -#define record_type_node cp_global_trees[CPTI_RECORD_TYPE] -#define union_type_node cp_global_trees[CPTI_UNION_TYPE] -#define enum_type_node cp_global_trees[CPTI_ENUM_TYPE] #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE] #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE] #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE] @@ -1000,7 +994,7 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and ambiguity issues. */ #define DERIVED_FROM_P(PARENT, TYPE) \ - (lookup_base ((TYPE), PARENT, ba_any, NULL) != NULL_TREE) + (lookup_base ((TYPE), (PARENT), ba_any, NULL) != NULL_TREE) /* Nonzero iff TYPE is uniquely derived from PARENT. Ignores accessibility. */ #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) \ @@ -1017,7 +1011,7 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* This is a few header flags for 'struct lang_type'. Actually, all but the first are used only for lang_type_class; they are put in this structure to save space. */ -__extension__ struct lang_type_header GTY(()) +struct lang_type_header GTY(()) { CHAR_BITFIELD is_lang_type_class : 1; @@ -1357,7 +1351,7 @@ struct lang_type GTY(()) #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->h.has_default_ctor) -/* Nonzero means that this type contains a mutable member */ +/* Nonzero means that this type contains a mutable member. */ #define CLASSTYPE_HAS_MUTABLE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_mutable) #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE)) @@ -1634,12 +1628,17 @@ struct lang_decl_flags GTY(()) unsigned this_thunk_p : 1; union lang_decl_u { - /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this - is DECL_TEMPLATE_INFO. */ + /* In a FUNCTION_DECL for which DECL_THUNK_P does not hold, + VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this is + DECL_TEMPLATE_INFO. */ tree GTY ((tag ("0"))) template_info; /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */ struct cp_binding_level * GTY ((tag ("1"))) level; + + /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is + THUNK_ALIAS. */ + tree GTY ((tag ("2"))) thunk_alias; } GTY ((desc ("%1.u1sel"))) u; union lang_decl_u2 { @@ -1840,7 +1839,7 @@ struct lang_decl GTY(()) /* Nonzero if NODE is a user-defined conversion operator. */ #define DECL_CONV_FN_P(NODE) \ - (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE))) + (DECL_NAME (NODE) && IDENTIFIER_TYPENAME_P (DECL_NAME (NODE))) /* If FN is a conversion operator, the type to which it converts. Otherwise, NULL_TREE. */ @@ -2063,6 +2062,11 @@ struct lang_decl GTY(()) of a namespace, to record the transitive closure of using namespace. */ #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE)) +/* In a NAMESPACE_DECL, the list of namespaces which have associated + themselves with this one. */ +#define DECL_NAMESPACE_ASSOCIATIONS(NODE) \ + (NAMESPACE_DECL_CHECK (NODE)->decl.saved_tree) + /* In a NAMESPACE_DECL, points to the original namespace if this is a namespace alias. */ #define DECL_NAMESPACE_ALIAS(NODE) \ @@ -2854,12 +2858,17 @@ struct lang_decl GTY(()) for the result pointer adjustment. The constant adjustment is given by THUNK_FIXED_OFFSET. If the - vcall or vbase offset is required, the index into the vtable is given by - THUNK_VIRTUAL_OFFSET. - - Due to ordering constraints in class layout, it is possible to have - equivalent covariant thunks. THUNK_ALIAS_P and THUNK_ALIAS are used - in those cases. */ + vcall or vbase offset is required, THUNK_VIRTUAL_OFFSET is + used. For this pointer adjusting thunks, it is the vcall offset + into the vtable. For result pointer adjusting thunks it is the + binfo of the virtual base to convert to. Use that binfo's vbase + offset. + + It is possible to have equivalent covariant thunks. These are + distinct virtual covariant thunks whose vbase offsets happen to + have the same value. THUNK_ALIAS is used to pick one as the + canonical thunk, which will get all the this pointer adjusting + thunks attached to it. */ /* An integer indicating how many bytes should be subtracted from the this or result pointer when this function is called. */ @@ -2877,15 +2886,11 @@ struct lang_decl GTY(()) binfos.) */ #define THUNK_VIRTUAL_OFFSET(DECL) \ - (LANG_DECL_U2_CHECK (VAR_OR_FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset) - -/* A thunk which is equivalent to another thunk. */ -#define THUNK_ALIAS_P(DECL) \ - (THUNK_VIRTUAL_OFFSET (DECL) && DECL_P (THUNK_VIRTUAL_OFFSET (DECL))) + (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset) -/* When THUNK_ALIAS_P is true, this indicates the thunk which is - aliased. */ -#define THUNK_ALIAS(DECL) THUNK_VIRTUAL_OFFSET (DECL) +/* A thunk which is equivalent to another thunk. */ +#define THUNK_ALIAS(DECL) \ + (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.thunk_alias) /* For thunk NODE, this is the FUNCTION_DECL thunked to. */ #define THUNK_TARGET(NODE) \ @@ -2935,7 +2940,7 @@ typedef enum cp_lvalue_kind { clk_ordinary = 1, /* An ordinary lvalue. */ clk_class = 2, /* An rvalue of class-type. */ clk_bitfield = 4, /* An lvalue for a bit-field. */ - clk_packed = 8 /* An lvalue for a packed field. */ + clk_packed = 8 /* An lvalue for a packed field. */ } cp_lvalue_kind; /* Various kinds of template specialization, instantiation, etc. */ @@ -3080,8 +3085,6 @@ extern GTY(()) tree error_mark_list; extern GTY(()) tree integer_two_node; extern GTY(()) tree integer_three_node; -extern GTY(()) tree anonymous_namespace_name; - /* The number of function bodies which we are currently processing. (Zero if we are at namespace scope, one inside the body of a function, two inside the body of a function in a local class, etc.) */ @@ -3618,7 +3621,7 @@ extern void pushtag (tree, tree, int); extern tree make_anon_name (void); extern void clear_anon_tags (void); extern int decls_match (tree, tree); -extern int duplicate_decls (tree, tree); +extern tree duplicate_decls (tree, tree); extern tree pushdecl_top_level (tree); extern tree pushdecl_top_level_and_finish (tree, tree); extern tree push_using_decl (tree, tree); @@ -3689,6 +3692,7 @@ extern int walk_namespaces (walk_namespaces_fn, extern int wrapup_globals_for_namespace (tree, void *); extern tree create_implicit_typedef (tree, tree); extern tree maybe_push_decl (tree); +extern tree force_target_expr (tree, tree); extern tree build_target_expr_with_type (tree, tree); extern int local_variable_p (tree); extern int nonstatic_local_decl_p (tree); @@ -3706,14 +3710,13 @@ extern GTY(()) tree last_function_parms; /* in decl2.c */ extern bool check_java_method (tree); extern int grok_method_quals (tree, tree, tree); -extern void warn_if_unknown_interface (tree); extern void grok_x_components (tree); extern void maybe_retrofit_in_chrg (tree); extern void maybe_make_one_only (tree); extern void grokclassfn (tree, tree, enum overload_flags, tree); extern tree grok_array_decl (tree, tree); extern tree delete_sanity (tree, tree, int, int); -extern tree check_classfn (tree, tree); +extern tree check_classfn (tree, tree, bool); extern void check_member_template (tree); extern tree grokfield (tree, tree, tree, tree, tree); extern tree grokbitfield (tree, tree, tree); @@ -3872,6 +3875,7 @@ extern void redeclare_class_template (tree, tree); extern tree lookup_template_class (tree, tree, tree, tree, int, tsubst_flags_t); extern tree lookup_template_function (tree, tree); extern int uses_template_parms (tree); +extern int uses_template_parms_level (tree, int); extern tree instantiate_class_template (tree); extern tree instantiate_template (tree, tree, tsubst_flags_t); extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t, int); @@ -3889,6 +3893,7 @@ extern int is_member_template (tree); extern int comp_template_parms (tree, tree); extern int template_class_depth (tree); extern int is_specialization_of (tree, tree); +extern bool is_specialization_of_friend (tree, tree); extern int comp_template_args (tree, tree); extern void maybe_process_partial_specialization (tree); extern void maybe_check_template_type (tree); @@ -3959,6 +3964,7 @@ extern void reinit_search_statistics (void); extern tree current_scope (void); extern int at_function_scope_p (void); extern bool at_class_scope_p (void); +extern bool at_namespace_scope_p (void); extern tree context_for_name_lookup (tree); extern tree lookup_conversions (tree); extern tree binfo_for_vtable (tree); @@ -4162,8 +4168,6 @@ extern int cp_is_overload_p (tree); extern int cp_auto_var_in_fn_p (tree,tree); extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*, int*, tree); -extern int cp_start_inlining (tree); -extern void cp_end_inlining (tree); /* in typeck.c */ extern int string_conv_p (tree, tree, int); diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index cf69b95a333..4672830ed60 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -76,8 +76,8 @@ static void warn_ref_binding (tree, tree, tree); static tree cp_convert_to_pointer (tree type, tree expr, bool force) { - register tree intype = TREE_TYPE (expr); - register enum tree_code form; + tree intype = TREE_TYPE (expr); + enum tree_code form; tree rval; if (IS_AGGR_TYPE (intype)) @@ -306,8 +306,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) static tree convert_to_pointer_force (tree type, tree expr) { - register tree intype = TREE_TYPE (expr); - register enum tree_code form = TREE_CODE (intype); + tree intype = TREE_TYPE (expr); + enum tree_code form = TREE_CODE (intype); if (form == POINTER_TYPE) { @@ -449,8 +449,8 @@ tree convert_to_reference (tree reftype, tree expr, int convtype, int flags, tree decl) { - register tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype)); - register tree intype; + tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype)); + tree intype; tree rval = NULL_TREE; tree rval_as_conversion = NULL_TREE; bool can_convert_intype_to_type; @@ -612,8 +612,8 @@ cp_convert (tree type, tree expr) tree ocp_convert (tree type, tree expr, int convtype, int flags) { - register tree e = expr; - register enum tree_code code = TREE_CODE (type); + tree e = expr; + enum tree_code code = TREE_CODE (type); if (error_operand_p (e) || type == error_mark_node) return error_mark_node; @@ -817,7 +817,8 @@ convert_to_void (tree expr, const char *implicit) /* The second part of a compound expr contains the value. */ tree op1 = TREE_OPERAND (expr,1); tree new_op1 = convert_to_void - (op1, implicit ? "right-hand operand of comma" : NULL); + (op1, (implicit && !TREE_NO_UNUSED_WARNING (expr) + ? "right-hand operand of comma" : NULL)); if (new_op1 != op1) { @@ -834,7 +835,7 @@ convert_to_void (tree expr, const char *implicit) /* These have already decayed to rvalue. */ break; - case CALL_EXPR: /* we have a special meaning for volatile void fn() */ + case CALL_EXPR: /* We have a special meaning for volatile void fn(). */ break; case INDIRECT_REF: @@ -883,6 +884,7 @@ convert_to_void (tree expr, const char *implicit) of an overloaded function, and this is not one of them. */ pedwarn ("%s cannot resolve address of overloaded function", implicit ? implicit : "void cast"); + expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) /* Only warn when there is no &. */ @@ -943,8 +945,8 @@ convert (tree type, tree expr) tree convert_force (tree type, tree expr, int convtype) { - register tree e = expr; - register enum tree_code code = TREE_CODE (type); + tree e = expr; + enum tree_code code = TREE_CODE (type); if (code == REFERENCE_TYPE) return fold (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN, diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index ca8c603c0e3..53c677ab88a 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -619,7 +619,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) pp_cxx_qualified_id (pp, t); break; } - /* else fall through */ + /* Else fall through. */ case MEMBER_REF: case DOTSTAR_EXPR: pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0)); @@ -1055,7 +1055,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t) pp_cxx_cv_qualifier_seq (pp, t); break; } - /* else fall trhough. */ + /* else fall through. */ default: pp_unsupported_tree (pp, t); @@ -1479,7 +1479,7 @@ static void pp_cxx_original_namespace_definition (cxx_pretty_printer *pp, tree t) { pp_cxx_identifier (pp, "namespace"); - if (DECL_NAME (t) != anonymous_namespace_name) + if (DECL_NAME (t)) pp_cxx_unqualified_id (pp, t); pp_cxx_whitespace (pp); pp_cxx_left_brace (pp); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2bd6ff335bc..92f3a75975c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -140,7 +140,7 @@ tree error_mark_list; tree ptm_desc_type_node; tree base_desc_type_node; - tree class_type_node, record_type_node, union_type_node, enum_type_node; + tree class_type_node; tree unknown_type_node; Array type `vtable_entry_type[]' @@ -228,10 +228,6 @@ struct named_label_list GTY(()) #define named_labels cp_function_chain->x_named_labels -/* The name of the anonymous namespace, throughout this translation - unit. */ -tree anonymous_namespace_name; - /* The number of function bodies which we are currently processing. (Zero if we are at namespace scope, one inside the body of a function, two inside the body of a function in a local class, etc.) */ @@ -429,7 +425,7 @@ pop_labels (tree block) tree poplevel (int keep, int reverse, int functionbody) { - register tree link; + tree link; /* The chain of decls was accumulated in reverse order. Put it into forward order, just for cleanliness. */ tree decls; @@ -1137,14 +1133,14 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl) cp_pedwarn_at ("previous declaration of `%D'", olddecl); } -/* Handle when a new declaration NEWDECL has the same name as an old - one OLDDECL in the same binding contour. Prints an error message - if appropriate. +/* If NEWDECL is a redeclaration of OLDDECL, merge the declarations. + If the redeclaration is invalid, a diagnostic is issued, and the + error_mark_node is returned. Otherwise, OLDDECL is returned. - If safely possible, alter OLDDECL to look like NEWDECL, and return 1. - Otherwise, return 0. */ + If NEWDECL is not a redeclaration of OLDDECL, NULL_TREE is + returned. */ -int +tree duplicate_decls (tree newdecl, tree olddecl) { unsigned olddecl_uid = DECL_UID (olddecl); @@ -1152,7 +1148,7 @@ duplicate_decls (tree newdecl, tree olddecl) int new_defines_function = 0; if (newdecl == olddecl) - return 1; + return olddecl; types_match = decls_match (newdecl, olddecl); @@ -1205,7 +1201,7 @@ duplicate_decls (tree newdecl, tree olddecl) { /* Avoid warnings redeclaring anticipated built-ins. */ if (DECL_ANTICIPATED (olddecl)) - return 0; + return NULL_TREE; /* If you declare a built-in or predefined function name as static, the old definition is overridden, but optionally warn this was a @@ -1217,7 +1213,7 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_BUILT_IN (olddecl) ? "built-in" : "library", olddecl); /* Discard the old built-in function. */ - return 0; + return NULL_TREE; } /* If the built-in is not ansi, then programs can override it even globally without an error. */ @@ -1230,7 +1226,7 @@ duplicate_decls (tree newdecl, tree olddecl) error ("conflicts with built-in declaration `%#D'", olddecl); } - return 0; + return NULL_TREE; } else if (!types_match) { @@ -1257,7 +1253,7 @@ duplicate_decls (tree newdecl, tree olddecl) } else /* Discard the old built-in function. */ - return 0; + return NULL_TREE; /* Replace the old RTL to avoid problems with inlining. */ SET_DECL_RTL (olddecl, DECL_RTL (newdecl)); @@ -1265,7 +1261,14 @@ duplicate_decls (tree newdecl, tree olddecl) /* Even if the types match, prefer the new declarations type for anticipated built-ins, for exception lists, etc... */ else if (DECL_ANTICIPATED (olddecl)) - TREE_TYPE (olddecl) = TREE_TYPE (newdecl); + { + tree type = TREE_TYPE (newdecl); + tree attribs = (*targetm.merge_type_attributes) + (TREE_TYPE (olddecl), type); + + type = build_type_attribute_variant (type, attribs); + TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = type; + } /* Whether or not the builtin can throw exceptions has no bearing on this declarator. */ @@ -1302,14 +1305,14 @@ duplicate_decls (tree newdecl, tree olddecl) get shadowed, and know that if we need to find a TYPE_DECL for a given name, we can look in the IDENTIFIER_TYPE_VALUE slot of the identifier. */ - return 0; + return NULL_TREE; } if ((TREE_CODE (newdecl) == FUNCTION_DECL && DECL_FUNCTION_TEMPLATE_P (olddecl)) || (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_FUNCTION_TEMPLATE_P (newdecl))) - return 0; + return NULL_TREE; error ("`%#D' redeclared as different kind of symbol", newdecl); if (TREE_CODE (olddecl) == TREE_LIST) @@ -1319,14 +1322,14 @@ duplicate_decls (tree newdecl, tree olddecl) /* New decl is completely inconsistent with the old one => tell caller to replace the old one. */ - return 0; + return NULL_TREE; } else if (!types_match) { if (CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl)) /* These are certainly not duplicate declarations; they're from different scopes. */ - return 0; + return NULL_TREE; if (TREE_CODE (newdecl) == TEMPLATE_DECL) { @@ -1354,7 +1357,7 @@ duplicate_decls (tree newdecl, tree olddecl) error ("new declaration `%#D'", newdecl); cp_error_at ("ambiguates old declaration `%#D'", olddecl); } - return 0; + return NULL_TREE; } if (TREE_CODE (newdecl) == FUNCTION_DECL) { @@ -1371,7 +1374,7 @@ duplicate_decls (tree newdecl, tree olddecl) cp_error_at ("ambiguates old declaration `%#D'", olddecl); } else - return 0; + return NULL_TREE; } /* Already complained about this, so don't do so again. */ @@ -1381,7 +1384,7 @@ duplicate_decls (tree newdecl, tree olddecl) error ("conflicting declaration '%#D'", newdecl); cp_error_at ("'%D' has a previous declaration as `%#D'", olddecl, olddecl); - return false; + return NULL_TREE; } } else if (TREE_CODE (newdecl) == FUNCTION_DECL @@ -1401,7 +1404,7 @@ duplicate_decls (tree newdecl, tree olddecl) can occur if we instantiate a template class, and then specialize one of its methods. This situation is valid, but the declarations must be merged in the usual way. */ - return 0; + return NULL_TREE; else if (TREE_CODE (newdecl) == FUNCTION_DECL && ((DECL_TEMPLATE_INSTANTIATION (olddecl) && !DECL_USE_TEMPLATE (newdecl)) @@ -1409,12 +1412,20 @@ duplicate_decls (tree newdecl, tree olddecl) && !DECL_USE_TEMPLATE (olddecl)))) /* One of the declarations is a template instantiation, and the other is not a template at all. That's OK. */ - return 0; + return NULL_TREE; else if (TREE_CODE (newdecl) == NAMESPACE_DECL && DECL_NAMESPACE_ALIAS (newdecl) && DECL_NAMESPACE_ALIAS (newdecl) == DECL_NAMESPACE_ALIAS (olddecl)) - /* Redeclaration of namespace alias, ignore it. */ - return 1; + /* In [namespace.alias] we have: + + In a declarative region, a namespace-alias-definition can be + used to redefine a namespace-alias declared in that declarative + region to refer only to the namespace to which it already + refers. + + Therefore, if we encounter a second alias directive for the same + alias, we can just ignore the second directive. */ + return olddecl; else { const char *errmsg = redeclaration_error_message (newdecl, olddecl); @@ -1426,7 +1437,7 @@ duplicate_decls (tree newdecl, tree olddecl) && namespace_bindings_p ()) ? "`%#D' previously defined here" : "`%#D' previously declared here", olddecl); - return 0; + return error_mark_node; } else if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_INITIAL (olddecl) != NULL_TREE @@ -1506,7 +1517,7 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_CODE (olddecl) == TYPE_DECL && (DECL_IMPLICIT_TYPEDEF_P (olddecl) || DECL_IMPLICIT_TYPEDEF_P (newdecl))) - return 0; + return NULL_TREE; /* If new decl is `static' and an `extern' was seen previously, warn about it. */ @@ -1552,8 +1563,8 @@ duplicate_decls (tree newdecl, tree olddecl) /* Deal with C++: must preserve virtual function table size. */ if (TREE_CODE (olddecl) == TYPE_DECL) { - register tree newtype = TREE_TYPE (newdecl); - register tree oldtype = TREE_TYPE (olddecl); + tree newtype = TREE_TYPE (newdecl); + tree oldtype = TREE_TYPE (olddecl); if (newtype != error_mark_node && oldtype != error_mark_node && TYPE_LANG_SPECIFIC (newtype) && TYPE_LANG_SPECIFIC (oldtype)) @@ -1585,7 +1596,15 @@ duplicate_decls (tree newdecl, tree olddecl) = DECL_SOURCE_LOCATION (newdecl); } - return 1; + if (DECL_FUNCTION_TEMPLATE_P (newdecl)) + { + DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl)) + |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl)); + DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl)) + |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl)); + } + + return olddecl; } if (types_match) @@ -1852,6 +1871,19 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_COMMON (newdecl) = DECL_COMMON (olddecl); COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); + /* If either declaration has a nondefault visibility, use it. */ + if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) + { + if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT + && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) + { + warning ("%J'%D': visibility attribute ignored because it", + newdecl, newdecl); + warning ("%Jconflicts with previous declaration here", olddecl); + } + DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); + } + if (TREE_CODE (newdecl) == FUNCTION_DECL) { int function_size; @@ -1913,7 +1945,7 @@ duplicate_decls (tree newdecl, tree olddecl) && TREE_STATIC (olddecl)))) make_decl_rtl (olddecl, NULL); - return 1; + return olddecl; } /* Generate an implicit declaration for identifier FUNCTIONID @@ -1922,7 +1954,7 @@ duplicate_decls (tree newdecl, tree olddecl) tree implicitly_declare (tree functionid) { - register tree decl; + tree decl; /* We used to reuse an old implicit decl here, but this loses with inline functions because it can clobber @@ -2331,7 +2363,7 @@ define_label (location_t location, tree name) { tree decl = lookup_label (name); struct named_label_list *ent; - register struct cp_binding_level *p; + struct cp_binding_level *p; timevar_push (TV_NAME_LOOKUP); for (ent = named_labels; ent; ent = ent->next) @@ -2422,19 +2454,7 @@ tree finish_case_label (tree low_value, tree high_value) { tree cond, r; - register struct cp_binding_level *p; - - if (! switch_stack) - { - if (high_value) - error ("case label not within a switch statement"); - else if (low_value) - error ("case label `%E' not within a switch statement", - low_value); - else - error ("`default' label not within a switch statement"); - return NULL_TREE; - } + struct cp_binding_level *p; if (processing_template_decl) { @@ -3098,7 +3118,7 @@ cxx_init_decl_processing (void) /* Generate an initializer for a function naming variable from NAME. NAME may be NULL, to indicate a dependent name. TYPE_P is - filled in with the type of the init. */ + filled in with the type of the init. */ tree cp_fname_init (const char* name, tree *type_p) @@ -3160,9 +3180,10 @@ cp_make_fname_decl (tree id, int type_dep) while (b->level_chain->kind != sk_function_parms) b = b->level_chain; pushdecl_with_scope (decl, b); + cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING); } - - cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING); + else + pushdecl_top_level_and_finish (decl, init); return decl; } @@ -3371,7 +3392,7 @@ fixup_anonymous_aggr (tree t) { tree *q; - /* Wipe out memory of synthesized methods */ + /* Wipe out memory of synthesized methods. */ TYPE_HAS_CONSTRUCTOR (t) = 0; TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0; TYPE_HAS_INIT_REF (t) = 0; @@ -3435,7 +3456,7 @@ check_tag_decl (tree declspecs) int saw_friend = 0; int saw_typedef = 0; tree ob_modifier = NULL_TREE; - register tree link; + tree link; /* If a class, struct, or enum type is declared by the DECLSPECS (i.e, if a class-specifier, enum-specifier, or non-typename elaborated-type-specifier appears in the DECLSPECS), @@ -3632,7 +3653,7 @@ start_decl (tree declarator, tree prefix_attributes) { tree decl; - register tree type, tem; + tree type, tem; tree context; /* This should only be done once on the top most decl. */ @@ -3758,7 +3779,9 @@ start_decl (tree declarator, } else { - tree field = check_classfn (context, decl); + tree field = check_classfn (context, decl, + processing_template_decl + > template_class_depth (context)); if (field && duplicate_decls (decl, field)) decl = field; } @@ -4263,8 +4286,11 @@ reshape_init (tree type, tree *initp) empty class shall have the form of an empty initializer-list {}. */ if (!brace_enclosed_p) - error ("initializer for `%T' must be brace-enclosed", - type); + { + error ("initializer for `%T' must be brace-enclosed", + type); + return error_mark_node; + } } else { @@ -4289,6 +4315,8 @@ reshape_init (tree type, tree *initp) break; field_init = reshape_init (TREE_TYPE (field), initp); + if (field_init == error_mark_node) + return error_mark_node; TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init); CONSTRUCTOR_ELTS (new_init) = field_init; /* [dcl.init.aggr] @@ -4319,10 +4347,22 @@ reshape_init (tree type, tree *initp) tree element_init; element_init = reshape_init (TREE_TYPE (type), initp); + if (element_init == error_mark_node) + return error_mark_node; TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init); CONSTRUCTOR_ELTS (new_init) = element_init; if (TREE_PURPOSE (element_init)) - index = TREE_PURPOSE (element_init); + { + tree next_index = TREE_PURPOSE (element_init); + if (TREE_CODE (next_index) == IDENTIFIER_NODE) + { + error ("name `%D' used in a GNU-style designated " + "initializer for an array", next_index); + TREE_PURPOSE (element_init) = NULL_TREE; + } + else + index = next_index; + } } } else @@ -4528,7 +4568,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) /* Set the DECL_ASSEMBLER_NAME for the variable. */ if (asmspec) { - SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec)); + change_decl_assembler_name (decl, get_identifier (asmspec)); /* The `register' keyword, when used together with an asm-specification, indicates that the variable should be placed in a particular register. */ @@ -4910,7 +4950,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) mark_referenced (DECL_ASSEMBLER_NAME (decl)); } -/* This is here for a midend callback from c-common.c */ +/* This is here for a midend callback from c-common.c. */ void finish_decl (tree decl, tree init, tree asmspec_tree) @@ -5271,7 +5311,7 @@ start_handler_parms (tree declspecs, tree declarator) int complete_array_type (tree type, tree initial_value, int do_default) { - register tree maxindex = NULL_TREE; + tree maxindex = NULL_TREE; int value = 0; if (initial_value) @@ -5663,7 +5703,9 @@ grokfndecl (tree ctype, { tree old_decl; - old_decl = check_classfn (ctype, decl); + old_decl = check_classfn (ctype, decl, + processing_template_decl + > template_class_depth (ctype)); if (old_decl && TREE_CODE (old_decl) == TEMPLATE_DECL) /* Because grokfndecl is always supposed to return a @@ -5685,7 +5727,7 @@ grokfndecl (tree ctype, if (old_decl) { - bool ok; + tree ok; /* Since we've smashed OLD_DECL to its DECL_TEMPLATE_RESULT, we must do the same to DECL. */ @@ -5972,48 +6014,35 @@ check_static_variable_definition (tree decl, tree type) tree compute_array_index_type (tree name, tree size) { + tree type = TREE_TYPE (size); tree itype; - /* If this involves a template parameter, it will be a constant at - instantiation time, but we don't know what the value is yet. - Even if no template parameters are involved, we may an expression - that is not a constant; we don't even simplify `1 + 2' when - processing a template. */ - if (processing_template_decl) + /* The array bound must be an integer type. */ + if (!dependent_type_p (type) && !INTEGRAL_TYPE_P (type)) { - /* Resolve a qualified reference to an enumerator or static - const data member of ours. */ - if (TREE_CODE (size) == SCOPE_REF - && TREE_OPERAND (size, 0) == current_class_type) - { - tree t = lookup_field (current_class_type, - TREE_OPERAND (size, 1), 0, false); - if (t) - size = t; - } - - return build_index_type (build_min (MINUS_EXPR, sizetype, - size, integer_one_node)); + if (name) + error ("size of array `%D' has non-integral type `%T'", name, type); + else + error ("size of array has non-integral type `%T'", type); + size = integer_one_node; + type = TREE_TYPE (size); } + if (abi_version_at_least (2) + /* We should only handle value dependent expressions specially. */ + ? value_dependent_expression_p (size) + /* But for abi-1, we handled all instances in templates. This + effects the manglings produced. */ + : processing_template_decl) + return build_index_type (build_min (MINUS_EXPR, sizetype, + size, integer_one_node)); + /* The size might be the result of a cast. */ STRIP_TYPE_NOPS (size); /* It might be a const variable or enumeration constant. */ size = decl_constant_value (size); - /* The array bound must be an integer type. */ - if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE - && TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE - && TREE_CODE (TREE_TYPE (size)) != BOOLEAN_TYPE) - { - if (name) - error ("size of array `%D' has non-integer type", name); - else - error ("size of array has non-integer type"); - size = integer_one_node; - } - /* Normally, the array-bound will be a constant. */ if (TREE_CODE (size) == INTEGER_CST) { @@ -6055,38 +6084,36 @@ compute_array_index_type (tree name, tree size) else error ("size of array is not an integral constant-expression"); } + else if (pedantic) + { + if (name) + pedwarn ("ISO C++ forbids variable-size array `%D'", name); + else + pedwarn ("ISO C++ forbids variable-size array"); + } - /* Compute the index of the largest element in the array. It is - one less than the number of elements in the array. */ - itype - = fold (cp_build_binary_op (MINUS_EXPR, - cp_convert (ssizetype, size), - cp_convert (ssizetype, - integer_one_node))); - - /* Check for variable-sized arrays. We allow such things as an - extension, even though they are not allowed in ANSI/ISO C++. */ - if (!TREE_CONSTANT (itype)) + if (processing_template_decl && !TREE_CONSTANT (size)) + /* A variable sized array. */ + itype = build_min (MINUS_EXPR, sizetype, size, integer_one_node); + else { - if (pedantic) + /* Compute the index of the largest element in the array. It is + one less than the number of elements in the array. */ + itype + = fold (cp_build_binary_op (MINUS_EXPR, + cp_convert (ssizetype, size), + cp_convert (ssizetype, integer_one_node))); + if (!TREE_CONSTANT (itype)) + /* A variable sized array. */ + itype = variable_size (itype); + /* Make sure that there was no overflow when creating to a signed + index type. (For example, on a 32-bit machine, an array with + size 2^32 - 1 is too big.) */ + else if (TREE_OVERFLOW (itype)) { - if (name) - pedwarn ("ISO C++ forbids variable-size array `%D'", - name); - else - pedwarn ("ISO C++ forbids variable-size array"); + error ("overflow in array dimension"); + TREE_OVERFLOW (itype) = 0; } - - /* Create a variable-sized array index type. */ - itype = variable_size (itype); - } - /* Make sure that there was no overflow when creating to a signed - index type. (For example, on a 32-bit machine, an array with - size 2^32 - 1 is too big.) */ - else if (TREE_OVERFLOW (itype)) - { - error ("overflow in array dimension"); - TREE_OVERFLOW (itype) = 0; } /* Create and return the appropriate index type. */ @@ -6348,7 +6375,7 @@ grokdeclarator (tree declarator, and get it as a string, for an error message. */ { tree *next = &declarator; - register tree decl; + tree decl; name = NULL; while (next && *next) @@ -6672,8 +6699,8 @@ grokdeclarator (tree declarator, for (spec = declspecs; spec; spec = TREE_CHAIN (spec)) { - register int i; - register tree id; + int i; + tree id; /* Certain parse errors slip through. For example, `int class;' is not caught by the parser. Try @@ -6777,7 +6804,7 @@ grokdeclarator (tree declarator, error ("two or more data types in declaration of `%s'", name); else if (TREE_CODE (id) == IDENTIFIER_NODE) { - register tree t = lookup_name (id, 1); + tree t = lookup_name (id, 1); if (!t || TREE_CODE (t) != TYPE_DECL) error ("`%s' fails to be a typedef or built in type", IDENTIFIER_POINTER (id)); @@ -7086,7 +7113,7 @@ grokdeclarator (tree declarator, else if (RIDBIT_SETP (RID_TYPEDEF, specbits)) ; else if (decl_context == FIELD - /* C++ allows static class elements */ + /* C++ allows static class elements. */ && RIDBIT_SETP (RID_STATIC, specbits)) /* C++ also allows inlines and signed and unsigned elements, but in those cases we don't come in here. */ @@ -7096,7 +7123,7 @@ grokdeclarator (tree declarator, if (decl_context == FIELD) { tree tmp = NULL_TREE; - register int op = 0; + int op = 0; if (declarator) { @@ -7472,7 +7499,7 @@ grokdeclarator (tree declarator, if (TREE_TYPE (declarator)) { - register tree typemodlist; + tree typemodlist; int erred = 0; int constp = 0; int volatilep = 0; @@ -7991,7 +8018,7 @@ grokdeclarator (tree declarator, } { - register tree decl; + tree decl; if (decl_context == PARM) { @@ -8194,7 +8221,7 @@ grokdeclarator (tree declarator, return void_type_node; } - /* Structure field. It may not be a function, except for C++ */ + /* Structure field. It may not be a function, except for C++. */ if (decl == NULL_TREE) { @@ -8419,7 +8446,7 @@ require_complete_types_for_parms (tree parms) for (; parms; parms = TREE_CHAIN (parms)) { if (VOID_TYPE_P (TREE_TYPE (parms))) - /* grokparms will have already issued an error */ + /* grokparms will have already issued an error. */ TREE_TYPE (parms) = error_mark_node; else if (complete_type_or_else (TREE_TYPE (parms), parms)) { @@ -9283,7 +9310,7 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes, bool globalize, bool template_header_p) { enum tree_code code; - register tree t; + tree t; struct cp_binding_level *b = current_binding_level; tree context = NULL_TREE; @@ -9615,7 +9642,15 @@ xref_basetypes (tree ref, tree base_list) inheritance order chain. */ copy_base_binfos (TYPE_BINFO (ref), ref, NULL_TREE); CLASSTYPE_VBASECLASSES (ref) = nreverse (CLASSTYPE_VBASECLASSES (ref)); - + + if (TYPE_FOR_JAVA (ref)) + { + if (TYPE_USES_MULTIPLE_INHERITANCE (ref)) + error ("Java class '%T' cannot have multiple bases", ref); + if (CLASSTYPE_VBASECLASSES (ref)) + error ("Java class '%T' cannot have virtual bases", ref); + } + /* Unmark all the types. */ while (i--) { @@ -9641,7 +9676,7 @@ xref_basetypes (tree ref, tree base_list) tree start_enum (tree name) { - register tree enumtype = NULL_TREE; + tree enumtype = NULL_TREE; struct cp_binding_level *b = current_binding_level; /* If this is the real definition for a previous forward reference, @@ -10217,7 +10252,19 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) /* A specialization is not used to guide overload resolution. */ if (!DECL_TEMPLATE_SPECIALIZATION (decl1) && ! DECL_FUNCTION_MEMBER_P (decl1)) - decl1 = pushdecl (decl1); + { + tree olddecl = pushdecl (decl1); + + if (olddecl == error_mark_node) + /* If something went wrong when registering the declaration, + use DECL1; we have to have a FUNCTION_DECL to use when + parsing the body of the function. */ + ; + else + /* Otherwise, OLDDECL is either a previous declaration of + the same function or DECL1 itself. */ + decl1 = olddecl; + } else { /* We need to set the DECL_CONTEXT. */ @@ -10288,8 +10335,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) If it belongs to someone else's interface, it is also external. This only affects inlines and template instantiations. */ else if (interface_unknown == 0 - && (! DECL_TEMPLATE_INSTANTIATION (decl1) - || flag_alt_external_templates)) + && ! DECL_TEMPLATE_INSTANTIATION (decl1)) { if (DECL_DECLARED_INLINE_P (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1) @@ -10310,8 +10356,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) DECL_INTERFACE_KNOWN (decl1) = 1; } else if (interface_unknown && interface_only - && (! DECL_TEMPLATE_INSTANTIATION (decl1) - || flag_alt_external_templates)) + && ! DECL_TEMPLATE_INSTANTIATION (decl1)) { /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma interface, we will have interface_only set but not @@ -10365,8 +10410,8 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) static void store_parm_decls (tree current_function_parms) { - register tree fndecl = current_function_decl; - register tree parm; + tree fndecl = current_function_decl; + tree parm; /* This is a chain of any other decls that came in among the parm declarations. If a parm is declared with enum {foo, bar} x; @@ -10642,7 +10687,7 @@ finish_function_body (tree compstmt) tree finish_function (int flags) { - register tree fndecl = current_function_decl; + tree fndecl = current_function_decl; tree fntype, ctype = NULL_TREE; int inclass_inline = (flags & 2) != 0; int nested; @@ -10797,6 +10842,7 @@ finish_function (int flags) /* Complain if there's just no return statement. */ if (warn_return_type && TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE + && !dependent_type_p (TREE_TYPE (fntype)) && !current_function_returns_value && !current_function_returns_null /* Don't complain if we abort or throw. */ && !current_function_returns_abnormally @@ -10915,7 +10961,7 @@ start_method (tree declspecs, tree declarator, tree attrlist) cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0); - /* Make a place for the parms */ + /* Make a place for the parms. */ begin_scope (sk_function_parms, fndecl); DECL_IN_AGGR_P (fndecl) = 1; @@ -10937,10 +10983,10 @@ start_method (tree declspecs, tree declarator, tree attrlist) tree finish_method (tree decl) { - register tree fndecl = decl; + tree fndecl = decl; tree old_initial; - register tree link; + tree link; if (decl == void_type_node) return decl; @@ -11128,8 +11174,6 @@ cxx_push_function_context (struct function * f) { tree fn = f->decl; - current_function_is_thunk = DECL_THUNK_P (fn); - if (DECL_SAVED_FUNCTION_DATA (fn)) { /* If we already parsed this function, and we're just expanding it diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 7be1c1402c9..4068826a9a9 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -156,36 +156,6 @@ grok_method_quals (tree ctype, tree function, tree quals) return this_quals; } -/* Warn when -fexternal-templates is used and #pragma - interface/implementation is not used all the times it should be, - inform the user. */ - -void -warn_if_unknown_interface (tree decl) -{ - static int already_warned = 0; - if (already_warned++) - return; - - if (flag_alt_external_templates) - { - tree til = tinst_for_decl (); - location_t saved_loc = input_location; - - if (til) - { - input_line = TINST_LINE (til); - input_filename = TINST_FILE (til); - } - warning ("template `%#D' instantiated in file without #pragma interface", - decl); - input_location = saved_loc; - } - else - cp_warning_at ("template `%#D' defined in file without #pragma interface", - decl); -} - /* A subroutine of the parser, to handle a component list. */ void @@ -622,12 +592,20 @@ check_java_method (tree method) bool jerr = false; tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method)); tree ret_type = TREE_TYPE (TREE_TYPE (method)); + if (!acceptable_java_type (ret_type)) { error ("Java method '%D' has non-Java return type `%T'", method, ret_type); jerr = true; } + + arg_types = TREE_CHAIN (arg_types); + if (DECL_HAS_IN_CHARGE_PARM_P (method)) + arg_types = TREE_CHAIN (arg_types); + if (DECL_HAS_VTT_PARM_P (method)) + arg_types = TREE_CHAIN (arg_types); + for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types)) { tree type = TREE_VALUE (arg_types); @@ -643,10 +621,12 @@ check_java_method (tree method) /* Sanity check: report error if this function FUNCTION is not really a member of the class (CTYPE) it is supposed to belong to. - CNAME is the same here as it is for grokclassfn above. */ + CNAME is the same here as it is for grokclassfn above. + TEMPLATE_HEADER_P is true when this declaration comes with a + template header. */ tree -check_classfn (tree ctype, tree function) +check_classfn (tree ctype, tree function, bool template_header_p) { int ix; int is_template; @@ -669,7 +649,7 @@ check_classfn (tree ctype, tree function) /* OK, is this a definition of a member template? */ is_template = (TREE_CODE (function) == TEMPLATE_DECL - || (processing_template_decl - template_class_depth (ctype))); + || template_header_p); ix = lookup_fnfields_1 (complete_type (ctype), DECL_CONSTRUCTOR_P (function) ? ctor_identifier : @@ -872,10 +852,8 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, init = NULL_TREE; value = grokdeclarator (declarator, declspecs, FIELD, init != 0, &attrlist); - if (! value || value == error_mark_node) + if (! value || error_operand_p (value)) /* friend or constructor went bad. */ - return value; - if (TREE_TYPE (value) == error_mark_node) return error_mark_node; if (TREE_CODE (value) == TYPE_DECL && init) @@ -971,7 +949,11 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, if (processing_template_decl && (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL)) - value = push_template_decl (value); + { + value = push_template_decl (value); + if (error_operand_p (value)) + return error_mark_node; + } if (attrlist) cplus_decl_attributes (&value, attrlist, 0); @@ -1000,7 +982,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, /* This must override the asm specifier which was placed by grokclassfn. Lay this out fresh. */ SET_DECL_RTL (value, NULL_RTX); - SET_DECL_ASSEMBLER_NAME (value, get_identifier (asmspec)); + change_decl_assembler_name (value, get_identifier (asmspec)); } if (!DECL_FRIEND_P (value)) grok_special_member_properties (value); @@ -1025,8 +1007,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, tree grokbitfield (tree declarator, tree declspecs, tree width) { - register tree value = grokdeclarator (declarator, declspecs, BITFIELD, - 0, NULL); + tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL); if (! value) return NULL_TREE; /* friends went bad. */ @@ -1295,12 +1276,12 @@ coerce_new_type (tree type) { case 2: args = tree_cons (NULL_TREE, size_type_node, args); - /* FALLTHROUGH */ + /* Fall through. */ case 1: type = build_exception_variant (build_function_type (ptr_type_node, args), TYPE_RAISES_EXCEPTIONS (type)); - /* FALLTHROUGH */ + /* Fall through. */ default:; } return type; @@ -1329,12 +1310,12 @@ coerce_delete_type (tree type) { case 2: args = tree_cons (NULL_TREE, ptr_type_node, args); - /* FALLTHROUGH */ + /* Fall through. */ case 1: type = build_exception_variant (build_function_type (void_type_node, args), TYPE_RAISES_EXCEPTIONS (type)); - /* FALLTHROUGH */ + /* Fall through. */ default:; } diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index b48f25b7752..17b30c94367 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -230,11 +230,6 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("tynm", TREE_TYPE (t)); return true; } - else if (t == anonymous_namespace_name) - { - dump_string (di, "unnamed"); - return true; - } break; case OFFSET_TYPE: diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 1c44324c640..bb6ff341572 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -331,7 +331,7 @@ dump_type (tree t, int flags) ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); break; } - /* else fallthrough */ + /* Else fall through. */ case TEMPLATE_DECL: case NAMESPACE_DECL: @@ -644,7 +644,7 @@ dump_type_suffix (tree t, int flags) dump_type_suffix (TREE_TYPE (t), flags); break; - /* Can only be reached through function pointer */ + /* Can only be reached through function pointer. */ case FUNCTION_TYPE: case METHOD_TYPE: { @@ -788,7 +788,7 @@ dump_decl (tree t, int flags) dump_type (DECL_CONTEXT (t), flags); break; } - /* else fall through */ + /* Else fall through. */ case FIELD_DECL: case PARM_DECL: dump_simple_decl (t, TREE_TYPE (t), flags); @@ -805,7 +805,7 @@ dump_decl (tree t, int flags) else { dump_scope (CP_DECL_CONTEXT (t), flags); - if (DECL_NAME (t) == anonymous_namespace_name) + if (DECL_NAME (t) == NULL_TREE) pp_identifier (cxx_pp, ""); else pp_tree_identifier (cxx_pp, DECL_NAME (t)); @@ -1050,7 +1050,7 @@ dump_function_decl (tree t, int flags) if (DECL_CLASS_SCOPE_P (t)) cname = DECL_CONTEXT (t); - /* this is for partially instantiated template methods */ + /* This is for partially instantiated template methods. */ else if (TREE_CODE (fntype) == METHOD_TYPE) cname = TREE_TYPE (TREE_VALUE (parmtypes)); @@ -1269,7 +1269,7 @@ dump_template_parms (tree info, int primary, int flags) pp_template_argument_list_end (cxx_pp); } -/* Print out a list of initializers (subr of dump_expr) */ +/* Print out a list of initializers (subr of dump_expr). */ static void dump_expr_list (tree l, int flags) @@ -1596,7 +1596,7 @@ dump_expr (tree t, int flags) pp_right_paren (cxx_pp); break; } - /* else FALLTHRU */ + /* Else fall through. */ } dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); break; diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 1dc149a8685..03a3274e90a 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -296,7 +296,7 @@ choose_personality_routine (enum languages lang) return; case chose_none: - ; /* proceed to language selection */ + ; /* Proceed to language selection. */ } switch (lang) @@ -645,7 +645,12 @@ build_throw (tree exp) tmp = build_function_type (ptr_type_node, tmp); fn = push_throw_library_fn (fn, tmp); } - + else if (really_overloaded_fn (fn)) + { + error ("`%D' should never be overloaded", fn); + return error_mark_node; + } + fn = OVL_CURRENT (fn); exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE)); } else if (exp) @@ -887,7 +892,7 @@ can_convert_eh (tree to, tree from) if (TREE_CODE (to) == VOID_TYPE) return 1; - /* else fall through */ + /* Else fall through. */ } if (CLASS_TYPE_P (to) && CLASS_TYPE_P (from) diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 630f0789073..06a2e0c2146 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -78,8 +78,8 @@ rtx cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier) { tree type = TREE_TYPE (exp); - register enum machine_mode mode = TYPE_MODE (type); - register enum tree_code code = TREE_CODE (exp); + enum machine_mode mode = TYPE_MODE (type); + enum tree_code code = TREE_CODE (exp); rtx ret; /* No sense saving up arithmetic to be done diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 1b3d4b46233..46616b13608 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -39,7 +39,7 @@ int is_friend (tree type, tree supplicant) { int declp; - register tree list; + tree list; tree context; if (supplicant == NULL_TREE || type == NULL_TREE) @@ -60,25 +60,15 @@ is_friend (tree type, tree supplicant) tree friends = FRIEND_DECLS (list); for (; friends ; friends = TREE_CHAIN (friends)) { - if (TREE_VALUE (friends) == NULL_TREE) - continue; + tree friend = TREE_VALUE (friends); - if (supplicant == TREE_VALUE (friends)) - return 1; + if (friend == NULL_TREE) + continue; - /* Temporarily, we are more lenient to deal with - nested friend functions, for which there can be - more than one FUNCTION_DECL, despite being the - same function. When that's fixed, this bit can - go. */ - if (DECL_FUNCTION_MEMBER_P (supplicant) - && same_type_p (TREE_TYPE (supplicant), - TREE_TYPE (TREE_VALUE (friends)))) + if (supplicant == friend) return 1; - if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL - && is_specialization_of (supplicant, - TREE_VALUE (friends))) + if (is_specialization_of_friend (supplicant, friend)) return 1; } break; @@ -158,12 +148,8 @@ add_friend (tree type, tree decl, bool complain) if (decl == TREE_VALUE (friends)) { if (complain) - { - warning ("`%D' is already a friend of class `%T'", - decl, type); - cp_warning_at ("previous friend declaration of `%D'", - TREE_VALUE (friends)); - } + warning ("`%D' is already a friend of class `%T'", + decl, type); return; } } @@ -342,8 +328,6 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls, tree attrlist, enum overload_flags flags, tree quals, int funcdef_flag) { - int is_friend_template = 0; - /* Every decl that gets here is a friend of something. */ DECL_FRIEND_P (decl) = 1; @@ -357,39 +341,70 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls, if (TREE_CODE (decl) != FUNCTION_DECL) abort (); - is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P (); - if (ctype) { + /* CLASS_TEMPLATE_DEPTH counts the number of template headers for + the enclosing class. FRIEND_DEPTH counts the number of template + headers used for this friend declaration. TEMPLATE_MEMBER_P is + true if a template header in FRIEND_DEPTH is intended for + DECLARATOR. For example, the code + + template struct A { + template struct B { + template template + friend void C::f(W); + }; + }; + + will eventually give the following results + + 1. CLASS_TEMPLATE_DEPTH equals 2 (for `T' and `U'). + 2. FRIEND_DEPTH equals 2 (for `V' and `W'). + 3. TEMPLATE_MEMBER_P is true (for `W'). */ + + int class_template_depth = template_class_depth (current_class_type); + int friend_depth = processing_template_decl - class_template_depth; + /* We will figure this out later. */ + bool template_member_p = false; + tree cname = TYPE_NAME (ctype); if (TREE_CODE (cname) == TYPE_DECL) cname = DECL_NAME (cname); /* A method friend. */ - if (flags == NO_SPECIAL && ctype && declarator == cname) + if (flags == NO_SPECIAL && declarator == cname) DECL_CONSTRUCTOR_P (decl) = 1; /* This will set up DECL_ARGUMENTS for us. */ grokclassfn (ctype, decl, flags, quals); - if (is_friend_template) - decl = DECL_TI_TEMPLATE (push_template_decl (decl)); - else if (DECL_TEMPLATE_INFO (decl)) - ; - else if (template_class_depth (current_class_type)) - decl = push_template_decl_real (decl, /*is_friend=*/1); - - /* We can't do lookup in a type that involves template - parameters. Instead, we rely on tsubst_friend_function - to check the validity of the declaration later. */ - if (processing_template_decl) - add_friend (current_class_type, decl, /*complain=*/true); + if (friend_depth) + { + if (!uses_template_parms_level (ctype, class_template_depth + + friend_depth)) + template_member_p = true; + } + /* A nested class may declare a member of an enclosing class to be a friend, so we do lookup here even if CTYPE is in the process of being defined. */ - else if (COMPLETE_TYPE_P (ctype) || TYPE_BEING_DEFINED (ctype)) + if (class_template_depth + || COMPLETE_TYPE_P (ctype) + || TYPE_BEING_DEFINED (ctype)) { - decl = check_classfn (ctype, decl); + if (DECL_TEMPLATE_INFO (decl)) + /* DECL is a template specialization. No need to + build a new TEMPLATE_DECL. */ + ; + else if (class_template_depth) + /* We rely on tsubst_friend_function to check the + validity of the declaration later. */ + decl = push_template_decl_real (decl, /*is_friend=*/1); + else + decl = check_classfn (ctype, decl, template_member_p); + + if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL) + decl = DECL_TI_TEMPLATE (decl); if (decl) add_friend (current_class_type, decl, /*complain=*/true); @@ -402,6 +417,8 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls, @@ or possibly a friend from a base class ?!? */ else if (TREE_CODE (decl) == FUNCTION_DECL) { + int is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P (); + /* Friends must all go through the overload machinery, even though they may not technically be overloaded. @@ -459,6 +476,9 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls, } } + if (decl == error_mark_node) + return error_mark_node; + add_friend (current_class_type, is_friend_template ? DECL_TI_TEMPLATE (decl) : decl, /*complain=*/true); diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 4951ff3211e..e6c9ee6892a 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -302,13 +302,6 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, { arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; added_libraries++; -#ifdef USE_LIBUNWIND_EXCEPTIONS -# ifndef LIBUNWIND -# define LIBUNWIND "-lunwind" -# endif - arglist[j++] = LIBUNWIND; - added_libraries++; -#endif } if (saw_math) arglist[j++] = saw_math; diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 735215377a3..f717fb23507 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -514,6 +514,7 @@ sort_mem_initializers (tree t, tree mem_inits) cp_warning_at (" `%#D'", subobject); else warning (" base `%T'", subobject); + warning (" when initialized here"); } /* Look again, from the beginning of the list. */ @@ -1121,7 +1122,7 @@ build_aggr_init (tree exp, tree init, int flags) } if (TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == PARM_DECL) - /* just know that we've seen something for this node */ + /* Just know that we've seen something for this node. */ TREE_USED (exp) = 1; TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type); @@ -1499,7 +1500,7 @@ build_offset_ref (tree type, tree name, bool address_p) if (TREE_CODE (t) != TEMPLATE_ID_EXPR && !really_overloaded_fn (t)) { - /* Get rid of a potential OVERLOAD around it */ + /* Get rid of a potential OVERLOAD around it. */ t = OVL_CURRENT (t); /* Unique functions are handled easily. */ @@ -1687,7 +1688,7 @@ build_new (tree placement, tree decl, tree init, int use_global_new) if (absdcl && TREE_CODE (absdcl) == ARRAY_REF) { - /* probably meant to be a vec new */ + /* Probably meant to be a vec new. */ tree this_nelts; while (TREE_OPERAND (absdcl, 0) @@ -1842,7 +1843,7 @@ build_java_class_ref (tree type) jclass_node = TREE_TYPE (jclass_node); } - /* Mangle the class$ field */ + /* Mangle the class$ field. */ { tree field; for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) @@ -2005,11 +2006,18 @@ build_new_1 (tree exp) tree class_size = size_in_bytes (true_type); static const char alloc_name[] = "_Jv_AllocObject"; use_java_new = 1; - alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name)); - if (alloc_decl == NULL_TREE) - fatal_error ("call to Java constructor with `%s' undefined", - alloc_name); - + if (!get_global_value_if_present (get_identifier (alloc_name), + &alloc_decl)) + { + error ("call to Java constructor with `%s' undefined", alloc_name); + return error_mark_node; + } + else if (really_overloaded_fn (alloc_decl)) + { + error ("`%D' should never be overloaded", alloc_decl); + return error_mark_node; + } + alloc_decl = OVL_CURRENT (alloc_decl); class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); alloc_call = (build_function_call (alloc_decl, @@ -2060,13 +2068,22 @@ build_new_1 (tree exp) if (alloc_call == error_mark_node) return error_mark_node; - /* The ALLOC_CALL should be a CALL_EXPR -- or a COMPOUND_EXPR whose - right-hand-side is ultimately a CALL_EXPR -- and the first - operand should be the address of a known FUNCTION_DECL. */ - t = alloc_call; - while (TREE_CODE (t) == COMPOUND_EXPR) - t = TREE_OPERAND (t, 1); - alloc_fn = get_callee_fndecl (t); + /* In the simple case, we can stop now. */ + pointer_type = build_pointer_type (type); + if (!cookie_size && !is_initialized) + return build_nop (pointer_type, alloc_call); + + /* While we're working, use a pointer to the type we've actually + allocated. Store the result of the call in a variable so that we + can use it more than once. */ + full_pointer_type = build_pointer_type (full_type); + alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call)); + alloc_node = TARGET_EXPR_SLOT (alloc_expr); + + /* Strip any COMPOUND_EXPRs from ALLOC_CALL. */ + while (TREE_CODE (alloc_call) == COMPOUND_EXPR) + alloc_call = TREE_OPERAND (alloc_call, 1); + alloc_fn = get_callee_fndecl (alloc_call); my_friendly_assert (alloc_fn != NULL_TREE, 20020325); /* Now, check to see if this function is actually a placement @@ -2083,6 +2100,27 @@ build_new_1 (tree exp) = (type_num_arguments (TREE_TYPE (alloc_fn)) > 1 || varargs_function_p (alloc_fn)); + /* Preevaluate the placement args so that we don't reevaluate them for a + placement delete. */ + if (placement_allocation_fn_p) + { + tree inits = NULL_TREE; + t = TREE_CHAIN (TREE_OPERAND (alloc_call, 1)); + for (; t; t = TREE_CHAIN (t)) + if (TREE_SIDE_EFFECTS (TREE_VALUE (t))) + { + tree init; + TREE_VALUE (t) = stabilize_expr (TREE_VALUE (t), &init); + if (inits) + inits = build (COMPOUND_EXPR, void_type_node, inits, init); + else + inits = init; + } + if (inits) + alloc_expr = build (COMPOUND_EXPR, TREE_TYPE (alloc_expr), inits, + alloc_expr); + } + /* unless an allocation function is declared with an empty excep- tion-specification (_except.spec_), throw(), it indicates failure to allocate storage by throwing a bad_alloc exception (clause _except_, @@ -2096,18 +2134,6 @@ build_new_1 (tree exp) nothrow = TYPE_NOTHROW_P (TREE_TYPE (alloc_fn)); check_new = (flag_check_new || nothrow) && ! use_java_new; - /* In the simple case, we can stop now. */ - pointer_type = build_pointer_type (type); - if (!cookie_size && !is_initialized) - return build_nop (pointer_type, alloc_call); - - /* While we're working, use a pointer to the type we've actually - allocated. Store the result of the call in a variable so that we - can use it more than once. */ - full_pointer_type = build_pointer_type (full_type); - alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call)); - alloc_node = TARGET_EXPR_SLOT (alloc_expr); - if (cookie_size) { tree cookie; @@ -2578,11 +2604,13 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) num_initialized_elts++; + current_stmt_tree ()->stmts_are_full_exprs_p = 1; if (IS_AGGR_TYPE (type) || TREE_CODE (type) == ARRAY_TYPE) finish_expr_stmt (build_aggr_init (baseref, elt, 0)); else finish_expr_stmt (build_modify_expr (baseref, NOP_EXPR, elt)); + current_stmt_tree ()->stmts_are_full_exprs_p = 0; finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0)); finish_expr_stmt (build_unary_op (PREDECREMENT_EXPR, iterator, 0)); @@ -2828,7 +2856,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); - /* throw away const and volatile on target type of addr */ + /* Throw away const and volatile on target type of addr. */ addr = convert_force (build_pointer_type (type), addr, 0); } else if (TREE_CODE (type) == ARRAY_TYPE) @@ -3088,7 +3116,8 @@ build_vec_delete (tree base, tree maxindex, } else if (TREE_CODE (type) == ARRAY_TYPE) { - /* get the total number of things in the array, maxindex is a bad name */ + /* Get the total number of things in the array, maxindex is a + bad name. */ maxindex = array_type_nelts_total (type); type = strip_array_types (type); base = build_unary_op (ADDR_EXPR, base, 1); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6d5482330b2..d22f5b063c1 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -231,7 +231,7 @@ init_operators (void) struct resword { const char *const word; - const ENUM_BITFIELD(rid) rid : 16; + ENUM_BITFIELD(rid) const rid : 16; const unsigned int disable : 16; }; @@ -266,6 +266,8 @@ static const struct resword reswords[] = { "__inline__", RID_INLINE, 0 }, { "__label__", RID_LABEL, 0 }, { "__null", RID_NULL, 0 }, + { "__offsetof", RID_OFFSETOF, 0 }, + { "__offsetof__", RID_OFFSETOF, 0 }, { "__real", RID_REALPART, 0 }, { "__real__", RID_REALPART, 0 }, { "__restrict", RID_RESTRICT, 0 }, @@ -403,21 +405,7 @@ cxx_init (void) current_function_decl = NULL; - class_type_node = build_int_2 (class_type, 0); - TREE_TYPE (class_type_node) = class_type_node; - ridpointers[(int) RID_CLASS] = class_type_node; - - record_type_node = build_int_2 (record_type, 0); - TREE_TYPE (record_type_node) = record_type_node; - ridpointers[(int) RID_STRUCT] = record_type_node; - - union_type_node = build_int_2 (union_type, 0); - TREE_TYPE (union_type_node) = union_type_node; - ridpointers[(int) RID_UNION] = union_type_node; - - enum_type_node = build_int_2 (enum_type, 0); - TREE_TYPE (enum_type_node) = enum_type_node; - ridpointers[(int) RID_ENUM] = enum_type_node; + class_type_node = ridpointers[(int) RID_CLASS]; cxx_init_decl_processing (); @@ -448,18 +436,9 @@ cxx_init (void) void extract_interface_info (void) { - struct c_fileinfo *finfo = 0; - - if (flag_alt_external_templates) - { - tree til = tinst_for_decl (); - - if (til) - finfo = get_fileinfo (TINST_FILE (til)); - } - if (!finfo) - finfo = get_fileinfo (input_filename); + struct c_fileinfo *finfo; + finfo = get_fileinfo (input_filename); interface_only = finfo->interface_only; interface_unknown = finfo->interface_unknown; } @@ -836,7 +815,7 @@ copy_type (tree type) tree cxx_make_type (enum tree_code code) { - register tree t = make_node (code); + tree t = make_node (code); /* Create lang_type structure. */ if (IS_AGGR_TYPE_CODE (code) diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 15334f321e3..b34c309c827 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -158,7 +158,7 @@ static void mangle_call_offset (const tree, const tree); /* Functions for emitting mangled representations of things. */ -static void write_mangled_name (const tree); +static void write_mangled_name (const tree, bool); static void write_encoding (const tree); static void write_name (tree, const int); static void write_unscoped_name (const tree); @@ -602,27 +602,66 @@ find_substitution (tree node) } -/* ::= _Z */ +/* TOP_LEVEL is true, if this is being called at outermost level of + mangling. It should be false when mangling a decl appearing in an + expression within some other mangling. + + ::= _Z */ static inline void -write_mangled_name (const tree decl) +write_mangled_name (const tree decl, bool top_level) { MANGLE_TRACE_TREE ("mangled-name", decl); - if (DECL_LANG_SPECIFIC (decl) - && DECL_EXTERN_C_FUNCTION_P (decl) - && ! DECL_OVERLOADED_OPERATOR_P (decl)) - /* The standard notes: - "The of an extern "C" function is treated like - global-scope data, i.e. as its without a type." - We cannot write overloaded operators that way though, - because it contains characters invalid in assembler. */ - write_source_name (DECL_NAME (decl)); + if (/* The names of `extern "C"' functions are not mangled. */ + DECL_EXTERN_C_FUNCTION_P (decl) + /* But overloaded operator names *are* mangled. */ + && !DECL_OVERLOADED_OPERATOR_P (decl)) + { + unmangled_name:; + + if (top_level) + write_string (IDENTIFIER_POINTER (DECL_NAME (decl))); + else + { + /* The standard notes: "The of an extern "C" + function is treated like global-scope data, i.e. as its + without a type." We cannot write + overloaded operators that way though, because it contains + characters invalid in assembler. */ + if (abi_version_at_least (2)) + write_string ("_Z"); + else + G.need_abi_warning = true; + write_source_name (DECL_NAME (decl)); + } + } + else if (TREE_CODE (decl) == VAR_DECL + /* The names of global variables aren't mangled. */ + && (CP_DECL_CONTEXT (decl) == global_namespace + /* And neither are `extern "C"' variables. */ + || DECL_EXTERN_C_P (decl))) + { + if (top_level || abi_version_at_least (2)) + goto unmangled_name; + else + { + G.need_abi_warning = true; + goto mangled_name; + } + } else - /* C++ name; needs to be mangled. */ { + mangled_name:; write_string ("_Z"); write_encoding (decl); + if (DECL_LANG_SPECIFIC (decl) + && (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl) + || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))) + /* We need a distinct mangled name for these entities, but + we should never actually output it. So, we append some + characters the assembler won't like. */ + write_string (" *INTERNAL* "); } } @@ -991,6 +1030,8 @@ write_unqualified_name (const tree decl) write_special_name_constructor (decl); else if (DECL_LANG_SPECIFIC (decl) != NULL && DECL_DESTRUCTOR_P (decl)) write_special_name_destructor (decl); + else if (DECL_NAME (decl) == NULL_TREE) + write_source_name (DECL_ASSEMBLER_NAME (decl)); else if (DECL_CONV_FN_P (decl)) { /* Conversion operator. Handle it right here. @@ -1804,37 +1845,25 @@ write_class_enum_type (const tree type) static void write_template_args (tree args) { + int i; + int length = TREE_VEC_LENGTH (args); + MANGLE_TRACE_TREE ("template-args", args); write_char ('I'); - if (TREE_CODE (args) == TREE_VEC) - { - int i; - int length = TREE_VEC_LENGTH (args); - my_friendly_assert (length > 0, 20000422); + my_friendly_assert (length > 0, 20000422); - if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC) - { - /* We have nested template args. We want the innermost template - argument list. */ - args = TREE_VEC_ELT (args, length - 1); - length = TREE_VEC_LENGTH (args); - } - for (i = 0; i < length; ++i) - write_template_arg (TREE_VEC_ELT (args, i)); - } - else + if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC) { - my_friendly_assert (TREE_CODE (args) == TREE_LIST, 20021014); - - while (args) - { - write_template_arg (TREE_VALUE (args)); - args = TREE_CHAIN (args); - } + /* We have nested template args. We want the innermost template + argument list. */ + args = TREE_VEC_ELT (args, length - 1); + length = TREE_VEC_LENGTH (args); } - + for (i = 0; i < length; ++i) + write_template_arg (TREE_VEC_ELT (args, i)); + write_char ('E'); } @@ -1893,7 +1922,7 @@ write_expression (tree expr) if (code == CONST_DECL) G.need_abi_warning = 1; write_char ('L'); - write_mangled_name (expr); + write_mangled_name (expr, false); write_char ('E'); } else if (TREE_CODE (expr) == SIZEOF_EXPR @@ -2112,7 +2141,7 @@ write_template_arg (tree node) MANGLE_TRACE_TREE ("template-arg", node); - /* A template template paramter's argument list contains TREE_LIST + /* A template template parameter's argument list contains TREE_LIST nodes of which the value field is the the actual argument. */ if (code == TREE_LIST) { @@ -2124,6 +2153,20 @@ write_template_arg (tree node) code = TREE_CODE (node); } } + + if (TREE_CODE (node) == NOP_EXPR + && TREE_CODE (TREE_TYPE (node)) == REFERENCE_TYPE) + { + /* Template parameters can be of reference type. To maintain + internal consistency, such arguments use a conversion from + address of object to reference type. */ + my_friendly_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR, + 20031215); + if (abi_version_at_least (2)) + node = TREE_OPERAND (TREE_OPERAND (node, 0), 0); + else + G.need_abi_warning = 1; + } if (TYPE_P (node)) write_type (node); @@ -2199,7 +2242,20 @@ write_array_type (const tree type) write_unsigned_number (tree_low_cst (max, 1)); } else - write_expression (TREE_OPERAND (max, 0)); + { + max = TREE_OPERAND (max, 0); + if (!abi_version_at_least (2)) + { + /* value_dependent_expression_p presumes nothing is + dependent when PROCESSING_TEMPLATE_DECL is zero. */ + ++processing_template_decl; + if (!value_dependent_expression_p (max)) + G.need_abi_warning = 1; + --processing_template_decl; + } + write_expression (max); + } + } write_char ('_'); write_type (TREE_TYPE (type)); @@ -2363,29 +2419,9 @@ mangle_decl_string (const tree decl) if (TREE_CODE (decl) == TYPE_DECL) write_type (TREE_TYPE (decl)); - else if (/* The names of `extern "C"' functions are not mangled. */ - (DECL_EXTERN_C_FUNCTION_P (decl) - /* But overloaded operator names *are* mangled. */ - && !DECL_OVERLOADED_OPERATOR_P (decl)) - /* The names of global variables aren't mangled either. */ - || (TREE_CODE (decl) == VAR_DECL - && CP_DECL_CONTEXT (decl) == global_namespace) - /* And neither are `extern "C"' variables. */ - || (TREE_CODE (decl) == VAR_DECL - && DECL_EXTERN_C_P (decl))) - write_string (IDENTIFIER_POINTER (DECL_NAME (decl))); else - { - write_mangled_name (decl); - if (DECL_LANG_SPECIFIC (decl) - && (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl) - || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))) - /* We need a distinct mangled name for these entities, but - we should never actually output it. So, we append some - characters the assembler won't like. */ - write_string (" *INTERNAL* "); - } - + write_mangled_name (decl, true); + result = finish_mangling (/*warn=*/true); if (DEBUG_MANGLE) fprintf (stderr, "mangle_decl_string = '%s'\n\n", result); @@ -2600,8 +2636,8 @@ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset, } /* This hash table maps TYPEs to the IDENTIFIER for a conversion - operator to TYPE. The nodes are TREE_LISTs whose TREE_PURPOSE is - the TYPE and whose TREE_VALUE is the IDENTIFIER. */ + operator to TYPE. The nodes are IDENTIFIERs whose TREE_TYPE is the + TYPE. */ static GTY ((param_is (union tree_node))) htab_t conv_type_names; @@ -2610,7 +2646,7 @@ static GTY ((param_is (union tree_node))) htab_t conv_type_names; static hashval_t hash_type (const void *val) { - return htab_hash_pointer (TREE_PURPOSE ((tree) val)); + return (hashval_t) TYPE_UID (TREE_TYPE ((tree) val)); } /* Compare VAL1 (a node in the table) with VAL2 (a TYPE). */ @@ -2618,7 +2654,7 @@ hash_type (const void *val) static int compare_type (const void *val1, const void *val2) { - return TREE_PURPOSE ((tree) val1) == (tree) val2; + return TREE_TYPE ((tree) val1) == (tree) val2; } /* Return an identifier for the mangled unqualified name for a @@ -2630,29 +2666,32 @@ mangle_conv_op_name_for_type (const tree type) { void **slot; tree identifier; - char buffer[64]; if (conv_type_names == NULL) conv_type_names = htab_create_ggc (31, &hash_type, &compare_type, NULL); slot = htab_find_slot_with_hash (conv_type_names, type, - htab_hash_pointer (type), INSERT); - if (*slot) - return TREE_VALUE ((tree) *slot); - - /* Create a unique name corresponding to TYPE. */ - sprintf (buffer, "operator %lu", - (unsigned long) htab_elements (conv_type_names)); - identifier = get_identifier (buffer); - *slot = build_tree_list (type, identifier); + (hashval_t) TYPE_UID (type), INSERT); + identifier = (tree)*slot; + if (!identifier) + { + char buffer[64]; + + /* Create a unique name corresponding to TYPE. */ + sprintf (buffer, "operator %lu", + (unsigned long) htab_elements (conv_type_names)); + identifier = get_identifier (buffer); + *slot = identifier; + + /* Hang TYPE off the identifier so it can be found easily later + when performing conversions. */ + TREE_TYPE (identifier) = type; + + /* Set bits on the identifier so we know later it's a conversion. */ + IDENTIFIER_OPNAME_P (identifier) = 1; + IDENTIFIER_TYPENAME_P (identifier) = 1; + } - /* Set bits on the identifier so we know later it's a conversion. */ - IDENTIFIER_OPNAME_P (identifier) = 1; - IDENTIFIER_TYPENAME_P (identifier) = 1; - /* Hang TYPE off the identifier so it can be found easily later when - performing conversions. */ - TREE_TYPE (identifier) = type; - return identifier; } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index c6651e84880..f06896b0451 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -125,19 +125,24 @@ make_thunk (tree function, bool this_adjusting, will be a BINFO. */ for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk)) if (DECL_THIS_THUNK_P (thunk) == this_adjusting - && THUNK_FIXED_OFFSET (thunk) == d - && (this_adjusting - ? (!THUNK_VIRTUAL_OFFSET (thunk) == !virtual_offset - && (!virtual_offset - || tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk), - virtual_offset))) - : THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset)) + && THUNK_FIXED_OFFSET (thunk) == d + && !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk) + && (!virtual_offset + || (this_adjusting + ? tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk), + virtual_offset) + : THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset))) return thunk; /* All thunks must be created before FUNCTION is actually emitted; the ABI requires that all thunks be emitted together with the function to which they transfer control. */ my_friendly_assert (!TREE_ASM_WRITTEN (function), 20021025); + /* Likewise, we can only be adding thunks to a function declared in + the class currently being laid out. */ + my_friendly_assert (TYPE_SIZE (DECL_CONTEXT (function)) + && TYPE_BEING_DEFINED (DECL_CONTEXT (function)), + 20031211); thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function)); DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function); @@ -154,6 +159,7 @@ make_thunk (tree function, bool this_adjusting, THUNK_TARGET (thunk) = function; THUNK_FIXED_OFFSET (thunk) = d; THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset; + THUNK_ALIAS (thunk) = NULL_TREE; /* The thunk itself is not a constructor or destructor, even if the thing it is thunking to is. */ @@ -213,7 +219,7 @@ finish_thunk (tree thunk) if (DECL_NAME (cov_probe) == name) { my_friendly_assert (!DECL_THUNKS (thunk), 20031023); - THUNK_ALIAS (thunk) = (THUNK_ALIAS_P (cov_probe) + THUNK_ALIAS (thunk) = (THUNK_ALIAS (cov_probe) ? THUNK_ALIAS (cov_probe) : cov_probe); break; } @@ -335,7 +341,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) /* We should never be using an alias, always refer to the aliased thunk. */ - my_friendly_assert (!THUNK_ALIAS_P (thunk_fndecl), 20031023); + my_friendly_assert (!THUNK_ALIAS (thunk_fndecl), 20031023); if (TREE_ASM_WRITTEN (thunk_fndecl)) return; @@ -383,6 +389,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) /* The linkage of the function may have changed. FIXME in linkage rewrite. */ TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function); + DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); if (flag_syntax_only) { @@ -480,6 +487,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) t = tree_cons (NULL_TREE, a, t); t = nreverse (t); t = build_call (alias, t); + CALL_FROM_THUNK_P (t) = 1; if (!this_adjusting) t = thunk_adjust (t, /*this_adjusting=*/0, fixed_offset, virtual_offset); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index add0d55d405..0be758f450d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -48,6 +48,10 @@ static tree push_using_directive (tree); tree global_namespace; +/* The name of the anonymous namespace, throughout this translation + unit. */ +GTY(()) tree anonymous_namespace_name; + /* Compute the chain index of a binding_entry given the HASH value of its name and the total COUNT of chains. COUNT is assumed to be a power @@ -435,10 +439,13 @@ supplement_binding (cxx_binding *binding, tree decl) if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)) /* The new name is the type name. */ binding->type = decl; - else if (!bval) - /* This situation arises when push_class_level_binding moves an - inherited type-binding out of the way to make room for a new - value binding. */ + else if (!bval || bval == error_mark_node) + /* VALUE is null when push_class_level_binding moves an inherited + type-binding out of the way to make room for a new value binding. + It is an error_mark_node when DECL's name has been used in a + non-class scope prior declaration. In that case, we should have + already issued a diagnostic; for graceful error recovery purpose, + pretend this was the intended declaration for that name. */ binding->value = decl; else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)) { @@ -518,7 +525,7 @@ add_decl_to_level (tree decl, cxx_scope *b) b->names = decl; b->names_size++; - /* If appropriate, add decl to separate list of statics */ + /* If appropriate, add decl to separate list of statics. */ if (b->kind == sk_namespace) if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) || (TREE_CODE (decl) == FUNCTION_DECL @@ -538,8 +545,8 @@ add_decl_to_level (tree decl, cxx_scope *b) tree pushdecl (tree x) { - register tree t; - register tree name; + tree t; + tree name; int need_new_binding; timevar_push (TV_NAME_LOOKUP); @@ -555,7 +562,7 @@ pushdecl (tree x) if (current_function_decl && x != current_function_decl /* A local declaration for a function doesn't constitute nesting. */ - && !(TREE_CODE (x) == FUNCTION_DECL && !DECL_INITIAL (x)) + && TREE_CODE (x) != FUNCTION_DECL /* A local declaration for an `extern' variable is in the scope of the current namespace, not the current function. */ @@ -583,8 +590,7 @@ pushdecl (tree x) /* In case this decl was explicitly namespace-qualified, look it up in its namespace context. */ - if (TREE_CODE (x) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (x) - && namespace_bindings_p ()) + if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ()) t = namespace_binding (name, DECL_CONTEXT (x)); else t = lookup_name_current_level (name); @@ -677,33 +683,38 @@ pushdecl (tree x) /* Throw away the redeclaration. */ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); } - else if (TREE_CODE (t) != TREE_CODE (x)) - { - if (duplicate_decls (x, t)) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); - } - else if (duplicate_decls (x, t)) - { - if (TREE_CODE (t) == TYPE_DECL) - SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t)); - else if (TREE_CODE (t) == FUNCTION_DECL) - check_default_args (t); - - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); - } - else if (DECL_MAIN_P (x)) + else { - /* A redeclaration of main, but not a duplicate of the - previous one. - - [basic.start.main] + tree olddecl = duplicate_decls (x, t); + + /* If the redeclaration failed, we can stop at this + point. */ + if (olddecl == error_mark_node) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + + if (olddecl) + { + if (TREE_CODE (t) == TYPE_DECL) + SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t)); + else if (TREE_CODE (t) == FUNCTION_DECL) + check_default_args (t); - This function shall not be overloaded. */ - cp_error_at ("invalid redeclaration of `%D'", t); - error ("as `%D'", x); - /* We don't try to push this declaration since that - causes a crash. */ - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); + } + else if (DECL_MAIN_P (x)) + { + /* A redeclaration of main, but not a duplicate of the + previous one. + + [basic.start.main] + + This function shall not be overloaded. */ + cp_error_at ("invalid redeclaration of `%D'", t); + error ("as `%D'", x); + /* We don't try to push this declaration since that + causes a crash. */ + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x); + } } } @@ -1257,7 +1268,7 @@ begin_scope (scope_kind kind, tree entity) case sk_template_spec: scope->explicit_spec_p = true; kind = sk_template_parms; - /* fall through */ + /* Fall through. */ case sk_template_parms: case sk_block: case sk_try: @@ -1799,7 +1810,7 @@ make_anon_name (void) void clear_anon_tags (void) { - register struct cp_binding_level *b; + struct cp_binding_level *b; static int last_cnt = 0; /* Fast out if no new anon names were declared. */ @@ -1897,7 +1908,7 @@ push_using_decl (tree scope, tree name) tree pushdecl_with_scope (tree x, cxx_scope *level) { - register struct cp_binding_level *b; + struct cp_binding_level *b; tree function_decl = current_function_decl; timevar_push (TV_NAME_LOOKUP); @@ -1979,7 +1990,7 @@ push_overloaded_decl (tree decl, int flags) error ("`%#D' conflicts with previous using declaration `%#D'", decl, fn); - if (duplicate_decls (decl, fn)) + if (duplicate_decls (decl, fn) == fn) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fn); } } @@ -1994,7 +2005,11 @@ push_overloaded_decl (tree decl, int flags) } } - if (old || TREE_CODE (decl) == TEMPLATE_DECL) + if (old || TREE_CODE (decl) == TEMPLATE_DECL + /* If it's a using declaration, we always need to build an OVERLOAD, + because it's the only way to remember that the declaration comes + from 'using', and have the lookup behave correctly. */ + || (flags & PUSH_USING)) { if (old && TREE_CODE (old) != OVERLOAD) new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE)); @@ -2319,7 +2334,7 @@ tree lookup_tag (enum tree_code form, tree name, cxx_scope *binding_level, int thislevel_only) { - register struct cp_binding_level *level; + struct cp_binding_level *level; /* Nonzero if, we should look past a template parameter level, even if THISLEVEL_ONLY. */ int allow_template_parms_p = 1; @@ -2328,7 +2343,7 @@ lookup_tag (enum tree_code form, tree name, timevar_push (TV_NAME_LOOKUP); for (level = binding_level; level; level = level->level_chain) { - register tree tail; + tree tail; if (type_is_anonymous && level->type_decls != NULL) { tree type = binding_table_find_anon_type (level->type_decls, name); @@ -2431,7 +2446,7 @@ lookup_tag (enum tree_code form, tree name, tree lookup_tag_reverse (tree type, tree name) { - register struct cp_binding_level *level; + struct cp_binding_level *level; timevar_push (TV_NAME_LOOKUP); for (level = current_binding_level; level; level = level->level_chain) @@ -2515,7 +2530,7 @@ pushlevel_class (void) void poplevel_class (void) { - register struct cp_binding_level *level = class_binding_level; + struct cp_binding_level *level = class_binding_level; tree shadowed; timevar_push (TV_NAME_LOOKUP); @@ -2975,6 +2990,7 @@ push_namespace (tree name) tree d = NULL_TREE; int need_new = 1; int implicit_use = 0; + bool anon = !name; timevar_push (TV_NAME_LOOKUP); @@ -2984,7 +3000,7 @@ push_namespace (tree name) my_friendly_assert (global_namespace != NULL && name != global_scope_name, 20030531); - if (!name) + if (anon) { /* The name of anonymous namespace is unique for the translation unit. */ @@ -3019,6 +3035,12 @@ push_namespace (tree name) d = build_lang_decl (NAMESPACE_DECL, name, void_type_node); DECL_CONTEXT (d) = FROB_CONTEXT (current_namespace); d = pushdecl (d); + if (anon) + { + /* Clear DECL_NAME for the benefit of debugging back ends. */ + SET_DECL_ASSEMBLER_NAME (d, name); + DECL_NAME (d) = NULL_TREE; + } begin_scope (sk_namespace, d); } else @@ -3134,8 +3156,8 @@ do_namespace_alias (tree alias, tree namespace) tree pushdecl_namespace_level (tree x) { - register struct cp_binding_level *b = current_binding_level; - register tree t; + struct cp_binding_level *b = current_binding_level; + tree t; timevar_push (TV_NAME_LOOKUP); t = pushdecl_with_scope (x, NAMESPACE_LEVEL (current_namespace)); @@ -3283,6 +3305,33 @@ do_using_directive (tree namespace) add_using_namespace (current_namespace, namespace, 0); } +/* Deal with a using-directive seen by the parser. Currently we only + handle attributes here, since they cannot appear inside a template. */ + +void +parse_using_directive (tree namespace, tree attribs) +{ + tree a; + + do_using_directive (namespace); + + for (a = attribs; a; a = TREE_CHAIN (a)) + { + tree name = TREE_PURPOSE (a); + if (is_attribute_p ("strong", name)) + { + if (!toplevel_bindings_p ()) + error ("strong using only meaningful at namespace scope"); + else + DECL_NAMESPACE_ASSOCIATIONS (namespace) + = tree_cons (current_namespace, 0, + DECL_NAMESPACE_ASSOCIATIONS (namespace)); + } + else + warning ("`%D' attribute directive ignored", name); + } +} + /* Like pushdecl, only it places X in the global scope if appropriate. Calls cp_finish_decl to register the variable, initializing it with *INIT, if INIT is non-NULL. */ @@ -3927,7 +3976,7 @@ lookup_name_current_level (tree name) static tree lookup_type_current_level (tree name) { - register tree t = NULL_TREE; + tree t = NULL_TREE; timevar_push (TV_NAME_LOOKUP); my_friendly_assert (current_binding_level->kind != sk_namespace, @@ -4008,6 +4057,34 @@ add_function (struct arg_lookup *k, tree fn) return false; } +/* Returns true iff CURRENT has declared itself to be an associated + namespace of SCOPE via a strong using-directive (or transitive chain + thereof). Both are namespaces. */ + +bool +is_associated_namespace (tree current, tree scope) +{ + tree seen = NULL_TREE; + tree todo = NULL_TREE; + tree t; + while (1) + { + if (scope == current) + return true; + seen = tree_cons (scope, NULL_TREE, seen); + for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t)) + if (!purpose_member (TREE_PURPOSE (t), seen)) + todo = tree_cons (TREE_PURPOSE (t), NULL_TREE, todo); + if (todo) + { + scope = TREE_PURPOSE (todo); + todo = TREE_CHAIN (todo); + } + else + return false; + } +} + /* Add functions of a namespace to the lookup structure. Returns true on error. */ @@ -4019,6 +4096,12 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope) if (purpose_member (scope, k->namespaces)) return 0; k->namespaces = tree_cons (scope, NULL_TREE, k->namespaces); + + /* Check out our super-users. */ + for (value = DECL_NAMESPACE_ASSOCIATIONS (scope); value; + value = TREE_CHAIN (value)) + if (arg_assoc_namespace (k, TREE_PURPOSE (value))) + return true; value = namespace_binding (k->name, scope); if (!value) @@ -4407,7 +4490,7 @@ maybe_process_template_type_declaration (tree type, int globalize, void pushtag (tree name, tree type, int globalize) { - register struct cp_binding_level *b; + struct cp_binding_level *b; timevar_push (TV_NAME_LOOKUP); b = current_binding_level; @@ -4430,7 +4513,7 @@ pushtag (tree name, tree type, int globalize) /* Do C++ gratuitous typedefing. */ if (IDENTIFIER_TYPE_VALUE (name) != type) { - register tree d = NULL_TREE; + tree d = NULL_TREE; int in_class = 0; tree context = TYPE_CONTEXT (type); diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 36643b26d29..8c8b04057f6 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -211,7 +211,7 @@ struct cp_binding_level GTY(()) /* The kind of scope that this object represents. However, a SK_TEMPLATE_SPEC scope is represented with KIND set to SK_TEMPALTE_PARMS and EXPLICIT_SPEC_P set to true. */ - enum scope_kind kind : 4; + ENUM_BITFIELD (scope_kind) kind : 4; /* True if this scope is an SK_TEMPLATE_SPEC scope. This field is only valid if KIND == SK_TEMPLATE_PARMS. */ @@ -306,6 +306,8 @@ extern void do_local_using_decl (tree); extern tree do_class_using_decl (tree); extern void do_using_directive (tree); extern tree lookup_arg_dependent (tree, tree, tree); +extern bool is_associated_namespace (tree, tree); +extern void parse_using_directive (tree, tree); /* Set *DECL to the (non-hidden) declaration for ID at global scope, diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 2b7df6c5244..7dc57ce31a3 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -158,6 +158,7 @@ maybe_clone_body (tree fn) DECL_INTERFACE_KNOWN (clone) = DECL_INTERFACE_KNOWN (fn); DECL_NOT_REALLY_EXTERN (clone) = DECL_NOT_REALLY_EXTERN (fn); TREE_PUBLIC (clone) = TREE_PUBLIC (fn); + DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn); /* Adjust the parameter names and locations. */ parm = DECL_ARGUMENTS (fn); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9b040f557d0..46907ecb5bb 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -68,10 +68,10 @@ typedef struct cp_token GTY (()) { /* The kind of token. */ - enum cpp_ttype type : 8; + ENUM_BITFIELD (cpp_ttype) type : 8; /* If this token is a keyword, this value indicates which keyword. Otherwise, this value is RID_MAX. */ - enum rid keyword : 8; + ENUM_BITFIELD (rid) keyword : 8; /* The value associated with this token, if any. */ tree value; /* The location at which this token was found. */ @@ -219,6 +219,8 @@ static int cp_lexer_saving_tokens (const cp_lexer *); static cp_token *cp_lexer_next_token (cp_lexer *, cp_token *); +static cp_token *cp_lexer_prev_token + (cp_lexer *, cp_token *); static ptrdiff_t cp_lexer_token_difference (cp_lexer *, cp_token *, cp_token *); static cp_token *cp_lexer_read_token @@ -419,6 +421,17 @@ cp_lexer_next_token (cp_lexer* lexer, cp_token* token) return token; } +/* TOKEN points into the circular token buffer. Return a pointer to + the previous token in the buffer. */ + +static inline cp_token * +cp_lexer_prev_token (cp_lexer* lexer, cp_token* token) +{ + if (token == lexer->buffer) + token = lexer->buffer_end; + return token - 1; +} + /* nonzero if we are presently saving tokens. */ static int @@ -1063,9 +1076,9 @@ typedef enum cp_parser_declarator_kind typedef struct cp_parser_token_tree_map_node { /* The token type. */ - enum cpp_ttype token_type : 8; + ENUM_BITFIELD (cpp_ttype) token_type : 8; /* The corresponding tree code. */ - enum tree_code tree_type : 8; + ENUM_BITFIELD (tree_code) tree_type : 8; } cp_parser_token_tree_map_node; /* A complete map consists of several ordinary entries, followed by a @@ -1205,17 +1218,20 @@ typedef struct cp_parser GTY(()) /* TRUE if we are parsing an integral constant-expression. See [expr.const] for a precise definition. */ - bool constant_expression_p; + bool integral_constant_expression_p; /* TRUE if we are parsing an integral constant-expression -- but a non-constant expression should be permitted as well. This flag is used when parsing an array bound so that GNU variable-length arrays are tolerated. */ - bool allow_non_constant_expression_p; + bool allow_non_integral_constant_expression_p; /* TRUE if ALLOW_NON_CONSTANT_EXPRESSION_P is TRUE and something has been seen that makes the expression non-constant. */ - bool non_constant_expression_p; + bool non_integral_constant_expression_p; + + /* TRUE if we are parsing the argument to "__offsetof__". */ + bool in_offsetof_p; /* TRUE if local variable names and `this' are forbidden in the current context. */ @@ -1230,6 +1246,17 @@ typedef struct cp_parser GTY(()) direct-declarator. */ bool in_declarator_p; + /* TRUE if we are presently parsing a template-argument-list. */ + bool in_template_argument_list_p; + + /* TRUE if we are presently parsing the body of an + iteration-statement. */ + bool in_iteration_statement_p; + + /* TRUE if we are presently parsing the body of a switch + statement. */ + bool in_switch_statement_p; + /* If non-NULL, then we are parsing a construct where new type definitions are not permitted. The string stored here will be issued as an error message if a type is defined. */ @@ -1301,11 +1328,11 @@ static tree cp_parser_id_expression static tree cp_parser_unqualified_id (cp_parser *, bool, bool, bool); static tree cp_parser_nested_name_specifier_opt - (cp_parser *, bool, bool, bool); + (cp_parser *, bool, bool, bool, bool); static tree cp_parser_nested_name_specifier - (cp_parser *, bool, bool, bool); -static tree cp_parser_class_or_namespace_name (cp_parser *, bool, bool, bool, bool); +static tree cp_parser_class_or_namespace_name + (cp_parser *, bool, bool, bool, bool, bool); static tree cp_parser_postfix_expression (cp_parser *, bool); static tree cp_parser_parenthesized_expression_list @@ -1449,7 +1476,7 @@ static void cp_parser_linkage_specification static tree cp_parser_init_declarator (cp_parser *, tree, tree, bool, bool, int, bool *); static tree cp_parser_declarator - (cp_parser *, cp_parser_declarator_kind, int *); + (cp_parser *, cp_parser_declarator_kind, int *, bool *); static tree cp_parser_direct_declarator (cp_parser *, cp_parser_declarator_kind, int *); static enum tree_code cp_parser_ptr_operator @@ -1469,9 +1496,7 @@ static tree cp_parser_parameter_declaration_clause static tree cp_parser_parameter_declaration_list (cp_parser *); static tree cp_parser_parameter_declaration - (cp_parser *, bool); -static tree cp_parser_function_definition - (cp_parser *, bool *); + (cp_parser *, bool, bool *); static void cp_parser_function_body (cp_parser *); static tree cp_parser_initializer @@ -1487,7 +1512,7 @@ static bool cp_parser_ctor_initializer_opt_and_function_body /* Classes [gram.class] */ static tree cp_parser_class_name - (cp_parser *, bool, bool, bool, bool, bool); + (cp_parser *, bool, bool, bool, bool, bool, bool); static tree cp_parser_class_specifier (cp_parser *); static tree cp_parser_class_head @@ -1545,9 +1570,9 @@ static tree cp_parser_template_parameter static tree cp_parser_type_parameter (cp_parser *); static tree cp_parser_template_id - (cp_parser *, bool, bool); + (cp_parser *, bool, bool, bool); static tree cp_parser_template_name - (cp_parser *, bool, bool); + (cp_parser *, bool, bool, bool, bool *); static tree cp_parser_template_argument_list (cp_parser *); static tree cp_parser_template_argument @@ -1623,6 +1648,10 @@ static tree cp_parser_single_declaration (cp_parser *, bool, bool *); static tree cp_parser_functional_cast (cp_parser *, tree); +static tree cp_parser_save_member_function_body + (cp_parser *, tree, tree, tree); +static tree cp_parser_enclosed_template_argument_list + (cp_parser *); static void cp_parser_save_default_args (cp_parser *, tree); static void cp_parser_late_parsing_for_member @@ -1673,18 +1702,22 @@ static bool cp_parser_committed_to_tentative_parse (cp_parser *); static void cp_parser_error (cp_parser *, const char *); +static void cp_parser_name_lookup_error + (cp_parser *, tree, tree, const char *); static bool cp_parser_simulate_error (cp_parser *); static void cp_parser_check_type_definition (cp_parser *); static void cp_parser_check_for_definition_in_return_type (tree, int); -static tree cp_parser_non_constant_expression +static void cp_parser_check_for_invalid_template_id + (cp_parser *, tree); +static tree cp_parser_non_integral_constant_expression (const char *); static bool cp_parser_diagnose_invalid_type_name (cp_parser *); static int cp_parser_skip_to_closing_parenthesis - (cp_parser *, bool, bool); + (cp_parser *, bool, bool, bool); static void cp_parser_skip_to_end_of_statement (cp_parser *); static void cp_parser_consume_semicolon_at_end_of_statement @@ -1735,7 +1768,47 @@ cp_parser_error (cp_parser* parser, const char* message) { /* Output the MESSAGE -- unless we're parsing tentatively. */ if (!cp_parser_simulate_error (parser)) - error (message); + { + cp_token *token; + token = cp_lexer_peek_token (parser->lexer); + c_parse_error (message, + /* Because c_parser_error does not understand + CPP_KEYWORD, keywords are treated like + identifiers. */ + (token->type == CPP_KEYWORD ? CPP_NAME : token->type), + token->value); + } +} + +/* Issue an error about name-lookup failing. NAME is the + IDENTIFIER_NODE DECL is the result of + the lookup (as returned from cp_parser_lookup_name). DESIRED is + the thing that we hoped to find. */ + +static void +cp_parser_name_lookup_error (cp_parser* parser, + tree name, + tree decl, + const char* desired) +{ + /* If name lookup completely failed, tell the user that NAME was not + declared. */ + if (decl == error_mark_node) + { + if (parser->scope && parser->scope != global_namespace) + error ("`%D::%D' has not been declared", + parser->scope, name); + else if (parser->scope == global_namespace) + error ("`::%D' has not been declared", name); + else + error ("`%D' has not been declared", name); + } + else if (parser->scope && parser->scope != global_namespace) + error ("`%D::%D' %s", parser->scope, name, desired); + else if (parser->scope == global_namespace) + error ("`::%D' %s", name, desired); + else + error ("`%D' %s", name, desired); } /* If we are parsing tentatively, remember that an error has occurred @@ -1790,11 +1863,59 @@ cp_parser_check_for_definition_in_return_type (tree declarator, error ("new types may not be defined in a return type"); } +/* A type-specifier (TYPE) has been parsed which cannot be followed by + "<" in any valid C++ program. If the next token is indeed "<", + issue a message warning the user about what appears to be an + invalid attempt to form a template-id. */ + +static void +cp_parser_check_for_invalid_template_id (cp_parser* parser, + tree type) +{ + ptrdiff_t start; + cp_token *token; + + if (cp_lexer_next_token_is (parser->lexer, CPP_LESS)) + { + if (TYPE_P (type)) + error ("`%T' is not a template", type); + else if (TREE_CODE (type) == IDENTIFIER_NODE) + error ("`%s' is not a template", IDENTIFIER_POINTER (type)); + else + error ("invalid template-id"); + /* Remember the location of the invalid "<". */ + if (cp_parser_parsing_tentatively (parser) + && !cp_parser_committed_to_tentative_parse (parser)) + { + token = cp_lexer_peek_token (parser->lexer); + token = cp_lexer_prev_token (parser->lexer, token); + start = cp_lexer_token_difference (parser->lexer, + parser->lexer->first_token, + token); + } + else + start = -1; + /* Consume the "<". */ + cp_lexer_consume_token (parser->lexer); + /* Parse the template arguments. */ + cp_parser_enclosed_template_argument_list (parser); + /* Permanently remove the invalid template arguments so that + this error message is not issued again. */ + if (start >= 0) + { + token = cp_lexer_advance_token (parser->lexer, + parser->lexer->first_token, + start); + cp_lexer_purge_tokens_after (parser->lexer, token); + } + } +} + /* Issue an error message about the fact that THING appeared in a constant-expression. Returns ERROR_MARK_NODE. */ static tree -cp_parser_non_constant_expression (const char *thing) +cp_parser_non_integral_constant_expression (const char *thing) { error ("%s cannot appear in a constant-expression", thing); return error_mark_node; @@ -1880,7 +2001,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser) static int cp_parser_skip_to_closing_parenthesis (cp_parser *parser, - bool recovering, bool or_comma) + bool recovering, + bool or_comma, + bool consume_paren) { unsigned paren_depth = 0; unsigned brace_depth = 0; @@ -1897,28 +2020,22 @@ cp_parser_skip_to_closing_parenthesis (cp_parser *parser, if (cp_lexer_next_token_is (parser->lexer, CPP_EOF)) return 0; - if (recovering) + token = cp_lexer_peek_token (parser->lexer); + + /* This matches the processing in skip_to_end_of_statement. */ + if (token->type == CPP_SEMICOLON && !brace_depth) + return 0; + if (token->type == CPP_OPEN_BRACE) + ++brace_depth; + if (token->type == CPP_CLOSE_BRACE) { - token = cp_lexer_peek_token (parser->lexer); - - /* This matches the processing in skip_to_end_of_statement */ - if (token->type == CPP_SEMICOLON && !brace_depth) + if (!brace_depth--) return 0; - if (token->type == CPP_OPEN_BRACE) - ++brace_depth; - if (token->type == CPP_CLOSE_BRACE) - { - if (!brace_depth--) - return 0; - } - if (or_comma && token->type == CPP_COMMA - && !brace_depth && !paren_depth) - return -1; } + if (recovering && or_comma && token->type == CPP_COMMA + && !brace_depth && !paren_depth) + return -1; - /* Consume the token. */ - token = cp_lexer_consume_token (parser->lexer); - if (!brace_depth) { /* If it is an `(', we have entered another level of nesting. */ @@ -1926,8 +2043,15 @@ cp_parser_skip_to_closing_parenthesis (cp_parser *parser, ++paren_depth; /* If it is a `)', then we might be done. */ else if (token->type == CPP_CLOSE_PAREN && !paren_depth--) - return 1; + { + if (consume_paren) + cp_lexer_consume_token (parser->lexer); + return 1; + } } + + /* Consume the token. */ + cp_lexer_consume_token (parser->lexer); } } @@ -2105,9 +2229,12 @@ cp_parser_new (void) parser->default_arg_ok_p = true; /* We are not parsing a constant-expression. */ - parser->constant_expression_p = false; - parser->allow_non_constant_expression_p = false; - parser->non_constant_expression_p = false; + parser->integral_constant_expression_p = false; + parser->allow_non_integral_constant_expression_p = false; + parser->non_integral_constant_expression_p = false; + + /* We are not parsing offsetof. */ + parser->in_offsetof_p = false; /* Local variable names are not forbidden. */ parser->local_variables_forbidden_p = false; @@ -2118,6 +2245,15 @@ cp_parser_new (void) /* We are not processing a declarator. */ parser->in_declarator_p = false; + /* We are not processing a template-argument-list. */ + parser->in_template_argument_list_p = false; + + /* We are not in an iteration statement. */ + parser->in_iteration_statement_p = false; + + /* We are not in a switch statement. */ + parser->in_switch_statement_p = false; + /* The unparsed function queue is empty. */ parser->unparsed_functions_queues = build_tree_list (NULL_TREE, NULL_TREE); @@ -2322,11 +2458,11 @@ cp_parser_primary_expression (cp_parser *parser, return error_mark_node; } /* Pointers cannot appear in constant-expressions. */ - if (parser->constant_expression_p) + if (parser->integral_constant_expression_p) { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("`this'"); - parser->non_constant_expression_p = true; + if (!parser->allow_non_integral_constant_expression_p) + return cp_parser_non_integral_constant_expression ("`this'"); + parser->non_integral_constant_expression_p = true; } return finish_this_expr (); @@ -2369,15 +2505,38 @@ cp_parser_primary_expression (cp_parser *parser, cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); /* Using `va_arg' in a constant-expression is not allowed. */ - if (parser->constant_expression_p) + if (parser->integral_constant_expression_p) { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("`va_arg'"); - parser->non_constant_expression_p = true; + if (!parser->allow_non_integral_constant_expression_p) + return cp_parser_non_integral_constant_expression ("`va_arg'"); + parser->non_integral_constant_expression_p = true; } return build_x_va_arg (expression, type); } + case RID_OFFSETOF: + { + tree expression; + bool saved_in_offsetof_p; + + /* Consume the "__offsetof__" token. */ + cp_lexer_consume_token (parser->lexer); + /* Consume the opening `('. */ + cp_parser_require (parser, CPP_OPEN_PAREN, "`('"); + /* Parse the parenthesized (almost) constant-expression. */ + saved_in_offsetof_p = parser->in_offsetof_p; + parser->in_offsetof_p = true; + expression + = cp_parser_constant_expression (parser, + /*allow_non_constant_p=*/false, + /*non_constant_p=*/NULL); + parser->in_offsetof_p = saved_in_offsetof_p; + /* Consume the closing ')'. */ + cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); + + return expression; + } + default: cp_parser_error (parser, "expected primary-expression"); return error_mark_node; @@ -2454,9 +2613,9 @@ cp_parser_primary_expression (cp_parser *parser, decl = finish_id_expression (id_expression, decl, parser->scope, idk, qualifying_class, - parser->constant_expression_p, - parser->allow_non_constant_expression_p, - &parser->non_constant_expression_p, + parser->integral_constant_expression_p, + parser->allow_non_integral_constant_expression_p, + &parser->non_integral_constant_expression_p, &error_msg); if (error_msg) cp_parser_error (parser, error_msg); @@ -2527,7 +2686,8 @@ cp_parser_id_expression (cp_parser *parser, = (cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, check_dependency_p, - /*type_p=*/false) + /*type_p=*/false, + /*is_declarator=*/false) != NULL_TREE); /* If there is a nested-name-specifier, then we are looking at the first qualified-id production. */ @@ -2580,7 +2740,8 @@ cp_parser_id_expression (cp_parser *parser, /* Try a template-id. */ id = cp_parser_template_id (parser, /*template_keyword_p=*/false, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + declarator_p); /* If that worked, we're done. */ if (cp_parser_parse_definitely (parser)) return id; @@ -2654,7 +2815,8 @@ cp_parser_unqualified_id (cp_parser* parser, cp_parser_parse_tentatively (parser); /* Try a template-id. */ id = cp_parser_template_id (parser, template_keyword_p, - check_dependency_p); + check_dependency_p, + declarator_p); /* If it worked, we're done. */ if (cp_parser_parse_definitely (parser)) return id; @@ -2664,7 +2826,8 @@ cp_parser_unqualified_id (cp_parser* parser, case CPP_TEMPLATE_ID: return cp_parser_template_id (parser, template_keyword_p, - check_dependency_p); + check_dependency_p, + declarator_p); case CPP_COMPL: { @@ -2736,7 +2899,8 @@ cp_parser_unqualified_id (cp_parser* parser, /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency=*/false, - /*class_head_p=*/false); + /*class_head_p=*/false, + declarator_p); if (cp_parser_parse_definitely (parser)) return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl)); } @@ -2753,7 +2917,8 @@ cp_parser_unqualified_id (cp_parser* parser, /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency=*/false, - /*class_head_p=*/false); + /*class_head_p=*/false, + declarator_p); if (cp_parser_parse_definitely (parser)) return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl)); } @@ -2770,7 +2935,8 @@ cp_parser_unqualified_id (cp_parser* parser, /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency=*/false, - /*class_head_p=*/false); + /*class_head_p=*/false, + declarator_p); if (cp_parser_parse_definitely (parser)) return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl)); } @@ -2784,7 +2950,8 @@ cp_parser_unqualified_id (cp_parser* parser, /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency=*/false, - /*class_head_p=*/false); + /*class_head_p=*/false, + declarator_p); /* If an error occurred, assume that the name of the destructor is the same as the name of the qualifying class. That allows us to keep parsing after running @@ -2816,7 +2983,8 @@ cp_parser_unqualified_id (cp_parser* parser, cp_parser_parse_tentatively (parser); /* Try a template-id. */ id = cp_parser_template_id (parser, template_keyword_p, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + declarator_p); /* If that worked, we're done. */ if (cp_parser_parse_definitely (parser)) return id; @@ -2853,13 +3021,17 @@ cp_parser_unqualified_id (cp_parser* parser, Sets PARSER->SCOPE to the class (TYPE) or namespace (NAMESPACE_DECL) specified by the nested-name-specifier, or leaves it unchanged if there is no nested-name-specifier. Returns the new - scope iff there is a nested-name-specifier, or NULL_TREE otherwise. */ + scope iff there is a nested-name-specifier, or NULL_TREE otherwise. + + If IS_DECLARATION is TRUE, the nested-name-specifier is known to be + part of a declaration and/or decl-specifier. */ static tree cp_parser_nested_name_specifier_opt (cp_parser *parser, bool typename_keyword_p, bool check_dependency_p, - bool type_p) + bool type_p, + bool is_declaration) { bool success = false; tree access_check = NULL_TREE; @@ -2958,7 +3130,8 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser, typename_keyword_p, template_keyword_p, check_dependency_p, - type_p); + type_p, + is_declaration); /* Look for the `::' token. */ cp_parser_require (parser, CPP_SCOPE, "`::'"); @@ -2991,24 +3164,10 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser, if (TREE_CODE (decl) == TEMPLATE_DECL) error ("`%D' used without template parameters", decl); - else if (parser->scope) - { - if (TYPE_P (parser->scope)) - error ("`%T::%D' is not a class-name or " - "namespace-name", - parser->scope, token->value); - else if (parser->scope == global_namespace) - error ("`::%D' is not a class-name or " - "namespace-name", - token->value); - else - error ("`%D::%D' is not a class-name or " - "namespace-name", - parser->scope, token->value); - } else - error ("`%D' is not a class-name or namespace-name", - token->value); + cp_parser_name_lookup_error + (parser, token->value, decl, + "is not a class or namespace"); parser->scope = NULL_TREE; error_p = true; /* Treat this as a successful nested-name-specifier @@ -3085,7 +3244,8 @@ static tree cp_parser_nested_name_specifier (cp_parser *parser, bool typename_keyword_p, bool check_dependency_p, - bool type_p) + bool type_p, + bool is_declaration) { tree scope; @@ -3093,7 +3253,8 @@ cp_parser_nested_name_specifier (cp_parser *parser, scope = cp_parser_nested_name_specifier_opt (parser, typename_keyword_p, check_dependency_p, - type_p); + type_p, + is_declaration); /* If it was not present, issue an error message. */ if (!scope) { @@ -3127,7 +3288,8 @@ cp_parser_class_or_namespace_name (cp_parser *parser, bool typename_keyword_p, bool template_keyword_p, bool check_dependency_p, - bool type_p) + bool type_p, + bool is_declaration) { tree saved_scope; tree saved_qualifying_scope; @@ -3151,7 +3313,8 @@ cp_parser_class_or_namespace_name (cp_parser *parser, template_keyword_p, type_p, check_dependency_p, - /*class_head_p=*/false); + /*class_head_p=*/false, + is_declaration); /* If that didn't work, try for a namespace-name. */ if (!only_class_p && !cp_parser_parse_definitely (parser)) { @@ -3263,15 +3426,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* Only type conversions to integral or enumeration types can be used in constant-expressions. */ - if (parser->constant_expression_p + if (parser->integral_constant_expression_p && !dependent_type_p (type) - && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)) + && !INTEGRAL_OR_ENUMERATION_TYPE_P (type) + /* A cast to pointer or reference type is allowed in the + implementation of "offsetof". */ + && !(parser->in_offsetof_p && POINTER_TYPE_P (type))) { - if (!parser->allow_non_constant_expression_p) - return (cp_parser_non_constant_expression + if (!parser->allow_non_integral_constant_expression_p) + return (cp_parser_non_integral_constant_expression ("a cast to a type other than an integral or " "enumeration type")); - parser->non_constant_expression_p = true; + parser->non_integral_constant_expression_p = true; } switch (keyword) @@ -3356,7 +3522,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) cp_parser_nested_name_specifier (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, - /*type_p=*/true); + /*type_p=*/true, + /*is_declaration=*/true); /* Look for the optional `template' keyword. */ template_p = cp_parser_optional_template_keyword (parser); /* We don't know whether we're looking at a template-id or an @@ -3364,7 +3531,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) cp_parser_parse_tentatively (parser); /* Try a template-id. */ id = cp_parser_template_id (parser, template_p, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + /*is_declaration=*/true); /* If that didn't work, try an identifier. */ if (!cp_parser_parse_definitely (parser)) id = cp_parser_identifier (parser); @@ -3506,6 +3674,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) postfix_expression = grok_array_decl (postfix_expression, index); idk = CP_ID_KIND_NONE; + /* Array references are not permitted in + constant-expressions. */ + if (parser->integral_constant_expression_p) + { + if (!parser->allow_non_integral_constant_expression_p) + postfix_expression + = cp_parser_non_integral_constant_expression ("an array reference"); + parser->non_integral_constant_expression_p = true; + } } break; @@ -3524,11 +3701,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* Function calls are not permitted in constant-expressions. */ - if (parser->constant_expression_p) + if (parser->integral_constant_expression_p) { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("a function call"); - parser->non_constant_expression_p = true; + if (!parser->allow_non_integral_constant_expression_p) + { + postfix_expression + = cp_parser_non_integral_constant_expression ("a function call"); + break; + } + parser->non_integral_constant_expression_p = true; } koenig_p = false; @@ -3606,6 +3787,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) bool dependent_p; bool template_p; tree scope = NULL_TREE; + enum cpp_ttype token_type = token->type; /* If this is a `->' operator, dereference the pointer. */ if (token->type == CPP_DEREF) @@ -3693,7 +3875,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* Otherwise, try the pseudo-destructor-name production. */ else { - tree s; + tree s = NULL_TREE; tree type; /* Parse the pseudo-destructor-name. */ @@ -3708,6 +3890,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) object on the left-hand side of the `.' or `->' operator. */ parser->context->object_type = NULL_TREE; + /* These operators may not appear in constant-expressions. */ + if (parser->integral_constant_expression_p + /* The "->" operator is allowed in the implementation + of "offsetof". */ + && !(parser->in_offsetof_p && token_type == CPP_DEREF)) + { + if (!parser->allow_non_integral_constant_expression_p) + postfix_expression + = (cp_parser_non_integral_constant_expression + (token_type == CPP_DEREF ? "'->'" : "`.'")); + parser->non_integral_constant_expression_p = true; + } } break; @@ -3715,17 +3909,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* postfix-expression ++ */ /* Consume the `++' token. */ cp_lexer_consume_token (parser->lexer); - /* Increments may not appear in constant-expressions. */ - if (parser->constant_expression_p) - { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("an increment"); - parser->non_constant_expression_p = true; - } /* Generate a representation for the complete expression. */ postfix_expression = finish_increment_expr (postfix_expression, POSTINCREMENT_EXPR); + /* Increments may not appear in constant-expressions. */ + if (parser->integral_constant_expression_p) + { + if (!parser->allow_non_integral_constant_expression_p) + postfix_expression + = cp_parser_non_integral_constant_expression ("an increment"); + parser->non_integral_constant_expression_p = true; + } idk = CP_ID_KIND_NONE; break; @@ -3733,17 +3928,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* postfix-expression -- */ /* Consume the `--' token. */ cp_lexer_consume_token (parser->lexer); - /* Decrements may not appear in constant-expressions. */ - if (parser->constant_expression_p) - { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("a decrement"); - parser->non_constant_expression_p = true; - } /* Generate a representation for the complete expression. */ postfix_expression = finish_increment_expr (postfix_expression, POSTDECREMENT_EXPR); + /* Decrements may not appear in constant-expressions. */ + if (parser->integral_constant_expression_p) + { + if (!parser->allow_non_integral_constant_expression_p) + postfix_expression + = cp_parser_non_integral_constant_expression ("a decrement"); + parser->non_integral_constant_expression_p = true; + } idk = CP_ID_KIND_NONE; break; @@ -3856,7 +4052,10 @@ cp_parser_parenthesized_expression_list (cp_parser* parser, skip_comma:; /* We try and resync to an unnested comma, as that will give the user better diagnostics. */ - ending = cp_parser_skip_to_closing_parenthesis (parser, true, true); + ending = cp_parser_skip_to_closing_parenthesis (parser, + /*recovering=*/true, + /*or_comma=*/true, + /*consume_paren=*/true); if (ending < 0) goto get_comma; if (!ending) @@ -3897,7 +4096,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser, = (cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false) + /*type_p=*/false, + /*is_declaration=*/true) != NULL_TREE); /* Now, if we saw a nested-name-specifier, we might be doing the second production. */ @@ -3909,7 +4109,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser, /* Parse the template-id. */ cp_parser_template_id (parser, /*template_keyword_p=*/true, - /*check_dependency_p=*/false); + /*check_dependency_p=*/false, + /*is_declaration=*/true); /* Look for the `::' token. */ cp_parser_require (parser, CPP_SCOPE, "`::'"); } @@ -4081,6 +4282,8 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p) if (unary_operator != ERROR_MARK) { tree cast_expression; + tree expression = error_mark_node; + const char *non_constant_p = NULL; /* Consume the operator token. */ token = cp_lexer_consume_token (parser->lexer); @@ -4091,32 +4294,43 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p) switch (unary_operator) { case INDIRECT_REF: - return build_x_indirect_ref (cast_expression, "unary *"); - + non_constant_p = "`*'"; + expression = build_x_indirect_ref (cast_expression, "unary *"); + break; + case ADDR_EXPR: + /* The "&" operator is allowed in the implementation of + "offsetof". */ + if (!parser->in_offsetof_p) + non_constant_p = "`&'"; + /* Fall through. */ case BIT_NOT_EXPR: - return build_x_unary_op (unary_operator, cast_expression); - + expression = build_x_unary_op (unary_operator, cast_expression); + break; + case PREINCREMENT_EXPR: case PREDECREMENT_EXPR: - if (parser->constant_expression_p) - { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression (PREINCREMENT_EXPR - ? "an increment" - : "a decrement"); - parser->non_constant_expression_p = true; - } + non_constant_p = (unary_operator == PREINCREMENT_EXPR + ? "`++'" : "`--'"); /* Fall through. */ case CONVERT_EXPR: case NEGATE_EXPR: case TRUTH_NOT_EXPR: - return finish_unary_op_expr (unary_operator, cast_expression); + expression = finish_unary_op_expr (unary_operator, cast_expression); + break; default: abort (); - return error_mark_node; } + + if (non_constant_p && parser->integral_constant_expression_p) + { + if (!parser->allow_non_integral_constant_expression_p) + return cp_parser_non_integral_constant_expression (non_constant_p); + parser->non_integral_constant_expression_p = true; + } + + return expression; } return cp_parser_postfix_expression (parser, address_p); @@ -4487,7 +4701,8 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p) If we find the closing `)', and the next token is a `{', then we are looking at a compound-literal. */ compound_literal_p - = (cp_parser_skip_to_closing_parenthesis (parser, false, false) + = (cp_parser_skip_to_closing_parenthesis (parser, false, false, + /*consume_paren=*/true) && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)); /* Roll back the tokens we skipped. */ cp_lexer_rollback_tokens (parser->lexer); @@ -4525,15 +4740,15 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p) /* Only type conversions to integral or enumeration types can be used in constant-expressions. */ - if (parser->constant_expression_p + if (parser->integral_constant_expression_p && !dependent_type_p (type) && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)) { - if (!parser->allow_non_constant_expression_p) - return (cp_parser_non_constant_expression + if (!parser->allow_non_integral_constant_expression_p) + return (cp_parser_non_integral_constant_expression ("a casts to a type other than an integral or " "enumeration type")); - parser->non_constant_expression_p = true; + parser->non_integral_constant_expression_p = true; } /* Perform the cast. */ expr = build_c_cast (type, expr); @@ -4887,11 +5102,11 @@ cp_parser_assignment_expression (cp_parser* parser) rhs = cp_parser_assignment_expression (parser); /* An assignment may not appear in a constant-expression. */ - if (parser->constant_expression_p) + if (parser->integral_constant_expression_p) { - if (!parser->allow_non_constant_expression_p) - return cp_parser_non_constant_expression ("an assignment"); - parser->non_constant_expression_p = true; + if (!parser->allow_non_integral_constant_expression_p) + return cp_parser_non_integral_constant_expression ("an assignment"); + parser->non_integral_constant_expression_p = true; } /* Build the assignment expression. */ expr = build_x_modify_expr (expr, @@ -5030,12 +5245,12 @@ cp_parser_expression (cp_parser* parser) /* Consume the `,'. */ cp_lexer_consume_token (parser->lexer); /* A comma operator cannot appear in a constant-expression. */ - if (parser->constant_expression_p) + if (parser->integral_constant_expression_p) { - if (!parser->allow_non_constant_expression_p) + if (!parser->allow_non_integral_constant_expression_p) expression - = cp_parser_non_constant_expression ("a comma operator"); - parser->non_constant_expression_p = true; + = cp_parser_non_integral_constant_expression ("a comma operator"); + parser->non_integral_constant_expression_p = true; } } @@ -5057,9 +5272,9 @@ cp_parser_constant_expression (cp_parser* parser, bool allow_non_constant_p, bool *non_constant_p) { - bool saved_constant_expression_p; - bool saved_allow_non_constant_expression_p; - bool saved_non_constant_expression_p; + bool saved_integral_constant_expression_p; + bool saved_allow_non_integral_constant_expression_p; + bool saved_non_integral_constant_expression_p; tree expression; /* It might seem that we could simply parse the @@ -5080,14 +5295,14 @@ cp_parser_constant_expression (cp_parser* parser, will fold this operation to an INTEGER_CST for `3'. */ /* Save the old settings. */ - saved_constant_expression_p = parser->constant_expression_p; - saved_allow_non_constant_expression_p - = parser->allow_non_constant_expression_p; - saved_non_constant_expression_p = parser->non_constant_expression_p; + saved_integral_constant_expression_p = parser->integral_constant_expression_p; + saved_allow_non_integral_constant_expression_p + = parser->allow_non_integral_constant_expression_p; + saved_non_integral_constant_expression_p = parser->non_integral_constant_expression_p; /* We are now parsing a constant-expression. */ - parser->constant_expression_p = true; - parser->allow_non_constant_expression_p = allow_non_constant_p; - parser->non_constant_expression_p = false; + parser->integral_constant_expression_p = true; + parser->allow_non_integral_constant_expression_p = allow_non_constant_p; + parser->non_integral_constant_expression_p = false; /* Although the grammar says "conditional-expression", we parse an "assignment-expression", which also permits "throw-expression" and the use of assignment operators. In the case that @@ -5099,12 +5314,12 @@ cp_parser_constant_expression (cp_parser* parser, constant. */ expression = cp_parser_assignment_expression (parser); /* Restore the old settings. */ - parser->constant_expression_p = saved_constant_expression_p; - parser->allow_non_constant_expression_p - = saved_allow_non_constant_expression_p; + parser->integral_constant_expression_p = saved_integral_constant_expression_p; + parser->allow_non_integral_constant_expression_p + = saved_allow_non_integral_constant_expression_p; if (allow_non_constant_p) - *non_constant_p = parser->non_constant_expression_p; - parser->non_constant_expression_p = saved_non_constant_expression_p; + *non_constant_p = parser->non_integral_constant_expression_p; + parser->non_integral_constant_expression_p = saved_non_integral_constant_expression_p; return expression; } @@ -5228,7 +5443,7 @@ static tree cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p) { cp_token *token; - tree statement = NULL_TREE; + tree statement = error_mark_node; /* The next token should be an identifier. */ token = cp_lexer_peek_token (parser->lexer); @@ -5251,16 +5466,20 @@ cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p) expr = cp_parser_constant_expression (parser, /*allow_non_constant_p=*/false, NULL); - /* Create the label. */ - statement = finish_case_label (expr, NULL_TREE); + if (!parser->in_switch_statement_p) + error ("case label `%E' not within a switch statement", expr); + else + statement = finish_case_label (expr, NULL_TREE); } break; case RID_DEFAULT: /* Consume the `default' token. */ cp_lexer_consume_token (parser->lexer); - /* Create the label. */ - statement = finish_case_label (NULL_TREE, NULL_TREE); + if (!parser->in_switch_statement_p) + error ("case label not within a switch statement"); + else + statement = finish_case_label (NULL_TREE, NULL_TREE); break; default: @@ -5410,7 +5629,8 @@ cp_parser_selection_statement (cp_parser* parser) condition = cp_parser_condition (parser); /* Look for the `)'. */ if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'")) - cp_parser_skip_to_closing_parenthesis (parser, true, false); + cp_parser_skip_to_closing_parenthesis (parser, true, false, + /*consume_paren=*/true); if (keyword == RID_IF) { @@ -5443,12 +5663,16 @@ cp_parser_selection_statement (cp_parser* parser) else { tree body; + bool in_switch_statement_p; /* Add the condition. */ finish_switch_cond (condition, statement); /* Parse the body of the switch-statement. */ + in_switch_statement_p = parser->in_switch_statement_p; + parser->in_switch_statement_p = true; body = cp_parser_implicitly_scoped_statement (parser); + parser->in_switch_statement_p = in_switch_statement_p; /* Now we're all done with the switch-statement. */ finish_switch_stmt (statement); @@ -5506,7 +5730,8 @@ cp_parser_condition (cp_parser* parser) /* Parse the declarator. */ declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED, - /*ctor_dtor_or_conv_p=*/NULL); + /*ctor_dtor_or_conv_p=*/NULL, + /*parenthesized_p=*/NULL); /* Parse the attributes. */ attributes = cp_parser_attributes_opt (parser); /* Parse the asm-specification. */ @@ -5564,12 +5789,18 @@ cp_parser_iteration_statement (cp_parser* parser) cp_token *token; enum rid keyword; tree statement; + bool in_iteration_statement_p; + /* Peek at the next token. */ token = cp_parser_require (parser, CPP_KEYWORD, "iteration-statement"); if (!token) return error_mark_node; + /* Remember whether or not we are already within an iteration + statement. */ + in_iteration_statement_p = parser->in_iteration_statement_p; + /* See what kind of keyword it is. */ keyword = token->keyword; switch (keyword) @@ -5588,7 +5819,9 @@ cp_parser_iteration_statement (cp_parser* parser) /* Look for the `)'. */ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); /* Parse the dependent statement. */ + parser->in_iteration_statement_p = true; cp_parser_already_scoped_statement (parser); + parser->in_iteration_statement_p = in_iteration_statement_p; /* We're done with the while-statement. */ finish_while_stmt (statement); } @@ -5601,7 +5834,9 @@ cp_parser_iteration_statement (cp_parser* parser) /* Begin the do-statement. */ statement = begin_do_stmt (); /* Parse the body of the do-statement. */ + parser->in_iteration_statement_p = true; cp_parser_implicitly_scoped_statement (parser); + parser->in_iteration_statement_p = in_iteration_statement_p; finish_do_body (statement); /* Look for the `while' keyword. */ cp_parser_require_keyword (parser, RID_WHILE, "`while'"); @@ -5646,7 +5881,9 @@ cp_parser_iteration_statement (cp_parser* parser) cp_parser_require (parser, CPP_CLOSE_PAREN, "`;'"); /* Parse the body of the for-statement. */ + parser->in_iteration_statement_p = true; cp_parser_already_scoped_statement (parser); + parser->in_iteration_statement_p = in_iteration_statement_p; /* We're done with the for-statement. */ finish_for_stmt (statement); @@ -5727,12 +5964,25 @@ cp_parser_jump_statement (cp_parser* parser) switch (keyword) { case RID_BREAK: - statement = finish_break_stmt (); + if (!parser->in_switch_statement_p + && !parser->in_iteration_statement_p) + { + error ("break statement not within loop or switch"); + statement = error_mark_node; + } + else + statement = finish_break_stmt (); cp_parser_require (parser, CPP_SEMICOLON, "`;'"); break; case RID_CONTINUE: - statement = finish_continue_stmt (); + if (!parser->in_iteration_statement_p) + { + error ("continue statement not within a loop"); + statement = error_mark_node; + } + else + statement = finish_continue_stmt (); cp_parser_require (parser, CPP_SEMICOLON, "`;'"); break; @@ -5878,7 +6128,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser) { /* A declaration consisting of a single semicolon is invalid. Allow it unless we're being pedantic. */ - if (pedantic) + if (pedantic && !in_system_header) pedwarn ("extra `;'"); cp_lexer_consume_token (parser->lexer); continue; @@ -6875,7 +7125,8 @@ cp_parser_mem_initializer_id (cp_parser* parser) = (cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, - /*type_p=*/true) + /*type_p=*/true, + /*is_declaration=*/true) != NULL_TREE); /* If there is a `::' operator or a nested-name-specifier, then we are definitely looking for a class-name. */ @@ -6885,7 +7136,8 @@ cp_parser_mem_initializer_id (cp_parser* parser) /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency_p=*/true, - /*class_head_p=*/false); + /*class_head_p=*/false, + /*is_declaration=*/true); /* Otherwise, we could also be looking for an ordinary identifier. */ cp_parser_parse_tentatively (parser); /* Try a class-name. */ @@ -6894,7 +7146,8 @@ cp_parser_mem_initializer_id (cp_parser* parser) /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency_p=*/true, - /*class_head_p=*/false); + /*class_head_p=*/false, + /*is_declaration=*/true); /* If we found one, we're done. */ if (cp_parser_parse_definitely (parser)) return id; @@ -7306,7 +7559,8 @@ cp_parser_template_parameter (cp_parser* parser) of the template parameter-list rather than a greater-than operator. */ return - cp_parser_parameter_declaration (parser, /*template_parm_p=*/true); + cp_parser_parameter_declaration (parser, /*template_parm_p=*/true, + /*parenthesized_p=*/NULL); } /* Parse a type-parameter. @@ -7458,18 +7712,16 @@ cp_parser_type_parameter (cp_parser* parser) static tree cp_parser_template_id (cp_parser *parser, bool template_keyword_p, - bool check_dependency_p) + bool check_dependency_p, + bool is_declaration) { tree template; tree arguments; - tree saved_scope; - tree saved_qualifying_scope; - tree saved_object_scope; tree template_id; - bool saved_greater_than_is_operator_p; ptrdiff_t start_of_id; tree access_check = NULL_TREE; cp_token *next_token; + bool is_identifier; /* If the next token corresponds to a template-id, there is no need to reparse it. */ @@ -7514,12 +7766,15 @@ cp_parser_template_id (cp_parser *parser, push_deferring_access_checks (dk_deferred); /* Parse the template-name. */ + is_identifier = false; template = cp_parser_template_name (parser, template_keyword_p, - check_dependency_p); - if (template == error_mark_node) + check_dependency_p, + is_declaration, + &is_identifier); + if (template == error_mark_node || is_identifier) { pop_deferring_access_checks (); - return error_mark_node; + return template; } /* Look for the `<' that starts the template-argument-list. */ @@ -7529,33 +7784,8 @@ cp_parser_template_id (cp_parser *parser, return error_mark_node; } - /* [temp.names] - - When parsing a template-id, the first non-nested `>' is taken as - the end of the template-argument-list rather than a greater-than - operator. */ - saved_greater_than_is_operator_p - = parser->greater_than_is_operator_p; - parser->greater_than_is_operator_p = false; - /* Parsing the argument list may modify SCOPE, so we save it - here. */ - saved_scope = parser->scope; - saved_qualifying_scope = parser->qualifying_scope; - saved_object_scope = parser->object_scope; - /* Parse the template-argument-list itself. */ - if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER)) - arguments = NULL_TREE; - else - arguments = cp_parser_template_argument_list (parser); - /* Look for the `>' that ends the template-argument-list. */ - cp_parser_require (parser, CPP_GREATER, "`>'"); - /* The `>' token might be a greater-than operator again now. */ - parser->greater_than_is_operator_p - = saved_greater_than_is_operator_p; - /* Restore the SAVED_SCOPE. */ - parser->scope = saved_scope; - parser->qualifying_scope = saved_qualifying_scope; - parser->object_scope = saved_object_scope; + /* Parse the arguments. */ + arguments = cp_parser_enclosed_template_argument_list (parser); /* Build a representation of the specialization. */ if (TREE_CODE (template) == IDENTIFIER_NODE) @@ -7641,7 +7871,9 @@ cp_parser_template_id (cp_parser *parser, static tree cp_parser_template_name (cp_parser* parser, bool template_keyword_p, - bool check_dependency_p) + bool check_dependency_p, + bool is_declaration, + bool *is_identifier) { tree identifier; tree decl; @@ -7679,9 +7911,70 @@ cp_parser_template_name (cp_parser* parser, correctly. We would treat `S' as a template -- if it were `S' -- but we do not if there is no `<'. */ - if (template_keyword_p && processing_template_decl + + if (processing_template_decl && cp_lexer_next_token_is (parser->lexer, CPP_LESS)) - return identifier; + { + /* In a declaration, in a dependent context, we pretend that the + "template" keyword was present in order to improve error + recovery. For example, given: + + template void f(T::X); + + we want to treat "X" as a template-id. */ + if (is_declaration + && !template_keyword_p + && parser->scope && TYPE_P (parser->scope) + && dependent_type_p (parser->scope)) + { + ptrdiff_t start; + cp_token* token; + /* Explain what went wrong. */ + error ("non-template `%D' used as template", identifier); + error ("(use `%T::template %D' to indicate that it is a template)", + parser->scope, identifier); + /* If parsing tentatively, find the location of the "<" + token. */ + if (cp_parser_parsing_tentatively (parser) + && !cp_parser_committed_to_tentative_parse (parser)) + { + cp_parser_simulate_error (parser); + token = cp_lexer_peek_token (parser->lexer); + token = cp_lexer_prev_token (parser->lexer, token); + start = cp_lexer_token_difference (parser->lexer, + parser->lexer->first_token, + token); + } + else + start = -1; + /* Parse the template arguments so that we can issue error + messages about them. */ + cp_lexer_consume_token (parser->lexer); + cp_parser_enclosed_template_argument_list (parser); + /* Skip tokens until we find a good place from which to + continue parsing. */ + cp_parser_skip_to_closing_parenthesis (parser, + /*recovering=*/true, + /*or_comma=*/true, + /*consume_paren=*/false); + /* If parsing tentatively, permanently remove the + template argument list. That will prevent duplicate + error messages from being issued about the missing + "template" keyword. */ + if (start >= 0) + { + token = cp_lexer_advance_token (parser->lexer, + parser->lexer->first_token, + start); + cp_lexer_purge_tokens_after (parser->lexer, token); + } + if (is_identifier) + *is_identifier = true; + return identifier; + } + if (template_keyword_p) + return identifier; + } /* Look up the name. */ decl = cp_parser_lookup_name (parser, identifier, @@ -7745,7 +8038,10 @@ cp_parser_template_argument_list (cp_parser* parser) unsigned alloced = 10; tree *arg_ary = fixed_args; tree vec; + bool saved_in_template_argument_list_p; + saved_in_template_argument_list_p = parser->in_template_argument_list_p; + parser->in_template_argument_list_p = true; do { tree argument; @@ -7779,6 +8075,7 @@ cp_parser_template_argument_list (cp_parser* parser) if (arg_ary != fixed_args) free (arg_ary); + parser->in_template_argument_list_p = saved_in_template_argument_list_p; return vec; } @@ -7804,6 +8101,7 @@ cp_parser_template_argument (cp_parser* parser) tree argument; bool template_p; bool address_p; + bool maybe_type_id = false; cp_token *token; cp_id_kind idk; tree qualifying_class; @@ -7820,13 +8118,35 @@ cp_parser_template_argument (cp_parser* parser) Therefore, we try a type-id first. */ cp_parser_parse_tentatively (parser); argument = cp_parser_type_id (parser); - /* If the next token isn't a `,' or a `>', then this argument wasn't - really finished. */ - if (!cp_parser_next_token_ends_template_argument_p (parser)) - cp_parser_error (parser, "expected template-argument"); - /* If that worked, we're done. */ - if (cp_parser_parse_definitely (parser)) - return argument; + /* If there was no error parsing the type-id but the next token is a '>>', + we probably found a typo for '> >'. But there are type-id which are + also valid expressions. For instance: + + struct X { int operator >> (int); }; + template struct Foo {}; + Foo> 5> r; + + Here 'X()' is a valid type-id of a function type, but the user just + wanted to write the expression "X() >> 5". Thus, we remember that we + found a valid type-id, but we still try to parse the argument as an + expression to see what happens. */ + if (!cp_parser_error_occurred (parser) + && cp_lexer_next_token_is (parser->lexer, CPP_RSHIFT)) + { + maybe_type_id = true; + cp_parser_abort_tentative_parse (parser); + } + else + { + /* If the next token isn't a `,' or a `>', then this argument wasn't + really finished. This means that the argument is not a valid + type-id. */ + if (!cp_parser_next_token_ends_template_argument_p (parser)) + cp_parser_error (parser, "expected template-argument"); + /* If that worked, we're done. */ + if (cp_parser_parse_definitely (parser)) + return argument; + } /* We're still not sure what the argument will be. */ cp_parser_parse_tentatively (parser); /* Try a template. */ @@ -7941,12 +8261,27 @@ cp_parser_template_argument (cp_parser* parser) cp_parser_error (parser, "invalid non-type template argument"); return error_mark_node; } - /* The argument must be a constant-expression. */ + /* If the argument wasn't successfully parsed as a type-id followed + by '>>', the argument can only be a constant expression now. + Otherwise, we try parsing the constant-expression tentatively, + because the argument could really be a type-id. */ + if (maybe_type_id) + cp_parser_parse_tentatively (parser); argument = cp_parser_constant_expression (parser, /*allow_non_constant_p=*/false, /*non_constant_p=*/NULL); - /* If it's non-dependent, simplify it. */ - return cp_parser_fold_non_dependent_expr (argument); + argument = cp_parser_fold_non_dependent_expr (argument); + if (!maybe_type_id) + return argument; + if (!cp_parser_next_token_ends_template_argument_p (parser)) + cp_parser_error (parser, "expected template-argument"); + if (cp_parser_parse_definitely (parser)) + return argument; + /* We did our best to parse the argument as a non type-id, but that + was the only alternative that matched (albeit with a '>' after + it). We can assume it's just a typo from the user, and a + diagnostic will then be issued. */ + return cp_parser_type_id (parser); } /* Parse an explicit-instantiation. @@ -8025,7 +8360,8 @@ cp_parser_explicit_instantiation (cp_parser* parser) /* Parse the declarator. */ declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED, - /*ctor_dtor_or_conv_p=*/NULL); + /*ctor_dtor_or_conv_p=*/NULL, + /*parenthesized_p=*/NULL); cp_parser_check_for_definition_in_return_type (declarator, declares_class_or_enum); decl = grokdeclarator (declarator, decl_specifiers, @@ -8344,7 +8680,8 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags, cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/false); /* If we have seen a nested-name-specifier, and the next token is `template', then we are using the template-id production. */ if (parser->scope @@ -8353,7 +8690,8 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags, /* Look for the template-id. */ type = cp_parser_template_id (parser, /*template_keyword_p=*/true, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + /*is_declaration=*/false); /* If the template-id did not name a type, we are out of luck. */ if (TREE_CODE (type) != TYPE_DECL) @@ -8364,12 +8702,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags, } /* Otherwise, look for a type-name. */ else - { - type = cp_parser_type_name (parser); - if (type == error_mark_node) - type = NULL_TREE; - } - + type = cp_parser_type_name (parser); /* If it didn't work out, we don't have a TYPE. */ if ((flags & CP_PARSER_FLAGS_OPTIONAL) && !cp_parser_parse_definitely (parser)) @@ -8383,6 +8716,12 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags, return error_mark_node; } + /* There is no valid C++ program where a non-template type is + followed by a "<". That usually indicates that the user thought + that the type was a template. */ + if (type && type != error_mark_node) + cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type)); + return type; } @@ -8415,7 +8754,8 @@ cp_parser_type_name (cp_parser* parser) /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency_p=*/true, - /*class_head_p=*/false); + /*class_head_p=*/false, + /*is_declaration=*/false); /* If it's not a class-name, keep looking. */ if (!cp_parser_parse_definitely (parser)) { @@ -8429,7 +8769,9 @@ cp_parser_type_name (cp_parser* parser) /* Issue an error if we did not find a type-name. */ if (TREE_CODE (type_decl) != TYPE_DECL) { - cp_parser_error (parser, "expected type-name"); + if (!cp_parser_simulate_error (parser)) + cp_parser_name_lookup_error (parser, identifier, type_decl, + "is not a type"); type_decl = error_mark_node; } /* Remember that the name was used in the definition of the @@ -8456,6 +8798,14 @@ cp_parser_type_name (cp_parser* parser) typename :: [opt] nested-name-specifier template [opt] template-id + GNU extension: + + elaborated-type-specifier: + class-key attributes :: [opt] nested-name-specifier [opt] identifier + class-key attributes :: [opt] nested-name-specifier [opt] + template [opt] template-id + enum attributes :: [opt] nested-name-specifier [opt] identifier + If IS_FRIEND is TRUE, then this elaborated-type-specifier is being declared `friend'. If IS_DECLARATION is TRUE, then this elaborated-type-specifier appears in a decl-specifiers-seq, i.e., @@ -8471,6 +8821,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, enum tag_types tag_type; tree identifier; tree type = NULL_TREE; + tree attributes = NULL_TREE; /* See if we're looking at the `enum' keyword. */ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ENUM)) @@ -8479,6 +8830,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, cp_lexer_consume_token (parser->lexer); /* Remember that it's an enumeration type. */ tag_type = enum_type; + /* Parse the attributes. */ + attributes = cp_parser_attributes_opt (parser); } /* Or, it might be `typename'. */ else if (cp_lexer_next_token_is_keyword (parser->lexer, @@ -8498,6 +8851,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, tag_type = cp_parser_class_key (parser); if (tag_type == none_type) return error_mark_node; + /* Parse the attributes. */ + attributes = cp_parser_attributes_opt (parser); } /* Look for the `::' operator. */ @@ -8509,7 +8864,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, if (cp_parser_nested_name_specifier (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, - /*type_p=*/true) + /*type_p=*/true, + is_declaration) == error_mark_node) return error_mark_node; } @@ -8520,7 +8876,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, - /*type_p=*/true); + /*type_p=*/true, + is_declaration); /* For everything but enumeration types, consider a template-id. */ if (tag_type != enum_type) { @@ -8535,7 +8892,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, cp_parser_parse_tentatively (parser); /* Parse the template-id. */ decl = cp_parser_template_id (parser, template_p, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + is_declaration); /* If we didn't find a template-id, look for an ordinary identifier. */ if (!template_p && !cp_parser_parse_definitely (parser)) @@ -8664,7 +9022,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, declaration context. */ type = xref_tag (tag_type, identifier, - /*attributes=*/NULL_TREE, + attributes, (is_friend || !is_declaration || cp_lexer_next_token_is_not (parser->lexer, @@ -8674,6 +9032,11 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, } if (tag_type != enum_type) cp_parser_check_class_key (tag_type, type); + + /* A "<" cannot follow an elaborated type specifier. If that + happens, the user was probably trying to form a template-id. */ + cp_parser_check_for_invalid_template_id (parser, type); + return type; } @@ -8963,7 +9326,8 @@ cp_parser_qualified_namespace_specifier (cp_parser* parser) cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/true); return cp_parser_namespace_name (parser); } @@ -9009,14 +9373,16 @@ cp_parser_using_declaration (cp_parser* parser) if (typename_p || !global_scope_p) cp_parser_nested_name_specifier (parser, typename_p, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/true); /* Otherwise, we could be in either of the two productions. In that case, treat the nested-name-specifier as optional. */ else cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/true); /* Parse the unqualified-id. */ identifier = cp_parser_unqualified_id (parser, @@ -9050,13 +9416,7 @@ cp_parser_using_declaration (cp_parser* parser) { decl = cp_parser_lookup_name_simple (parser, identifier); if (decl == error_mark_node) - { - if (parser->scope && parser->scope != global_namespace) - error ("`%D::%D' has not been declared", - parser->scope, identifier); - else - error ("`::%D' has not been declared", identifier); - } + cp_parser_name_lookup_error (parser, identifier, decl, NULL); else if (scope) do_local_using_decl (decl); else @@ -9078,6 +9438,7 @@ static void cp_parser_using_directive (cp_parser* parser) { tree namespace_decl; + tree attribs; /* Look for the `using' keyword. */ cp_parser_require_keyword (parser, RID_USING, "`using'"); @@ -9089,11 +9450,14 @@ cp_parser_using_directive (cp_parser* parser) cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/true); /* Get the namespace being used. */ namespace_decl = cp_parser_namespace_name (parser); + /* And any specified attributes. */ + attribs = cp_parser_attributes_opt (parser); /* Update the symbol table. */ - do_using_directive (namespace_decl); + parse_using_directive (namespace_decl, attribs); /* Look for the final `;'. */ cp_parser_require (parser, CPP_SEMICOLON, "`;'"); } @@ -9219,7 +9583,8 @@ cp_parser_asm_definition (cp_parser* parser) } /* Look for the closing `)'. */ if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'")) - cp_parser_skip_to_closing_parenthesis (parser, true, false); + cp_parser_skip_to_closing_parenthesis (parser, true, false, + /*consume_paren=*/true); cp_parser_require (parser, CPP_SEMICOLON, "`;'"); /* Create the ASM_STMT. */ @@ -9249,6 +9614,16 @@ cp_parser_asm_definition (cp_parser* parser) init-declarator: declarator asm-specification [opt] attributes [opt] initializer [opt] + function-definition: + decl-specifier-seq [opt] declarator ctor-initializer [opt] + function-body + decl-specifier-seq [opt] declarator function-try-block + + GNU Extension: + + function-definition: + __extension__ function-definition + The DECL_SPECIFIERS and PREFIX_ATTRIBUTES apply to this declarator. Returns a representation of the entity declared. If MEMBER_P is TRUE, then this declarator appears in a class scope. The new DECL created @@ -9298,7 +9673,8 @@ cp_parser_init_declarator (cp_parser* parser, /* Parse the declarator. */ declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED, - &ctor_dtor_or_conv_p); + &ctor_dtor_or_conv_p, + /*parenthesized_p=*/NULL); /* Gather up the deferred checks. */ stop_deferring_access_checks (); @@ -9356,8 +9732,15 @@ cp_parser_init_declarator (cp_parser* parser, *function_definition_p = true; /* Parse the function definition. */ - decl = (cp_parser_function_definition_from_specifiers_and_declarator - (parser, decl_specifiers, prefix_attributes, declarator)); + if (member_p) + decl = cp_parser_save_member_function_body (parser, + decl_specifiers, + declarator, + prefix_attributes); + else + decl + = (cp_parser_function_definition_from_specifiers_and_declarator + (parser, decl_specifiers, prefix_attributes, declarator)); return decl; } @@ -9560,12 +9943,16 @@ cp_parser_init_declarator (cp_parser* parser, semantic analysis, rather than parsing, but that makes it difficult to handle something like `f()'. We want to notice that there are no decl-specifiers, and therefore realize that this is an - expression, not a declaration.) */ + expression, not a declaration.) + + If PARENTHESIZED_P is non-NULL, *PARENTHESIZED_P is set to true iff + the declarator is a direct-declarator of the form "(...)". */ static tree cp_parser_declarator (cp_parser* parser, cp_parser_declarator_kind dcl_kind, - int* ctor_dtor_or_conv_p) + int* ctor_dtor_or_conv_p, + bool* parenthesized_p) { cp_token *token; tree declarator; @@ -9594,6 +9981,10 @@ cp_parser_declarator (cp_parser* parser, /* If that worked, then we have a ptr-operator. */ if (cp_parser_parse_definitely (parser)) { + /* If a ptr-operator was found, then this declarator was not + parenthesized. */ + if (parenthesized_p) + *parenthesized_p = true; /* The dependent declarator is optional if we are parsing an abstract-declarator. */ if (dcl_kind != CP_PARSER_DECLARATOR_NAMED) @@ -9601,7 +9992,8 @@ cp_parser_declarator (cp_parser* parser, /* Parse the dependent declarator. */ declarator = cp_parser_declarator (parser, dcl_kind, - /*ctor_dtor_or_conv_p=*/NULL); + /*ctor_dtor_or_conv_p=*/NULL, + /*parenthesized_p=*/NULL); /* If we are parsing an abstract-declarator, we must handle the case where the dependent declarator is absent. */ @@ -9622,8 +10014,13 @@ cp_parser_declarator (cp_parser* parser, } /* Everything else is a direct-declarator. */ else - declarator = cp_parser_direct_declarator (parser, dcl_kind, - ctor_dtor_or_conv_p); + { + if (parenthesized_p) + *parenthesized_p = cp_lexer_next_token_is (parser->lexer, + CPP_OPEN_PAREN); + declarator = cp_parser_direct_declarator (parser, dcl_kind, + ctor_dtor_or_conv_p); + } if (attributes && declarator != error_mark_node) declarator = tree_cons (attributes, declarator, NULL_TREE); @@ -9797,7 +10194,8 @@ cp_parser_direct_declarator (cp_parser* parser, cp_lexer_consume_token (parser->lexer); /* Parse the nested declarator. */ declarator - = cp_parser_declarator (parser, dcl_kind, ctor_dtor_or_conv_p); + = cp_parser_declarator (parser, dcl_kind, ctor_dtor_or_conv_p, + /*parenthesized_p=*/NULL); first = false; /* Expect a `)'. */ if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'")) @@ -9853,7 +10251,7 @@ cp_parser_direct_declarator (cp_parser* parser, } else if (first && dcl_kind != CP_PARSER_DECLARATOR_ABSTRACT) { - /* Parse a declarator_id */ + /* Parse a declarator-id */ if (dcl_kind == CP_PARSER_DECLARATOR_EITHER) cp_parser_parse_tentatively (parser); declarator = cp_parser_declarator_id (parser); @@ -10040,7 +10438,8 @@ cp_parser_ptr_operator (cp_parser* parser, cp_parser_nested_name_specifier (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/true, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/false); /* If we found it, and the next token is a `*', then we are indeed looking at a pointer-to-member operator. */ if (!cp_parser_error_occurred (parser) @@ -10207,7 +10606,8 @@ cp_parser_type_id (cp_parser* parser) cp_parser_parse_tentatively (parser); /* Look for the declarator. */ abstract_declarator - = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_ABSTRACT, NULL); + = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_ABSTRACT, NULL, + /*parenthesized_p=*/NULL); /* Check to see if there really was a declarator. */ if (!cp_parser_parse_definitely (parser)) abstract_declarator = NULL_TREE; @@ -10383,9 +10783,12 @@ cp_parser_parameter_declaration_list (cp_parser* parser) while (true) { tree parameter; + bool parenthesized_p; /* Parse the parameter. */ parameter - = cp_parser_parameter_declaration (parser, /*template_parm_p=*/false); + = cp_parser_parameter_declaration (parser, + /*template_parm_p=*/false, + &parenthesized_p); /* If a parse error occurred parsing the parameter declaration, then the entire parameter-declaration-list is erroneous. */ @@ -10415,10 +10818,37 @@ cp_parser_parameter_declaration_list (cp_parser* parser) /* Otherwise, there must be more parameters. Consume the `,'. */ cp_lexer_consume_token (parser->lexer); + /* When parsing something like: + + int i(float f, double d) + + we can tell after seeing the declaration for "f" that we + are not looking at an initialization of a variable "i", + but rather at the declaration of a function "i". + + Due to the fact that the parsing of template arguments + (as specified to a template-id) requires backtracking we + cannot use this technique when inside a template argument + list. */ + if (!parser->in_template_argument_list_p + && cp_parser_parsing_tentatively (parser) + && !cp_parser_committed_to_tentative_parse (parser) + /* However, a parameter-declaration of the form + "foat(f)" (which is a valid declaration of a + parameter "f") can also be interpreted as an + expression (the conversion of "f" to "float"). */ + && !parenthesized_p) + cp_parser_commit_to_tentative_parse (parser); } else { cp_parser_error (parser, "expected `,' or `...'"); + if (!cp_parser_parsing_tentatively (parser) + || cp_parser_committed_to_tentative_parse (parser)) + cp_parser_skip_to_closing_parenthesis (parser, + /*recovering=*/true, + /*or_comma=*/false, + /*consume_paren=*/false); break; } } @@ -10441,14 +10871,18 @@ cp_parser_parameter_declaration_list (cp_parser* parser) is not interpreted as a greater-than operator.) Returns a TREE_LIST representing the parameter-declaration. The - TREE_VALUE is a representation of the decl-specifier-seq and - declarator. In particular, the TREE_VALUE will be a TREE_LIST - whose TREE_PURPOSE represents the decl-specifier-seq and whose - TREE_VALUE represents the declarator. */ + TREE_PURPOSE is the default argument expression, or NULL_TREE if + there is no default argument. The TREE_VALUE is a representation + of the decl-specifier-seq and declarator. In particular, the + TREE_VALUE will be a TREE_LIST whose TREE_PURPOSE represents the + decl-specifier-seq and whose TREE_VALUE represents the declarator. + If PARENTHESIZED_P is non-NULL, *PARENTHESIZED_P is set to true iff + the declarator is of the form "(p)". */ static tree cp_parser_parameter_declaration (cp_parser *parser, - bool template_parm_p) + bool template_parm_p, + bool *parenthesized_p) { int declares_class_or_enum; bool greater_than_is_operator_p; @@ -10498,16 +10932,31 @@ cp_parser_parameter_declaration (cp_parser *parser, || token->type == CPP_EQ || token->type == CPP_ELLIPSIS || token->type == CPP_GREATER) - declarator = NULL_TREE; + { + declarator = NULL_TREE; + if (parenthesized_p) + *parenthesized_p = false; + } /* Otherwise, there should be a declarator. */ else { bool saved_default_arg_ok_p = parser->default_arg_ok_p; parser->default_arg_ok_p = false; + /* After seeing a decl-specifier-seq, if the next token is not a + "(", there is no possibility that the code is a valid + expression initializer. Therefore, if parsing tentatively, + we commit at this point. */ + if (!parser->in_template_argument_list_p + && cp_parser_parsing_tentatively (parser) + && !cp_parser_committed_to_tentative_parse (parser) + && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN)) + cp_parser_commit_to_tentative_parse (parser); + /* Parse the declarator. */ declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_EITHER, - /*ctor_dtor_or_conv_p=*/NULL); + /*ctor_dtor_or_conv_p=*/NULL, + parenthesized_p); parser->default_arg_ok_p = saved_default_arg_ok_p; /* After the declarator, allow more attributes. */ attributes = chainon (attributes, cp_parser_attributes_opt (parser)); @@ -10661,184 +11110,6 @@ cp_parser_parameter_declaration (cp_parser *parser, return parameter; } -/* Parse a function-definition. - - function-definition: - decl-specifier-seq [opt] declarator ctor-initializer [opt] - function-body - decl-specifier-seq [opt] declarator function-try-block - - GNU Extension: - - function-definition: - __extension__ function-definition - - Returns the FUNCTION_DECL for the function. If FRIEND_P is - non-NULL, *FRIEND_P is set to TRUE iff the function was declared to - be a `friend'. */ - -static tree -cp_parser_function_definition (cp_parser* parser, bool* friend_p) -{ - tree decl_specifiers; - tree attributes; - tree declarator; - tree fn; - cp_token *token; - int declares_class_or_enum; - bool member_p; - /* The saved value of the PEDANTIC flag. */ - int saved_pedantic; - - /* Any pending qualification must be cleared by our caller. It is - more robust to force the callers to clear PARSER->SCOPE than to - do it here since if the qualification is in effect here, it might - also end up in effect elsewhere that it is not intended. */ - my_friendly_assert (!parser->scope, 20010821); - - /* Handle `__extension__'. */ - if (cp_parser_extension_opt (parser, &saved_pedantic)) - { - /* Parse the function-definition. */ - fn = cp_parser_function_definition (parser, friend_p); - /* Restore the PEDANTIC flag. */ - pedantic = saved_pedantic; - - return fn; - } - - /* Check to see if this definition appears in a class-specifier. */ - member_p = (at_class_scope_p () - && TYPE_BEING_DEFINED (current_class_type)); - /* Defer access checks in the decl-specifier-seq until we know what - function is being defined. There is no need to do this for the - definition of member functions; we cannot be defining a member - from another class. */ - push_deferring_access_checks (member_p ? dk_no_check: dk_deferred); - - /* Parse the decl-specifier-seq. */ - decl_specifiers - = cp_parser_decl_specifier_seq (parser, - CP_PARSER_FLAGS_OPTIONAL, - &attributes, - &declares_class_or_enum); - /* Figure out whether this declaration is a `friend'. */ - if (friend_p) - *friend_p = cp_parser_friend_p (decl_specifiers); - - /* Parse the declarator. */ - declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED, - /*ctor_dtor_or_conv_p=*/NULL); - - /* Gather up any access checks that occurred. */ - stop_deferring_access_checks (); - - /* If something has already gone wrong, we may as well stop now. */ - if (declarator == error_mark_node) - { - /* Skip to the end of the function, or if this wasn't anything - like a function-definition, to a `;' in the hopes of finding - a sensible place from which to continue parsing. */ - cp_parser_skip_to_end_of_block_or_statement (parser); - pop_deferring_access_checks (); - return error_mark_node; - } - - /* The next character should be a `{' (for a simple function - definition), a `:' (for a ctor-initializer), or `try' (for a - function-try block). */ - token = cp_lexer_peek_token (parser->lexer); - if (!cp_parser_token_starts_function_definition_p (token)) - { - /* Issue the error-message. */ - cp_parser_error (parser, "expected function-definition"); - /* Skip to the next `;'. */ - cp_parser_skip_to_end_of_block_or_statement (parser); - - pop_deferring_access_checks (); - return error_mark_node; - } - - cp_parser_check_for_definition_in_return_type (declarator, - declares_class_or_enum); - - /* If we are in a class scope, then we must handle - function-definitions specially. In particular, we save away the - tokens that make up the function body, and parse them again - later, in order to handle code like: - - struct S { - int f () { return i; } - int i; - }; - - Here, we cannot parse the body of `f' until after we have seen - the declaration of `i'. */ - if (member_p) - { - cp_token_cache *cache; - - /* Create the function-declaration. */ - fn = start_method (decl_specifiers, declarator, attributes); - /* If something went badly wrong, bail out now. */ - if (fn == error_mark_node) - { - /* If there's a function-body, skip it. */ - if (cp_parser_token_starts_function_definition_p - (cp_lexer_peek_token (parser->lexer))) - cp_parser_skip_to_end_of_block_or_statement (parser); - pop_deferring_access_checks (); - return error_mark_node; - } - - /* Remember it, if there default args to post process. */ - cp_parser_save_default_args (parser, fn); - - /* Create a token cache. */ - cache = cp_token_cache_new (); - /* Save away the tokens that make up the body of the - function. */ - cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0); - /* Handle function try blocks. */ - while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH)) - cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0); - - /* Save away the inline definition; we will process it when the - class is complete. */ - DECL_PENDING_INLINE_INFO (fn) = cache; - DECL_PENDING_INLINE_P (fn) = 1; - - /* We need to know that this was defined in the class, so that - friend templates are handled correctly. */ - DECL_INITIALIZED_IN_CLASS_P (fn) = 1; - - /* We're done with the inline definition. */ - finish_method (fn); - - /* Add FN to the queue of functions to be parsed later. */ - TREE_VALUE (parser->unparsed_functions_queues) - = tree_cons (NULL_TREE, fn, - TREE_VALUE (parser->unparsed_functions_queues)); - - pop_deferring_access_checks (); - return fn; - } - - /* Check that the number of template-parameter-lists is OK. */ - if (!cp_parser_check_declarator_template_parameters (parser, - declarator)) - { - cp_parser_skip_to_end_of_block_or_statement (parser); - pop_deferring_access_checks (); - return error_mark_node; - } - - fn = cp_parser_function_definition_from_specifiers_and_declarator - (parser, decl_specifiers, attributes, declarator); - pop_deferring_access_checks (); - return fn; -} - /* Parse a function-body. function-body: @@ -11085,7 +11356,8 @@ cp_parser_class_name (cp_parser *parser, bool template_keyword_p, bool type_p, bool check_dependency_p, - bool class_head_p) + bool class_head_p, + bool is_declaration) { tree decl; tree scope; @@ -11150,7 +11422,8 @@ cp_parser_class_name (cp_parser *parser, { /* Try a template-id. */ decl = cp_parser_template_id (parser, template_keyword_p, - check_dependency_p); + check_dependency_p, + is_declaration); if (decl == error_mark_node) return error_mark_node; } @@ -11237,6 +11510,8 @@ cp_parser_class_specifier (cp_parser* parser) parser->num_template_parameter_lists = 0; /* Start the class. */ + if (nested_name_specifier_p) + push_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (type))); type = begin_class_definition (type); if (type == error_mark_node) /* If the type is erroneous, skip the entire body of the class. */ @@ -11374,6 +11649,7 @@ cp_parser_class_head (cp_parser* parser, bool template_id_p = false; bool qualified_p = false; bool invalid_nested_name_p = false; + bool invalid_explicit_specialization_p = false; unsigned num_templates; /* Assume no nested-name-specifier will be present. */ @@ -11410,7 +11686,8 @@ cp_parser_class_head (cp_parser* parser, = cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/false, - /*type_p=*/false); + /*type_p=*/false, + /*is_declaration=*/false); /* If there was a nested-name-specifier, then there *must* be an identifier. */ if (nested_name_specifier) @@ -11438,7 +11715,8 @@ cp_parser_class_head (cp_parser* parser, /*template_keyword_p=*/false, /*type_p=*/true, /*check_dependency_p=*/false, - /*class_head_p=*/true); + /*class_head_p=*/true, + /*is_declaration=*/false); /* If that didn't work, ignore the nested-name-specifier. */ if (!cp_parser_parse_definitely (parser)) { @@ -11479,7 +11757,8 @@ cp_parser_class_head (cp_parser* parser, /* Check for a template-id. */ id = cp_parser_template_id (parser, /*template_keyword_p=*/false, - /*check_dependency_p=*/true); + /*check_dependency_p=*/true, + /*is_declaration=*/true); /* If that didn't work, it could still be an identifier. */ if (!cp_parser_parse_definitely (parser)) { @@ -11497,6 +11776,8 @@ cp_parser_class_head (cp_parser* parser, pop_deferring_access_checks (); + cp_parser_check_for_invalid_template_id (parser, id); + /* If it's not a `:' or a `{' then we can't really be looking at a class-head, since a class-head only appears as part of a class-specifier. We have to detect this situation before calling @@ -11517,12 +11798,31 @@ cp_parser_class_head (cp_parser* parser, else if (invalid_nested_name_p) cp_parser_error (parser, "qualified name does not name a class"); + /* An explicit-specialization must be preceded by "template <>". If + it is not, try to recover gracefully. */ + if (at_namespace_scope_p () + && parser->num_template_parameter_lists == 0 + && template_id_p) + { + error ("an explicit specialization must be preceded by 'template <>'"); + invalid_explicit_specialization_p = true; + /* Take the same action that would have been taken by + cp_parser_explicit_specialization. */ + ++parser->num_template_parameter_lists; + begin_specialization (); + } + /* There must be no "return" statements between this point and the + end of this function; set "type "to the correct return value and + use "goto done;" to return. */ /* Make sure that the right number of template parameters were present. */ if (!cp_parser_check_template_parameters (parser, num_templates)) - /* If something went wrong, there is no point in even trying to - process the class-definition. */ - return NULL_TREE; + { + /* If something went wrong, there is no point in even trying to + process the class-definition. */ + type = NULL_TREE; + goto done; + } /* Look up the type. */ if (template_id_p) @@ -11574,7 +11874,8 @@ cp_parser_class_head (cp_parser* parser, { error ("declaration of `%D' in `%D' which does not " "enclose `%D'", type, scope, nested_name_specifier); - return NULL_TREE; + type = NULL_TREE; + goto done; } /* [dcl.meaning] @@ -11600,7 +11901,10 @@ cp_parser_class_head (cp_parser* parser, type = push_template_decl (type); type = TREE_TYPE (type); if (nested_name_specifier) - *nested_name_specifier_p = true; + { + *nested_name_specifier_p = true; + pop_scope (nested_name_specifier); + } } /* Indicate whether this class was declared as a `class' or as a `struct'. */ @@ -11633,6 +11937,12 @@ cp_parser_class_head (cp_parser* parser, if (nested_name_specifier) pop_scope (nested_name_specifier); + done: + if (invalid_explicit_specialization_p) + { + end_specialization (); + --parser->num_template_parameter_lists; + } return type; } @@ -11775,10 +12085,6 @@ cp_parser_member_declaration (cp_parser* parser) return; } - /* We can't tell whether we're looking at a declaration or a - function-definition. */ - cp_parser_parse_tentatively (parser); - /* Parse the decl-specifier-seq. */ decl_specifiers = cp_parser_decl_specifier_seq (parser, @@ -11945,7 +12251,8 @@ cp_parser_member_declaration (cp_parser* parser) /* Parse the declarator. */ declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED, - &ctor_dtor_or_conv_p); + &ctor_dtor_or_conv_p, + /*parenthesized_p=*/NULL); /* If something went wrong parsing the declarator, make sure that we at least consume some tokens. */ @@ -11953,7 +12260,15 @@ cp_parser_member_declaration (cp_parser* parser) { /* Skip to the end of the statement. */ cp_parser_skip_to_end_of_statement (parser); - break; + /* If the next token is not a semicolon, that is + probably because we just skipped over the body of + a function. So, we consume a semicolon if + present, but do not issue an error message if it + is not present. */ + if (cp_lexer_next_token_is (parser->lexer, + CPP_SEMICOLON)) + cp_lexer_consume_token (parser->lexer); + return; } cp_parser_check_for_definition_in_return_type @@ -11994,13 +12309,8 @@ cp_parser_member_declaration (cp_parser* parser) if (TREE_CODE (declarator) == CALL_EXPR) initializer = cp_parser_pure_specifier (parser); else - { - /* This declaration cannot be a function - definition. */ - cp_parser_commit_to_tentative_parse (parser); - /* Parse the initializer. */ - initializer = cp_parser_constant_initializer (parser); - } + /* Parse the initializer. */ + initializer = cp_parser_constant_initializer (parser); } /* Otherwise, there is no initializer. */ else @@ -12013,7 +12323,28 @@ cp_parser_member_declaration (cp_parser* parser) that we are looking at a member-declarator. */ if (cp_parser_token_starts_function_definition_p (cp_lexer_peek_token (parser->lexer))) - decl = error_mark_node; + { + /* The grammar does not allow a pure-specifier to be + used when a member function is defined. (It is + possible that this fact is an oversight in the + standard, since a pure function may be defined + outside of the class-specifier. */ + if (initializer) + error ("pure-specifier on function-definition"); + decl = cp_parser_save_member_function_body (parser, + decl_specifiers, + declarator, + attributes); + /* If the member was not a friend, declare it here. */ + if (!friend_p) + finish_member_declaration (decl); + /* Peek at the next token. */ + token = cp_lexer_peek_token (parser->lexer); + /* If the next token is a semicolon, consume it. */ + if (token->type == CPP_SEMICOLON) + cp_lexer_consume_token (parser->lexer); + return; + } else { /* Create the declaration. */ @@ -12064,23 +12395,7 @@ cp_parser_member_declaration (cp_parser* parser) } } - /* If everything went well, look for the `;'. */ - if (cp_parser_parse_definitely (parser)) - { - cp_parser_require (parser, CPP_SEMICOLON, "`;'"); - return; - } - - /* Parse the function-definition. */ - decl = cp_parser_function_definition (parser, &friend_p); - /* If the member was not a friend, declare it here. */ - if (!friend_p) - finish_member_declaration (decl); - /* Peek at the next token. */ - token = cp_lexer_peek_token (parser->lexer); - /* If the next token is a semicolon, consume it. */ - if (token->type == CPP_SEMICOLON) - cp_lexer_consume_token (parser->lexer); + cp_parser_require (parser, CPP_SEMICOLON, "`;'"); } /* Parse a pure-specifier. @@ -12300,7 +12615,8 @@ cp_parser_base_specifier (cp_parser* parser) cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, - /*type_p=*/true); + /*type_p=*/true, + /*is_declaration=*/true); /* If the base class is given by a qualified name, assume that names we see are type names or templates, as appropriate. */ class_scope_p = (parser->scope && TYPE_P (parser->scope)); @@ -12312,7 +12628,8 @@ cp_parser_base_specifier (cp_parser* parser) template_p, /*type_p=*/true, /*check_dependency_p=*/true, - /*class_head_p=*/false); + /*class_head_p=*/false, + /*is_declaration=*/true); if (type == error_mark_node) return error_mark_node; @@ -12538,7 +12855,8 @@ cp_parser_exception_declaration (cp_parser* parser) declarator = NULL_TREE; else declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_EITHER, - /*ctor_dtor_or_conv_p=*/NULL); + /*ctor_dtor_or_conv_p=*/NULL, + /*parenthesized_p=*/NULL); /* Restore the saved message. */ parser->type_definition_forbidden_message = saved_message; @@ -12557,15 +12875,21 @@ static tree cp_parser_throw_expression (cp_parser* parser) { tree expression; + cp_token* token; cp_parser_require_keyword (parser, RID_THROW, "`throw'"); - /* We can't be sure if there is an assignment-expression or not. */ - cp_parser_parse_tentatively (parser); - /* Try it. */ - expression = cp_parser_assignment_expression (parser); - /* If it didn't work, this is just a rethrow. */ - if (!cp_parser_parse_definitely (parser)) + token = cp_lexer_peek_token (parser->lexer); + /* Figure out whether or not there is an assignment-expression + following the "throw" keyword. */ + if (token->type == CPP_COMMA + || token->type == CPP_SEMICOLON + || token->type == CPP_CLOSE_PAREN + || token->type == CPP_CLOSE_SQUARE + || token->type == CPP_CLOSE_BRACE + || token->type == CPP_COLON) expression = NULL_TREE; + else + expression = cp_parser_assignment_expression (parser); return build_throw (expression); } @@ -13403,7 +13727,8 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) = (cp_parser_nested_name_specifier_opt (parser, /*typename_keyword_p=*/false, /*check_dependency_p=*/false, - /*type_p=*/false) + /*type_p=*/false, + /*is_declaration=*/false) != NULL_TREE); /* Outside of a class-specifier, there must be a nested-name-specifier. */ @@ -13431,7 +13756,8 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) /*template_keyword_p=*/false, /*type_p=*/false, /*check_dependency_p=*/false, - /*class_head_p=*/false); + /*class_head_p=*/false, + /*is_declaration=*/false); /* If there was no class-name, then this is not a constructor. */ constructor_p = !cp_parser_error_occurred (parser); } @@ -13578,7 +13904,8 @@ cp_parser_function_definition_after_declarator (cp_parser* parser, /* Issue an error message. */ error ("named return values are no longer supported"); /* Skip tokens until we reach the start of the function body. */ - while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)) + while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE) + && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF)) cp_lexer_consume_token (parser->lexer); } /* The `extern' in `extern "C" void f () { ... }' does not apply to @@ -13634,19 +13961,23 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p) if (!cp_parser_require (parser, CPP_LESS, "`<'")) return; - /* Parse the template parameters. */ - begin_template_parm_list (); /* If the next token is `>', then we have an invalid specialization. Rather than complain about an invalid template parameter, issue an error message here. */ if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER)) { cp_parser_error (parser, "invalid explicit specialization"); + begin_specialization (); parameter_list = NULL_TREE; } else - parameter_list = cp_parser_template_parameter_list (parser); - parameter_list = end_template_parm_list (parameter_list); + { + /* Parse the template parameters. */ + begin_template_parm_list (); + parameter_list = cp_parser_template_parameter_list (parser); + parameter_list = end_template_parm_list (parameter_list); + } + /* Look for the `>'. */ cp_parser_skip_until_found (parser, CPP_GREATER, "`>'"); /* We just processed one more parameter list. */ @@ -13712,10 +14043,8 @@ cp_parser_single_declaration (cp_parser* parser, tree decl = NULL_TREE; tree decl_specifiers; tree attributes; + bool function_definition_p = false; - /* Parse the dependent declaration. We don't know yet - whether it will be a function-definition. */ - cp_parser_parse_tentatively (parser); /* Defer access checks until we know what is being declared. */ push_deferring_access_checks (dk_deferred); @@ -13726,6 +14055,8 @@ cp_parser_single_declaration (cp_parser* parser, CP_PARSER_FLAGS_OPTIONAL, &attributes, &declares_class_or_enum); + if (friend_p) + *friend_p = cp_parser_friend_p (decl_specifiers); /* Gather up the access checks that occurred the decl-specifier-seq. */ stop_deferring_access_checks (); @@ -13755,10 +14086,10 @@ cp_parser_single_declaration (cp_parser* parser, decl = cp_parser_init_declarator (parser, decl_specifiers, attributes, - /*function_definition_allowed_p=*/false, + /*function_definition_allowed_p=*/true, member_p, declares_class_or_enum, - /*function_definition_p=*/NULL); + &function_definition_p); pop_deferring_access_checks (); @@ -13768,18 +14099,9 @@ cp_parser_single_declaration (cp_parser* parser, parser->qualifying_scope = NULL_TREE; parser->object_scope = NULL_TREE; /* Look for a trailing `;' after the declaration. */ - if (!cp_parser_require (parser, CPP_SEMICOLON, "`;'") - && cp_parser_committed_to_tentative_parse (parser)) + if (!function_definition_p + && !cp_parser_require (parser, CPP_SEMICOLON, "`;'")) cp_parser_skip_to_end_of_block_or_statement (parser); - /* If it worked, set *FRIEND_P based on the DECL_SPECIFIERS. */ - if (cp_parser_parse_definitely (parser)) - { - if (friend_p) - *friend_p = cp_parser_friend_p (decl_specifiers); - } - /* Otherwise, try a function-definition. */ - else - decl = cp_parser_function_definition (parser, friend_p); return decl; } @@ -13807,6 +14129,132 @@ cp_parser_functional_cast (cp_parser* parser, tree type) return build_functional_cast (type, expression_list); } +/* Save the tokens that make up the body of a member function defined + in a class-specifier. The DECL_SPECIFIERS and DECLARATOR have + already been parsed. The ATTRIBUTES are any GNU "__attribute__" + specifiers applied to the declaration. Returns the FUNCTION_DECL + for the member function. */ + +tree +cp_parser_save_member_function_body (cp_parser* parser, + tree decl_specifiers, + tree declarator, + tree attributes) +{ + cp_token_cache *cache; + tree fn; + + /* Create the function-declaration. */ + fn = start_method (decl_specifiers, declarator, attributes); + /* If something went badly wrong, bail out now. */ + if (fn == error_mark_node) + { + /* If there's a function-body, skip it. */ + if (cp_parser_token_starts_function_definition_p + (cp_lexer_peek_token (parser->lexer))) + cp_parser_skip_to_end_of_block_or_statement (parser); + return error_mark_node; + } + + /* Remember it, if there default args to post process. */ + cp_parser_save_default_args (parser, fn); + + /* Create a token cache. */ + cache = cp_token_cache_new (); + /* Save away the tokens that make up the body of the + function. */ + cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0); + /* Handle function try blocks. */ + while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH)) + cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0); + + /* Save away the inline definition; we will process it when the + class is complete. */ + DECL_PENDING_INLINE_INFO (fn) = cache; + DECL_PENDING_INLINE_P (fn) = 1; + + /* We need to know that this was defined in the class, so that + friend templates are handled correctly. */ + DECL_INITIALIZED_IN_CLASS_P (fn) = 1; + + /* We're done with the inline definition. */ + finish_method (fn); + + /* Add FN to the queue of functions to be parsed later. */ + TREE_VALUE (parser->unparsed_functions_queues) + = tree_cons (NULL_TREE, fn, + TREE_VALUE (parser->unparsed_functions_queues)); + + return fn; +} + +/* Parse a template-argument-list, as well as the trailing ">" (but + not the opening ">"). See cp_parser_template_argument_list for the + return value. */ + +static tree +cp_parser_enclosed_template_argument_list (cp_parser* parser) +{ + tree arguments; + tree saved_scope; + tree saved_qualifying_scope; + tree saved_object_scope; + bool saved_greater_than_is_operator_p; + + /* [temp.names] + + When parsing a template-id, the first non-nested `>' is taken as + the end of the template-argument-list rather than a greater-than + operator. */ + saved_greater_than_is_operator_p + = parser->greater_than_is_operator_p; + parser->greater_than_is_operator_p = false; + /* Parsing the argument list may modify SCOPE, so we save it + here. */ + saved_scope = parser->scope; + saved_qualifying_scope = parser->qualifying_scope; + saved_object_scope = parser->object_scope; + /* Parse the template-argument-list itself. */ + if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER)) + arguments = NULL_TREE; + else + arguments = cp_parser_template_argument_list (parser); + /* Look for the `>' that ends the template-argument-list. If we find + a '>>' instead, it's probably just a typo. */ + if (cp_lexer_next_token_is (parser->lexer, CPP_RSHIFT)) + { + if (!saved_greater_than_is_operator_p) + { + /* If we're in a nested template argument list, the '>>' has to be + a typo for '> >'. We emit the error message, but we continue + parsing and we push a '>' as next token, so that the argument + list will be parsed correctly.. */ + cp_token* token; + error ("`>>' should be `> >' within a nested template argument list"); + token = cp_lexer_peek_token (parser->lexer); + token->type = CPP_GREATER; + } + else + { + /* If this is not a nested template argument list, the '>>' is + a typo for '>'. Emit an error message and continue. */ + error ("spurious `>>', use `>' to terminate a template argument list"); + cp_lexer_consume_token (parser->lexer); + } + } + else + cp_parser_require (parser, CPP_GREATER, "`>'"); + /* The `>' token might be a greater-than operator again now. */ + parser->greater_than_is_operator_p + = saved_greater_than_is_operator_p; + /* Restore the SAVED_SCOPE. */ + parser->scope = saved_scope; + parser->qualifying_scope = saved_qualifying_scope; + parser->object_scope = saved_object_scope; + + return arguments; +} + /* MEMBER_FUNCTION is a member function, or a friend. If default arguments, or the body of the function have not yet been parsed, parse them now. */ @@ -13948,10 +14396,10 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) saved_local_variables_forbidden_p = parser->local_variables_forbidden_p; parser->local_variables_forbidden_p = true; /* Parse the assignment-expression. */ - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) push_nested_class (DECL_CONTEXT (fn)); TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser); - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) pop_nested_class (); /* Restore saved state. */ @@ -13975,7 +14423,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) static const char *format; tree expr = NULL_TREE; const char *saved_message; - bool saved_constant_expression_p; + bool saved_integral_constant_expression_p; /* Initialize FORMAT the first time we get here. */ if (!format) @@ -13994,8 +14442,8 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) /* The restrictions on constant-expressions do not apply inside sizeof expressions. */ - saved_constant_expression_p = parser->constant_expression_p; - parser->constant_expression_p = false; + saved_integral_constant_expression_p = parser->integral_constant_expression_p; + parser->integral_constant_expression_p = false; /* Do not actually evaluate the expression. */ ++skip_evaluation; @@ -14042,7 +14490,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) free ((char *) parser->type_definition_forbidden_message); /* And restore the old one. */ parser->type_definition_forbidden_message = saved_message; - parser->constant_expression_p = saved_constant_expression_p; + parser->integral_constant_expression_p = saved_integral_constant_expression_p; return expr; } @@ -14235,7 +14683,9 @@ cp_parser_next_token_starts_class_definition_p (cp_parser *parser) } /* Returns TRUE iff the next token is the "," or ">" ending a - template-argument. */ + template-argument. ">>" is also accepted (after the full + argument was parsed) because it's probably a typo for "> >", + and there is a specific diagnostic for this. */ static bool cp_parser_next_token_ends_template_argument_p (cp_parser *parser) @@ -14243,7 +14693,8 @@ cp_parser_next_token_ends_template_argument_p (cp_parser *parser) cp_token *token; token = cp_lexer_peek_token (parser->lexer); - return (token->type == CPP_COMMA || token->type == CPP_GREATER); + return (token->type == CPP_COMMA || token->type == CPP_GREATER + || token->type == CPP_RSHIFT); } /* Returns the kind of tag indicated by TOKEN, if it is a class-key, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 600d2402f3e..3c0e7d80213 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -731,8 +731,10 @@ maybe_process_partial_specialization (tree type) if (CLASSTYPE_IMPLICIT_INSTANTIATION (type) && !COMPLETE_TYPE_P (type)) { - if (current_namespace - != decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type))) + tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type)); + if (is_associated_namespace (current_namespace, tpl_ns)) + /* Same or super-using namespace. */; + else { pedwarn ("specializing `%#T' in different namespace", type); cp_pedwarn_at (" from definition of `%#D'", @@ -874,6 +876,140 @@ is_specialization_of (tree decl, tree tmpl) return 0; } +/* Returns nonzero iff DECL is a specialization of friend declaration + FRIEND according to [temp.friend]. */ + +bool +is_specialization_of_friend (tree decl, tree friend) +{ + bool need_template = true; + int template_depth; + + my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL, 0); + + /* For [temp.friend/6] when FRIEND is an ordinary member function + of a template class, we want to check if DECL is a specialization + if this. */ + if (TREE_CODE (friend) == FUNCTION_DECL + && DECL_TEMPLATE_INFO (friend) + && !DECL_USE_TEMPLATE (friend)) + { + friend = DECL_TI_TEMPLATE (friend); + need_template = false; + } + + /* There is nothing to do if this is not a template friend. */ + if (TREE_CODE (friend) != TEMPLATE_DECL) + return 0; + + if (is_specialization_of (decl, friend)) + return 1; + + /* [temp.friend/6] + A member of a class template may be declared to be a friend of a + non-template class. In this case, the corresponding member of + every specialization of the class template is a friend of the + class granting friendship. + + For example, given a template friend declaration + + template friend void A::f(); + + the member function below is considered a friend + + template <> struct A { + void f(); + }; + + For this type of template friend, TEMPLATE_DEPTH below will be + nonzero. To determine if DECL is a friend of FRIEND, we first + check if the enclosing class is a specialization of another. */ + + template_depth = template_class_depth (DECL_CONTEXT (friend)); + if (template_depth + && DECL_CLASS_SCOPE_P (decl) + && is_specialization_of (TYPE_NAME (DECL_CONTEXT (decl)), + CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (friend)))) + { + /* Next, we check the members themselves. In order to handle + a few tricky cases like + + template friend void A::g(T t); + template template friend void A::h(); + + we need to figure out what ARGS is (corresponding to `T' in above + examples) from DECL for later processing. */ + + tree context = DECL_CONTEXT (decl); + tree args = NULL_TREE; + int current_depth = 0; + while (current_depth < template_depth) + { + if (CLASSTYPE_TEMPLATE_INFO (context)) + { + if (current_depth == 0) + args = TYPE_TI_ARGS (context); + else + args = add_to_template_args (TYPE_TI_ARGS (context), args); + current_depth++; + } + context = TYPE_CONTEXT (context); + } + + if (TREE_CODE (decl) == FUNCTION_DECL) + { + bool is_template; + tree friend_type; + tree decl_type; + tree friend_args_type; + tree decl_args_type; + + /* Make sure that both DECL and FRIEND are templates or + non-templates. */ + is_template = DECL_TEMPLATE_INFO (decl) + && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl)); + if (need_template ^ is_template) + return 0; + else if (is_template) + { + /* If both are templates, check template parameter list. */ + tree friend_parms + = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend), + args, tf_none); + if (!comp_template_parms + (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (decl)), + friend_parms)) + return 0; + + decl_type = TREE_TYPE (DECL_TI_TEMPLATE (decl)); + } + else + decl_type = TREE_TYPE (decl); + + friend_type = tsubst_function_type (TREE_TYPE (friend), args, + tf_none, NULL_TREE); + if (friend_type == error_mark_node) + return 0; + + /* Check if return types match. */ + if (!same_type_p (TREE_TYPE (decl_type), TREE_TYPE (friend_type))) + return 0; + + /* Check if function parameter types match, ignoring the + `this' parameter. */ + friend_args_type = TYPE_ARG_TYPES (friend_type); + decl_args_type = TYPE_ARG_TYPES (decl_type); + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend)) + friend_args_type = TREE_CHAIN (friend_args_type); + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) + decl_args_type = TREE_CHAIN (decl_args_type); + if (compparms (decl_args_type, friend_args_type)) + return 1; + } + } + return 0; +} + /* Register the specialization SPEC as a specialization of TMPL with the indicated ARGS. Returns SPEC, or an equivalent prior declaration, if available. */ @@ -2087,7 +2223,7 @@ process_template_parm (tree list, tree next) else { t = make_aggr_type (TEMPLATE_TYPE_PARM); - /* parm is either IDENTIFIER_NODE or NULL_TREE */ + /* parm is either IDENTIFIER_NODE or NULL_TREE. */ decl = build_decl (TYPE_DECL, parm, t); } @@ -2859,10 +2995,8 @@ push_template_decl_real (tree decl, int is_friend) /* It is a conversion operator. See if the type converted to depends on innermost template operands. */ - if (for_each_template_parm (TREE_TYPE (TREE_TYPE (tmpl)), - template_parm_this_level_p, - &depth, - NULL)) + if (uses_template_parms_level (TREE_TYPE (TREE_TYPE (tmpl)), + depth)) DECL_TEMPLATE_CONV_FN_P (tmpl) = 1; } } @@ -3306,8 +3440,9 @@ convert_nontype_argument (tree type, tree expr) if (expr == error_mark_node) return error_mark_node; - my_friendly_assert (same_type_p (type, TREE_TYPE (expr)), - 0); + if (!same_type_p (type, TREE_TYPE (expr))) + return error_mark_node; + return expr; } break; @@ -3754,7 +3889,7 @@ mangle_class_name_for_template (const char* name, tree parms, tree arglist) cat (IDENTIFIER_POINTER (DECL_NAME (arg))); } else - /* Output the parameter declaration */ + /* Output the parameter declaration. */ cat (type_as_string (arg, TFF_CHASE_TYPEDEF)); continue; } @@ -4350,19 +4485,7 @@ lookup_template_class (tree d1, is set up. */ if (TREE_CODE (t) != ENUMERAL_TYPE) DECL_NAME (type_decl) = classtype_mangled_name (t); - if (!is_partial_instantiation) - { - /* For backwards compatibility; code that uses - -fexternal-templates expects looking up a template to - instantiate it. I think DDD still relies on this. - (jason 8/20/1998) */ - if (TREE_CODE (t) != ENUMERAL_TYPE - && flag_external_templates - && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template)) - && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template))) - add_pending_template (t); - } - else + if (is_partial_instantiation) /* If the type makes use of template parameters, the code that generates debugging information will crash. */ DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1; @@ -4495,7 +4618,7 @@ for_each_template_parm_r (tree* tp, int* walk_subtrees, void* d) break; case TEMPLATE_DECL: - /* A template template parameter is encountered */ + /* A template template parameter is encountered. */ if (DECL_TEMPLATE_TEMPLATE_PARM_P (t) && for_each_template_parm (TREE_TYPE (t), fn, data, pfd->visited)) return error_mark_node; @@ -4600,12 +4723,22 @@ for_each_template_parm (tree t, tree_fn_t fn, void* data, htab_t visited) return result; } +/* Returns true if T depends on any template parameter. */ + int uses_template_parms (tree t) { return for_each_template_parm (t, 0, 0, NULL); } +/* Returns true if T depends on any template parameter with level LEVEL. */ + +int +uses_template_parms_level (tree t, int level) +{ + return for_each_template_parm (t, template_parm_this_level_p, &level, NULL); +} + static int tinst_depth; extern int max_tinst_depth; #ifdef GATHER_STATISTICS @@ -4764,6 +4897,9 @@ tsubst_friend_function (tree decl, tree args) Then, in S, template void f(int, U) is not an instantiation of anything. */ + if (new_friend == error_mark_node) + return error_mark_node; + DECL_USE_TEMPLATE (new_friend) = 0; if (TREE_CODE (decl) == TEMPLATE_DECL) { @@ -4915,7 +5051,7 @@ tsubst_friend_function (tree decl, tree args) /* Check to see that the declaration is really present, and, possibly obtain an improved declaration. */ tree fn = check_classfn (DECL_CONTEXT (new_friend), - new_friend); + new_friend, false); if (fn) new_friend = fn; @@ -5134,24 +5270,7 @@ instantiate_class_template (tree type) args = inner_args; } - if (flag_external_templates) - { - if (flag_alt_external_templates) - { - CLASSTYPE_INTERFACE_ONLY (type) = interface_only; - SET_CLASSTYPE_INTERFACE_UNKNOWN_X (type, interface_unknown); - } - else - { - CLASSTYPE_INTERFACE_ONLY (type) = CLASSTYPE_INTERFACE_ONLY (pattern); - SET_CLASSTYPE_INTERFACE_UNKNOWN_X - (type, CLASSTYPE_INTERFACE_UNKNOWN (pattern)); - } - } - else - { - SET_CLASSTYPE_INTERFACE_UNKNOWN (type); - } + SET_CLASSTYPE_INTERFACE_UNKNOWN (type); /* Set the input location to the template definition. This is needed if tsubsting causes an error. */ @@ -5610,7 +5729,7 @@ tsubst_aggr_type (tree t, if (TYPE_PTRMEMFUNC_P (t)) return tsubst (TYPE_PTRMEMFUNC_FN_TYPE (t), args, complain, in_decl); - /* else fall through */ + /* Else fall through. */ case ENUMERAL_TYPE: case UNION_TYPE: if (TYPE_TEMPLATE_INFO (t)) @@ -6547,7 +6666,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM) { /* We are processing a type constructed from - a template template parameter */ + a template template parameter. */ tree argvec = tsubst (TYPE_TI_ARGS (t), args, complain, in_decl); if (argvec == error_mark_node) @@ -6977,7 +7096,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) if (e1 == error_mark_node || e2 == error_mark_node) return error_mark_node; - return build_nt (ARRAY_REF, e1, e2, tsubst_expr); + return build_nt (ARRAY_REF, e1, e2); } case CALL_EXPR: @@ -7907,7 +8026,7 @@ tsubst_copy_and_build (tree t, tree decl; cp_id_kind idk; tree qualifying_class; - bool non_constant_expression_p; + bool non_integral_constant_expression_p; const char *error_msg; if (IDENTIFIER_TYPENAME_P (t)) @@ -7927,9 +8046,9 @@ tsubst_copy_and_build (tree t, decl = finish_id_expression (t, decl, NULL_TREE, &idk, &qualifying_class, - /*constant_expression_p=*/false, - /*allow_non_constant_expression_p=*/false, - &non_constant_expression_p, + /*integral_constant_expression_p=*/false, + /*allow_non_integral_constant_expression_p=*/false, + &non_integral_constant_expression_p, &error_msg); if (error_msg) error (error_msg); @@ -8482,7 +8601,7 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) deferring all checks until we have the FUNCTION_DECL. */ push_deferring_access_checks (dk_deferred); - /* substitute template parameters */ + /* Substitute template parameters. */ fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl), targ_ptr, complain, gen_tmpl); @@ -8497,9 +8616,6 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) template, not the most general template. */ DECL_TI_TEMPLATE (fndecl) = tmpl; - if (flag_external_templates) - add_pending_template (fndecl); - /* If we've just instantiated the main entry point for a function, instantiate all the alternate entry points as well. We do this by cloning the instantiation of the main entry point, not by @@ -8910,7 +9026,7 @@ type_unification_real (tree tparms, are present, and the parm list isn't variadic. */ if (args && args != void_list_node && parms == void_list_node) return 1; - /* Fail if parms are left and they don't have default values. */ + /* Fail if parms are left and they don't have default values. */ if (parms && parms != void_list_node && TREE_PURPOSE (parms) == NULL_TREE) @@ -9615,6 +9731,27 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) TREE_VEC_ELT (targs, idx) = arg; return 0; + case PTRMEM_CST: + { + /* A pointer-to-member constant can be unified only with + another constant. */ + if (TREE_CODE (arg) != PTRMEM_CST) + return 1; + + /* Just unify the class member. It would be useless (and possibly + wrong, depending on the strict flags) to unify also + PTRMEM_CST_CLASS, because we want to be sure that both parm and + arg refer to the same variable, even if through different + classes. For instance: + + struct A { int x; }; + struct B : A { }; + + Unification of &A::x and &B::x must succeed. */ + return unify (tparms, targs, PTRMEM_CST_MEMBER (parm), + PTRMEM_CST_MEMBER (arg), strict); + } + case POINTER_TYPE: { if (TREE_CODE (arg) != POINTER_TYPE) @@ -9803,6 +9940,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) return 1; return 0; + case FIELD_DECL: case TEMPLATE_DECL: /* Matched cases are handled by the ARG == PARM test above. */ return 1; @@ -9826,7 +9964,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) return unify (tparms, targs, t1, t, strict); } - /* else fall through */ + /* Else fall through. */ default: if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (parm)))) @@ -10362,9 +10500,6 @@ do_decl_instantiation (tree decl, tree storage) return; } - if (flag_external_templates) - return; - if (storage == NULL_TREE) ; else if (storage == ridpointers[(int) RID_EXTERN]) @@ -10433,11 +10568,6 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) complete_type (t); - /* With -fexternal-templates, explicit instantiations are treated the same - as implicit ones. */ - if (flag_external_templates) - return; - if (!COMPLETE_TYPE_P (t)) { if (complain & tf_error) @@ -10820,22 +10950,6 @@ instantiate_decl (tree d, int defer_ok) else repo_template_used (d); - if (flag_external_templates && ! DECL_INTERFACE_KNOWN (d)) - { - if (flag_alt_external_templates) - { - if (interface_unknown) - warn_if_unknown_interface (d); - } - else if (DECL_INTERFACE_KNOWN (code_pattern)) - { - DECL_INTERFACE_KNOWN (d) = 1; - DECL_NOT_REALLY_EXTERN (d) = ! DECL_EXTERNAL (code_pattern); - } - else - warn_if_unknown_interface (code_pattern); - } - if (at_eof) import_export_decl (d); } @@ -10948,10 +11062,20 @@ instantiate_decl (tree d, int defer_ok) /* Mark D as instantiated so that recursive calls to instantiate_decl do not try to instantiate it again. */ DECL_TEMPLATE_INSTANTIATED (d) = 1; + /* This is done in analogous to `start_decl'. It is + required for correct access checking. */ + push_nested_class (DECL_CONTEXT (d)); cp_finish_decl (d, (!DECL_INITIALIZED_IN_CLASS_P (d) ? DECL_INITIAL (d) : NULL_TREE), NULL_TREE, 0); + /* Normally, pop_nested_class is called by cp_finish_decl + above. But when instantiate_decl is triggered during + instantiate_class_template processing, its DECL_CONTEXT + is still not completed yet, and pop_nested_class isn't + called. */ + if (!COMPLETE_TYPE_P (DECL_CONTEXT (d))) + pop_nested_class (); } } else if (TREE_CODE (d) == FUNCTION_DECL) @@ -11037,6 +11161,7 @@ instantiate_pending_templates (void) tree last = NULL_TREE; int instantiated_something = 0; int reconsider; + location_t saved_loc = input_location; do { @@ -11111,6 +11236,7 @@ instantiate_pending_templates (void) } while (reconsider); + input_location = saved_loc; return instantiated_something; } @@ -11743,6 +11869,17 @@ any_dependent_template_arguments_p (tree args) bool dependent_template_p (tree tmpl) { + if (TREE_CODE (tmpl) == OVERLOAD) + { + while (tmpl) + { + if (dependent_template_p (OVL_FUNCTION (tmpl))) + return true; + tmpl = OVL_CHAIN (tmpl); + } + return false; + } + /* Template template parameters are dependent. */ if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl) || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM) @@ -11867,7 +12004,9 @@ build_non_dependent_expr (tree expr) return build (COND_EXPR, TREE_TYPE (expr), TREE_OPERAND (expr, 0), - build_non_dependent_expr (TREE_OPERAND (expr, 1)), + (TREE_OPERAND (expr, 1) + ? build_non_dependent_expr (TREE_OPERAND (expr, 1)) + : build_non_dependent_expr (TREE_OPERAND (expr, 0))), build_non_dependent_expr (TREE_OPERAND (expr, 2))); if (TREE_CODE (expr) == COMPOUND_EXPR && !COMPOUND_EXPR_OVERLOADED (expr)) diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 6dbf0605a48..7979504e3fd 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -150,8 +150,10 @@ cxx_print_binding (FILE *stream, cxx_binding *binding, const char *prefix) void cxx_print_identifier (FILE *file, tree node, int indent) { + indent_to (file, indent); cxx_print_binding (file, IDENTIFIER_NAMESPACE_BINDINGS (node), "bindings"); print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4); + indent_to (file, indent); cxx_print_binding (file, IDENTIFIER_BINDING (node), "local bindings"); print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4); print_node (file, "template", IDENTIFIER_TEMPLATE (node), indent + 4); diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 7b7b48cecd5..c97cf422304 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -53,8 +53,8 @@ static const char *old_args, *old_dir, *old_main; static struct obstack temporary_obstack; -#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_3 (NODE)) -#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE)) +#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_5 (NODE)) +#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_6 (NODE)) #if 0 /* Record the flags used to compile this translation unit. */ @@ -211,6 +211,12 @@ extract_string (char **pp) int backquote = 0; int inside = 0; +#if defined(_WIN32) && !defined(__CYGWIN__) +#define QUOTE_CHAR '"' +#else +#define QUOTE_CHAR '\'' +#endif + for (;;) { char c = *p; @@ -223,7 +229,7 @@ extract_string (char **pp) break; else if (! inside && c == '\\') backquote = 1; - else if (c == '\'') + else if (c == QUOTE_CHAR) inside = !inside; else obstack_1grow (&temporary_obstack, c); @@ -267,7 +273,7 @@ get_base_filename (const char *filename) static void open_repo_file (const char *filename) { - register const char *p; + const char *p; const char *s = get_base_filename (filename); if (s == NULL) diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 391a581ad98..a965383ad4e 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1065,7 +1065,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p) else offset = BINFO_OFFSET (base_binfo); - /* combine offset and flags into one field */ + /* Combine offset and flags into one field. */ offset = cp_build_binary_op (LSHIFT_EXPR, offset, build_int_2 (8, 0)); offset = cp_build_binary_op (BIT_IOR_EXPR, offset, diff --git a/gcc/cp/search.c b/gcc/cp/search.c index dc8ef9046ec..15927c69166 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -125,7 +125,7 @@ push_search_level (struct stack_level *stack, struct obstack *obstack) static struct search_level * pop_search_level (struct stack_level *obstack) { - register struct search_level *stack = pop_stack_level (obstack); + struct search_level *stack = pop_stack_level (obstack); return stack; } @@ -422,7 +422,7 @@ get_dynamic_cast_base_type (tree subtype, tree target) tree lookup_field_1 (tree type, tree name, bool want_type) { - register tree field; + tree field; if (TREE_CODE (type) == TEMPLATE_TYPE_PARM || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM @@ -580,6 +580,16 @@ at_class_scope_p (void) return cs && TYPE_P (cs); } +/* Returns true if the innermost active scope is a namespace scope. */ + +bool +at_namespace_scope_p (void) +{ + /* We are in a namespace scope if we are not it a class scope or a + function scope. */ + return !current_scope(); +} + /* Return the scope of DECL, as appropriate when doing name-lookup. */ tree diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 13d873430ea..4cf0261aff2 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -960,7 +960,7 @@ finish_handler_parms (tree decl, tree handler) type = expand_start_catch_block (decl); HANDLER_TYPE (handler) = type; - if (type) + if (!processing_template_decl && type) mark_used (eh_type_info (type)); } @@ -1232,7 +1232,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) type = TREE_TYPE (type); else { - /* Set the cv qualifiers */ + /* Set the cv qualifiers. */ int quals = cp_type_quals (TREE_TYPE (current_class_ref)); if (DECL_MUTABLE_P (decl)) @@ -1263,7 +1263,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) } } - /* If PROCESSING_TEMPLATE_DECL is non-zero here, then + /* If PROCESSING_TEMPLATE_DECL is nonzero here, then QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF for now. */ if (processing_template_decl) @@ -1638,6 +1638,8 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) if (DECL_FUNCTION_MEMBER_P (f)) { tree type = currently_open_derived_class (DECL_CONTEXT (f)); + if (!type) + type = DECL_CONTEXT (f); fn = build_baselink (TYPE_BINFO (type), TYPE_BINFO (type), fn, /*optype=*/NULL_TREE); @@ -2322,9 +2324,9 @@ finish_id_expression (tree id_expression, tree scope, cp_id_kind *idk, tree *qualifying_class, - bool constant_expression_p, - bool allow_non_constant_expression_p, - bool *non_constant_expression_p, + bool integral_constant_expression_p, + bool allow_non_integral_constant_expression_p, + bool *non_integral_constant_expression_p, const char **error_msg) { /* Initialize the output parameters. */ @@ -2390,12 +2392,31 @@ finish_id_expression (tree id_expression, } /* If the name resolved to a template parameter, there is no - need to look it up again later. Similarly, we resolve - enumeration constants to their underlying values. */ - if (TREE_CODE (decl) == CONST_DECL) + need to look it up again later. */ + if ((TREE_CODE (decl) == CONST_DECL && DECL_TEMPLATE_PARM_P (decl)) + || TREE_CODE (decl) == TEMPLATE_PARM_INDEX) { *idk = CP_ID_KIND_NONE; - if (DECL_TEMPLATE_PARM_P (decl) || !processing_template_decl) + if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX) + decl = TEMPLATE_PARM_DECL (decl); + if (integral_constant_expression_p + && !dependent_type_p (TREE_TYPE (decl)) + && !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))) + { + if (!allow_non_integral_constant_expression_p) + error ("template parameter `%D' of type `%T' is not allowed in " + "an integral constant expression because it is not of " + "integral or enumeration type", decl, TREE_TYPE (decl)); + *non_integral_constant_expression_p = true; + } + return DECL_INITIAL (decl); + } + /* Similarly, we resolve enumeration constants to their + underlying values. */ + else if (TREE_CODE (decl) == CONST_DECL) + { + *idk = CP_ID_KIND_NONE; + if (!processing_template_decl) return DECL_INITIAL (decl); return decl; } @@ -2490,8 +2511,8 @@ finish_id_expression (tree id_expression, /* Since this name was dependent, the expression isn't constant -- yet. No error is issued because it might be constant when things are instantiated. */ - if (constant_expression_p) - *non_constant_expression_p = true; + if (integral_constant_expression_p) + *non_integral_constant_expression_p = true; if (TYPE_P (scope) && dependent_type_p (scope)) return build_nt (SCOPE_REF, scope, id_expression); else if (TYPE_P (scope) && DECL_P (decl)) @@ -2507,37 +2528,33 @@ finish_id_expression (tree id_expression, /* Since this name was dependent, the expression isn't constant -- yet. No error is issued because it might be constant when things are instantiated. */ - if (constant_expression_p) - *non_constant_expression_p = true; + if (integral_constant_expression_p) + *non_integral_constant_expression_p = true; *idk = CP_ID_KIND_UNQUALIFIED_DEPENDENT; return id_expression; } /* Only certain kinds of names are allowed in constant - expression. Enumerators have already been handled above. */ - if (constant_expression_p) + expression. Enumerators and template parameters + have already been handled above. */ + if (integral_constant_expression_p) { - /* Non-type template parameters of integral or enumeration - type are OK. */ - if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX - && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))) - ; - /* Const variables or static data members of integral or - enumeration types initialized with constant expressions - are OK. */ - else if (TREE_CODE (decl) == VAR_DECL - && CP_TYPE_CONST_P (TREE_TYPE (decl)) - && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)) - && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)) + /* Const variables or static data members of integral or + enumeration types initialized with constant expressions + are OK. */ + if (TREE_CODE (decl) == VAR_DECL + && CP_TYPE_CONST_P (TREE_TYPE (decl)) + && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)) + && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)) ; else { - if (!allow_non_constant_expression_p) + if (!allow_non_integral_constant_expression_p) { error ("`%D' cannot appear in a constant-expression", decl); return error_mark_node; } - *non_constant_expression_p = true; + *non_integral_constant_expression_p = true; } } @@ -2834,7 +2851,7 @@ emit_associated_thunks (tree fn) for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk)) { - if (!THUNK_ALIAS_P (thunk)) + if (!THUNK_ALIAS (thunk)) { use_thunk (thunk, /*emit_p=*/1); if (DECL_RESULT_THUNK_P (thunk)) diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 63fdb948c7f..bedbbe96b44 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -49,6 +49,7 @@ static tree build_target_expr (tree, tree); static tree count_trees_r (tree *, int *, void *); static tree verify_stmt_tree_r (tree *, int *, void *); static tree find_tree_r (tree *, int *, void *); +static tree build_local_temp (tree); static tree handle_java_interface_attribute (tree *, tree, tree, int, bool *); static tree handle_com_interface_attribute (tree *, tree, tree, int, bool *); @@ -242,6 +243,19 @@ build_target_expr (tree decl, tree value) return t; } +/* Return an undeclared local temporary of type TYPE for use in building a + TARGET_EXPR. */ + +static tree +build_local_temp (tree type) +{ + tree slot = build_decl (VAR_DECL, NULL_TREE, type); + DECL_ARTIFICIAL (slot) = 1; + DECL_CONTEXT (slot) = current_function_decl; + layout_decl (slot, 0); + return slot; +} + /* INIT is a CALL_EXPR which needs info about its target. TYPE is the type that this initialization should appear to have. @@ -269,10 +283,7 @@ build_cplus_new (tree type, tree init) && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0))); - slot = build_decl (VAR_DECL, NULL_TREE, type); - DECL_ARTIFICIAL (slot) = 1; - DECL_CONTEXT (slot) = current_function_decl; - layout_decl (slot, 0); + slot = build_local_temp (type); /* We split the CALL_EXPR into its function and its arguments here. Then, in expand_expr, we put them back together. The reason for @@ -306,26 +317,33 @@ tree build_target_expr_with_type (tree init, tree type) { tree slot; - tree rval; if (TREE_CODE (init) == TARGET_EXPR) return init; else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type) && TREE_CODE (init) != COND_EXPR - && TREE_CODE (init) != CONSTRUCTOR) + && TREE_CODE (init) != CONSTRUCTOR + && TREE_CODE (init) != VA_ARG_EXPR) /* We need to build up a copy constructor call. COND_EXPR is a special case because we already have copies on the arms and we don't want another one here. A CONSTRUCTOR is aggregate initialization, which - is handled separately. */ + is handled separately. A VA_ARG_EXPR is magic creation of an + aggregate; there's no additional work to be done. */ return force_rvalue (init); - slot = build_decl (VAR_DECL, NULL_TREE, type); - DECL_ARTIFICIAL (slot) = 1; - DECL_CONTEXT (slot) = current_function_decl; - layout_decl (slot, 0); - rval = build_target_expr (slot, init); + slot = build_local_temp (type); + return build_target_expr (slot, init); +} - return rval; +/* Like the above function, but without the checking. This function should + only be used by code which is deliberately trying to subvert the type + system, such as call_builtin_trap. */ + +tree +force_target_expr (tree type, tree init) +{ + tree slot = build_local_temp (type); + return build_target_expr (slot, init); } /* Like build_target_expr_with_type, but use the type of INIT. */ @@ -345,14 +363,9 @@ build_cplus_array_type_1 (tree elt_type, tree index_type) if (elt_type == error_mark_node || index_type == error_mark_node) return error_mark_node; - /* Don't do the minimal thing just because processing_template_decl is - set; we want to give string constants the right type immediately, so - we don't have to fix them up at instantiation time. */ - if ((processing_template_decl - && index_type && TYPE_MAX_VALUE (index_type) - && TREE_CODE (TYPE_MAX_VALUE (index_type)) != INTEGER_CST) - || uses_template_parms (elt_type) - || (index_type && uses_template_parms (index_type))) + if (dependent_type_p (elt_type) + || (index_type + && value_dependent_expression_p (TYPE_MAX_VALUE (index_type)))) { t = make_node (ARRAY_TYPE); TREE_TYPE (t) = elt_type; @@ -1277,9 +1290,9 @@ break_out_target_exprs (tree t) tree build_min_nt (enum tree_code code, ...) { - register tree t; - register int length; - register int i; + tree t; + int length; + int i; va_list p; va_start (p, code); @@ -1303,9 +1316,9 @@ build_min_nt (enum tree_code code, ...) tree build_min (enum tree_code code, tree tt, ...) { - register tree t; - register int length; - register int i; + tree t; + int length; + int i; va_list p; va_start (p, tt); @@ -1334,9 +1347,9 @@ build_min (enum tree_code code, tree tt, ...) tree build_min_non_dep (enum tree_code code, tree non_dep, ...) { - register tree t; - register int length; - register int i; + tree t; + int length; + int i; va_list p; va_start (p, non_dep); @@ -1436,7 +1449,7 @@ decl_namespace_context (tree decl) bool cp_tree_equal (tree t1, tree t2) { - register enum tree_code code1, code2; + enum tree_code code1, code2; if (t1 == t2) return true; @@ -1978,7 +1991,7 @@ cp_walk_subtrees (tree* tp, case TYPENAME_TYPE: case TYPEOF_TYPE: case BASELINK: - /* None of thse have subtrees other than those already walked + /* None of these have subtrees other than those already walked above. */ *walk_subtrees_p = 0; break; @@ -2176,28 +2189,6 @@ cp_copy_res_decl_for_inlining (tree result, return var; } -/* Record that we're about to start inlining FN, and return nonzero if - that's OK. Used for lang_hooks.tree_inlining.start_inlining. */ - -int -cp_start_inlining (tree fn) -{ - if (DECL_TEMPLATE_INSTANTIATION (fn)) - return push_tinst_level (fn); - else - return 1; -} - -/* Record that we're done inlining FN. Used for - lang_hooks.tree_inlining.end_inlining. */ - -void -cp_end_inlining (tree fn ATTRIBUTE_UNUSED ) -{ - if (DECL_TEMPLATE_INSTANTIATION (fn)) - pop_tinst_level (); -} - /* Initialize tree.c. */ void diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 26c6f2c33a6..ff397c0417d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -579,8 +579,8 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, tree merge_types (tree t1, tree t2) { - register enum tree_code code1; - register enum tree_code code2; + enum tree_code code1; + enum tree_code code2; tree attributes; /* Save time if the two types are the same. */ @@ -857,6 +857,7 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration) { tree d1; tree d2; + tree max1, max2; if (t1 == t2) return true; @@ -887,8 +888,27 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration) return allow_redeclaration; /* Check that the dimensions are the same. */ - return (cp_tree_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2)) - && cp_tree_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2))); + + if (!cp_tree_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2))) + return false; + max1 = TYPE_MAX_VALUE (d1); + max2 = TYPE_MAX_VALUE (d2); + if (processing_template_decl && !abi_version_at_least (2) + && !value_dependent_expression_p (max1) + && !value_dependent_expression_p (max2)) + { + /* With abi-1 we do not fold non-dependent array bounds, (and + consequently mangle them incorrectly). We must therefore + fold them here, to verify the domains have the same + value. */ + max1 = fold (max1); + max2 = fold (max2); + } + + if (!cp_tree_equal (max1, max2)) + return false; + + return true; } /* Return true if T1 and T2 are related as allowed by STRICT. STRICT @@ -900,7 +920,7 @@ comptypes (tree t1, tree t2, int strict) if (t1 == t2) return true; - /* Suppress errors caused by previously reported errors */ + /* Suppress errors caused by previously reported errors. */ if (t1 == error_mark_node || t2 == error_mark_node) return false; @@ -974,7 +994,7 @@ comptypes (tree t1, tree t2, int strict) return true; /* Don't check inheritance. */ strict = COMPARE_STRICT; - /* fall through */ + /* Fall through. */ case RECORD_TYPE: case UNION_TYPE: @@ -995,7 +1015,7 @@ comptypes (tree t1, tree t2, int strict) if (!comptypes (TYPE_OFFSET_BASETYPE (t1), TYPE_OFFSET_BASETYPE (t2), strict & ~COMPARE_REDECLARATION)) return false; - /* FALLTHROUGH*/ + /* Fall through. */ case POINTER_TYPE: case REFERENCE_TYPE: @@ -1233,6 +1253,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) } if (TREE_CODE (e) == COMPONENT_REF + && TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL && DECL_C_BIT_FIELD (TREE_OPERAND (e, 1))) { error ("invalid application of `%s' to a bit-field", op_name); @@ -1264,8 +1285,8 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) tree decay_conversion (tree exp) { - register tree type; - register enum tree_code code; + tree type; + enum tree_code code; type = TREE_TYPE (exp); code = TREE_CODE (type); @@ -1316,7 +1337,7 @@ decay_conversion (tree exp) return build_unary_op (ADDR_EXPR, exp, 0); if (code == ARRAY_TYPE) { - register tree adr; + tree adr; tree ptrtype; if (TREE_CODE (exp) == INDIRECT_REF) @@ -1808,6 +1829,9 @@ finish_class_member_access_expr (tree object, tree name) { if (/* If OBJECT_TYPE is dependent, so is OBJECT.NAME. */ dependent_type_p (object_type) + /* If NAME is just an IDENTIFIER_NODE, then the expression + is dependent. */ + || TREE_CODE (object) == IDENTIFIER_NODE /* If NAME is "f", where either 'f' or 'args' is dependent, then the expression is dependent. */ || (TREE_CODE (name) == TEMPLATE_ID_EXPR @@ -1860,6 +1884,11 @@ finish_class_member_access_expr (tree object, tree name) is_template_id = true; template_args = TREE_OPERAND (name, 1); name = TREE_OPERAND (name, 0); + + if (TREE_CODE (name) == OVERLOAD) + name = DECL_NAME (get_first_fn (name)); + else if (DECL_P (name)) + name = DECL_NAME (name); } if (TREE_CODE (name) == SCOPE_REF) @@ -2004,7 +2033,7 @@ build_x_indirect_ref (tree expr, const char *errorstring) tree build_indirect_ref (tree ptr, const char *errorstring) { - register tree pointer, type; + tree pointer, type; if (ptr == error_mark_node) return error_mark_node; @@ -2342,8 +2371,8 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) tree build_function_call (tree function, tree params) { - register tree fntype, fndecl; - register tree coerced_params; + tree fntype, fndecl; + tree coerced_params; tree result; tree name = NULL_TREE, assembler_name = NULL_TREE; int is_method; @@ -2460,8 +2489,8 @@ build_function_call (tree function, tree params) tree convert_arguments (tree typelist, tree values, tree fndecl, int flags) { - register tree typetail, valtail; - register tree result = NULL_TREE; + tree typetail, valtail; + tree result = NULL_TREE; const char *called_thing = 0; int i = 0; @@ -2486,8 +2515,8 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags) valtail; valtail = TREE_CHAIN (valtail), i++) { - register tree type = typetail ? TREE_VALUE (typetail) : 0; - register tree val = TREE_VALUE (valtail); + tree type = typetail ? TREE_VALUE (typetail) : 0; + tree val = TREE_VALUE (valtail); if (val == error_mark_node) return error_mark_node; @@ -2577,7 +2606,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags) if (typetail != 0 && typetail != void_list_node) { - /* See if there are default arguments that can be used */ + /* See if there are default arguments that can be used. */ if (TREE_PURPOSE (typetail) && TREE_CODE (TREE_PURPOSE (typetail)) != DEFAULT_ARG) { @@ -2671,17 +2700,17 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, int convert_p ATTRIBUTE_UNUSED) { tree op0, op1; - register enum tree_code code0, code1; + enum tree_code code0, code1; tree type0, type1; /* Expression code to give to the expression when it is built. Normally this is CODE, which is what the caller asked for, but in some special cases we change it. */ - register enum tree_code resultcode = code; + enum tree_code resultcode = code; /* Data type in which the computation is to be performed. In the simplest cases this is the common type of the arguments. */ - register tree result_type = NULL; + tree result_type = NULL; /* Nonzero means operands have already been type-converted in whatever way is necessary. @@ -3390,8 +3419,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, build_type = result_type; { - register tree result = build (resultcode, build_type, op0, op1); - register tree folded; + tree result = build (resultcode, build_type, op0, op1); + tree folded; folded = fold (result); if (folded == result) @@ -3406,8 +3435,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, of pointer PTROP and integer INTOP. */ static tree -cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop, - register tree intop) +cp_pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) { tree res_type = TREE_TYPE (ptrop); @@ -3425,9 +3453,9 @@ cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop, The resulting tree has type int. */ static tree -pointer_diff (register tree op0, register tree op1, register tree ptrtype) +pointer_diff (tree op0, tree op1, tree ptrtype) { - register tree result, folded; + tree result, folded; tree restype = ptrdiff_type_node; tree target_type = TREE_TYPE (ptrtype); @@ -3496,7 +3524,7 @@ build_x_unary_op (enum tree_code code, tree xarg) && ((IS_AGGR_TYPE_CODE (TREE_CODE (TREE_TYPE (xarg))) && !COMPLETE_TYPE_P (TREE_TYPE (xarg))) || (TREE_CODE (xarg) == OFFSET_REF))) - /* don't look for a function */; + /* Don't look for a function. */; else exp = build_new_op (code, LOOKUP_NORMAL, xarg, NULL_TREE, NULL_TREE); if (!exp && code == ADDR_EXPR) @@ -3624,8 +3652,8 @@ tree build_unary_op (enum tree_code code, tree xarg, int noconvert) { /* No default_conversion here. It causes trouble for ADDR_EXPR. */ - register tree arg = xarg; - register tree argtype = 0; + tree arg = xarg; + tree argtype = 0; const char *errstring = NULL; tree val; @@ -3763,7 +3791,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) 0); { - register tree inc; + tree inc; tree result_type = TREE_TYPE (arg); arg = get_unwidened (arg, 0); @@ -3902,7 +3930,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) return arg; } - /* For &x[y], return x+y */ + /* For &x[y], return x+y. */ if (TREE_CODE (arg) == ARRAY_REF) { if (!cxx_mark_addressable (TREE_OPERAND (arg, 0))) @@ -4208,7 +4236,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) bool cxx_mark_addressable (tree exp) { - register tree x = exp; + tree x = exp; while (1) switch (TREE_CODE (x)) @@ -4225,10 +4253,10 @@ cxx_mark_addressable (tree exp) if (x == current_class_ptr) { error ("cannot take the address of `this', which is an rvalue expression"); - TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */ + TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later. */ return true; } - /* FALLTHRU */ + /* Fall through. */ case VAR_DECL: /* Caller should not be trying to mark initialized @@ -4237,7 +4265,7 @@ cxx_mark_addressable (tree exp) || DECL_IN_AGGR_P (x) == 0 || TREE_STATIC (x) || DECL_EXTERNAL (x), 314); - /* FALLTHRU */ + /* Fall through. */ case CONST_DECL: case RESULT_DECL: @@ -4744,7 +4772,7 @@ build_const_cast (tree type, tree expr) tree build_c_cast (tree type, tree expr) { - register tree value = expr; + tree value = expr; tree otype; if (type == error_mark_node || expr == error_mark_node) @@ -4909,11 +4937,11 @@ build_c_cast (tree type, tree expr) tree build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { - register tree result; + tree result; tree newrhs = rhs; tree lhstype = TREE_TYPE (lhs); tree olhstype = lhstype; - tree olhs = lhs; + tree olhs = NULL_TREE; /* Avoid duplicate error messages from operands that had errors. */ if (lhs == error_mark_node || rhs == error_mark_node) @@ -4922,7 +4950,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) /* Handle control structure constructs used as "lvalues". */ switch (TREE_CODE (lhs)) { - /* Handle --foo = 5; as these are valid constructs in C++ */ + /* Handle --foo = 5; as these are valid constructs in C++. */ case PREDECREMENT_EXPR: case PREINCREMENT_EXPR: if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0))) @@ -5001,7 +5029,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) return result; } else if (! IS_AGGR_TYPE (lhstype)) - /* Do the default thing */; + /* Do the default thing. */; else { result = build_special_member_call (lhs, complete_ctor_identifier, @@ -5028,7 +5056,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { /* `operator=' is not an inheritable operator. */ if (! IS_AGGR_TYPE (lhstype)) - /* Do the default thing */; + /* Do the default thing. */; else { result = build_new_op (MODIFY_EXPR, LOOKUP_NORMAL, @@ -5143,6 +5171,15 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (lhstype != TREE_TYPE (lhs)) { + /* Avoid warnings converting integral types back into enums for + enum bit fields. */ + if (TREE_CODE (lhstype) == INTEGER_TYPE + && TREE_CODE (olhstype) == ENUMERAL_TYPE) + { + if (TREE_SIDE_EFFECTS (lhs)) + lhs = stabilize_reference (lhs); + olhs = lhs; + } lhs = copy_node (lhs); TREE_TYPE (lhs) = lhstype; } @@ -5215,10 +5252,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (olhstype == TREE_TYPE (result)) return result; - /* Avoid warnings converting integral types back into enums - for enum bit fields. */ - if (TREE_CODE (TREE_TYPE (result)) == INTEGER_TYPE - && TREE_CODE (olhstype) == ENUMERAL_TYPE) + if (olhs) { result = build (COMPOUND_EXPR, olhstype, result, olhs); TREE_NO_UNUSED_WARNING (result) = 1; @@ -5577,8 +5611,8 @@ static tree convert_for_assignment (tree type, tree rhs, const char *errtype, tree fndecl, int parmnum) { - register tree rhstype; - register enum tree_code coder; + tree rhstype; + enum tree_code coder; /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ if (TREE_CODE (rhs) == NON_LVALUE_EXPR) @@ -5676,9 +5710,9 @@ tree convert_for_initialization (tree exp, tree type, tree rhs, int flags, const char *errtype, tree fndecl, int parmnum) { - register enum tree_code codel = TREE_CODE (type); - register tree rhstype; - register enum tree_code coder; + enum tree_code codel = TREE_CODE (type); + tree rhstype; + enum tree_code coder; /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. Strip such NOP_EXPRs, since RHS is used in non-lvalue context. */ @@ -5761,10 +5795,10 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs, tree clobbers, int vol, location_t locus) { int noutputs = list_length (outputs); - register int i; + int i; /* o[I] is the place that output number I should be written. */ - register tree *o = alloca (noutputs * sizeof (tree)); - register tree tail; + tree *o = alloca (noutputs * sizeof (tree)); + tree tail; /* Record the contents of OUTPUTS before it is modified. */ for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++) @@ -5984,8 +6018,9 @@ check_return_expr (tree retval) returned expression uses the chosen variable somehow. And people expect this restriction, anyway. (jason 2000-11-19) - See finish_function, genrtl_start_function, and declare_return_variable - for other pieces of this optimization. */ + See finish_function, cxx_expand_function_start, and + cp_copy_res_decl_for_inlining for other pieces of this + optimization. */ if (fn_returns_value_p && flag_elide_constructors) { @@ -6174,7 +6209,7 @@ cp_type_quals (tree type) return TYPE_QUALS (type); } -/* Returns nonzero if the TYPE contains a mutable member */ +/* Returns nonzero if the TYPE contains a mutable member. */ bool cp_has_mutable_p (tree type) diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 859fc26f63b..f839dddb300 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -306,7 +306,7 @@ cxx_incomplete_type_error (tree value, tree type) tree store_init_value (tree decl, tree init) { - register tree value, type; + tree value, type; /* If variable's type was invalidly declared, just ignore it. */ @@ -470,8 +470,7 @@ digest_init (tree type, tree init, tree* tail) if (TYPE_DOMAIN (type) != 0 && TREE_CONSTANT (TYPE_SIZE (type))) { - register int size - = TREE_INT_CST_LOW (TYPE_SIZE (type)); + int size = TREE_INT_CST_LOW (TYPE_SIZE (type)); size = (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT; /* In C it is ok to subtract 1 from the length of the string because it's ok to ignore the terminating null char that is @@ -577,11 +576,11 @@ digest_init (tree type, tree init, tree* tail) static tree process_init_constructor (tree type, tree init, tree* elts) { - register tree tail; + tree tail; /* List of the elements of the result constructor, in reverse order. */ - register tree members = NULL; - register tree next1; + tree members = NULL; + tree next1; tree result; int allconstant = 1; int allsimple = 1; @@ -605,8 +604,8 @@ process_init_constructor (tree type, tree init, tree* elts) if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE) { - register long len; - register int i; + long len; + int i; if (TREE_CODE (type) == ARRAY_TYPE) { @@ -616,7 +615,7 @@ process_init_constructor (tree type, tree init, tree* elts) - TREE_INT_CST_LOW (TYPE_MIN_VALUE (domain)) + 1); else - len = -1; /* Take as many as there are */ + len = -1; /* Take as many as there are. */ } else { @@ -696,7 +695,7 @@ process_init_constructor (tree type, tree init, tree* elts) } else if (TREE_CODE (type) == RECORD_TYPE) { - register tree field; + tree field; if (tail) { @@ -817,7 +816,7 @@ process_init_constructor (tree type, tree init, tree* elts) /* If the initializer was empty, use default zero initialization. */ && tail) { - register tree field = TYPE_FIELDS (type); + tree field = TYPE_FIELDS (type); /* Find the first named field. ANSI decided in September 1990 that only named fields count here. */ @@ -1132,7 +1131,7 @@ build_functional_cast (tree exp, tree parms) if (! IS_AGGR_TYPE (type)) { - /* this must build a C cast */ + /* This must build a C cast. */ if (parms == NULL_TREE) parms = integer_zero_node; else diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c index 2eeffca26d6..6b69fed639e 100644 --- a/gcc/cppcharset.c +++ b/gcc/cppcharset.c @@ -337,7 +337,7 @@ one_utf8_to_utf16 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, uchar **outbufp, size_t *outbytesleftp) { int rval; - cppchar_t s; + cppchar_t s = 0; const uchar *save_inbuf = *inbufp; size_t save_inbytesleft = *inbytesleftp; uchar *outbuf = *outbufp; @@ -649,18 +649,18 @@ init_iconv_desc (cpp_reader *pfile, const char *to, const char *from) if (ret.cd == (iconv_t) -1) { if (errno == EINVAL) - cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */ + cpp_error (pfile, CPP_DL_ERROR, /* XXX should be DL_SORRY */ "conversion from %s to %s not supported by iconv", from, to); else - cpp_errno (pfile, DL_ERROR, "iconv_open"); + cpp_errno (pfile, CPP_DL_ERROR, "iconv_open"); ret.func = convert_no_conversion; } } else { - cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */ + cpp_error (pfile, CPP_DL_ERROR, /* XXX should be DL_SORRY */ "no iconv implementation, cannot convert from %s to %s", from, to); ret.func = convert_no_conversion; @@ -804,10 +804,10 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, const uchar *base = str - 2; if (!CPP_OPTION (pfile, cplusplus) && !CPP_OPTION (pfile, c99)) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "universal character names are only valid in C++ and C99"); else if (CPP_WTRADITIONAL (pfile) && identifier_pos == 0) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "the meaning of '\\%c' is different in traditional C", (int) str[-1]); @@ -833,7 +833,8 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, if (length) { /* We'll error when we try it out as the start of an identifier. */ - cpp_error (pfile, DL_ERROR, "incomplete universal character name %.*s", + cpp_error (pfile, CPP_DL_ERROR, + "incomplete universal character name %.*s", (int) (str - base), base); result = 1; } @@ -844,7 +845,8 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, || (result & 0x80000000) || (result >= 0xD800 && result <= 0xDFFF)) { - cpp_error (pfile, DL_ERROR, "%.*s is not a valid universal character", + cpp_error (pfile, CPP_DL_ERROR, + "%.*s is not a valid universal character", (int) (str - base), base); result = 1; } @@ -853,11 +855,11 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, int validity = ucn_valid_in_identifier (pfile, result); if (validity == 0) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "universal character %.*s is not valid in an identifier", (int) (str - base), base); else if (validity == 2 && identifier_pos == 1) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "universal character %.*s is not valid at the start of an identifier", (int) (str - base), base); } @@ -892,10 +894,12 @@ convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit, if (rval) { errno = rval; - cpp_errno (pfile, DL_ERROR, "converting UCN to source character set"); + cpp_errno (pfile, CPP_DL_ERROR, + "converting UCN to source character set"); } else if (!APPLY_CONVERSION (cvt, buf, 6 - bytesleft, tbuf)) - cpp_errno (pfile, DL_ERROR, "converting UCN to execution character set"); + cpp_errno (pfile, CPP_DL_ERROR, + "converting UCN to execution character set"); return from; } @@ -959,7 +963,7 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, size_t mask = width_to_mask (width); if (CPP_WTRADITIONAL (pfile)) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "the meaning of '\\x' is different in traditional C"); from++; /* skip 'x' */ @@ -976,14 +980,14 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, if (!digits_found) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "\\x used with no following hex digits"); return from; } if (overflow | (n != (n & mask))) { - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "hex escape sequence out of range"); n &= mask; } @@ -1022,7 +1026,7 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, if (n != (n & mask)) { - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "octal escape sequence out of range"); n &= mask; } @@ -1090,14 +1094,14 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit, case 'a': if (CPP_WTRADITIONAL (pfile)) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "the meaning of '\\a' is different in traditional C"); c = charconsts[0]; break; case 'e': case 'E': if (CPP_PEDANTIC (pfile)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "non-ISO-standard escape sequence, '\\%c'", (int) c); c = charconsts[2]; break; @@ -1105,16 +1109,16 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit, default: unknown: if (ISGRAPH (c)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "unknown escape sequence '\\%c'", (int) c); else - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "unknown escape sequence: '\\%03o'", (int) c); } /* Now convert what we have to the execution character set. */ if (!APPLY_CONVERSION (cvt, &c, 1, tbuf)) - cpp_errno (pfile, DL_ERROR, + cpp_errno (pfile, CPP_DL_ERROR, "converting escape sequence to execution character set"); return from + 1; @@ -1174,7 +1178,7 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, return true; fail: - cpp_errno (pfile, DL_ERROR, "converting to execution character set"); + cpp_errno (pfile, CPP_DL_ERROR, "converting to execution character set"); free (tbuf.text); return false; } @@ -1236,10 +1240,11 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str, if (i > max_chars) { i = max_chars; - cpp_error (pfile, DL_WARNING, "character constant too long for its type"); + cpp_error (pfile, CPP_DL_WARNING, + "character constant too long for its type"); } else if (i > 1 && CPP_OPTION (pfile, warn_multichar)) - cpp_error (pfile, DL_WARNING, "multi-character character constant"); + cpp_error (pfile, CPP_DL_WARNING, "multi-character character constant"); /* Multichar constants are of type int and therefore signed. */ if (i > 1) @@ -1298,7 +1303,8 @@ wide_str_to_charconst (cpp_reader *pfile, cpp_string str, character exactly fills a wchar_t, so a multi-character wide character constant is guaranteed to overflow. */ if (off > 0) - cpp_error (pfile, DL_WARNING, "character constant too long for its type"); + cpp_error (pfile, CPP_DL_WARNING, + "character constant too long for its type"); /* Truncate the constant to its natural width, and simultaneously sign- or zero-extend to the full width of cppchar_t. */ @@ -1330,7 +1336,7 @@ cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token, /* an empty constant will appear as L'' or '' */ if (token->val.str.len == (size_t) (2 + wide)) { - cpp_error (pfile, DL_ERROR, "empty character constant"); + cpp_error (pfile, CPP_DL_ERROR, "empty character constant"); return 0; } else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, wide)) diff --git a/gcc/cpperror.c b/gcc/cpperror.c index 4926cb24ac5..61763cc1826 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -72,43 +72,43 @@ int _cpp_begin_message (cpp_reader *pfile, int code, fileline line, unsigned int column) { - int level = DL_EXTRACT (code); + int level = CPP_DL_EXTRACT (code); switch (level) { - case DL_WARNING: - case DL_PEDWARN: + case CPP_DL_WARNING: + case CPP_DL_PEDWARN: if (CPP_IN_SYSTEM_HEADER (pfile) && ! CPP_OPTION (pfile, warn_system_headers)) return 0; /* Fall through. */ - case DL_WARNING_SYSHDR: + case CPP_DL_WARNING_SYSHDR: if (CPP_OPTION (pfile, warnings_are_errors) - || (level == DL_PEDWARN && CPP_OPTION (pfile, pedantic_errors))) + || (level == CPP_DL_PEDWARN && CPP_OPTION (pfile, pedantic_errors))) { if (CPP_OPTION (pfile, inhibit_errors)) return 0; - level = DL_ERROR; + level = CPP_DL_ERROR; pfile->errors++; } else if (CPP_OPTION (pfile, inhibit_warnings)) return 0; break; - case DL_ERROR: + case CPP_DL_ERROR: if (CPP_OPTION (pfile, inhibit_errors)) return 0; /* ICEs cannot be inhibited. */ - case DL_ICE: + case CPP_DL_ICE: pfile->errors++; break; } print_location (pfile, line, column); - if (DL_WARNING_P (level)) + if (CPP_DL_WARNING_P (level)) fputs (_("warning: "), stderr); - else if (level == DL_ICE) + else if (level == CPP_DL_ICE) fputs (_("internal error: "), stderr); return 1; diff --git a/gcc/cppexp.c b/gcc/cppexp.c index b4f1dcc8960..c6f1f1d39a5 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -71,9 +71,10 @@ static void check_promotion (cpp_reader *, const struct op *); /* With -O2, gcc appears to produce nice code, moving the error message load and subsequent jump completely out of the main path. */ #define SYNTAX_ERROR(msgid) \ - do { cpp_error (pfile, DL_ERROR, msgid); goto syntax_error; } while(0) + do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0) #define SYNTAX_ERROR2(msgid, arg) \ - do { cpp_error (pfile, DL_ERROR, msgid, arg); goto syntax_error; } while(0) + do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \ + while(0) /* Subroutine of cpp_classify_number. S points to a float suffix of length LEN, possibly zero. Returns 0 for an invalid suffix, or a @@ -213,7 +214,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) if (float_flag != NOT_FLOAT) { if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "use of C99 hexadecimal floating constant"); if (float_flag == AFTER_EXPON) @@ -235,7 +236,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) result = interpret_float_suffix (str, limit - str); if (result == 0) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "invalid suffix \"%.*s\" on floating constant", (int) (limit - str), str); return CPP_N_INVALID; @@ -245,7 +246,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) if (limit != str && CPP_WTRADITIONAL (pfile) && ! cpp_sys_macro_p (pfile)) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "traditional C rejects the \"%.*s\" suffix", (int) (limit - str), str); @@ -256,7 +257,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) result = interpret_int_suffix (str, limit - str); if (result == 0) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "invalid suffix \"%.*s\" on integer constant", (int) (limit - str), str); return CPP_N_INVALID; @@ -270,7 +271,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) int large = (result & CPP_N_WIDTH) == CPP_N_LARGE; if (u_or_i || (large && CPP_OPTION (pfile, warn_long_long))) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "traditional C rejects the \"%.*s\" suffix", (int) (limit - str), str); } @@ -278,13 +279,15 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) if ((result & CPP_N_WIDTH) == CPP_N_LARGE && ! CPP_OPTION (pfile, c99) && CPP_OPTION (pfile, warn_long_long)) - cpp_error (pfile, DL_PEDWARN, "use of C99 long long integer constant"); + cpp_error (pfile, CPP_DL_PEDWARN, + "use of C99 long long integer constant"); result |= CPP_N_INTEGER; } if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile)) - cpp_error (pfile, DL_PEDWARN, "imaginary constants are a GCC extension"); + cpp_error (pfile, CPP_DL_PEDWARN, + "imaginary constants are a GCC extension"); if (radix == 10) result |= CPP_N_DECIMAL; @@ -369,7 +372,7 @@ cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token, } if (overflow) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "integer constant is too large for its type"); /* If too big to be signed, consider it unsigned. Only warn for decimal numbers. Traditional numbers were always signed (but @@ -381,7 +384,7 @@ cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token, && !num_positive (result, precision)) { if (base == 10) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "integer constant is so large that it is unsigned"); result.unsignedp = true; } @@ -464,13 +467,13 @@ parse_defined (cpp_reader *pfile) node = token->val.node; if (paren && cpp_get_token (pfile)->type != CPP_CLOSE_PAREN) { - cpp_error (pfile, DL_ERROR, "missing ')' after \"defined\""); + cpp_error (pfile, CPP_DL_ERROR, "missing ')' after \"defined\""); node = 0; } } else { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "operator \"defined\" requires an identifier"); if (token->flags & NAMED_OP) { @@ -478,7 +481,7 @@ parse_defined (cpp_reader *pfile) op.flags = 0; op.type = token->type; - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "(\"%s\" is an alternative token for \"%s\" in C++)", cpp_token_as_text (pfile, token), cpp_token_as_text (pfile, &op)); @@ -488,7 +491,7 @@ parse_defined (cpp_reader *pfile) if (node) { if (pfile->context != initial_context && CPP_PEDANTIC (pfile)) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "this use of \"defined\" may not be portable"); _cpp_mark_macro_used (node); @@ -524,13 +527,13 @@ eval_token (cpp_reader *pfile, const cpp_token *token) switch (temp & CPP_N_CATEGORY) { case CPP_N_FLOATING: - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "floating constant in preprocessor expression"); break; case CPP_N_INTEGER: if (!(temp & CPP_N_IMAGINARY)) return cpp_interpret_integer (pfile, token, temp); - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "imaginary number in preprocessor expression"); break; @@ -576,7 +579,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token) result.high = 0; result.low = 0; if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval) - cpp_error (pfile, DL_WARNING, "\"%s\" is not defined", + cpp_error (pfile, CPP_DL_WARNING, "\"%s\" is not defined", NODE_NAME (token->val.node)); } break; @@ -805,7 +808,7 @@ _cpp_parse_expr (cpp_reader *pfile) if (top != pfile->op_stack) { - cpp_error (pfile, DL_ICE, "unbalanced stack in #if"); + cpp_error (pfile, CPP_DL_ICE, "unbalanced stack in #if"); syntax_error: return false; /* Return false on syntax error. */ } @@ -824,7 +827,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op) if (top->op <= CPP_EQ || top->op > CPP_LAST_CPP_OP + 2) { bad_op: - cpp_error (pfile, DL_ICE, "impossible operator '%u'", top->op); + cpp_error (pfile, CPP_DL_ICE, "impossible operator '%u'", top->op); return 0; } @@ -916,7 +919,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op) case CPP_OPEN_PAREN: if (op != CPP_CLOSE_PAREN) { - cpp_error (pfile, DL_ERROR, "missing ')' in expression"); + cpp_error (pfile, CPP_DL_ERROR, "missing ')' in expression"); return 0; } top--; @@ -937,7 +940,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op) continue; case CPP_QUERY: - cpp_error (pfile, DL_ERROR, "'?' without following ':'"); + cpp_error (pfile, CPP_DL_ERROR, "'?' without following ':'"); return 0; default: @@ -946,13 +949,13 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op) top--; if (top->value.overflow && !pfile->state.skip_eval) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "integer overflow in preprocessor expression"); } if (op == CPP_CLOSE_PAREN) { - cpp_error (pfile, DL_ERROR, "missing '(' in expression"); + cpp_error (pfile, CPP_DL_ERROR, "missing '(' in expression"); return 0; } @@ -983,12 +986,12 @@ check_promotion (cpp_reader *pfile, const struct op *op) if (op->value.unsignedp) { if (!num_positive (op[-1].value, CPP_OPTION (pfile, precision))) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "the left operand of \"%s\" changes sign when promoted", cpp_token_as_text (pfile, op->token)); } else if (!num_positive (op->value, CPP_OPTION (pfile, precision))) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "the right operand of \"%s\" changes sign when promoted", cpp_token_as_text (pfile, op->token)); } @@ -1246,7 +1249,7 @@ num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op) { case CPP_UPLUS: if (CPP_WTRADITIONAL (pfile) && !pfile->state.skip_eval) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "traditional C rejects the unary plus operator"); num.overflow = false; break; @@ -1345,7 +1348,7 @@ num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op) /* Comma. */ default: /* case CPP_COMMA: */ if (CPP_PEDANTIC (pfile) && !pfile->state.skip_eval) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "comma operator in operand of #if"); lhs = rhs; break; @@ -1477,7 +1480,7 @@ num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op) else { if (!pfile->state.skip_eval) - cpp_error (pfile, DL_ERROR, "division by zero in #if"); + cpp_error (pfile, CPP_DL_ERROR, "division by zero in #if"); return lhs; } diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 00834aadc4b..b5b5461b9ee 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -154,8 +154,10 @@ struct file_hash_entry }; static bool open_file (_cpp_file *file); -static bool pch_open_file (cpp_reader *pfile, _cpp_file *file); -static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file); +static bool pch_open_file (cpp_reader *pfile, _cpp_file *file, + bool *invalid_pch); +static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file, + bool *invalid_pch); static bool read_file_guts (cpp_reader *pfile, _cpp_file *file); static bool read_file (cpp_reader *pfile, _cpp_file *file); static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import); @@ -170,7 +172,8 @@ static cpp_dir *make_cpp_dir (cpp_reader *, const char *dir_name, int sysp); static void allocate_file_hash_entries (cpp_reader *pfile); static struct file_hash_entry *new_file_hash_entry (cpp_reader *pfile); static int report_missing_guard (void **slot, void *b); -static int hash_string_eq (const void *p, const void *q); +static hashval_t file_hash_hash (const void *p); +static int file_hash_eq (const void *p, const void *q); static char *read_filename_string (int ch, FILE *f); static void read_name_map (cpp_dir *dir); static char *remap_filename (cpp_reader *pfile, _cpp_file *file); @@ -234,9 +237,13 @@ open_file (_cpp_file *file) return false; } -/* Temporary PCH intercept of opening a file. */ +/* Temporary PCH intercept of opening a file. Try to find a PCH file + based on FILE->name and FILE->dir, and test those found for + validity using PFILE->cb.valid_pch. Return true iff a valid file is + found. Set *INVALID_PCH if a PCH file is found but wasn't valid. */ + static bool -pch_open_file (cpp_reader *pfile, _cpp_file *file) +pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) { static const char extension[] = ".gch"; const char *path = file->path; @@ -285,6 +292,7 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file) closedir (pchdir); } file->pch |= valid; + *invalid_pch |= ! valid; } if (valid) @@ -297,9 +305,11 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file) /* Try to open the path FILE->name appended to FILE->dir. This is where remap and PCH intercept the file lookup process. Return true - if the file was found, whether or not the open was successful. */ + if the file was found, whether or not the open was successful. + Set *INVALID_PCH to true if a PCH file is found but wasn't valid. */ + static bool -find_file_in_dir (cpp_reader *pfile, _cpp_file *file) +find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) { char *path; @@ -309,7 +319,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file) path = append_file_to_dir (file->name, file->dir); file->path = path; - if (pch_open_file (pfile, file)) + if (pch_open_file (pfile, file, invalid_pch)) return true; if (open_file (file)) @@ -351,13 +361,16 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f { struct file_hash_entry *entry, **hash_slot; _cpp_file *file; + bool invalid_pch = false; /* Ensure we get no confusion between cached files and directories. */ if (start_dir == NULL) - cpp_error (pfile, DL_ICE, "NULL directory in find_file"); + cpp_error (pfile, CPP_DL_ICE, "NULL directory in find_file"); hash_slot = (struct file_hash_entry **) - htab_find_slot (pfile->file_hash, fname, INSERT); + htab_find_slot_with_hash (pfile->file_hash, fname, + htab_hash_string (fname), + INSERT); /* First check the cache before we resort to memory allocation. */ entry = search_cache (*hash_slot, start_dir); @@ -369,13 +382,21 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f /* Try each path in the include chain. */ for (; !fake ;) { - if (find_file_in_dir (pfile, file)) + if (find_file_in_dir (pfile, file, &invalid_pch)) break; file->dir = file->dir->next; if (file->dir == NULL) { open_file_failed (pfile, file); + if (invalid_pch) + { + cpp_error (pfile, CPP_DL_ERROR, + "one or more PCH files were found, but they were invalid"); + if (!cpp_get_options (pfile)->warn_invalid_pch) + cpp_error (pfile, CPP_DL_ERROR, + "use -Winvalid-pch for more information"); + } break; } @@ -432,7 +453,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file) if (S_ISBLK (file->st.st_mode)) { - cpp_error (pfile, DL_ERROR, "%s is a block device", file->path); + cpp_error (pfile, CPP_DL_ERROR, "%s is a block device", file->path); return false; } @@ -449,7 +470,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file) does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { - cpp_error (pfile, DL_ERROR, "%s is too large", file->path); + cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path); return false; } @@ -478,12 +499,13 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file) if (count < 0) { - cpp_errno (pfile, DL_ERROR, file->path); + cpp_errno (pfile, CPP_DL_ERROR, file->path); return false; } if (regular && total != size && STAT_SIZE_RELIABLE (file->st)) - cpp_error (pfile, DL_WARNING, "%s is shorter than expected", file->path); + cpp_error (pfile, CPP_DL_WARNING, + "%s is shorter than expected", file->path); /* Shrink buffer if we allocated substantially too much. */ if (total + 4096 < size) @@ -675,7 +697,7 @@ search_path_head (cpp_reader *pfile, const char *fname, int angle_brackets, return make_cpp_dir (pfile, dir_name_of_file (file), pfile->map->sysp); if (dir == NULL) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "no include path in which to search for %s", fname); return dir; @@ -732,9 +754,9 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file) /* If we are outputting dependencies but not for this file then don't error because we can still produce correct output. */ if (CPP_OPTION (pfile, deps.style) && ! print_dep) - cpp_errno (pfile, DL_WARNING, file->path); + cpp_errno (pfile, CPP_DL_WARNING, file->path); else - cpp_errno (pfile, DL_ERROR, file->path); + cpp_errno (pfile, CPP_DL_ERROR, file->path); } } @@ -778,7 +800,9 @@ make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp) cpp_dir *dir; hash_slot = (struct file_hash_entry **) - htab_find_slot (pfile->file_hash, dir_name, INSERT); + htab_find_slot_with_hash (pfile->file_hash, dir_name, + htab_hash_string (dir_name), + INSERT); /* Have we already hashed this directory? */ for (entry = *hash_slot; entry; entry = entry->next) @@ -829,7 +853,8 @@ cpp_included (cpp_reader *pfile, const char *fname) { struct file_hash_entry *entry; - entry = htab_find (pfile->file_hash, fname); + entry = htab_find_with_hash (pfile->file_hash, fname, + htab_hash_string (fname)); while (entry && (entry->start_dir == NULL || entry->u.file->err_no)) entry = entry->next; @@ -837,9 +862,24 @@ cpp_included (cpp_reader *pfile, const char *fname) return entry != NULL; } +/* Calculate the hash value of a file hash entry P. */ + +static hashval_t +file_hash_hash (const void *p) +{ + struct file_hash_entry *entry = (struct file_hash_entry *) p; + const char *hname; + if (entry->start_dir) + hname = entry->u.file->name; + else + hname = entry->u.dir->name; + + return htab_hash_string (hname); +} + /* Compare a string Q against a file hash entry P. */ static int -hash_string_eq (const void *p, const void *q) +file_hash_eq (const void *p, const void *q) { struct file_hash_entry *entry = (struct file_hash_entry *) p; const char *fname = (const char *) q; @@ -857,7 +897,7 @@ hash_string_eq (const void *p, const void *q) void _cpp_init_files (cpp_reader *pfile) { - pfile->file_hash = htab_create_alloc (127, htab_hash_string, hash_string_eq, + pfile->file_hash = htab_create_alloc (127, file_hash_hash, file_hash_eq, NULL, xcalloc, free); allocate_file_hash_entries (pfile); } diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 734d3bba4d9..80cb04c5f52 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "hashtable.h" -#ifdef HAVE_ICONV +#if defined HAVE_ICONV_H && defined HAVE_ICONV #include #else #define HAVE_ICONV 0 diff --git a/gcc/cppinit.c b/gcc/cppinit.c index a2e85b2d2e9..13326886778 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -383,36 +383,37 @@ static void sanity_checks (cpp_reader *pfile) type precisions made by cpplib. */ test--; if (test < 1) - cpp_error (pfile, DL_ICE, "cppchar_t must be an unsigned type"); + cpp_error (pfile, CPP_DL_ICE, "cppchar_t must be an unsigned type"); if (CPP_OPTION (pfile, precision) > max_precision) - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "preprocessor arithmetic has maximum precision of %lu bits;" " target requires %lu bits", (unsigned long) max_precision, (unsigned long) CPP_OPTION (pfile, precision)); if (CPP_OPTION (pfile, precision) < CPP_OPTION (pfile, int_precision)) - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "CPP arithmetic must be at least as precise as a target int"); if (CPP_OPTION (pfile, char_precision) < 8) - cpp_error (pfile, DL_ICE, "target char is less than 8 bits wide"); + cpp_error (pfile, CPP_DL_ICE, "target char is less than 8 bits wide"); if (CPP_OPTION (pfile, wchar_precision) < CPP_OPTION (pfile, char_precision)) - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "target wchar_t is narrower than target char"); if (CPP_OPTION (pfile, int_precision) < CPP_OPTION (pfile, char_precision)) - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "target int is narrower than target char"); /* This is assumed in eval_token() and could be fixed if necessary. */ if (sizeof (cppchar_t) > sizeof (cpp_num_part)) - cpp_error (pfile, DL_ICE, "CPP half-integer narrower than CPP character"); + cpp_error (pfile, CPP_DL_ICE, + "CPP half-integer narrower than CPP character"); if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T) - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "CPP on this host cannot handle wide character constants over" " %lu bits, but the target requires %lu bits", (unsigned long) BITS_PER_CPPCHAR_T, diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 3701415aa32..783732fa444 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -270,12 +270,12 @@ _cpp_process_line_notes (cpp_reader *pfile, int in_comment) if (note->type == '\\' || note->type == ' ') { if (note->type == ' ' && !in_comment) - cpp_error_with_line (pfile, DL_WARNING, pfile->line, col, + cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line, col, "backslash and newline separated by space"); if (buffer->next_line > buffer->rlimit) { - cpp_error_with_line (pfile, DL_PEDWARN, pfile->line, col, + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line, col, "backslash-newline at end of file"); /* Prevent "no newline at end of file" warning. */ buffer->next_line = buffer->rlimit; @@ -290,14 +290,14 @@ _cpp_process_line_notes (cpp_reader *pfile, int in_comment) && (!in_comment || warn_in_comment (pfile, note))) { if (CPP_OPTION (pfile, trigraphs)) - cpp_error_with_line (pfile, DL_WARNING, pfile->line, col, + cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line, col, "trigraph ??%c converted to %c", note->type, (int) _cpp_trigraph_map[note->type]); else { cpp_error_with_line - (pfile, DL_WARNING, pfile->line, col, + (pfile, CPP_DL_WARNING, pfile->line, col, "trigraph ??%c ignored, use -trigraphs to enable", note->type); } @@ -342,7 +342,7 @@ _cpp_skip_block_comment (cpp_reader *pfile) && cur[0] == '*' && cur[1] != '/') { buffer->cur = cur; - cpp_error_with_line (pfile, DL_WARNING, + cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line, CPP_BUF_COL (buffer), "\"/*\" within comment"); } @@ -396,7 +396,7 @@ skip_whitespace (cpp_reader *pfile, cppchar_t c) else if (c == '\0') saw_NUL = true; else if (pfile->state.in_directive && CPP_PEDANTIC (pfile)) - cpp_error_with_line (pfile, DL_PEDWARN, pfile->line, + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line, CPP_BUF_COL (buffer), "%s in preprocessing directive", c == '\f' ? "form feed" : "vertical tab"); @@ -407,7 +407,7 @@ skip_whitespace (cpp_reader *pfile, cppchar_t c) while (is_nvspace (c)); if (saw_NUL) - cpp_error (pfile, DL_WARNING, "null character(s) ignored"); + cpp_error (pfile, CPP_DL_WARNING, "null character(s) ignored"); buffer->cur--; } @@ -442,7 +442,7 @@ forms_identifier_p (cpp_reader *pfile, int first) if (CPP_OPTION (pfile, warn_dollars) && !pfile->state.skipping) { CPP_OPTION (pfile, warn_dollars) = 0; - cpp_error (pfile, DL_PEDWARN, "'$' in identifier or number"); + cpp_error (pfile, CPP_DL_PEDWARN, "'$' in identifier or number"); } return true; @@ -489,14 +489,14 @@ lex_identifier (cpp_reader *pfile, const uchar *base) { /* It is allowed to poison the same identifier twice. */ if ((result->flags & NODE_POISONED) && !pfile->state.poisoned_ok) - cpp_error (pfile, DL_ERROR, "attempt to use poisoned \"%s\"", + cpp_error (pfile, CPP_DL_ERROR, "attempt to use poisoned \"%s\"", NODE_NAME (result)); /* Constraint 6.10.3.5: __VA_ARGS__ should only appear in the replacement list of a variadic macro. */ if (result == pfile->spec_nodes.n__VA_ARGS__ && !pfile->state.va_args_ok) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "__VA_ARGS__ can only appear in the expansion" " of a C99 variadic macro"); } @@ -592,7 +592,8 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) } if (saw_NUL && !pfile->state.skipping) - cpp_error (pfile, DL_WARNING, "null character(s) preserved in literal"); + cpp_error (pfile, CPP_DL_WARNING, + "null character(s) preserved in literal"); pfile->buffer->cur = cur; create_literal (pfile, token, base, cur - base, type); @@ -771,7 +772,7 @@ _cpp_get_fresh_line (cpp_reader *pfile) { /* Only warn once. */ buffer->next_line = buffer->rlimit; - cpp_error_with_line (pfile, DL_PEDWARN, pfile->line - 1, + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line - 1, CPP_BUF_COLUMN (buffer, buffer->cur), "no newline at end of file"); } @@ -912,7 +913,7 @@ _cpp_lex_direct (cpp_reader *pfile) if (c == '*') { if (_cpp_skip_block_comment (pfile)) - cpp_error (pfile, DL_ERROR, "unterminated comment"); + cpp_error (pfile, CPP_DL_ERROR, "unterminated comment"); } else if (c == '/' && (CPP_OPTION (pfile, cplusplus_comments) || CPP_IN_SYSTEM_HEADER (pfile))) @@ -922,15 +923,15 @@ _cpp_lex_direct (cpp_reader *pfile) if (CPP_OPTION (pfile, lang) == CLK_GNUC89 && CPP_PEDANTIC (pfile) && ! buffer->warned_cplusplus_comments) { - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "C++ style comments are not allowed in ISO C90"); - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "(this will be reported only once per input file)"); buffer->warned_cplusplus_comments = 1; } if (skip_line_comment (pfile) && CPP_OPTION (pfile, warn_comments)) - cpp_error (pfile, DL_WARNING, "multi-line comment"); + cpp_error (pfile, CPP_DL_WARNING, "multi-line comment"); } else if (c == '=') { @@ -1193,7 +1194,8 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token, break; case SPELL_NONE: - cpp_error (pfile, DL_ICE, "unspellable token %s", TOKEN_NAME (token)); + cpp_error (pfile, CPP_DL_ICE, + "unspellable token %s", TOKEN_NAME (token)); break; } diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 7fba1f3e96b..2b213cb461a 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -215,7 +215,7 @@ static void check_eol (cpp_reader *pfile) { if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF) - cpp_error (pfile, DL_PEDWARN, "extra tokens at end of #%s directive", + cpp_error (pfile, CPP_DL_PEDWARN, "extra tokens at end of #%s directive", pfile->directive->name); } @@ -272,14 +272,17 @@ prepare_directive_trad (cpp_reader *pfile) && ! (pfile->directive->flags & EXPAND)); bool was_skipping = pfile->state.skipping; - pfile->state.skipping = false; pfile->state.in_expression = (pfile->directive == &dtable[T_IF] || pfile->directive == &dtable[T_ELIF]); + if (pfile->state.in_expression) + pfile->state.skipping = false; + if (no_expand) pfile->state.prevent_expansion++; _cpp_scan_out_logical_line (pfile, NULL); if (no_expand) pfile->state.prevent_expansion--; + pfile->state.skipping = was_skipping; _cpp_overlay_buffer (pfile, pfile->out.base, pfile->out.cur - pfile->out.base); @@ -298,7 +301,7 @@ directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented) if (CPP_PEDANTIC (pfile) && ! pfile->state.skipping && dir->origin == EXTENSION) - cpp_error (pfile, DL_PEDWARN, "#%s is a GCC extension", dir->name); + cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name); /* Traditionally, a directive is ignored unless its # is in column 1. Therefore in code intended to work with K+R @@ -309,14 +312,14 @@ directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented) if (CPP_WTRADITIONAL (pfile)) { if (dir == &dtable[T_ELIF]) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "suggest not using #elif in traditional C"); else if (indented && dir->origin == KANDR) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "traditional C ignores #%s with the # indented", dir->name); else if (!indented && dir->origin != KANDR) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "suggest hiding #%s from traditional C with an indented #", dir->name); } @@ -338,7 +341,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented) if (was_parsing_args) { if (CPP_OPTION (pfile, pedantic)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "embedding a directive within macro arguments is not portable"); pfile->state.parsing_args = 0; pfile->state.prevent_expansion = 0; @@ -358,7 +361,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented) dir = &linemarker_dir; if (CPP_PEDANTIC (pfile) && ! CPP_OPTION (pfile, preprocessed) && ! pfile->state.skipping) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "style of line directive is a GCC extension"); } @@ -409,7 +412,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented) if (CPP_OPTION (pfile, lang) == CLK_ASM) skip = 0; else if (!pfile->state.skipping) - cpp_error (pfile, DL_ERROR, "invalid preprocessing directive #%s", + cpp_error (pfile, CPP_DL_ERROR, "invalid preprocessing directive #%s", cpp_token_as_text (pfile, dname)); } @@ -477,20 +480,20 @@ lex_macro_node (cpp_reader *pfile) cpp_hashnode *node = token->val.node; if (node == pfile->spec_nodes.n_defined) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "\"defined\" cannot be used as a macro name"); else if (! (node->flags & NODE_POISONED)) return node; } else if (token->flags & NAMED_OP) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" cannot be used as a macro name as it is an operator in C++", NODE_NAME (token->val.node)); else if (token->type == CPP_EOF) - cpp_error (pfile, DL_ERROR, "no macro name given in #%s directive", + cpp_error (pfile, CPP_DL_ERROR, "no macro name given in #%s directive", pfile->directive->name); else - cpp_error (pfile, DL_ERROR, "macro names must be identifiers"); + cpp_error (pfile, CPP_DL_ERROR, "macro names must be identifiers"); return NULL; } @@ -520,21 +523,26 @@ do_undef (cpp_reader *pfile) { cpp_hashnode *node = lex_macro_node (pfile); - /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified identifier - is not currently defined as a macro name. */ - if (node && node->type == NT_MACRO) + if (node) { if (pfile->cb.undef) pfile->cb.undef (pfile, pfile->directive_line, node); - if (node->flags & NODE_WARN) - cpp_error (pfile, DL_WARNING, "undefining \"%s\"", NODE_NAME (node)); + /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified + identifier is not currently defined as a macro name. */ + if (node->type == NT_MACRO) + { + if (node->flags & NODE_WARN) + cpp_error (pfile, CPP_DL_WARNING, + "undefining \"%s\"", NODE_NAME (node)); - if (CPP_OPTION (pfile, warn_unused_macros)) - _cpp_warn_if_unused_macro (pfile, node, NULL); + if (CPP_OPTION (pfile, warn_unused_macros)) + _cpp_warn_if_unused_macro (pfile, node, NULL); - _cpp_free_definition (node); + _cpp_free_definition (node); + } } + check_eol (pfile); } @@ -598,7 +606,7 @@ glue_header_name (cpp_reader *pfile) break; if (token->type == CPP_EOF) { - cpp_error (pfile, DL_ERROR, "missing terminating > character"); + cpp_error (pfile, CPP_DL_ERROR, "missing terminating > character"); break; } @@ -651,7 +659,7 @@ parse_include (cpp_reader *pfile, int *pangle_brackets) dir = U"pragma dependency"; else dir = pfile->directive->name; - cpp_error (pfile, DL_ERROR, "#%s expects \"FILENAME\" or ", + cpp_error (pfile, CPP_DL_ERROR, "#%s expects \"FILENAME\" or ", dir); return NULL; @@ -674,7 +682,7 @@ do_include_common (cpp_reader *pfile, enum include_type type) /* Prevent #include recursion. */ if (pfile->line_maps.depth >= CPP_STACK_MAX) - cpp_error (pfile, DL_ERROR, "#include nested too deeply"); + cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply"); else { /* Get out of macro context, if we are. */ @@ -711,7 +719,7 @@ do_include_next (cpp_reader *pfile) search logic. */ if (! pfile->buffer->prev) { - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "#include_next in primary source file"); type = IT_INCLUDE; } @@ -738,7 +746,7 @@ read_flag (cpp_reader *pfile, unsigned int last) } if (token->type != CPP_EOF) - cpp_error (pfile, DL_ERROR, "invalid flag \"%s\" in line directive", + cpp_error (pfile, CPP_DL_ERROR, "invalid flag \"%s\" in line directive", cpp_token_as_text (pfile, token)); return 0; } @@ -782,14 +790,14 @@ do_line (cpp_reader *pfile) || strtoul_for_line (token->val.str.text, token->val.str.len, &new_lineno)) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" after #line is not a positive integer", cpp_token_as_text (pfile, token)); return; } if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap)) - cpp_error (pfile, DL_PEDWARN, "line number out of range"); + cpp_error (pfile, CPP_DL_PEDWARN, "line number out of range"); token = cpp_get_token (pfile); if (token->type == CPP_STRING) @@ -801,7 +809,7 @@ do_line (cpp_reader *pfile) } else if (token->type != CPP_EOF) { - cpp_error (pfile, DL_ERROR, "\"%s\" is not a valid filename", + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename", cpp_token_as_text (pfile, token)); return; } @@ -835,7 +843,8 @@ do_linemarker (cpp_reader *pfile) || strtoul_for_line (token->val.str.text, token->val.str.len, &new_lineno)) { - cpp_error (pfile, DL_ERROR, "\"%s\" after # is not a positive integer", + cpp_error (pfile, CPP_DL_ERROR, + "\"%s\" after # is not a positive integer", cpp_token_as_text (pfile, token)); return; } @@ -873,7 +882,7 @@ do_linemarker (cpp_reader *pfile) } else if (token->type != CPP_EOF) { - cpp_error (pfile, DL_ERROR, "\"%s\" is not a valid filename", + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename", cpp_token_as_text (pfile, token)); return; } @@ -918,14 +927,14 @@ do_diagnostic (cpp_reader *pfile, int code, int print_dir) static void do_error (cpp_reader *pfile) { - do_diagnostic (pfile, DL_ERROR, 1); + do_diagnostic (pfile, CPP_DL_ERROR, 1); } static void do_warning (cpp_reader *pfile) { /* We want #warning diagnostics to be emitted in system headers too. */ - do_diagnostic (pfile, DL_WARNING_SYSHDR, 1); + do_diagnostic (pfile, CPP_DL_WARNING_SYSHDR, 1); } /* Report program identification. */ @@ -935,7 +944,7 @@ do_ident (cpp_reader *pfile) const cpp_token *str = cpp_get_token (pfile); if (str->type != CPP_STRING) - cpp_error (pfile, DL_ERROR, "invalid #ident directive"); + cpp_error (pfile, CPP_DL_ERROR, "invalid #ident directive"); else if (pfile->cb.ident) pfile->cb.ident (pfile, pfile->directive_line, &str->val.str); @@ -1014,14 +1023,14 @@ cpp_register_pragma (cpp_reader *pfile, const char *space, const char *name, { if (entry->is_nspace) clash: - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "registering \"%s\" as both a pragma and a pragma namespace", NODE_NAME (node)); else if (space) - cpp_error (pfile, DL_ICE, "#pragma %s %s is already registered", + cpp_error (pfile, CPP_DL_ICE, "#pragma %s %s is already registered", space, name); else - cpp_error (pfile, DL_ICE, "#pragma %s is already registered", name); + cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name); } else insert_pragma_entry (pfile, chain, node, handler); @@ -1166,7 +1175,7 @@ static void do_pragma_once (cpp_reader *pfile) { if (pfile->buffer->prev == NULL) - cpp_error (pfile, DL_WARNING, "#pragma once in main file"); + cpp_error (pfile, CPP_DL_WARNING, "#pragma once in main file"); check_eol (pfile); _cpp_mark_file_once_only (pfile, pfile->buffer->file); @@ -1188,7 +1197,8 @@ do_pragma_poison (cpp_reader *pfile) break; if (tok->type != CPP_NAME) { - cpp_error (pfile, DL_ERROR, "invalid #pragma GCC poison directive"); + cpp_error (pfile, CPP_DL_ERROR, + "invalid #pragma GCC poison directive"); break; } @@ -1197,7 +1207,7 @@ do_pragma_poison (cpp_reader *pfile) continue; if (hp->type == NT_MACRO) - cpp_error (pfile, DL_WARNING, "poisoning existing macro \"%s\"", + cpp_error (pfile, CPP_DL_WARNING, "poisoning existing macro \"%s\"", NODE_NAME (hp)); _cpp_free_definition (hp); hp->flags |= NODE_POISONED | NODE_DIAGNOSTIC; @@ -1217,7 +1227,7 @@ do_pragma_system_header (cpp_reader *pfile) cpp_buffer *buffer = pfile->buffer; if (buffer->prev == 0) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "#pragma system_header ignored outside include file"); else { @@ -1242,14 +1252,15 @@ do_pragma_dependency (cpp_reader *pfile) ordering = _cpp_compare_file_date (pfile, fname, angle_brackets); if (ordering < 0) - cpp_error (pfile, DL_WARNING, "cannot find source file %s", fname); + cpp_error (pfile, CPP_DL_WARNING, "cannot find source file %s", fname); else if (ordering > 0) { - cpp_error (pfile, DL_WARNING, "current file is older than %s", fname); + cpp_error (pfile, CPP_DL_WARNING, + "current file is older than %s", fname); if (cpp_get_token (pfile)->type != CPP_EOF) { _cpp_backup_tokens (pfile, 1); - do_diagnostic (pfile, DL_WARNING, 0); + do_diagnostic (pfile, CPP_DL_WARNING, 0); } } @@ -1358,7 +1369,7 @@ _cpp_do__Pragma (cpp_reader *pfile) if (string) destringize_and_run (pfile, &string->val.str); else - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "_Pragma takes a parenthesized string literal"); } @@ -1437,13 +1448,13 @@ do_else (cpp_reader *pfile) struct if_stack *ifs = buffer->if_stack; if (ifs == NULL) - cpp_error (pfile, DL_ERROR, "#else without #if"); + cpp_error (pfile, CPP_DL_ERROR, "#else without #if"); else { if (ifs->type == T_ELSE) { - cpp_error (pfile, DL_ERROR, "#else after #else"); - cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0, + cpp_error (pfile, CPP_DL_ERROR, "#else after #else"); + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, "the conditional began here"); } ifs->type = T_ELSE; @@ -1470,13 +1481,13 @@ do_elif (cpp_reader *pfile) struct if_stack *ifs = buffer->if_stack; if (ifs == NULL) - cpp_error (pfile, DL_ERROR, "#elif without #if"); + cpp_error (pfile, CPP_DL_ERROR, "#elif without #if"); else { if (ifs->type == T_ELSE) { - cpp_error (pfile, DL_ERROR, "#elif after #else"); - cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0, + cpp_error (pfile, CPP_DL_ERROR, "#elif after #else"); + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, "the conditional began here"); } ifs->type = T_ELIF; @@ -1505,7 +1516,7 @@ do_endif (cpp_reader *pfile) struct if_stack *ifs = buffer->if_stack; if (ifs == NULL) - cpp_error (pfile, DL_ERROR, "#endif without #if"); + cpp_error (pfile, CPP_DL_ERROR, "#endif without #if"); else { /* Only check EOL if was not originally skipping. */ @@ -1582,7 +1593,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type) if (type == T_UNASSERT && paren->type == CPP_EOF) return 0; - cpp_error (pfile, DL_ERROR, "missing '(' after predicate"); + cpp_error (pfile, CPP_DL_ERROR, "missing '(' after predicate"); return 1; } @@ -1597,7 +1608,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type) if (token->type == CPP_EOF) { - cpp_error (pfile, DL_ERROR, "missing ')' to complete answer"); + cpp_error (pfile, CPP_DL_ERROR, "missing ')' to complete answer"); return 1; } @@ -1617,7 +1628,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type) if (acount == 0) { - cpp_error (pfile, DL_ERROR, "predicate's answer is empty"); + cpp_error (pfile, CPP_DL_ERROR, "predicate's answer is empty"); return 1; } @@ -1644,9 +1655,9 @@ parse_assertion (cpp_reader *pfile, struct answer **answerp, int type) *answerp = 0; predicate = cpp_get_token (pfile); if (predicate->type == CPP_EOF) - cpp_error (pfile, DL_ERROR, "assertion without predicate"); + cpp_error (pfile, CPP_DL_ERROR, "assertion without predicate"); else if (predicate->type != CPP_NAME) - cpp_error (pfile, DL_ERROR, "predicate must be an identifier"); + cpp_error (pfile, CPP_DL_ERROR, "predicate must be an identifier"); else if (parse_answer (pfile, answerp, type) == 0) { unsigned int len = NODE_LEN (predicate->val.node); @@ -1730,7 +1741,7 @@ do_assert (cpp_reader *pfile) { if (*find_answer (node, new_answer)) { - cpp_error (pfile, DL_WARNING, "\"%s\" re-asserted", + cpp_error (pfile, CPP_DL_WARNING, "\"%s\" re-asserted", NODE_NAME (node) + 1); return; } @@ -1940,7 +1951,7 @@ _cpp_pop_buffer (cpp_reader *pfile) /* Walk back up the conditional stack till we reach its level at entry to this file, issuing error messages. */ for (ifs = buffer->if_stack; ifs; ifs = ifs->next) - cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0, + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, "unterminated #%s", dtable[ifs->type].name); /* In case of a missing #endif. */ diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 15187c49078..5f189245eb5 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -219,7 +219,7 @@ struct cpp_options /* Nonzero means use extra default include directories for C++. */ unsigned char cplusplus; - /* Nonzero means handle cplusplus style comments */ + /* Nonzero means handle cplusplus style comments. */ unsigned char cplusplus_comments; /* Nonzero means define __OBJC__, treat @ as a special token, and @@ -655,21 +655,21 @@ cpp_num cpp_num_sign_extend (cpp_num, size_t); with a line number of zero. */ /* Warning, an error with -Werror. */ -#define DL_WARNING 0x00 -/* Same as DL_WARNING, except it is not suppressed in system headers. */ -#define DL_WARNING_SYSHDR 0x01 +#define CPP_DL_WARNING 0x00 +/* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */ +#define CPP_DL_WARNING_SYSHDR 0x01 /* Warning, an error with -pedantic-errors or -Werror. */ -#define DL_PEDWARN 0x02 +#define CPP_DL_PEDWARN 0x02 /* An error. */ -#define DL_ERROR 0x03 +#define CPP_DL_ERROR 0x03 /* An internal consistency check failed. Prints "internal error: ", - otherwise the same as DL_ERROR. */ -#define DL_ICE 0x04 + otherwise the same as CPP_DL_ERROR. */ +#define CPP_DL_ICE 0x04 /* Extracts a diagnostic level from an int. */ -#define DL_EXTRACT(l) (l & 0xf) +#define CPP_DL_EXTRACT(l) (l & 0xf) /* Nonzero if a diagnostic level is one of the warnings. */ -#define DL_WARNING_P(l) (DL_EXTRACT (l) >= DL_WARNING \ - && DL_EXTRACT (l) <= DL_PEDWARN) +#define CPP_DL_WARNING_P(l) (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \ + && CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN) /* N.B. The error-message-printer prototypes have not been nicely formatted because exgettext needs to see 'msgid' on the same line diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 43f688ab7a0..efae0f094e1 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -81,7 +81,7 @@ _cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node, if (!macro->used && MAIN_FILE_P (linemap_lookup (&pfile->line_maps, macro->line))) - cpp_error_with_line (pfile, DL_WARNING, macro->line, 0, + cpp_error_with_line (pfile, CPP_DL_WARNING, macro->line, 0, "macro \"%s\" is not used", NODE_NAME (node)); } @@ -122,7 +122,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node) switch (node->value.builtin) { default: - cpp_error (pfile, DL_ICE, "invalid built-in macro \"%s\"", + cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"", NODE_NAME (node)); break; @@ -217,7 +217,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node) } else { - cpp_errno (pfile, DL_WARNING, + cpp_errno (pfile, CPP_DL_WARNING, "could not determine date and time"); pfile->date = U"\"??? ?? ????\""; @@ -277,7 +277,7 @@ builtin_macro (cpp_reader *pfile, cpp_hashnode *node) pfile->cur_token = _cpp_temp_token (pfile); push_token_context (pfile, NULL, _cpp_lex_direct (pfile), 1); if (pfile->buffer->cur != pfile->buffer->rlimit) - cpp_error (pfile, DL_ICE, "invalid built-in macro \"%s\"", + cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"", NODE_NAME (node)); _cpp_pop_buffer (pfile); @@ -389,7 +389,7 @@ stringify_arg (cpp_reader *pfile, macro_arg *arg) /* Ignore the final \ of invalid string literals. */ if (backslash_count & 1) { - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "invalid string literal, ignoring final '\\'"); dest--; } @@ -472,7 +472,7 @@ paste_all_tokens (cpp_reader *pfile, const cpp_token *lhs) /* Mandatory error for all apart from assembler. */ if (CPP_OPTION (pfile, lang) != CLK_ASM) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "pasting \"%s\" and \"%s\" does not give a valid preprocessing token", cpp_token_as_text (pfile, lhs), cpp_token_as_text (pfile, rhs)); @@ -510,17 +510,17 @@ _cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node if (argc + 1 == macro->paramc && macro->variadic) { if (CPP_PEDANTIC (pfile) && ! macro->syshdr) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "ISO C99 requires rest arguments to be used"); return true; } - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "macro \"%s\" requires %u arguments, but only %u given", NODE_NAME (node), macro->paramc, argc); } else - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "macro \"%s\" passed %u arguments, but takes just %u", NODE_NAME (node), argc, macro->paramc); @@ -631,7 +631,7 @@ collect_args (cpp_reader *pfile, const cpp_hashnode *node) callers at the end of an -include-d file. */ if (pfile->context->prev || pfile->state.in_directive) _cpp_backup_tokens (pfile, 1); - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "unterminated argument list invoking macro \"%s\"", NODE_NAME (node)); } @@ -734,7 +734,7 @@ enter_macro_context (cpp_reader *pfile, cpp_hashnode *node) if (buff == NULL) { if (CPP_WTRADITIONAL (pfile) && ! node->value.macro->syshdr) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "function-like macro \"%s\" must be used with arguments in traditional C", NODE_NAME (node)); @@ -1238,7 +1238,7 @@ _cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node) /* Constraint 6.10.3.6 - duplicate parameter names. */ if (node->flags & NODE_MACRO_ARG) { - cpp_error (pfile, DL_ERROR, "duplicate macro parameter \"%s\"", + cpp_error (pfile, CPP_DL_ERROR, "duplicate macro parameter \"%s\"", NODE_NAME (node)); return true; } @@ -1282,7 +1282,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) && ! CPP_OPTION (pfile, discard_comments_in_macro_exp)) continue; - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" may not appear in macro parameter list", cpp_token_as_text (pfile, token)); return false; @@ -1290,7 +1290,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) case CPP_NAME: if (prev_ident) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "macro parameters must be comma-separated"); return false; } @@ -1308,7 +1308,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) case CPP_COMMA: if (!prev_ident) { - cpp_error (pfile, DL_ERROR, "parameter name missing"); + cpp_error (pfile, CPP_DL_ERROR, "parameter name missing"); return false; } prev_ident = 0; @@ -1322,11 +1322,11 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) pfile->spec_nodes.n__VA_ARGS__); pfile->state.va_args_ok = 1; if (! CPP_OPTION (pfile, c99) && CPP_OPTION (pfile, pedantic)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "anonymous variadic macros were introduced in C99"); } else if (CPP_OPTION (pfile, pedantic)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "ISO C does not permit named variadic macros"); /* We're at the end, and just expect a closing parenthesis. */ @@ -1336,7 +1336,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) /* Fall through. */ case CPP_EOF: - cpp_error (pfile, DL_ERROR, "missing ')' in macro parameter list"); + cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list"); return false; } } @@ -1398,7 +1398,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro) macro->fun_like = 1; } else if (ctoken->type != CPP_EOF && !(ctoken->flags & PREV_WHITE)) - cpp_error (pfile, DL_PEDWARN, + cpp_error (pfile, CPP_DL_PEDWARN, "ISO C requires whitespace after the macro name"); if (macro->fun_like) @@ -1426,7 +1426,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro) /* Let assembler get away with murder. */ else if (CPP_OPTION (pfile, lang) != CLK_ASM) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "'#' is not followed by a macro parameter"); return false; } @@ -1445,7 +1445,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro) if (macro->count == 0 || token->type == CPP_EOF) { - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "'##' cannot appear at either end of a macro expansion"); return false; } @@ -1529,11 +1529,11 @@ _cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node) if (warn_of_redefinition (pfile, node, macro)) { - cpp_error_with_line (pfile, DL_PEDWARN, pfile->directive_line, 0, + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->directive_line, 0, "\"%s\" redefined", NODE_NAME (node)); if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) - cpp_error_with_line (pfile, DL_PEDWARN, + cpp_error_with_line (pfile, CPP_DL_PEDWARN, node->value.macro->line, 0, "this is the location of the previous definition"); } @@ -1584,7 +1584,7 @@ check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro, if (NODE_LEN (node) == len && !memcmp (p, NODE_NAME (node), len)) { - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "macro argument \"%s\" would be stringified in traditional C", NODE_NAME (node)); break; @@ -1607,7 +1607,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node) if (node->type != NT_MACRO || (node->flags & NODE_BUILTIN)) { - cpp_error (pfile, DL_ICE, + cpp_error (pfile, CPP_DL_ICE, "invalid hash type %d in cpp_macro_definition", node->type); return 0; } diff --git a/gcc/cpppch.c b/gcc/cpppch.c index 71c7aae98dd..872908de0bd 100644 --- a/gcc/cpppch.c +++ b/gcc/cpppch.c @@ -80,7 +80,8 @@ write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p) if (fwrite (&s, sizeof (s), 1, f) != 1 || fwrite (defn, 1, s.definition_length, f) != s.definition_length) { - cpp_errno (pfile, DL_ERROR, "while writing precompiled header"); + cpp_errno (pfile, CPP_DL_ERROR, + "while writing precompiled header"); return 0; } } @@ -328,7 +329,7 @@ cpp_write_pch_deps (cpp_reader *r, FILE *f) if (fwrite (&z, sizeof (z), 1, f) != 1 || fwrite (ss->definedstrs, ss->hashsize, 1, f) != 1) { - cpp_errno (r, DL_ERROR, "while writing precompiled header"); + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); return -1; } free (ss->definedstrs); @@ -352,7 +353,7 @@ cpp_write_pch_state (cpp_reader *r, FILE *f) memset (&z, 0, sizeof (z)); if (fwrite (&z, sizeof (z), 1, f) != 1) { - cpp_errno (r, DL_ERROR, "while writing precompiled header"); + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); return -1; } @@ -361,7 +362,7 @@ cpp_write_pch_state (cpp_reader *r, FILE *f) if (deps_save (r->deps, f) != 0) { - cpp_errno (r, DL_ERROR, "while writing precompiled header"); + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); return -1; } @@ -458,7 +459,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) || h->flags & NODE_POISONED) { if (CPP_OPTION (r, warn_invalid_pch)) - cpp_error (r, DL_WARNING_SYSHDR, + cpp_error (r, CPP_DL_WARNING_SYSHDR, "%s: not used because `%.*s' not defined", name, m.name_length, namebuf); goto fail; @@ -470,7 +471,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) || memcmp (namebuf, newdefn, m.definition_length) != 0) { if (CPP_OPTION (r, warn_invalid_pch)) - cpp_error (r, DL_WARNING_SYSHDR, + cpp_error (r, CPP_DL_WARNING_SYSHDR, "%s: not used because `%.*s' defined as `%s' not `%.*s'", name, m.name_length, namebuf, newdefn + m.name_length, m.definition_length - m.name_length, @@ -511,7 +512,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) else { if (CPP_OPTION (r, warn_invalid_pch)) - cpp_error (r, DL_WARNING_SYSHDR, + cpp_error (r, CPP_DL_WARNING_SYSHDR, "%s: not used because `%s' is defined", name, first); goto fail; @@ -525,7 +526,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) return 0; error: - cpp_errno (r, DL_ERROR, "while reading precompiled header"); + cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header"); return -1; fail: @@ -711,6 +712,6 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f, return 0; error: - cpp_errno (r, DL_ERROR, "while reading precompiled header"); + cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header"); return -1; } diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c index e2ccb0bdcbd..08636edb7a5 100644 --- a/gcc/cpptrad.c +++ b/gcc/cpptrad.c @@ -158,7 +158,7 @@ copy_comment (cpp_reader *pfile, const uchar *cur, int in_define) unterminated = _cpp_skip_block_comment (pfile); if (unterminated) - cpp_error_with_line (pfile, DL_ERROR, from_line, 0, + cpp_error_with_line (pfile, CPP_DL_ERROR, from_line, 0, "unterminated comment"); /* Comments in directives become spaces so that tokens are properly @@ -350,6 +350,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) unsigned int c, paren_depth = 0, quote; enum ls lex_state = ls_none; bool header_ok; + const uchar *start_of_input_line; fmacro.buff = NULL; @@ -359,6 +360,9 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) RLIMIT (pfile->context) = pfile->buffer->rlimit; pfile->out.cur = pfile->out.base; pfile->out.first_line = pfile->line; + /* start_of_input_line is needed to make sure that directives really, + really start at the first character of the line. */ + start_of_input_line = pfile->buffer->cur; new_context: context = pfile->context; cur = CUR (context); @@ -581,7 +585,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) break; case '#': - if (out - 1 == pfile->out.base + if (cur - 1 == start_of_input_line /* A '#' from a macro doesn't start a directive. */ && !pfile->context->prev && !pfile->state.in_directive) @@ -667,7 +671,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) _cpp_release_buff (pfile, fmacro.buff); if (lex_state == ls_fun_close) - cpp_error_with_line (pfile, DL_ERROR, fmacro.line, 0, + cpp_error_with_line (pfile, CPP_DL_ERROR, fmacro.line, 0, "unterminated argument list invoking macro \"%s\"", NODE_NAME (fmacro.node)); return result; @@ -736,7 +740,7 @@ recursive_macro (cpp_reader *pfile, cpp_hashnode *node) } if (recursing) - cpp_error (pfile, DL_ERROR, + cpp_error (pfile, CPP_DL_ERROR, "detected recursion whilst expanding macro \"%s\"", NODE_NAME (node)); @@ -903,6 +907,9 @@ scan_parameters (cpp_reader *pfile, cpp_macro *macro) break; } + if (!ok) + cpp_error (pfile, CPP_DL_ERROR, "syntax error in macro parameter list"); + CUR (pfile->context) = cur + (*cur == ')'); return ok; @@ -978,14 +985,17 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro) /* Is this a function-like macro? */ if (* CUR (context) == '(') { + bool ok = scan_parameters (pfile, macro); + + /* Remember the params so we can clear NODE_MACRO_ARG flags. */ + macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff); + /* Setting macro to NULL indicates an error occurred, and prevents unnecessary work in _cpp_scan_out_logical_line. */ - if (!scan_parameters (pfile, macro)) + if (!ok) macro = NULL; else { - /* Success. Commit the parameter array. */ - macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff); BUFF_FRONT (pfile->a_buff) = (uchar *) ¯o->params[macro->paramc]; macro->fun_like = 1; } diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index a5c46d602a5..b9a29a0ba60 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -120,15 +120,16 @@ call_ ## FUNC (void) \ /* References to __register_frame_info and __deregister_frame_info should be weak in this file if at all possible. */ -extern void __register_frame_info (void *, struct object *) +extern void __register_frame_info (const void *, struct object *) TARGET_ATTRIBUTE_WEAK; -extern void __register_frame_info_bases (void *, struct object *, +extern void __register_frame_info_bases (const void *, struct object *, void *, void *) TARGET_ATTRIBUTE_WEAK; -extern void *__deregister_frame_info (void *) +extern void *__deregister_frame_info (const void *) TARGET_ATTRIBUTE_WEAK; -extern void *__deregister_frame_info_bases (void *) +extern void *__deregister_frame_info_bases (const void *) TARGET_ATTRIBUTE_WEAK; +extern void __do_global_ctors_1 (void); /* Likewise for _Jv_RegisterClasses. */ extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK; @@ -361,6 +362,8 @@ __do_global_ctors_aux (void) /* prologue goes in .init section */ #elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */ +extern void __do_global_dtors (void); + /* This case is used by the Irix 6 port, which supports named sections but not an SVR4-style .fini section. __do_global_dtors can be non-static in this case because we protect it with -hidden_symbol. */ @@ -507,10 +510,11 @@ asm (TEXT_SECTION_ASM_OP); #elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */ +extern void __do_global_ctors (void); + /* This case is used by the Irix 6 port, which supports named sections but not an SVR4-style .init section. __do_global_ctors can be non-static in this case because we protect it with -hidden_symbol. */ -extern void __do_global_ctors_1(void); void __do_global_ctors (void) { diff --git a/gcc/cse.c b/gcc/cse.c index 7612a5a7ed5..4b0f1eced4c 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -5827,6 +5827,16 @@ cse_insn (rtx insn, rtx libcall_insn) enum machine_mode mode = GET_MODE (src) == VOIDmode ? GET_MODE (dest) : GET_MODE (src); + /* It's possible that we have a source value known to be + constant but don't have a REG_EQUAL note on the insn. + Lack of a note will mean src_eqv_elt will be NULL. This + can happen where we've generated a SUBREG to access a + CONST_INT that is already in a register in a wider mode. + Ensure that the source expression is put in the proper + constant class. */ + if (!classp) + classp = sets[i].src_const_elt; + if (sets[i].src_elt == 0) { /* Don't put a hard register source into the table if this is @@ -6676,6 +6686,10 @@ cse_set_around_loop (rtx x, rtx insn, rtx loop_start) } else { + if (CONSTANT_P (SET_SRC (set)) + && ! find_reg_equal_equiv_note (insn)) + set_unique_reg_note (insn, REG_EQUAL, + SET_SRC (set)); if (control_flow_insn_p (p)) /* p can cause a control flow transfer so it is the last insn of a basic block. We can't diff --git a/gcc/dbxout.c b/gcc/dbxout.c index ef04c831134..dee3839974a 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -185,19 +185,28 @@ enum binclstatus {BINCL_NOT_REQUIRED, BINCL_PENDING, BINCL_PROCESSED}; pair of the file number and the type number within the file. This is a stack of input files. */ -struct dbx_file GTY(()) +struct dbx_file { struct dbx_file *next; int file_number; int next_type_number; - enum binclstatus bincl_status; /* Keep track of lazy bincl. */ - const char *pending_bincl_name; /* Name of bincl. */ - struct dbx_file *prev; /* Chain to traverse all pending bincls. */ + enum binclstatus bincl_status; /* Keep track of lazy bincl. */ + const char *pending_bincl_name; /* Name of bincl. */ + struct dbx_file *prev; /* Chain to traverse all pending bincls. */ }; -/* This is the top of the stack. */ - -static GTY(()) struct dbx_file *current_file; +/* This is the top of the stack. + + This is not saved for PCH, because restoring a PCH should not change it. + next_file_number does have to be saved, because the PCH may use some + file numbers; however, just before restoring a PCH, next_file_number + should always be 0 because we should not have needed any file numbers + yet. */ + +#if (defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)) \ + && defined (DBX_USE_BINCL) +static struct dbx_file *current_file; +#endif /* This is the next file number to use. */ @@ -513,7 +522,7 @@ dbxout_init (const char *input_file_name) next_type_number = 1; #ifdef DBX_USE_BINCL - current_file = ggc_alloc (sizeof *current_file); + current_file = xmalloc (sizeof *current_file); current_file->next = NULL; current_file->file_number = 0; current_file->next_type_number = 1; @@ -625,7 +634,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED, const char *filename ATTRIBUTE_UNUSED) { #ifdef DBX_USE_BINCL - struct dbx_file *n = ggc_alloc (sizeof *n); + struct dbx_file *n = xmalloc (sizeof *n); n->next = current_file; n->next_type_number = 1; diff --git a/gcc/dbxstclass.h b/gcc/dbxstclass.h deleted file mode 100644 index 2d003fed3bb..00000000000 --- a/gcc/dbxstclass.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Storage classes in XCOFF object file format designed for DBX's use. - This info is from the `Files Reference' manual for IBM's AIX version 3 - for the RS6000. */ - -#define C_GSYM 0x80 -#define C_LSYM 0x81 -#define C_PSYM 0x82 -#define C_RSYM 0x83 -#define C_RPSYM 0x84 -#define C_STSYM 0x85 - -#define C_BCOMM 0x87 -#define C_ECOML 0x88 -#define C_ECOMM 0x89 -#define C_DECL 0x8c -#define C_ENTRY 0x8d -#define C_FUN 0x8e diff --git a/gcc/defaults.h b/gcc/defaults.h index 0070c6d7586..afe788cdd26 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -382,10 +382,6 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \ #define POINTER_SIZE BITS_PER_WORD #endif -#ifndef BUILD_VA_LIST_TYPE -#define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node) -#endif - #ifndef PIC_OFFSET_TABLE_REGNUM #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM #endif @@ -489,7 +485,7 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \ PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way. This is one long line cause VAXC can't handle a \-newline. */ -#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO)) +#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO)) #ifndef PREFERRED_DEBUGGING_TYPE You Lose! You must define PREFERRED_DEBUGGING_TYPE! #endif /* no PREFERRED_DEBUGGING_TYPE */ @@ -689,4 +685,15 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE! fprintf ((FILE), "%s", reg_names[REGNO (RTX)]) #endif +#ifndef LOCAL_REGNO +#define LOCAL_REGNO(REGNO) 0 +#endif + +/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, + the stack pointer does not matter. The value is tested only in + functions that have frame pointers. */ +#ifndef EXIT_IGNORE_STACK +#define EXIT_IGNORE_STACK 0 +#endif + #endif /* ! GCC_DEFAULTS_H */ diff --git a/gcc/df.c b/gcc/df.c index ae99d8eb64f..96c8ad8dbd2 100644 --- a/gcc/df.c +++ b/gcc/df.c @@ -971,7 +971,7 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type, return; case MEM: - df_uses_record (df, &XEXP (x, 0), DF_REF_REG_MEM_LOAD, bb, insn, flags); + df_uses_record (df, &XEXP (x, 0), DF_REF_REG_MEM_LOAD, bb, insn, 0); return; case SUBREG: @@ -987,7 +987,6 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type, /* ... Fall through ... */ case REG: - /* See a REG (or SUBREG) other than being set. */ df_ref_record (df, x, loc, insn, ref_type, flags); return; @@ -999,14 +998,12 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type, switch (GET_CODE (dst)) { - enum df_ref_flags use_flags; case SUBREG: if ((df->flags & DF_FOR_REGALLOC) == 0 && read_modify_subreg_p (dst)) { - use_flags = DF_REF_READ_WRITE; df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb, - insn, use_flags); + insn, DF_REF_READ_WRITE); break; } /* ... FALLTHRU ... */ @@ -1025,9 +1022,8 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type, dst = XEXP (dst, 0); if (GET_CODE (dst) != SUBREG) abort (); - use_flags = DF_REF_READ_WRITE; df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb, - insn, use_flags); + insn, DF_REF_READ_WRITE); break; case ZERO_EXTRACT: case SIGN_EXTRACT: @@ -1219,14 +1215,14 @@ df_bb_refs_record (struct df *df, basic_block bb) rtx insn; /* Scan the block an insn at a time from beginning to end. */ - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) { /* Record defs within INSN. */ df_insn_refs_record (df, bb, insn); } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } @@ -1259,7 +1255,7 @@ df_bb_reg_def_chain_create (struct df *df, basic_block bb) scan the basic blocks in reverse order so that the first defs appear at the start of the chain. */ - for (insn = bb->end; insn && insn != PREV_INSN (bb->head); + for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb)); insn = PREV_INSN (insn)) { struct df_link *link; @@ -1311,7 +1307,7 @@ df_bb_reg_use_chain_create (struct df *df, basic_block bb) /* Scan in forward order so that the last uses appear at the start of the chain. */ - for (insn = bb->head; insn && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { struct df_link *link; @@ -1364,7 +1360,7 @@ df_bb_du_chain_create (struct df *df, basic_block bb, bitmap ru) /* For each def in BB create a linked list (chain) of uses reached from the def. */ - for (insn = bb->end; insn && insn != PREV_INSN (bb->head); + for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb)); insn = PREV_INSN (insn)) { struct df_link *def_link; @@ -1441,7 +1437,7 @@ df_bb_ud_chain_create (struct df *df, basic_block bb) /* For each use in BB create a linked list (chain) of defs that reach the use. */ - for (insn = bb->head; insn && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { unsigned int uid = INSN_UID (insn); @@ -1551,7 +1547,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb) struct bb_info *bb_info = DF_BB_INFO (df, bb); rtx insn; - for (insn = bb->head; insn && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { unsigned int uid = INSN_UID (insn); @@ -1615,7 +1611,7 @@ df_bb_ru_local_compute (struct df *df, basic_block bb) rtx insn; - for (insn = bb->end; insn && insn != PREV_INSN (bb->head); + for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb)); insn = PREV_INSN (insn)) { unsigned int uid = INSN_UID (insn); @@ -1678,7 +1674,7 @@ df_bb_lr_local_compute (struct df *df, basic_block bb) struct bb_info *bb_info = DF_BB_INFO (df, bb); rtx insn; - for (insn = bb->end; insn && insn != PREV_INSN (bb->head); + for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb)); insn = PREV_INSN (insn)) { unsigned int uid = INSN_UID (insn); @@ -1733,7 +1729,7 @@ df_bb_reg_info_compute (struct df *df, basic_block bb, bitmap live) bitmap_copy (live, bb_info->lr_out); - for (insn = bb->end; insn && insn != PREV_INSN (bb->head); + for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb)); insn = PREV_INSN (insn)) { unsigned int uid = INSN_UID (insn); @@ -1799,13 +1795,13 @@ df_bb_luids_set (struct df *df, basic_block bb) /* The LUIDs are monotonically increasing for each basic block. */ - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) DF_INSN_LUID (df, insn) = luid++; DF_INSN_LUID (df, insn) = luid; - if (insn == bb->end) + if (insn == BB_END (bb)) break; } return luid; @@ -2100,7 +2096,7 @@ df_bb_refs_update (struct df *df, basic_block bb) a bitmap for insns_modified saves memory and avoids queuing duplicates. */ - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { unsigned int uid; @@ -2116,7 +2112,7 @@ df_bb_refs_update (struct df *df, basic_block bb) count++; } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } return count; @@ -2252,14 +2248,14 @@ df_bb_refs_unlink (struct df *df, basic_block bb) rtx insn; /* Scan the block an insn at a time from beginning to end. */ - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) { /* Unlink refs for INSN. */ df_insn_refs_unlink (df, bb, insn); } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } @@ -2298,7 +2294,7 @@ df_insn_delete (struct df *df, basic_block bb ATTRIBUTE_UNUSED, rtx insn) handle the JUMP_LABEL? */ /* We should not be deleting the NOTE_INSN_BASIC_BLOCK or label. */ - if (insn == bb->head) + if (insn == BB_HEAD (bb)) abort (); /* Delete the insn. */ @@ -2595,7 +2591,7 @@ df_pattern_emit_before (struct df *df, rtx pattern, basic_block bb, rtx insn) rtx prev_insn = PREV_INSN (insn); /* We should not be inserting before the start of the block. */ - if (insn == bb->head) + if (insn == BB_HEAD (bb)) abort (); ret_insn = emit_insn_before (pattern, insn); if (ret_insn == insn) diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index c29867a60b3..badad530e6e 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -66,7 +66,7 @@ diagnostic_context *global_dc = &global_diagnostic_context; #define bug_report_request \ "Please submit a full bug report,\n\ with preprocessed source if appropriate.\n\ -See %s for instructions.\n" +Send email to %s for instructions.\n" /* Return a malloc'd string containing MSG formatted a la printf. The diff --git a/gcc/doc/.cvsignore b/gcc/doc/.cvsignore deleted file mode 100644 index 169b3ef6992..00000000000 --- a/gcc/doc/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -*.info* -gcc.1 -cpp.1 -gcov.1 -gfdl.7 -gpl.7 -fsf-funding.7 diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi index 29ccaec317d..9151fec67f5 100644 --- a/gcc/doc/c-tree.texi +++ b/gcc/doc/c-tree.texi @@ -788,7 +788,7 @@ This predicate holds whenever its argument represents a class-type with default constructor. @item CLASSTYPE_HAS_MUTABLE -@item TYPE_HAS_MUTABLE_P +@itemx TYPE_HAS_MUTABLE_P These predicates hold for a class-type having a mutable data member. @item CLASSTYPE_NON_POD_P @@ -1546,10 +1546,10 @@ This is used for branch prediction. Used to represent a C++ @code{catch} block. The @code{HANDLER_TYPE} is the type of exception that will be caught by this handler; it is -equal (by pointer equality) to @code{CATCH_ALL_TYPE} if this handler -is for all types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for -the catch parameter, and @code{HANDLER_BODY} is the -@code{COMPOUND_STMT} for the block itself. +equal (by pointer equality) to @code{NULL} if this handler is for all +types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for the catch +parameter, and @code{HANDLER_BODY} is the @code{COMPOUND_STMT} for the +block itself. @item IF_STMT @@ -1991,7 +1991,7 @@ real part and the second operand is the imaginary part. These nodes represent the conjugate of their operand. @item REALPART_EXPR -@item IMAGPART_EXPR +@itemx IMAGPART_EXPR These nodes represent respectively the real and the imaginary parts of complex numbers (their sole argument). @@ -2234,10 +2234,7 @@ second operand is a @code{TREE_LIST}. If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a @code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the -expression used to initialize that field. You should not depend on the -fields appearing in any particular order, nor should you assume that all -fields will be represented. Unrepresented fields may be assigned any -value. +expression used to initialize that field. If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an @code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the @@ -2247,8 +2244,10 @@ again, the @code{TREE_VALUE} is the corresponding initializer. If the @code{TREE_PURPOSE} is @code{NULL_TREE}, then the initializer is for the next available array element. -Conceptually, before any initialization is done, the entire area of -storage is initialized to zero. +In the front end, you should not depend on the fields appearing in any +particular order. However, in the middle end, fields must appear in +declaration order. You should not assume that all fields will be +represented. Unrepresented fields will be set to zero. @item COMPOUND_LITERAL_EXPR @findex COMPOUND_LITERAL_EXPR_DECL_STMT diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index 6d6377b4b0d..80399ed784f 100644 --- a/gcc/doc/contrib.texi +++ b/gcc/doc/contrib.texi @@ -35,6 +35,9 @@ port. @item Alasdair Baird for various bug fixes. +@item +Giovanni Bajo for analyzing lots of complicated C++ problem reports. + @item Peter Barada for his work to improve code generation for new ColdFire cores. @@ -308,6 +311,9 @@ Michael Hayes for various thankless work he's done trying to get the c30/c40 ports functional. Lots of loop and unroll improvements and fixes. +@item +Dara Hazeghi for wading through myriads of target-specific bug reports. + @item Kate Hedstrom for staking the g77 folks with an initial testsuite. @@ -338,6 +344,9 @@ Steve Holmgren for MachTen patches. @item Jan Hubicka for his x86 port improvements. +@item +Falk Hueffner for working on C and optimization bug reports. + @item Bernardo Innocenti for his m68k work, including merging of ColdFire improvements and uClinux support. @@ -555,7 +564,8 @@ Linux kernels. Mike Moreton for his various Java patches. @item -David Mosberger-Tang for various Alpha improvements. +David Mosberger-Tang for various Alpha improvements, and for the initial +IA-64 port. @item Stephen Moshier contributed the floating point emulator that assists in @@ -635,6 +645,9 @@ Gerald Pfeifer for his direction via the steering committee, pointing out lots of problems we need to solve, maintenance of the web pages, and taking care of documentation maintenance in general. +@item +Andrew Pinski for processing bug reports by the dozen. + @item Ovidiu Predescu for his work on the Objective-C front end and runtime libraries. diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 2db1ee1ff11..0ab1b3203ec 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -2086,7 +2086,7 @@ runtime is used, this macro is not defined, so that you can use this macro to determine which runtime (NeXT or GNU) is being used. @item __LP64__ -@item _LP64 +@itemx _LP64 These macros are defined, with value 1, if (and only if) the compilation is for a target where @code{long int} and pointer both use 64-bits and @code{int} uses 32-bit. diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi index 4d509e859d1..2e7f50e37a6 100644 --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi @@ -456,8 +456,6 @@ Append @var{dir} to the prefix specified previously with path. @option{-iwithprefixbefore} puts it in the same place @option{-I} would; @option{-iwithprefix} puts it where @option{-idirafter} would. -Use of these options is discouraged. - @item -isystem @var{dir} @opindex isystem Search @var{dir} for header files, after all directories specified by diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e2982929e58..ac038554b9a 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -884,6 +884,11 @@ and later return that value, without knowing what data type the function tried to return (as long as your caller expects that data type). +However, these built-in functions may interact badly with some +sophisticated features or other extensions of the language. It +is, therefore, not recommended to use them outside very simple +functions acting as mere forwarders for their arguments. + @deftypefn {Built-in Function} {void *} __builtin_apply_args () This built-in function returns a pointer to data describing how to perform a call with the same arguments as were passed @@ -1069,7 +1074,8 @@ This will work with all versions of GCC@. Compound expressions, conditional expressions and casts are allowed as lvalues provided their operands are lvalues. This means that you can take -their addresses or store values into them. +their addresses or store values into them. All these extensions are +deprecated. Standard C++ allows compound expressions and conditional expressions as lvalues, and permits casts to reference type, so use of this @@ -3907,18 +3913,19 @@ The ordinary output operands must be write-only; GCC will assume that the values in these operands before the instruction are dead and need not be generated. Extended asm supports input-output or read-write operands. Use the constraint character @samp{+} to indicate such an -operand and list it with the output operands. - -When the constraints for the read-write operand (or the operand in which -only some of the bits are to be changed) allows a register, you may, as -an alternative, logically split its function into two separate operands, -one input operand and one write-only output operand. The connection -between them is expressed by constraints which say they need to be in -the same location when the instruction executes. You can use the same C -expression for both operands, or different expressions. For example, -here we write the (fictitious) @samp{combine} instruction with -@code{bar} as its read-only source operand and @code{foo} as its -read-write destination: +operand and list it with the output operands. You should only use +read-write operands when the constraints for the operand (or the +operand in which only some of the bits are to be changed) allow a +register. + +You may, as an alternative, logically split its function into two +separate operands, one input operand and one write-only output +operand. The connection between them is expressed by constraints +which say they need to be in the same location when the instruction +executes. You can use the same C expression for both operands, or +different expressions. For example, here we write the (fictitious) +@samp{combine} instruction with @code{bar} as its read-only source +operand and @code{foo} as its read-write destination: @example asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar)); @@ -4721,8 +4728,8 @@ architecture does not allow for this specific SIMD type, gcc will produce code that uses 4 @code{SIs}. The types defined in this manner can be used with a subset of normal C -operations. Currently, gcc will allow using the following operators on -these types: @code{+, -, *, /, unary minus}@. +operations. Currently, gcc will allow using the following operators +on these types: @code{+, -, *, /, unary minus, ^, |, &, ~}@. The operations behave like C++ @code{valarrays}. Addition is defined as the addition of the corresponding elements of the operands. For @@ -4738,9 +4745,10 @@ v4si a, b, c; c = a + b; @end example -Subtraction, multiplication, and division operate in a similar manner. -Likewise, the result of using the unary minus operator on a vector type -is a vector whose elements are the negative value of the corresponding +Subtraction, multiplication, division, and the logical operations +operate in a similar manner. Likewise, the result of using the unary +minus or complement operators on a vector type is a vector whose +elements are the negative or complemented values of the corresponding elements in the operand. You can declare variables and use them in function calls and returns, as @@ -7648,6 +7656,8 @@ Predefined Macros,cpp,The GNU C Preprocessor}). * Bound member functions:: You can extract a function pointer to the method denoted by a @samp{->*} or @samp{.*} expression. * C++ Attributes:: Variable, function, and type attributes for C++ only. +* Strong Using:: Strong using-directives for namespace composition. +* Offsetof:: Special syntax for implementing @code{offsetof}. * Java Exceptions:: Tweaking exception handling to work with Java. * Deprecated Features:: Things will disappear from g++. * Backwards Compatibility:: Compatibilities with earlier definitions of C++. @@ -8248,6 +8258,64 @@ interface table mechanism, instead of regular virtual table dispatch. @end table +See also @xref{Strong Using}. + +@node Strong Using +@section Strong Using + +A using-directive with @code{__attribute ((strong))} is stronger +than a normal using-directive in two ways: + +@itemize @bullet +@item +Templates from the used namespace can be specialized as though they were members of the using namespace. + +@item +The using namespace is considered an associated namespace of all +templates in the used namespace for purposes of argument-dependent +name lookup. +@end itemize + +This is useful for composing a namespace transparently from +implementation namespaces. For example: + +@smallexample +namespace std @{ + namespace debug @{ + template struct A @{ @}; + @} + using namespace debug __attribute ((__strong__)); + template <> struct A @{ @}; // ok to specialize + + template void f (A); +@} + +int main() +@{ + f (std::A()); // lookup finds std::f + f (std::A()); +@} +@end smallexample + +@node Offsetof +@section Offsetof + +G++ uses a syntactic extension to implement the @code{offsetof} macro. + +In particular: + +@smallexample + __offsetof__ (expression) +@end smallexample + +is equivalent to the parenthesized expression, except that the +expression is considered an integral constant expression even if it +contains certain operators that are not normally permitted in an +integral constant expression. Users should never use +@code{__offsetof__} directly; the only valid use of +@code{__offsetof__} is to implement the @code{offsetof} macro in +@code{}. + @node Java Exceptions @section Java Exceptions diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 731a37a871f..8f0a23cae5d 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -249,8 +249,8 @@ information needed by gcov. These additional files are placed in the directory where the object file is located. Running the program will cause profile output to be generated. For each -source file compiled with @option{-fprofile-arcs}, an accompanying @file{.da} -file will be placed in the object file directory. +source file compiled with @option{-fprofile-arcs}, an accompanying +@file{.gcda} file will be placed in the object file directory. Running @command{gcov} with your program's source file names as arguments will now produce a listing of the code along with frequency of execution @@ -410,7 +410,7 @@ of times the call was executed will be printed. This will usually be and thus may not return every time they are called. The execution counts are cumulative. If the example program were -executed again without removing the @file{.da} file, the count for the +executed again without removing the @file{.gcda} file, the count for the number of times each line in the source was executed would be added to the results of the previous run(s). This is potentially useful in several ways. For example, it could be used to accumulate data over a @@ -418,9 +418,9 @@ number of program runs as part of a test verification suite, or to provide more accurate long-term information over a large number of program runs. -The data in the @file{.da} files is saved immediately before the program +The data in the @file{.gcda} files is saved immediately before the program exits. For each source file compiled with @option{-fprofile-arcs}, the -profiling code first attempts to read in an existing @file{.da} file; if +profiling code first attempts to read in an existing @file{.gcda} file; if the file doesn't match the executable (differing number of basic block counts) it will ignore the contents of the file. It then adds in the new execution counts and finally writes the data to the file. @@ -463,6 +463,28 @@ executed 100 times. In one sense this result is correct, because there was only one instruction representing all four of these lines. However, the output does not indicate how many times the result was 0 and how many times the result was 1. + +Inlineable functions can create unexpected line counts. Line counts are +shown for the source code of the inlineable function, but what is shown +depends on where the function is inlined, or if it is not inlined at all. + +If the function is not inlined, the compiler must emit an out of line +copy of the function, in any object file that needs it. If +@file{fileA.o} and @file{fileB.o} both contain out of line bodies of a +particular inlineable function, they will also both contain coverage +counts for that function. When @file{fileA.o} and @file{fileB.o} are +linked together, the linker will, on many systems, select one of those +out of line bodies for all calls to that function, and remove or ignore +the other. Unfortunately, it will not remove the coverage counters for +the unused function body. Hence when instrumented, all but one use of +that function will show zero counts. + +If the function is inlined in several places, the block structure in +each location might not be the same. For instance, a condition might +now be calculable at compile time in some instances. Because the +coverage of all the uses of the inline function will be shown for the +same source lines, the line counts themselves might seem inconsistent. + @c man end @node Gcov Data Files diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index 6d4f8394f42..56ce597f8dc 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -132,8 +132,19 @@ field really isn't ever used. @itemx default The type machinery needs to be told which field of a @code{union} is -currently active. This is done by giving each field a constant @code{tag} -value, and then specifying a discriminator using @code{desc}. For example, +currently active. This is done by giving each field a constant +@code{tag} value, and then specifying a discriminator using @code{desc}. +The value of the expression given by @code{desc} is compared against +each @code{tag} value, each of which should be different. If no +@code{tag} is matched, the field marked with @code{default} is used if +there is one, otherwise no field in the union will be marked. + +In the @code{desc} option, the ``current structure'' is the union that +it discriminates. Use @code{%1} to mean the structure containing it. +(There are no escapes available to the @code{tag} option, since it's +supposed to be a constant.) + +For example, @smallexample struct tree_binding GTY(()) @{ @@ -141,19 +152,15 @@ struct tree_binding GTY(()) union tree_binding_u @{ tree GTY ((tag ("0"))) scope; struct cp_binding_level * GTY ((tag ("1"))) level; - @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) scope; + @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) xscope; tree value; @}; @end smallexample -In the @code{desc} option, the ``current structure'' is the union that -it discriminates. Use @code{%1} to mean the structure containing it. -(There are no escapes available to the @code{tag} option, since it's -supposed to be a constant.) - -Each @code{tag} should be different. If no @code{tag} is matched, -the field marked with @code{default} is used if there is one, otherwise -no field in the union will be marked. +In this example, the value of BINDING_HAS_LEVEL_P when applied to a +@code{struct tree_binding *} is presumed to be 0 or 1. If 1, the type +mechanism will treat the field @code{level} as being present and if 0, +will treat the field @code{scope} as being present. @findex param_is @findex use_param diff --git a/gcc/doc/include/gcc-common.texi b/gcc/doc/include/gcc-common.texi index 7bc6de85a99..2d934bda540 100644 --- a/gcc/doc/include/gcc-common.texi +++ b/gcc/doc/include/gcc-common.texi @@ -1,10 +1,10 @@ -@c Copyright (C) 2001, 2002 Free Software Foundation, Inc. +@c Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @c Common values used in the GCC manuals: -@set version-GCC 3.4 +@set version-GCC 3.4.0 @c DEVELOPMENT is set to indicate an in-development version, @c as compared to a release version. When making a release diff --git a/gcc/doc/install-old.texi b/gcc/doc/install-old.texi index 4a695a19f2e..0a4afbe451f 100644 --- a/gcc/doc/install-old.texi +++ b/gcc/doc/install-old.texi @@ -21,13 +21,10 @@ main manual. @ifnothtml @menu * Configurations:: Configurations Supported by GCC. -* Cross-Compiler:: Building and installing a cross-compiler. -* VMS Install:: See below for installation on VMS. @end menu @end ifnothtml Here is the procedure for installing GCC on a GNU or Unix system. -See @ref{VMS Install}, for VMS systems. @enumerate @item @@ -59,8 +56,7 @@ wrong. In those cases, specify the build machine's @dfn{configuration name} with the @option{--host} option; the host and target will default to be -the same as the host machine. (If you are building a cross-compiler, -see @ref{Cross-Compiler}.) +the same as the host machine. Here is an example: @@ -92,7 +88,7 @@ section before proceeding any further with the installation of GCC@. @end enumerate @ifnothtml -@node Configurations, Cross-Compiler, , Old +@node Configurations, , , Old @section Configurations Supported by GCC @end ifnothtml @html @@ -196,518 +192,3 @@ Thus, if you specify @samp{m68k-local}, configuration uses files @file{m68k.md}, @file{local.h}, @file{m68k.c}, @file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the directory @file{config/m68k}. - -Here is a list of configurations that have special treatment or special -things you must know: - -@table @samp -@item vax-dec-vms -See @ref{VMS Install}, for details on how to install GCC on VMS@. -@end table - -@ifnothtml -@node Cross-Compiler, VMS Install, Configurations, Old -@section Building and Installing a Cross-Compiler -@end ifnothtml -@html -

@anchor{Cross-Compiler}Building and Installing a Cross-Compiler

-@end html -@cindex cross-compiler, installation - -GCC can function as a cross-compiler for many machines, but not all. - -@itemize @bullet -@item -Cross-compilers for the Mips as target using the Mips assembler -currently do not work, because the auxiliary programs -@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on -anything but a Mips. It does work to cross compile for a Mips -if you use the GNU assembler and linker. - -@item -Cross-compilers between machines with different floating point formats -have not all been made to work. GCC now has a floating point -emulator with which these can work, but each target machine description -needs to be updated to take advantage of it. - -@item -Cross-compilation between machines of different word sizes is -somewhat problematic and sometimes does not work. -@end itemize - -Since GCC generates assembler code, you probably need a -cross-assembler that GCC can run, in order to produce object files. -If you want to link on other than the target machine, you need a -cross-linker as well. You also need header files and libraries suitable -for the target machine that you can install on the host machine. - -@ifnothtml -@menu -* Steps of Cross:: Using a cross-compiler involves several steps - that may be carried out on different machines. -* Configure Cross:: Configuring a cross-compiler. -* Tools and Libraries:: Where to put the linker and assembler, and the C library. -* Cross Headers:: Finding and installing header files - for a cross-compiler. -* Build Cross:: Actually compiling the cross-compiler. -@end menu -@end ifnothtml - -@ifnothtml -@node Steps of Cross, Configure Cross, , Cross-Compiler -@subsection Steps of Cross-Compilation -@end ifnothtml -@html -

Steps of Cross-Compilation

-@end html - -To compile and run a program using a cross-compiler involves several -steps: - -@itemize @bullet -@item -Run the cross-compiler on the host machine to produce assembler files -for the target machine. This requires header files for the target -machine. - -@item -Assemble the files produced by the cross-compiler. You can do this -either with an assembler on the target machine, or with a -cross-assembler on the host machine. - -@item -Link those files to make an executable. You can do this either with a -linker on the target machine, or with a cross-linker on the host -machine. Whichever machine you use, you need libraries and certain -startup files (typically @file{crt@dots{}.o}) for the target machine. -@end itemize - -It is most convenient to do all of these steps on the same host machine, -since then you can do it all with a single invocation of GCC@. This -requires a suitable cross-assembler and cross-linker. For some targets, -the GNU assembler and linker are available. - -@ifnothtml -@node Configure Cross, Tools and Libraries, Steps of Cross, Cross-Compiler -@subsection Configuring a Cross-Compiler -@end ifnothtml -@html -

Configuring a Cross-Compiler

-@end html - -To build GCC as a cross-compiler, you start out by running -@file{configure}. Use the @option{--target=@var{target}} to specify the -target type. If @file{configure} was unable to correctly identify the -system you are running on, also specify the @option{--build=@var{build}} -option. For example, here is how to configure for a cross-compiler that -produces code for an HP 68030 system running BSD on a system that -@file{configure} can correctly identify: - -@smallexample -./configure --target=m68k-hp-bsd4.3 -@end smallexample - -@ifnothtml -@node Tools and Libraries, Cross Headers, Configure Cross, Cross-Compiler -@subsection Tools and Libraries for a Cross-Compiler -@end ifnothtml -@html -

Tools and Libraries for a Cross-Compiler

-@end html - -If you have a cross-assembler and cross-linker available, you should -install them now. Put them in the directory -@file{/usr/local/@var{target}/bin}. Here is a table of the tools -you should put in this directory: - -@table @file -@item as -This should be the cross-assembler. - -@item ld -This should be the cross-linker. - -@item ar -This should be the cross-archiver: a program which can manipulate -archive files (linker libraries) in the target machine's format. - -@item ranlib -This should be a program to construct a symbol table in an archive file. -@end table - -The installation of GCC will find these programs in that directory, -and copy or link them to the proper place to for the cross-compiler to -find them when run later. - -The easiest way to provide these files is to build the Binutils package -and GAS@. Configure them with the same @option{--host} and @option{--target} -options that you use for configuring GCC, then build and install -them. They install their executables automatically into the proper -directory. Alas, they do not support all the targets that GCC -supports. - -If you want to install libraries to use with the cross-compiler, such as -a standard C library, put them in the directory -@file{/usr/local/@var{target}/lib}; installation of GCC copies -all the files in that subdirectory into the proper place for GCC to -find them and link with them. Here's an example of copying some -libraries from a target machine: - -@example -ftp @var{target-machine} -lcd /usr/local/@var{target}/lib -cd /lib -get libc.a -cd /usr/lib -get libg.a -get libm.a -quit -@end example - -@noindent -The precise set of libraries you'll need, and their locations on -the target machine, vary depending on its operating system. - -@cindex start files -Many targets require ``start files'' such as @file{crt0.o} and -@file{crtn.o} which are linked into each executable; these too should be -placed in @file{/usr/local/@var{target}/lib}. There may be several -alternatives for @file{crt0.o}, for use with profiling or other -compilation options. Check your target's definition of -@code{STARTFILE_SPEC} to find out what start files it uses. -Here's an example of copying these files from a target machine: - -@example -ftp @var{target-machine} -lcd /usr/local/@var{target}/lib -prompt -cd /lib -mget *crt*.o -cd /usr/lib -mget *crt*.o -quit -@end example - -@ifnothtml -@node Cross Headers, Build Cross, Tools and Libraries, Cross-Compiler -@subsection Cross-Compilers and Header Files -@end ifnothtml -@html -

Cross-Compilers and Header Files

-@end html - -If you are cross-compiling a standalone program or a program for an -embedded system, then you may not need any header files except the few -that are part of GCC (and those of your program). However, if you -intend to link your program with a standard C library such as -@file{libc.a}, then you probably need to compile with the header files -that go with the library you use. - -The GNU C compiler does not come with these files, because (1) they are -system-specific, and (2) they belong in a C library, not in a compiler. - -If the GNU C library supports your target machine, then you can get the -header files from there (assuming you actually use the GNU library when -you link your program). - -If your target machine comes with a C compiler, it probably comes with -suitable header files also. If you make these files accessible from the host -machine, the cross-compiler can use them also. - -Otherwise, you're on your own in finding header files to use when -cross-compiling. - -When you have found suitable header files, you should put them in the -directory @file{/usr/local/@var{target}/include}, before building the -cross compiler. Then installation will run fixincludes properly and -install the corrected versions of the header files where the compiler -will use them. - -Provide the header files before you build the cross-compiler, because -the build stage actually runs the cross-compiler to produce parts of -@file{libgcc.a}. (These are the parts that @emph{can} be compiled with -GCC@.) Some of them need suitable header files. - -Here's an example showing how to copy the header files from a target -machine. On the target machine, do this: - -@example -(cd /usr/include; tar cf - .) > tarfile -@end example - -Then, on the host machine, do this: - -@example -ftp @var{target-machine} -lcd /usr/local/@var{target}/include -get tarfile -quit -tar xf tarfile -@end example - -@ifnothtml -@node Build Cross, , Cross Headers, Cross-Compiler -@subsection Actually Building the Cross-Compiler -@end ifnothtml -@html -

Actually Building the Cross-Compiler

-@end html - -Now you can proceed just as for compiling a single-machine compiler -through the step of building stage 1. - -Do not try to build stage 2 for a cross-compiler. It doesn't work to -rebuild GCC as a cross-compiler using the cross-compiler, because -that would produce a program that runs on the target machine, not on the -host. For example, if you compile a 386-to-68030 cross-compiler with -itself, the result will not be right either for the 386 (because it was -compiled into 68030 code) or for the 68030 (because it was configured -for a 386 as the host). If you want to compile GCC into 68030 code, -whether you compile it on a 68030 or with a cross-compiler on a 386, you -must specify a 68030 as the host when you configure it. - -To install the cross-compiler, use @samp{make install}, as usual. - -@ifnothtml -@node VMS Install, , Cross-Compiler, Old -@section Installing GCC on VMS -@end ifnothtml -@html -

@anchor{VMS Install}Installing GCC on VMS

-@end html -@cindex VMS installation -@cindex installing GCC on VMS - -The VMS version of GCC is distributed in a backup saveset containing -both source code and precompiled binaries. - -To install the @file{gcc} command so you can use the compiler easily, in -the same manner as you use the VMS C compiler, you must install the VMS CLD -file for GCC as follows: - -@enumerate -@item -Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE} -to point to the directories where the GCC executables -(@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are -kept respectively. This should be done with the commands: - -@smallexample -$ assign /system /translation=concealed - - disk:[gcc.] gnu_cc -$ assign /system /translation=concealed - - disk:[gcc.include.] gnu_cc_include -@end smallexample - -@noindent -with the appropriate disk and directory names. These commands can be -placed in your system startup file so they will be executed whenever -the machine is rebooted. You may, if you choose, do this via the -@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory. - -@item -Install the @file{GCC} command with the command line: - -@smallexample -$ set command /table=sys$common:[syslib]dcltables - - /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc -$ install replace sys$common:[syslib]dcltables -@end smallexample - -@item -To install the help file, do the following: - -@smallexample -$ library/help sys$library:helplib.hlb gcc.hlp -@end smallexample - -@noindent -Now you can invoke the compiler with a command like @samp{gcc /verbose -file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in -Unix. -@end enumerate - -If you wish to use GNU C++ you must first install GCC, and then -perform the following steps: - -@enumerate -@item -Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the -directory where the preprocessor will search for the C++ header files. -This can be done with the command: - -@smallexample -$ assign /system /translation=concealed - - disk:[gcc.gxx_include.] gnu_gxx_include -@end smallexample - -@noindent -with the appropriate disk and directory name. If you are going to be -using a C++ runtime library, this is where its install procedure will install -its header files. - -@item -Obtain the file @file{gcc-cc1plus.exe}, and place this in the same -directory that @file{gcc-cc1.exe} is kept. - -The GNU C++ compiler can be invoked with a command like @samp{gcc /plus -/verbose file.cc}, which is equivalent to the command @samp{g++ -v -c -file.cc} in Unix. -@end enumerate - -We try to put corresponding binaries and sources on the VMS distribution -tape. But sometimes the binaries will be from an older version than the -sources, because we don't always have time to update them. (Use the -@samp{/version} option to determine the version number of the binaries and -compare it with the source file @file{version.c} to tell whether this is -so.) In this case, you should use the binaries you get to recompile the -sources. If you must recompile, here is how: - -@enumerate -@item -Execute the command procedure @file{vmsconfig.com} to set up the files -@file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and -to create files @file{tconfig.h} and @file{bconfig.h}. This procedure -also creates several linker option files used by @file{make-cc1.com} and -a data file used by @file{make-l2.com}. - -@smallexample -$ @@vmsconfig.com -@end smallexample - -@item -Setup the logical names and command tables as defined above. In -addition, define the VMS logical name @samp{GNU_BISON} to point at the -to the directories where the Bison executable is kept. This should be -done with the command: - -@smallexample -$ assign /system /translation=concealed - - disk:[bison.] gnu_bison -@end smallexample - -You may, if you choose, use the @file{INSTALL_BISON.COM} script in the -@file{[BISON]} directory. - -@item -Install the @samp{BISON} command with the command line: - -@smallexample -$ set command /table=sys$common:[syslib]dcltables - - /output=sys$common:[syslib]dcltables - - gnu_bison:[000000]bison -$ install replace sys$common:[syslib]dcltables -@end smallexample - -@item -Type @samp{@@make-gcc} to recompile everything, or submit the file -@file{make-gcc.com} to a batch queue. If you wish to build the GNU C++ -compiler as well as the GCC compiler, you must first edit -@file{make-gcc.com} and follow the instructions that appear in the -comments. - -@item -In order to use GCC, you need a library of functions which GCC compiled code -will call to perform certain tasks, and these functions are defined in the -file @file{libgcc2.c}. To compile this you should use the command procedure -@file{make-l2.com}, which will generate the library @file{libgcc2.olb}. -@file{libgcc2.olb} should be built using the compiler built from -the same distribution that @file{libgcc2.c} came from, and -@file{make-gcc.com} will automatically do all of this for you. - -To install the library, use the following commands: - -@smallexample -$ library gnu_cc:[000000]gcclib/delete=(new,eprintf) -$ library gnu_cc:[000000]gcclib/delete=L_* -$ library libgcc2/extract=*/output=libgcc2.obj -$ library gnu_cc:[000000]gcclib libgcc2.obj -@end smallexample - -The first command simply removes old modules that will be replaced with -modules from @file{libgcc2} under different module names. The modules -@code{new} and @code{eprintf} may not actually be present in your -@file{gcclib.olb}---if the VMS librarian complains about those modules -not being present, simply ignore the message and continue on with the -next command. The second command removes the modules that came from the -previous version of the library @file{libgcc2.c}. - -Whenever you update the compiler on your system, you should also update the -library with the above procedure. - -@item -You may wish to build GCC in such a way that no files are written to the -directory where the source files reside. An example would be the when -the source files are on a read-only disk. In these cases, execute the -following DCL commands (substituting your actual path names): - -@smallexample -$ assign dua0:[gcc.build_dir.]/translation=concealed, - - dua1:[gcc.source_dir.]/translation=concealed gcc_build -$ set default gcc_build:[000000] -@end smallexample - -@noindent -where the directory @file{dua1:[gcc.source_dir]} contains the source -code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain -all of the generated object files and executables. Once you have done -this, you can proceed building GCC as described above. (Keep in mind -that @file{gcc_build} is a rooted logical name, and thus the device -names in each element of the search list must be an actual physical -device name rather than another rooted logical name). - -@item -@strong{If you are building GCC with a previous version of GCC, -you also should check to see that you have the newest version of the -assembler}. In particular, GCC version 2 treats global constant -variables slightly differently from GCC version 1, and GAS version -1.38.1 does not have the patches required to work with GCC version 2. -If you use GAS 1.38.1, then @code{extern const} variables will not have -the read-only bit set, and the linker will generate warning messages -about mismatched psect attributes for these variables. These warning -messages are merely a nuisance, and can safely be ignored. - -@item -If you want to build GCC with the VAX C compiler, you will need to -make minor changes in @file{make-cccp.com} and @file{make-cc1.com} -to choose alternate definitions of @code{CC}, @code{CFLAGS}, and -@code{LIBS}. See comments in those files. However, you must -also have a working version of the GNU assembler (GNU as, aka GAS) as -it is used as the back end for GCC to produce binary object modules -and is not included in the GCC sources. GAS is also needed to -compile @file{libgcc2} in order to build @file{gcclib} (see above); -@file{make-l2.com} expects to be able to find it operational in -@file{gnu_cc:[000000]gnu-as.exe}. - -To use GCC on VMS, you need the VMS driver programs -@file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}. They are -distributed with the VMS binaries (@file{gcc-vms}) rather than the -GCC sources. GAS is also included in @file{gcc-vms}, as is Bison. - -Once you have successfully built GCC with VAX C, you should use the -resulting compiler to rebuild itself. Before doing this, be sure to -restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in -@file{make-cccp.com} and @file{make-cc1.com}. The second generation -compiler will be able to take advantage of many optimizations that must -be suppressed when building with other compilers. -@end enumerate - -Under previous versions of GCC, the generated code would occasionally -give strange results when linked with the sharable @file{VAXCRTL} library. -Now this should work. - -Even with this version, however, GCC itself should not be linked with -the sharable @file{VAXCRTL}. The version of @code{qsort} in -@file{VAXCRTL} has a bug (known to be present in VMS versions V4.6 -through V5.5) which causes the compiler to fail. - -The executables are generated by @file{make-cc1.com} and -@file{make-cccp.com} use the object library version of @file{VAXCRTL} in -order to make use of the @code{qsort} routine in @file{gcclib.olb}. If -you wish to link the compiler executables with the shareable image -version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created -by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}. - -@code{QSORT_WORKAROUND} is always defined when GCC is compiled with -VAX C, to avoid a problem in case @file{gcclib.olb} is not yet -available. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 4b89617f0f5..2ed8cecab4d 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -43,7 +43,7 @@ @end ifset @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -@c 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +@c 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com @c Include everything if we're not making html @@ -287,16 +287,24 @@ systems' @command{tar} programs will also work, only try GNU @heading Tools/packages necessary for modifying GCC @table @asis -@item autoconf version 2.13 (NO earlier or later versions) and +@item autoconf versions 2.13 and 2.57 @itemx GNU m4 version 1.4 (or later) Necessary when modifying @file{configure.in}, @file{aclocal.m4}, etc.@: -to regenerate @file{configure} and @file{config.in} files +to regenerate @file{configure} and @file{config.in} files. Most +directories require autoconf 2.13 (exactly), but @file{libiberty}, +@file{fastjar}, and @file{libstdc++-v3} require autoconf 2.57 (exactly). -@item automake version ??? +@item automake versions 1.4-p? and 1.7.? Necessary when modifying a @file{Makefile.am} file to regenerate its -associated @file{Makefile.in} +associated @file{Makefile.in}. Most directories require a 1.4 series +automake; @file{libstdc++-v3} and @file{fastjar} requires a 1.7 series +automake. + +@item gettext version 0.12 (or later) + +Needed to regenerate @file{gcc.pot}. @item gperf version 2.7.2 (or later) @@ -362,8 +370,10 @@ snapshots of the development sources are also available via FTP. @item perl version 5.6.1 (or later) Necessary when regenerating @file{Makefile} dependencies in libiberty. -Necessary when regenerating something with intl??? (pod2man???) -Other stuff??? +Necessary when regenerating @file{libiberty/functions.texi}. +Necessary when generating manpages from Texinfo manuals. +Used by various scripts to generate some files included in CVS (mainly +Unicode-related and rarely changing) from source tables. @item GNU diffutils version 2.7 (or later) @@ -915,12 +925,13 @@ and SPARC@. @itemx --with-arch=@var{cpu} @itemx --with-tune=@var{cpu} @itemx --with-abi=@var{abi} +@itemx --with-fpu=@var{type} @itemx --with-float=@var{type} These configure options provide default values for the @option{-mschedule=}, -@option{-march=}, @option{-mtune=}, and @option{-mabi=} options and for -@option{-mhard-float} or @option{-msoft-float}. As with @option{--with-cpu}, -which switches will be accepted and acceptable values of the arguments depend -on the target. +@option{-march=}, @option{-mtune=}, @option{-mabi=}, and @option{-mfpu=} +options and for @option{-mhard-float} or @option{-msoft-float}. As with +@option{--with-cpu}, which switches will be accepted and acceptable values +of the arguments depend on the target. @item --enable-altivec Specify that the target supports AltiVec vector enhancements. This @@ -1062,12 +1073,12 @@ specifying @var{list}; the categories of checks available are @samp{misc}, @samp{tree}, @samp{gc}, @samp{rtl}, @samp{rtlflag}, @samp{fold}, @samp{gcac} and @samp{valgrind}. The check @samp{valgrind} requires the external @command{valgrind} simulator, available from -@uref{http://developer.kde.org/~sewardj/}. The default when @var{list} is +@uref{http://valgrind.kde.org/}. The default when @var{list} is not specified is @samp{misc,tree,gc,rtlflag}; the checks @samp{rtl}, @samp{gcac} and @samp{valgrind} are very expensive. @item --enable-coverage -@item --enable-coverage=@var{level} +@itemx --enable-coverage=@var{level} With this option, the compiler is built to collect self coverage information, every time it is run. This is for internal development purposes, and only works when the compiler is being built with gcc. The @@ -1077,6 +1088,11 @@ want to disable optimization, for performance analysis you want to enable optimization. When coverage is enabled, the default level is without optimization. +@item --enable-gather-detailed-mem-stats +When this option is specfied more detailed information on memory +allocation is gathered. This information is printed when using +@option{-fmem-report}. + @item --enable-nls @itemx --disable-nls The @option{--enable-nls} option enables Native Language Support (NLS), @@ -1347,6 +1363,49 @@ Build runtime libraries using the compiler from the previous step. Note that if an error occurs in any step the make process will exit. +If you are not building GNU binutils in the same source tree as GCC, +you will need a cross-assembler and cross-linker installed before +configuring GCC@. Put them in the directory +@file{@var{prefix}/@var{target}/bin}. Here is a table of the tools +you should put in this directory: + +@table @file +@item as +This should be the cross-assembler. + +@item ld +This should be the cross-linker. + +@item ar +This should be the cross-archiver: a program which can manipulate +archive files (linker libraries) in the target machine's format. + +@item ranlib +This should be a program to construct a symbol table in an archive file. +@end table + +The installation of GCC will find these programs in that directory, +and copy or link them to the proper place to for the cross-compiler to +find them when run later. + +The easiest way to provide these files is to build the Binutils package. +Configure it with the same @option{--host} and @option{--target} +options that you use for configuring GCC, then build and install +them. They install their executables automatically into the proper +directory. Alas, they do not support all the targets that GCC +supports. + +If you are not building a C library in the same source tree as GCC, +you should also provide the target libraries and headers before +configuring GCC, specifying the directories with +@option{--with-sysroot} or @option{--with-headers} and +@option{--with-libs}. Many targets also require ``start files'' such +as @file{crt0.o} and +@file{crtn.o} which are linked into each executable. There may be several +alternatives for @file{crt0.o}, for use with profiling or other +compilation options. Check your target's definition of +@code{STARTFILE_SPEC} to find out what start files it uses. + @section Building in parallel You can use @samp{make bootstrap MAKE="make -j 2" -j 2}, or just @@ -1361,38 +1420,23 @@ this is especially true for slow drives and network filesystems. In order to build GNAT, the Ada compiler, you need a working GNAT compiler (GNAT version 3.14 or later, or GCC version 3.1 or later), +including GNAT tools such as @command{gnatmake} and @command{gnatlink}, since the Ada front end is written in Ada (with some GNAT-specific extensions), and GNU make. -However, you do not need a full installation of GNAT, just the GNAT -binary @file{gnat1}, a copy of @file{gnatbind}, and a compiler driver -which can deal with Ada input (by invoking the @file{gnat1} binary). -You can specify this compiler driver by setting the @env{ADAC} -environment variable at the configure step. @command{configure} can -detect the driver automatically if it has got a common name such as -@command{gcc} or @command{gnatgcc}. Of course, you still need a working -C compiler (the compiler driver can be different or not). @command{configure} does not test whether the GNAT installation works and has a sufficiently recent version; if too old a GNAT version is installed, the build will fail unless @option{--enable-languages} is used to disable building the Ada front end. -Additional build tools (such as @command{gnatmake}) or a working GNAT -run-time library installation are usually @emph{not} required. However, -if you want to bootstrap the compiler using a minimal version of GNAT, -you have to issue the following commands before invoking @samp{make -bootstrap} (this assumes that you start with an unmodified and consistent -source distribution): - -@example - cd @var{srcdir}/gcc/ada - touch treeprs.ads [es]info.h nmake.ad[bs] -@end example - At the moment, the GNAT library and several tools for GNAT are not built -by @samp{make bootstrap}. You have to invoke +by @samp{make bootstrap}. For a native build, you have to invoke @samp{make gnatlib_and_tools} in the @file{@var{objdir}/gcc} subdirectory before proceeding with the next steps. +For a cross build, you need to invoke +@samp{make gnatlib cross-gnattools ada.all.cross}. For a canadian +cross you only need to invoke @samp{make cross-gnattools}; the GNAT +library would be the same as the one built for the cross compiler. For example, you can build a native Ada compiler by issuing the following commands (assuming @command{make} is GNU make): @@ -1400,8 +1444,6 @@ following commands (assuming @command{make} is GNU make): @example cd @var{objdir} @var{srcdir}/configure --enable-languages=c,ada - cd @var{srcdir}/gcc/ada - touch treeprs.ads [es]info.h nmake.ad[bs] cd @var{objdir} make bootstrap cd gcc @@ -2585,20 +2627,6 @@ Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present in glibc 2.2.5 and later. More information is available in the libstdc++-v3 documentation. -If you use glibc 2.2 (or 2.1.9x), GCC 2.95.2 won't install -out-of-the-box. You'll get compile errors while building @samp{libstdc++}. -The patch @uref{glibc-2.2.patch,,glibc-2.2.patch}, that is to be -applied in the GCC source tree, fixes the compatibility problems. - -Currently Glibc 2.2.3 (and older releases) and GCC 3.0 are out of sync -since the latest exception handling changes for GCC@. Compiling glibc -with GCC 3.0 will give a binary incompatible glibc and therefore cause -lots of problems and might make your system completely unusable. This -will definitely need fixes in glibc but might also need fixes in GCC@. We -strongly advise to wait for glibc 2.2.4 and to read the release notes of -glibc 2.2.4 whether patches for GCC 3.0 are needed. You can use glibc -2.2.3 with GCC 3.0, just do not try to recompile it. - @html
@end html @@ -2705,6 +2733,9 @@ have installed. IA-64 processor (also known as IPF, or Itanium Processor Family) running GNU/Linux. +If you are using the optional libunwind library, then you must use +libunwind 0.96 or later. + None of the following versions of GCC has an ABI that is compatible with any of the other versions in this list, with the exception that Red Hat 2.96 and Trillian 000171 are compatible with each other: @@ -2948,6 +2979,12 @@ configure for @samp{mipsel-elf} as a workaround. The @samp{mips*-*-linux*} target continues to use the MIPS II routines. More work on this is expected in future releases. +Cross-compilers for the Mips as target using the Mips assembler +currently do not work, because the auxiliary programs +@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on +anything but a Mips. It does work to cross compile for a Mips +if you use the GNU assembler and linker. + @html
@end html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f5f59382371..9e3d915c0a3 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -174,8 +174,7 @@ in the following sections. @gccoptlist{-fabi-version=@var{n} -fno-access-control -fcheck-new @gol -fconserve-space -fno-const-strings @gol -fno-elide-constructors @gol --fno-enforce-eh-specs -fexternal-templates @gol --falt-external-templates @gol +-fno-enforce-eh-specs @gol -ffor-scope -fno-for-scope -fno-gnu-keywords @gol -fno-implicit-templates @gol -fno-implicit-inline-templates @gol @@ -218,7 +217,7 @@ in the following sections. -Werror -Werror-implicit-function-declaration @gol -Wfloat-equal -Wformat -Wformat=2 @gol -Wno-format-extra-args -Wformat-nonliteral @gol --Wformat-security -Wno-format-y2k @gol +-Wformat-security -Wformat-y2k @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol -Wimport -Wno-import -Winit-self -Winline @gol -Wno-invalid-offsetof -Winvalid-pch @gol @@ -253,7 +252,7 @@ in the following sections. -feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol -ftest-coverage -ftime-report @gol --g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol +-g -g@var{level} -gcoff -gdwarf-2 @gol -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol -print-multi-directory -print-multi-lib @gol @@ -282,6 +281,7 @@ in the following sections. -fno-trapping-math -fno-zero-initialized-in-bss @gol -fomit-frame-pointer -foptimize-register-move @gol -foptimize-sibling-calls -fprefetch-loop-arrays @gol +-fprofile-generate -fprofile-use @gol -freduce-all-givs -fregmove -frename-registers @gol -freorder-blocks -freorder-functions @gol -frerun-cse-after-loop -frerun-loop-opt @gol @@ -291,7 +291,7 @@ in the following sections. -fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol -fsched2-use-superblocks @gol -fsched2-use-traces -fsignaling-nans @gol --fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol +-fsingle-precision-constant @gol -fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol -funroll-all-loops -funroll-loops -fpeel-loops @gol -funswitch-loops -fold-unroll-loops -fold-unroll-all-loops @gol @@ -375,9 +375,9 @@ in the following sections. -msched-prolog -mno-sched-prolog @gol -mlittle-endian -mbig-endian -mwords-little-endian @gol -malignment-traps -mno-alignment-traps @gol --msoft-float -mhard-float -mfpe @gol +-mfloat-abi=@var{name} soft-float -mhard-float -mfpe @gol -mthumb-interwork -mno-thumb-interwork @gol --mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol +-mcpu=@var{name} -march=@var{name} -mfpu=@var{name} @gol -mstructure-size-boundary=@var{n} @gol -mabort-on-noreturn @gol -mlong-calls -mno-long-calls @gol @@ -400,7 +400,7 @@ in the following sections. -mno-crt0 -mrelax} @emph{M32R/D Options} -@gccoptlist{-m32rx -m32r -mcode-model=@var{model-type} @gol +@gccoptlist{-m32r2 -m32rx -m32r -mcode-model=@var{model-type} @gol -msdata=@var{sdata-type} -G @var{num}} @emph{M88K Options} @@ -675,7 +675,7 @@ in the following sections. -fnon-call-exceptions -funwind-tables @gol -fasynchronous-unwind-tables @gol -finhibit-size-directive -finstrument-functions @gol --fno-common -fno-ident -fno-gnu-linker @gol +-fno-common -fno-ident @gol -fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol -freg-struct-return -fshared-data -fshort-enums @gol -fshort-double -fshort-wchar @gol @@ -1049,7 +1049,7 @@ names @samp{c9x} and @samp{iso9899:199x} are deprecated. Default, ISO C90 plus GNU extensions (including some C99 features). @item gnu99 -@item gnu9x +@itemx gnu9x ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC, this will become the default. The name @samp{gnu9x} is deprecated. @@ -1245,6 +1245,8 @@ write into string constants. Writing into string constants is a very bad idea; ``constants'' should be constant. + +This option is deprecated. @end table @node C++ Dialect Options @@ -1273,11 +1275,12 @@ Here is a list of options that are @emph{only} for compiling C++ programs: @item -fabi-version=@var{n} @opindex fabi-version -Use version @var{n} of the C++ ABI. Version 1 is the version of the C++ -ABI that first appeared in G++ 3.2. Version 0 will always be the -version that conforms most closely to the C++ ABI specification. -Therefore, the ABI obtained using version 0 will change as ABI bugs are -fixed. +Use version @var{n} of the C++ ABI. Version 2 is the version of the +C++ ABI that first appeared in G++ 3.4. Version 1 is the version of +the C++ ABI that first appeared in G++ 3.2. Version 0 will always be +the version that conforms most closely to the C++ ABI specification. +Therefore, the ABI obtained using version 0 will change as ABI bugs +are fixed. The default is version 1. @@ -1336,24 +1339,6 @@ option violates the C++ standard, but may be useful for reducing code size in production builds, much like defining @samp{NDEBUG}. The compiler will still optimize based on the exception specifications. -@item -fexternal-templates -@opindex fexternal-templates - -Cause @samp{#pragma interface} and @samp{implementation} to apply to -template instantiation; template instances are emitted or not according -to the location of the template definition. @xref{Template -Instantiation}, for more information. - -This option is deprecated. - -@item -falt-external-templates -@opindex falt-external-templates -Similar to @option{-fexternal-templates}, but template instances are -emitted or not according to the place where they are first instantiated. -@xref{Template Instantiation}, for more information. - -This option is deprecated. - @item -ffor-scope @itemx -fno-for-scope @opindex ffor-scope @@ -2125,14 +2110,14 @@ Since @option{-Wformat} also checks for null format arguments for several functions, @option{-Wformat} also implies @option{-Wnonnull}. @option{-Wformat} is included in @option{-Wall}. For more control over some -aspects of format checking, the options @option{-Wno-format-y2k}, +aspects of format checking, the options @option{-Wformat-y2k}, @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length}, @option{-Wformat-nonliteral}, @option{-Wformat-security}, and @option{-Wformat=2} are available, but are not included in @option{-Wall}. -@item -Wno-format-y2k -@opindex Wno-format-y2k -If @option{-Wformat} is specified, do not warn about @code{strftime} +@item -Wformat-y2k +@opindex Wformat-y2k +If @option{-Wformat} is specified, also warn about @code{strftime} formats which may yield only a two-digit year. @item -Wno-format-extra-args @@ -2176,7 +2161,7 @@ included in @option{-Wformat-nonliteral}.) @opindex Wformat=2 Enable @option{-Wformat} plus format checks not included in @option{-Wformat}. Currently equivalent to @samp{-Wformat --Wformat-nonliteral -Wformat-security}. +-Wformat-nonliteral -Wformat-security -Wformat-y2k}. @item -Wnonnull @opindex Wnonnull @@ -3040,8 +3025,7 @@ makes debugging work better in GDB but will probably make other debuggers crash or refuse to read the program. If you want to control for certain whether to generate the extra information, use @option{-gstabs+}, @option{-gstabs}, -@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, @option{-gdwarf-1}, -or @option{-gvms} (see below). +@option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below). Unlike most other C compilers, GCC allows you to use @option{-g} with @option{-O}. The shortcuts taken by optimized code may occasionally @@ -3103,23 +3087,6 @@ use of these extensions is likely to make other debuggers crash or refuse to read the program, and may cause assemblers other than the GNU assembler (GAS) to fail with an error. -@item -gdwarf -@opindex gdwarf -Produce debugging information in DWARF version 1 format (if that is -supported). This is the format used by SDB on most System V Release 4 -systems. - -This option is deprecated. - -@item -gdwarf+ -@opindex gdwarf+ -Produce debugging information in DWARF version 1 format (if that is -supported), using GNU extensions understood only by the GNU debugger -(GDB)@. The use of these extensions is likely to make other debuggers -crash or refuse to read the program. - -This option is deprecated. - @item -gdwarf-2 @opindex gdwarf-2 Produce debugging information in DWARF version 2 format (if that is @@ -3149,9 +3116,9 @@ present in the program. Some debuggers support macro expansion when you use @option{-g3}. Note that in order to avoid confusion between DWARF1 debug level 2, -and DWARF2, neither @option{-gdwarf} nor @option{-gdwarf-2} accept -a concatenated debug level. Instead use an additional @option{-g@var{level}} -option to change the debug level for DWARF1 or DWARF2. +and DWARF2 @option{-gdwarf-2} does not accept a concatenated debug +level. Instead use an additional @option{-g@var{level}} option to +change the debug level for DWARF2. @item -feliminate-dwarf2-dups @opindex feliminate-dwarf2-dups @@ -3265,7 +3232,7 @@ for most of the dumps are made by appending a pass number and a word to the @var{dumpname}. @var{dumpname} is generated from the name of the output file, if explicitly specified and it is not an executable, otherwise it is the basename of the source file. In both cases any -suffix is removed (e.g. @file{foo.00.rtl} or @file{foo.01.sibling}). +suffix is removed (e.g. @file{foo.01.rtl} or @file{foo.02.sibling}). Here are the possible letters for use in @var{letters}, and their meanings: @@ -3275,47 +3242,43 @@ meanings: Annotate the assembler output with miscellaneous debugging information. @item b @opindex db -Dump after computing branch probabilities, to @file{@var{file}.16.bp}. +Dump after computing branch probabilities, to @file{@var{file}.12.bp}. @item B @opindex dB -Dump after block reordering, to @file{@var{file}.32.bbro}. +Dump after block reordering, to @file{@var{file}.30.bbro}. @item c @opindex dc -Dump after instruction combination, to the file @file{@var{file}.22.combine}. +Dump after instruction combination, to the file @file{@var{file}.20.combine}. @item C @opindex dC -Dump after the first if conversion, to the file @file{@var{file}.17.ce1}. -Also dump after the second if conversion, to the file @file{@var{file}.23.ce2}. +Dump after the first if conversion, to the file @file{@var{file}.14.ce1}. +Also dump after the second if conversion, to the file @file{@var{file}.21.ce2}. @item d @opindex dd -Dump after branch target load optimization, to to @file{@var{file}.34.btl}. -Also dump after delayed branch scheduling, to @file{@var{file}.37.dbr}. +Dump after branch target load optimization, to to @file{@var{file}.32.btl}. +Also dump after delayed branch scheduling, to @file{@var{file}.36.dbr}. @item D @opindex dD Dump all macro definitions, at the end of preprocessing, in addition to normal output. -@item e -@opindex de -Dump after SSA optimizations, to @file{@var{file}.05.ssa} and -@file{@var{file}.010.ussa}. @item E @opindex dE -Dump after the second if conversion, to @file{@var{file}.33.ce3}. +Dump after the second if conversion, to @file{@var{file}.31.ce3}. @item f @opindex df -Dump after control and data flow analysis, to @file{@var{file}.15.cfg}. -Also dump after life analysis, to @file{@var{file}.21.life}. +Dump after control and data flow analysis, to @file{@var{file}.11.cfg}. +Also dump after life analysis, to @file{@var{file}.19.life}. @item F @opindex dF -Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.11.addressof}. +Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.07.addressof}. @item g @opindex dg -Dump after global register allocation, to @file{@var{file}.27.greg}. +Dump after global register allocation, to @file{@var{file}.25.greg}. @item G @opindex dG -Dump after GCSE, to @file{@var{file}.12.gcse}. +Dump after GCSE, to @file{@var{file}.08.gcse}. Also dump after jump bypassing and control flow optimizations, to -@file{@var{file}.14.bypass}. +@file{@var{file}.10.bypass}. @item h @opindex dh Dump after finalization of EH handling code, to @file{@var{file}.03.eh}. @@ -3327,66 +3290,65 @@ Dump after sibling call optimizations, to @file{@var{file}.02.sibling}. Dump after the first jump optimization, to @file{@var{file}.04.jump}. @item k @opindex dk -Dump after conversion from registers to stack, to @file{@var{file}.36.stack}. +Dump after conversion from registers to stack, to @file{@var{file}.34.stack}. @item l @opindex dl -Dump after local register allocation, to @file{@var{file}.26.lreg}. +Dump after local register allocation, to @file{@var{file}.24.lreg}. @item L @opindex dL -Dump after loop optimization passes, to @file{@var{file}.13.loop} and -@file{@var{file}.19.loop2}. +Dump after loop optimization passes, to @file{@var{file}.09.loop} and +@file{@var{file}.16.loop2}. @item M @opindex dM Dump after performing the machine dependent reorganization pass, to -@file{@var{file}.37.mach}. +@file{@var{file}.35.mach}. @item n @opindex dn -Dump after register renumbering, to @file{@var{file}.31.rnreg}. +Dump after register renumbering, to @file{@var{file}.29.rnreg}. @item N @opindex dN -Dump after the register move pass, to @file{@var{file}.24.regmove}. +Dump after the register move pass, to @file{@var{file}.22.regmove}. @item o @opindex do -Dump after post-reload optimizations, to @file{@var{file}.28.postreload}. +Dump after post-reload optimizations, to @file{@var{file}.26.postreload}. @item r @opindex dr Dump after RTL generation, to @file{@var{file}.01.rtl}. @item R @opindex dR -Dump after the second scheduling pass, to @file{@var{file}.35.sched2}. +Dump after the second scheduling pass, to @file{@var{file}.33.sched2}. @item s @opindex ds Dump after CSE (including the jump optimization that sometimes follows -CSE), to @file{@var{file}.019.cse}. +CSE), to @file{@var{file}.06.cse}. @item S @opindex dS -Dump after the first scheduling pass, to @file{@var{file}.25.sched}. +Dump after the first scheduling pass, to @file{@var{file}.23.sched}. @item t @opindex dt Dump after the second CSE pass (including the jump optimization that -sometimes follows CSE), to @file{@var{file}.20.cse2}. +sometimes follows CSE), to @file{@var{file}.18.cse2}. @item T @opindex dT -Dump after running tracer, to @file{@var{file}.18.tracer}. +Dump after running tracer, to @file{@var{file}.15.tracer}. @item u @opindex du -Dump after null pointer elimination pass to @file{@var{file}.018.null}. +Dump after null pointer elimination pass to @file{@var{file}.05.null}. @item U @opindex dU Dump callgraph and unit-at-a-time optimization @file{@var{file}.00.unit}. +@item V +@opindex dV +Dump after the value profile transformations, to @file{@var{file}.13.vpt}. @item w @opindex dw -Dump after the second flow pass, to @file{@var{file}.29.flow2}. -@item W -@opindex dW -Dump after SSA conditional constant propagation, to -@file{@var{file}.06.ssaccp}. -@item X -@opindex dX -Dump after SSA dead code elimination, to @file{@var{file}.07.ssadce}. +Dump after the second flow pass, to @file{@var{file}.27.flow2}. @item z @opindex dz -Dump after the peephole pass, to @file{@var{file}.30.peephole2}. +Dump after the peephole pass, to @file{@var{file}.28.peephole2}. +@item Z +@opindex dZ +Dump after constructing the web, to @file{@var{file}.17.web}. @item a @opindex da Produce all the dumps listed above. @@ -3691,7 +3653,7 @@ also turns on the following optimization flags: -fpeephole2 @gol -freorder-blocks -freorder-functions @gol -fstrict-aliasing @gol --funit-at-a-time -fweb @gol +-funit-at-a-time @gol -falign-functions -falign-jumps @gol -falign-loops -falign-labels} @@ -3829,8 +3791,6 @@ The @option{-finline-limit=@var{n}} option sets some of these parameters as follows: @table @gcctabopt - @item max-inline-insns - is set to @var{n}. @item max-inline-insns-single is set to @var{n}/2. @item max-inline-insns-auto @@ -3841,8 +3801,7 @@ as follows: is set to @var{n}. @end table -Using @option{-finline-limit=600} thus results in the default settings -for these parameters. See below for a documentation of the individual +See below for a documentation of the individual parameters controlling inlining. @emph{Note:} pseudo instruction represents, in this particular context, an @@ -4401,6 +4360,21 @@ and occasionally eliminate the copy. Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}. +@item -fprofile-generate +@opindex fprofile-generate +Enable options usually used for instrumenting application to produce profile usefull +for later recompilation profile feedback based optimization. + +The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt} + +@item -fprofile-use +@opindex fprofile-use +Enable profile feedback directed optimizations, and optimizations +generally profitable only with profile feedback available. + +The following options are enabled: @code{-fbranch-probabilities}, +@code{-fvpt}, @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}. + @end table The following options control compiler behavior regarding floating @@ -4677,23 +4651,6 @@ You will not be able to use @code{gprof} on all systems if you specify this option and you may have problems with debugging if you specify both this option and @option{-g}. -@item -fssa -@opindex fssa -Perform optimizations in static single assignment form. Each function's -flow graph is translated into SSA form, optimizations are performed, and -the flow graph is translated back from SSA form. Users should not -specify this option, since it is not yet ready for production use. - -@item -fssa-ccp -@opindex fssa-ccp -Perform Sparse Conditional Constant Propagation in SSA form. Requires -@option{-fssa}. Like @option{-fssa}, this is an experimental feature. - -@item -fssa-dce -@opindex fssa-dce -Perform aggressive dead-code elimination in SSA form. Requires @option{-fssa}. -Like @option{-fssa}, this is an experimental feature. - @item -fbranch-target-load-optimize @opindex fbranch-target-load-optimize Perform branch target register load optimization before prologue / epilogue @@ -4707,9 +4664,6 @@ a separate optimization pass. Perform branch target register load optimization after prologue / epilogue threading. - - - @item --param @var{name}=@var{value} @opindex param In some places, GCC uses various constants to control the amount of @@ -4776,17 +4730,6 @@ by the compiler will be investigated. To those functions, a different be applied. The default value is 150. -@item max-inline-insns -The tree inliner does decrease the allowable size for single functions -to be inlined after we already inlined the number of instructions -given here by repeated inlining. This number should be a factor of -two or more larger than the single function limit. -Higher numbers result in better runtime performance, but incur higher -compile-time resource (CPU time, memory) requirements and result in -larger binaries. Very high values are not advisable, as too large -binaries may adversely affect runtime performance. -The default value is 200. - @item large-function-insns The limit specifying really large functions. For functions greater than this limit inlining is constrained by @option{--param large-function-growth}. @@ -4811,7 +4754,6 @@ than tree inlining), you can set the maximum allowable size (counted in RTL instructions) for the RTL inliner with this parameter. The default value is 600. - @item max-unrolled-insns The maximum number of instructions that a loop should have if that loop is unrolled, and if the loop is unrolled, it determines how many times @@ -6578,6 +6520,16 @@ this option. In particular, you need to compile @file{libgcc.a}, the library that comes with GCC, with @option{-msoft-float} in order for this to work. +@item -mfloat-abi=@var{name} +@opindex mfloat-abi +Specifies which ABI to use for floating point values. Permissible values +are: @samp{soft}, @samp{softfp} and @samp{hard}. + +@samp{soft} and @samp{hard} are equivalent to @option{-msoft-float} +and @option{-mhard-float} respectively. @samp{softfp} allows the generation +of floating point instructions, but still uses the soft-float calling +conventions. + @item -mlittle-endian @opindex mlittle-endian Generate code for a processor running in little-endian mode. This is @@ -6676,16 +6628,23 @@ name to determine what kind of instructions it can emit when generating assembly code. This option can be used in conjunction with or instead of the @option{-mcpu=} option. Permissible names are: @samp{armv2}, @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t}, -@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6j}, +@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j}, @samp{iwmmxt}, @samp{ep9312}. -@item -mfpe=@var{number} +@item -mfpu=@var{name} +@itemx -mfpe=@var{number} @itemx -mfp=@var{number} +@opindex mfpu @opindex mfpe @opindex mfp -This specifies the version of the floating point emulation available on -the target. Permissible values are 2 and 3. @option{-mfp=} is a synonym -for @option{-mfpe=}, for compatibility with older versions of GCC@. +This specifies what floating point hardware (or hardware emulation) is +available on the target. Permissible names are: @samp{fpa}, @samp{fpe2}, +@samp{fpe3}, @samp{maverick}, @samp{vfp}. @option{-mfp} and @option{-mfpe} +are synonyms for @option{-mpfu}=@samp{fpe}@var{number}, for compatibility +with older versions of GCC@. + +If @option{-msoft-float} is specified this specifies the format of +floating point values. @item -mstructure-size-boundary=@var{n} @opindex mstructure-size-boundary @@ -6877,9 +6836,13 @@ This option makes symbolic debugging impossible. @subsection M32R/D Options @cindex M32R/D options -These @option{-m} options are defined for Mitsubishi M32R/D architectures: +These @option{-m} options are defined for Renesas M32R/D architectures: @table @gcctabopt +@item -m32r2 +@opindex m32r2 +Generate code for the M32R/2@. + @item -m32rx @opindex m32rx Generate code for the M32R/X@. @@ -7275,12 +7238,15 @@ should normally not specify either @option{-mnew-mnemonics} or @opindex mcpu Set architecture type, register usage, choice of mnemonics, and instruction scheduling parameters for machine type @var{cpu_type}. -Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1}, -@samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602}, -@samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, -@samp{630}, @samp{740}, @samp{7400}, @samp{7450}, @samp{750}, -@samp{power}, @samp{power2}, @samp{powerpc}, @samp{403}, @samp{505}, -@samp{801}, @samp{821}, @samp{823}, and @samp{860} and @samp{common}. +Supported values for @var{cpu_type} are @samp{401}, @samp{403}, +@samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505}, +@samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604}, +@samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400}, +@samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823}, +@samp{860}, @samp{970}, @samp{common}, @samp{ec603e}, @samp{G3}, +@samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3}, +@samp{power4}, @samp{powerpc}, @samp{powerpc64}, @samp{rios}, +@samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64a}. @option{-mcpu=common} selects a completely generic processor. Code generated under this option will run on any POWER or PowerPC processor. @@ -7298,43 +7264,23 @@ The other options specify a specific processor. Code generated under those options will run best on that processor, and may not run at all on others. -The @option{-mcpu} options automatically enable or disable other -@option{-m} options as follows: - -@table @samp -@item common -@option{-mno-power}, @option{-mno-powerpc} - -@item power -@itemx power2 -@itemx rios1 -@itemx rios2 -@itemx rsc -@option{-mpower}, @option{-mno-powerpc}, @option{-mno-new-mnemonics} - -@item powerpc -@itemx rs64a -@itemx 602 -@itemx 603 -@itemx 603e -@itemx 604 -@itemx 620 -@itemx 630 -@itemx 740 -@itemx 7400 -@itemx 7450 -@itemx 750 -@itemx 505 -@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics} - -@item 601 -@option{-mpower}, @option{-mpowerpc}, @option{-mnew-mnemonics} - -@item 403 -@itemx 821 -@itemx 860 -@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}, @option{-msoft-float} -@end table +The @option{-mcpu} options automatically enable or disable the +following options: @option{-maltivec}, @option{-mhard-float}, +@option{-mmfcrf}, @option{-mmultiple}, @option{-mnew-mnemonics}, +@option{-mpower}, @option{-mpower2}, @option{-mpowerpc64}, +@option{-mpowerpc-gpopt}, @option{-mpowerpc-gfxopt}, +@option{-mstring}. The particular options set for any particular CPU +will vary between compiler versions, depending on what setting seems +to produce optimal code for that CPU; it doesn't necessarily reflect +the actual hardware's capabilities. If you wish to set an individual +option to a particular value, you may specify it after the +@option{-mcpu} option, like @samp{-mcpu=970 -mno-altivec}. + +On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are +not enabled or disabled by the @option{-mcpu} option at present, since +AIX does not have full support for these options. You may still +enable or disable them individually if you're sure it'll work in your +environment. @item -mtune=@var{cpu_type} @opindex mtune @@ -7819,6 +7765,10 @@ generate slower code. As of this writing, the AIX linker can do this, as can the GNU linker for PowerPC/64. It is planned to add this feature to the GNU linker for 32-bit PowerPC systems as well. +On Mach-O (Darwin) systems, this option directs the compiler emit to +the glue for every direct call, and the Darwin linker decides whether +to use or discard it. + In the future, we may cause GCC to ignore all longcall specifications when the linker is known to generate glue. @@ -7863,62 +7813,62 @@ This specifies the @var{executable} that will be loading the build output file being linked. See man ld(1) for more information. @item -allowable_client @var{client_name} -@item -arch_only - -@item -client_name -@item -compatibility_version -@item -current_version -@item -dependency-file -@item -dylib_file -@item -dylinker_install_name -@item -dynamic -@item -dynamiclib -@item -exported_symbols_list -@item -filelist -@item -flat_namespace -@item -force_cpusubtype_ALL -@item -force_flat_namespace -@item -headerpad_max_install_names -@item -image_base -@item -init -@item -install_name -@item -keep_private_externs -@item -multi_module -@item -multiply_defined -@item -multiply_defined_unused -@item -noall_load -@item -nofixprebinding -@item -nomultidefs -@item -noprebind -@item -noseglinkedit -@item -pagezero_size -@item -prebind -@item -prebind_all_twolevel_modules -@item -private_bundle -@item -read_only_relocs -@item -sectalign -@item -sectobjectsymbols -@item -whyload -@item -seg1addr -@item -sectcreate -@item -sectobjectsymbols -@item -sectorder -@item -seg_addr_table -@item -seg_addr_table_filename -@item -seglinkedit -@item -segprot -@item -segs_read_only_addr -@item -segs_read_write_addr -@item -single_module -@item -static -@item -sub_library -@item -sub_umbrella -@item -twolevel_namespace -@item -umbrella -@item -undefined -@item -unexported_symbols_list -@item -weak_reference_mismatches -@item -whatsloaded +@itemx -arch_only + +@itemx -client_name +@itemx -compatibility_version +@itemx -current_version +@itemx -dependency-file +@itemx -dylib_file +@itemx -dylinker_install_name +@itemx -dynamic +@itemx -dynamiclib +@itemx -exported_symbols_list +@itemx -filelist +@itemx -flat_namespace +@itemx -force_cpusubtype_ALL +@itemx -force_flat_namespace +@itemx -headerpad_max_install_names +@itemx -image_base +@itemx -init +@itemx -install_name +@itemx -keep_private_externs +@itemx -multi_module +@itemx -multiply_defined +@itemx -multiply_defined_unused +@itemx -noall_load +@itemx -nofixprebinding +@itemx -nomultidefs +@itemx -noprebind +@itemx -noseglinkedit +@itemx -pagezero_size +@itemx -prebind +@itemx -prebind_all_twolevel_modules +@itemx -private_bundle +@itemx -read_only_relocs +@itemx -sectalign +@itemx -sectobjectsymbols +@itemx -whyload +@itemx -seg1addr +@itemx -sectcreate +@itemx -sectobjectsymbols +@itemx -sectorder +@itemx -seg_addr_table +@itemx -seg_addr_table_filename +@itemx -seglinkedit +@itemx -segprot +@itemx -segs_read_only_addr +@itemx -segs_read_write_addr +@itemx -single_module +@itemx -static +@itemx -sub_library +@itemx -sub_umbrella +@itemx -twolevel_namespace +@itemx -umbrella +@itemx -undefined +@itemx -unexported_symbols_list +@itemx -weak_reference_mismatches +@itemx -whatsloaded @opindex allowable_client @opindex arch_only @@ -7977,7 +7927,7 @@ output file being linked. See man ld(1) for more information. @opindex weak_reference_mismatches @opindex whatsloaded -This options are available for Darwin linker. Darwin linker man page +These options are available for Darwin linker. Darwin linker man page describes them in detail. @end table @@ -8636,7 +8586,7 @@ and will not be binary compatible with structures in code compiled without that switch. @item -m96bit-long-double -@item -m128bit-long-double +@itemx -m128bit-long-double @opindex m96bit-long-double @opindex m128bit-long-double These switches control the size of @code{long double} type. The i386 @@ -9435,7 +9385,7 @@ Supported values for @var{cpu_type} are @table @samp @item ev4 -@item ev45 +@itemx ev45 @itemx 21064 Schedules as an EV4 and has no instruction set extensions. @@ -9457,7 +9407,7 @@ Schedules as an EV5 and supports the BWX and MAX extensions. Schedules as an EV6 and supports the BWX, FIX, and MAX extensions. @item ev67 -@item 21264a +@itemx 21264a Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions. @end table @@ -9513,7 +9463,7 @@ These @samp{-m} options are defined for the H8/300 implementations: @opindex mrelax Shorten some address references at link time, when possible; uses the linker option @option{-relax}. @xref{H8/300,, @code{ld} and the H8/300, -ld.info, Using ld}, for a fuller description. +ld, Using ld}, for a fuller description. @item -mh @opindex mh @@ -9707,7 +9657,7 @@ parameters for machine type @var{cpu_type}. Supported values for TMS320C40. @item -mbig-memory -@item -mbig +@itemx -mbig @itemx -msmall-memory @itemx -msmall @opindex mbig-memory @@ -10799,7 +10749,7 @@ Use 32-bit @code{int}. Use 64-bit @code{float}. This is the default. @item -mfloat32 -@item -mno-float64 +@itemx -mno-float64 @opindex mfloat32 @opindex mno-float64 Use 32-bit @code{float}. @@ -11320,17 +11270,6 @@ program will work on other systems which always work this way. @opindex fno-ident Ignore the @samp{#ident} directive. -@item -fno-gnu-linker -@opindex fno-gnu-linker -Do not output global initializations (such as C++ constructors and -destructors) in the form used by the GNU linker (on systems where the GNU -linker is the standard method of handling them). Use this option when -you want to use a non-GNU linker, which also requires using the -@command{collect2} program to make sure the system linker includes -constructors and destructors. (@command{collect2} is included in the GCC -distribution.) For systems which @emph{must} use @command{collect2}, the -compiler driver @command{gcc} is configured to do this automatically. - @item -finhibit-size-directive @opindex finhibit-size-directive Don't output a @code{.size} assembler directive, or anything else that @@ -11719,7 +11658,7 @@ the headers it contains change. A precompiled header file will be searched for when @code{#include} is seen in the compilation. As it searches for the included file -(@pxref{Search Path,,Search Path,cpp.info,The C Preprocessor}) the +(@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the compiler looks for a precompiled header in each directory just before it looks for the include file in that directory. The name searched for is the name specified in the @code{#include} with @samp{.gch} appended. If diff --git a/gcc/doc/makefile.texi b/gcc/doc/makefile.texi index 3ab98c08da7..1995e5824a3 100644 --- a/gcc/doc/makefile.texi +++ b/gcc/doc/makefile.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 2001, 2002 Free Software Foundation, Inc. +@c Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -26,9 +26,6 @@ That, and all the other files built by @samp{make all}. @item distclean That, and all the files created by @command{configure}. -@item extraclean -That, and any temporary or intermediate files, like emacs backup files. - @item maintainer-clean Distclean plus any file that can be generated from other files. Note that additional tools may be required beyond what is normally needed to diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index ce59a0fd5ed..3f376fb1513 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -1340,6 +1340,9 @@ available on some particular machines. @item f Floating-point register +@item w +VFP floating-point register + @item F One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0 or 10.0 @@ -1376,6 +1379,9 @@ An item in the constant pool A symbol in the text segment of the current file @end table +@item U +A memory reference suitable for VFP load/store insns (reg+constant offset) + @item AVR family---@file{avr.h} @table @code @item l @@ -1439,7 +1445,7 @@ Constant integer 1 A floating point constant 0.0 @end table -@item IBM RS6000---@file{rs6000.h} +@item PowerPC and IBM RS6000---@file{rs6000.h} @table @code @item b Address base register @@ -1447,6 +1453,9 @@ Address base register @item f Floating point register +@item v +Vector register + @item h @samp{MQ}, @samp{CTR}, or @samp{LINK} register @@ -2196,13 +2205,52 @@ Unsigned 12-bit constant (0--4095) Signed 16-bit constant (@minus{}32768--32767) @item L -Unsigned 16-bit constant (0--65535) +Value appropriate as displacement. +@table @code + @item (0..4095) + for short displacement + @item (-524288..524287) + for long displacement +@end table + +@item M +Constant integer with a value of 0x7fffffff. + +@item N +Multiple letter constraint followed by 4 parameter letters. +@table @code + @item 0..9: + number of the part counting from most to least significant + @item H,Q: + mode of the part + @item D,S,H: + mode of the containing operand + @item 0,F: + value of the other parts (F - all bits set) +@end table +The constraint matches if the specified part of a constant +has a value different from it's other parts. @item Q -Memory reference without index register +Memory reference without index register and with short displacement. + +@item R +Memory reference with index register and short displacement. @item S -Symbolic constant suitable for use with the @code{larl} instruction +Memory reference without index register but with long displacement. + +@item T +Memory reference with index register and long displacement. + +@item U +Pointer with short displacement. + +@item W +Pointer with long displacement. + +@item Y +Shift count operand. @end table diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index ad07f60841e..6bbc61c2822 100644 --- a/gcc/doc/passes.texi +++ b/gcc/doc/passes.texi @@ -237,57 +237,6 @@ the second conditional test. The source code for this pass is in @file{jump.c}. This optimization is only performed if @option{-fthread-jumps} is enabled. -@cindex SSA optimizations -@cindex Single Static Assignment optimizations -@opindex fssa -@item -Static Single Assignment (SSA) based optimization passes. The -SSA conversion passes (to/from) are turned on by the @option{-fssa} -option (it is also done automatically if you enable an SSA optimization pass). -These passes utilize a form called Static Single Assignment. In SSA form, -each variable (pseudo register) is only set once, giving you def-use -and use-def chains for free, and enabling a lot more optimization -passes to be run in linear time. -Conversion to and from SSA form is handled by functions in -@file{ssa.c}. - -@opindex de -The option @option{-de} causes a debugging dump of the RTL code after -this pass. This dump file's name is made by appending @samp{.ssa} to -the input file name. -@itemize @bullet -@cindex SSA Conditional Constant Propagation -@cindex Conditional Constant Propagation, SSA based -@cindex conditional constant propagation -@opindex fssa-ccp -@item -SSA Conditional Constant Propagation. Turned on by the @option{-fssa-ccp} -option. This pass performs conditional constant propagation to simplify -instructions including conditional branches. This pass is more aggressive -than the constant propagation done by the CSE and GCSE passes, but operates -in linear time. - -@opindex dW -The option @option{-dW} causes a debugging dump of the RTL code after -this pass. This dump file's name is made by appending @samp{.ssaccp} to -the input file name. - -@cindex SSA DCE -@cindex DCE, SSA based -@cindex dead code elimination -@opindex fssa-dce -@item -SSA Aggressive Dead Code Elimination. Turned on by the @option{-fssa-dce} -option. This pass performs elimination of code considered unnecessary because -it has no externally visible effects on the program. It operates in -linear time. - -@opindex dX -The option @option{-dX} causes a debugging dump of the RTL code after -this pass. This dump file's name is made by appending @samp{.ssadce} to -the input file name. -@end itemize - @cindex common subexpression elimination @cindex constant propagation @item diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index c29a64efeba..eba00ddd4c6 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -551,7 +551,9 @@ specified in @code{outputs} in @file{config-lang.in}, although this is deprecated). Some hooks are defined by using a double-colon rule for @code{@var{hook}}, rather than by using a target of form @code{@var{lang}.@var{hook}}. These hooks are called ``double-colon -hooks'' below. +hooks'' below. It also adds any testsuite targets that can use the +standard rule in @file{gcc/Makefile.in} to the variable +@code{lang_checks}. @table @code @item all.build @@ -600,14 +602,11 @@ anything. @item mostlyclean @itemx clean @itemx distclean -@itemx extraclean @itemx maintainer-clean -Except for @code{extraclean}, the language parts of the standard GNU +The language parts of the standard GNU @samp{*clean} targets. @xref{Standard Targets, , Standard Targets for Users, standards, GNU Coding Standards}, for details of the standard -targets. @code{extraclean} does @code{distclean} and also deletes -anything likely to be found in the source directory that shouldn't be -in the distribution. For GCC, @code{maintainer-clean} should delete +targets. For GCC, @code{maintainer-clean} should delete all generated files in the source directory that are not checked into CVS, but should not delete anything checked into CVS@. @item stage1 @@ -778,6 +777,7 @@ here; FIXME: document the others. @menu * Test Idioms:: Idioms used in test suite code. +* Ada Tests:: The Ada language test suites. * C Tests:: The C language test suites. * libgcj Tests:: The Java library test suites. * gcov Testing:: Support for testing gcov. @@ -860,6 +860,39 @@ unfortunately, the mechanisms for this differ by directory. FIXME: discuss non-C test suites here. +@node Ada Tests +@subsection Ada Language Test Suites + +The Ada test suite includes executable tests from the ACATS 2.5 test +suite, publicly available at @uref{http://www.adaic.org/compilers/acats/2.5} + +These tests are integrated in the GCC test suite in the +@file{gcc/testsuite/ada/acats} directory, and +enabled automatically when running @code{make check}, assuming +the Ada language has been enabled when configuring GCC. + +You can also run the Ada test suite independently, using +@code{make check-ada}, or run a subset of the tests by specifying which +chapter to run, e.g: + +@smallexample +$ make check-ada CHAPTERS="c3 c9" +@end smallexample + +The tests are organized by directory, each directory corresponding to +a chapter of the Ada Reference Manual. So for example, c9 corresponds +to chapter 9, which deals with tasking features of the language. + +There is also an extra chapter called @file{gcc} containing a template for +creating new executable tests. + +The tests are run using two 'sh' scripts: run_acats and run_all.sh +To run the tests using a simulator or a cross target, see the small +customization section at the top of run_all.sh + +These tests are run using the build tree: they can be run without doing +a @code{make install}. + @node C Tests @subsection C Language Test Suites diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 09f8295e9ee..6b8ad5ecabe 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -329,7 +329,7 @@ et al, within sysroot+suffix. @defmac SYSROOT_HEADERS_SUFFIX_SPEC Define this macro to add a headers_suffix to the target sysroot when GCC is configured with a sysroot. This will cause GCC to pass the -updated sysroot+headers_suffix to CPP@, causing it to search for +updated sysroot+headers_suffix to CPP, causing it to search for usr/include, et al, within sysroot+headers_suffix. @end defmac @@ -3052,6 +3052,19 @@ For proper signal handling in Java this macro is accompanied by @code{MAKE_THROW_FRAME}, defined in @file{libjava/include/*-signal.h} headers. @end defmac +@defmac MD_HANDLE_UNWABI (@var{context}, @var{fs}) +This macro allows the target to add operating system specific code to the +call-frame unwinder to handle the IA-64 @code{.unwabi} unwinding directive, +usually used for signal or interrupt frames. + +This macro is called from @code{uw_update_context} in @file{unwind-ia64.c}. +@var{context} is an @code{_Unwind_Context}; +@var{fs} is an @code{_Unwind_FrameState}. Examine @code{fs->unwabi} +for the abi and context in the @code{.unwabi} directive. If the +@code{.unwabi} directive can be handled, the register save addresses should +be updated in @var{fs}. +@end defmac + @node Stack Checking @subsection Specifying How Stack Checking is Done @@ -3798,13 +3811,6 @@ be passed in a pair of floating point registers, even though a complex float would fit in one 64-bit floating point register. @end defmac -@defmac LOAD_ARGS_REVERSED -If defined, the order in which arguments are loaded into their -respective argument registers is reversed so that the last -argument is loaded first. This macro only affects arguments -passed in registers. -@end defmac - @node Scalar Return @subsection How Scalar Function Values Are Returned @cindex return values in registers @@ -3903,6 +3909,18 @@ need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for saving and restoring an arbitrary return value. @end defmac +@deftypefn {Target Hook} bool TARGET_RETURN_IN_MSB (tree @var{type}) +This hook should return true if values of type @var{type} are returned +at the most significant end of a register (in other words, if they are +padded at the least significant end). You can assume that @var{type} +is returned in a register; the caller is required to check this. + +Note that the register provided by @code{FUNCTION_VALUE} must be able +to hold the complete return value. For example, if a 1-, 2- or 3-byte +structure is returned at the most significant end of a 4-byte register, +@code{FUNCTION_VALUE} should provide an @code{SImode} rtx. +@end deftypefn + @node Aggregate Return @subsection How Large Values Are Returned @cindex aggregates as return values @@ -3985,14 +4003,6 @@ If you enable it, GCC can save registers around function calls. This makes it possible to use call-clobbered registers to hold variables that must live across calls. -@defmac DEFAULT_CALLER_SAVES -Define this macro if function calls on the target machine do not preserve -any registers; in other words, if @code{CALL_USED_REGISTERS} has 1 -for all registers. When defined, this macro enables @option{-fcaller-saves} -by default for all optimization levels. It has no effect for optimization -levels 2 and higher, where @option{-fcaller-saves} is the default. -@end defmac - @defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls}) A C expression to determine whether it is worthwhile to consider placing a pseudo-register in a call-clobbered hard register and saving and @@ -4171,7 +4181,8 @@ function. Define this macro as a C expression that is nonzero if the return instruction or the function epilogue ignores the value of the stack pointer; in other words, if it is safe to delete an instruction to -adjust the stack pointer before a return from the function. +adjust the stack pointer before a return from the function. The +default is 0. Note that this macro's value is relevant only for functions for which frame pointers are maintained. It is never safe to delete a final @@ -7200,12 +7211,6 @@ writing conditional output routines in those patterns. If this macro is not defined, it is equivalent to a null statement. @end defmac -@defmac FINAL_PRESCAN_LABEL -If defined, @code{FINAL_PRESCAN_INSN} will be called on each -@code{CODE_LABEL}. In that case, @var{opvec} will be a null pointer and -@var{noperands} will be zero. -@end defmac - @defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code}) A C compound statement to output to stdio stream @var{stream} the assembler syntax for an instruction operand @var{x}. @var{x} is an @@ -7688,8 +7693,7 @@ defined, GCC uses @code{DBX_DEBUG}. The value of this macro only affects the default debugging output; the user can always get a specific type of output by using @option{-gstabs}, -@option{-gcoff}, @option{-gdwarf-1}, @option{-gdwarf-2}, @option{-gxcoff}, -or @option{-gvms}. +@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}. @end defmac @node DBX Options @@ -7965,11 +7969,6 @@ Define this macro if GCC should produce COFF-style debugging output for SDB in response to the @option{-g} option. @end defmac -@defmac DWARF_DEBUGGING_INFO -Define this macro if GCC should produce dwarf format debugging output -in response to the @option{-g} option. -@end defmac - @defmac DWARF2_DEBUGGING_INFO Define this macro if GCC should produce dwarf version 2 format debugging output in response to the @option{-g} option. @@ -8935,15 +8934,6 @@ A C statement that adds to @var{clobbers} @code{STRING_CST} trees for any hard regs the port wishes to automatically clobber for all asms. @end defmac -@defmac MAX_INTEGER_COMPUTATION_MODE -Define this to the largest integer machine mode which can be used for -operations other than load, store and copy operations. - -You need only define this macro if the target holds values larger than -@code{word_mode} in general purpose registers. Most targets should not define -this macro. -@end defmac - @defmac MATH_LIBRARY Define this macro as a C string constant for the linker argument to link in the system math library, or @samp{""} if the target does not have a diff --git a/gcc/dojump.c b/gcc/dojump.c index 2ed014bacf9..6b9569bb024 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -57,7 +57,6 @@ init_pending_stack_adjust (void) void clear_pending_stack_adjust (void) { -#ifdef EXIT_IGNORE_STACK if (optimize > 0 && (! flag_omit_frame_pointer || current_function_calls_alloca) && EXIT_IGNORE_STACK @@ -67,7 +66,6 @@ clear_pending_stack_adjust (void) stack_pointer_delta -= pending_stack_adjust, pending_stack_adjust = 0; } -#endif } /* Pop any previously-pushed arguments that have not been popped yet. */ @@ -128,10 +126,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) tree type; enum machine_mode mode; -#ifdef MAX_INTEGER_COMPUTATION_MODE - check_max_integer_computation_mode (exp); -#endif - emit_queue (); switch (code) @@ -584,7 +578,14 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) { /* The RTL optimizers prefer comparisons against pseudos. */ if (GET_CODE (temp) == SUBREG) - temp = copy_to_reg (temp); + { + /* Compare promoted variables in their promoted mode. */ + if (SUBREG_PROMOTED_VAR_P (temp) + && GET_CODE (XEXP (temp, 0)) == REG) + temp = XEXP (temp, 0); + else + temp = copy_to_reg (temp); + } do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)), NE, TREE_UNSIGNED (TREE_TYPE (exp)), GET_MODE (temp), NULL_RTX, diff --git a/gcc/dominance.c b/gcc/dominance.c index 38182ef5318..1b6c9fd8f42 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -43,16 +43,8 @@ #include "errors.h" #include "et-forest.h" -struct dominance_info -{ - et_forest_t forest; - varray_type varray; -}; - -#define BB_NODE(info, bb) \ - ((et_forest_node_t)VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2)) -#define SET_BB_NODE(info, bb, node) \ - (VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2) = (node)) +/* Whether the dominators and the postdominators are available. */ +enum dom_state dom_computed[2]; /* We name our nodes with integers, beginning with 1. Zero is reserved for 'undefined' or 'end of list'. The name of each node is given by the dfs @@ -124,7 +116,7 @@ static void compress (struct dom_info *, TBB); static TBB eval (struct dom_info *, TBB); static void link_roots (struct dom_info *, TBB, TBB); static void calc_idoms (struct dom_info *, enum cdi_direction); -void debug_dominance_info (dominance_info); +void debug_dominance_info (enum cdi_direction); /* Helper macro for allocating and initializing an array, for aesthetic reasons. */ @@ -526,172 +518,250 @@ calc_idoms (struct dom_info *di, enum cdi_direction reverse) di->dom[v] = di->dom[di->dom[v]]; } -/* The main entry point into this module. IDOM is an integer array with room - for last_basic_block integers, DOMS is a preallocated sbitmap array having - room for last_basic_block^2 bits, and POST is true if the caller wants to - know post-dominators. +/* Assign dfs numbers starting from NUM to NODE and its sons. */ + +static void +assign_dfs_numbers (struct et_node *node, int *num) +{ + struct et_node *son; + + node->dfs_num_in = (*num)++; + + if (node->son) + { + assign_dfs_numbers (node->son, num); + for (son = node->son->right; son != node->son; son = son->right) + assign_dfs_numbers (son, num); + } - On return IDOM[i] will be the BB->index of the immediate (post) dominator - of basic block i, and DOMS[i] will have set bit j if basic block j is a - (post)dominator for block i. + node->dfs_num_out = (*num)++; +} - Either IDOM or DOMS may be NULL (meaning the caller is not interested in - immediate resp. all dominators). */ +/* Compute the data neccesary for fast resolving of dominator queries in a + static dominator tree. */ -dominance_info -calculate_dominance_info (enum cdi_direction reverse) +static void +compute_dom_fast_query (enum cdi_direction dir) +{ + int num = 0; + basic_block bb; + + if (dom_computed[dir] < DOM_NO_FAST_QUERY) + abort (); + + if (dom_computed[dir] == DOM_OK) + return; + + FOR_ALL_BB (bb) + { + if (!bb->dom[dir]->father) + assign_dfs_numbers (bb->dom[dir], &num); + } + + dom_computed[dir] = DOM_OK; +} + +/* The main entry point into this module. DIR is set depending on whether + we want to compute dominators or postdominators. */ + +void +calculate_dominance_info (enum cdi_direction dir) { struct dom_info di; - dominance_info info; basic_block b; - /* Allocate structure for dominance information. */ - info = xmalloc (sizeof (struct dominance_info)); - info->forest = et_forest_create (); - VARRAY_GENERIC_PTR_INIT (info->varray, last_basic_block + 3, "dominance info"); + if (dom_computed[dir] == DOM_OK) + return; - /* Add the two well-known basic blocks. */ - SET_BB_NODE (info, ENTRY_BLOCK_PTR, et_forest_add_node (info->forest, - ENTRY_BLOCK_PTR)); - SET_BB_NODE (info, EXIT_BLOCK_PTR, et_forest_add_node (info->forest, - EXIT_BLOCK_PTR)); - FOR_EACH_BB (b) - SET_BB_NODE (info, b, et_forest_add_node (info->forest, b)); + if (dom_computed[dir] != DOM_NO_FAST_QUERY) + { + if (dom_computed[dir] != DOM_NONE) + free_dominance_info (dir); - init_dom_info (&di); - calc_dfs_tree (&di, reverse); - calc_idoms (&di, reverse); + FOR_ALL_BB (b) + { + b->dom[dir] = et_new_tree (b); + } + init_dom_info (&di); + calc_dfs_tree (&di, dir); + calc_idoms (&di, dir); - FOR_EACH_BB (b) - { - TBB d = di.dom[di.dfs_order[b->index]]; + FOR_EACH_BB (b) + { + TBB d = di.dom[di.dfs_order[b->index]]; + + if (di.dfs_to_bb[d]) + et_set_father (b->dom[dir], di.dfs_to_bb[d]->dom[dir]); + } - if (di.dfs_to_bb[d]) - et_forest_add_edge (info->forest, BB_NODE (info, di.dfs_to_bb[d]), BB_NODE (info, b)); + free_dom_info (&di); + dom_computed[dir] = DOM_NO_FAST_QUERY; } - free_dom_info (&di); - return info; + compute_dom_fast_query (dir); } -/* Free dominance information. */ +/* Free dominance information for direction DIR. */ void -free_dominance_info (dominance_info info) +free_dominance_info (enum cdi_direction dir) { basic_block bb; - /* Allow users to create new basic block without setting up the dominance - information for them. */ - FOR_EACH_BB (bb) - if (bb->index < (int)(info->varray->num_elements - 2) - && BB_NODE (info, bb)) - delete_from_dominance_info (info, bb); - delete_from_dominance_info (info, ENTRY_BLOCK_PTR); - delete_from_dominance_info (info, EXIT_BLOCK_PTR); - et_forest_delete (info->forest); - VARRAY_GROW (info->varray, 0); - free (info); + if (!dom_computed[dir]) + return; + + FOR_ALL_BB (bb) + { + delete_from_dominance_info (dir, bb); + } + + dom_computed[dir] = DOM_NONE; } /* Return the immediate dominator of basic block BB. */ basic_block -get_immediate_dominator (dominance_info dom, basic_block bb) +get_immediate_dominator (enum cdi_direction dir, basic_block bb) { - return et_forest_node_value (dom->forest, - et_forest_parent (dom->forest, - BB_NODE (dom, bb))); + struct et_node *node = bb->dom[dir]; + + if (!dom_computed[dir]) + abort (); + + if (!node->father) + return NULL; + + return node->father->data; } /* Set the immediate dominator of the block possibly removing existing edge. NULL can be used to remove any edge. */ inline void -set_immediate_dominator (dominance_info dom, basic_block bb, basic_block dominated_by) +set_immediate_dominator (enum cdi_direction dir, basic_block bb, + basic_block dominated_by) { - void *aux_bb_node; - et_forest_node_t bb_node = BB_NODE (dom, bb); + struct et_node *node = bb->dom[dir]; + + if (!dom_computed[dir]) + abort (); - aux_bb_node = et_forest_parent (dom->forest, bb_node); - if (aux_bb_node) - et_forest_remove_edge (dom->forest, aux_bb_node, bb_node); - if (dominated_by != NULL) + if (node->father) { - if (bb == dominated_by) - abort (); - if (!et_forest_add_edge (dom->forest, BB_NODE (dom, dominated_by), bb_node)) - abort (); + if (node->father->data == dominated_by) + return; + et_split (node); } + + if (dominated_by) + et_set_father (node, dominated_by->dom[dir]); + + if (dom_computed[dir] == DOM_OK) + dom_computed[dir] = DOM_NO_FAST_QUERY; } -/* Store all basic blocks dominated by BB into BBS and return their number. */ +/* Store all basic blocks immediatelly dominated by BB into BBS and return + their number. */ int -get_dominated_by (dominance_info dom, basic_block bb, basic_block **bbs) +get_dominated_by (enum cdi_direction dir, basic_block bb, basic_block **bbs) { - int n, i; + int n; + struct et_node *node = bb->dom[dir], *son = node->son, *ason; + + if (!dom_computed[dir]) + abort (); + + if (!son) + { + *bbs = NULL; + return 0; + } + + for (ason = son->right, n = 1; ason != son; ason = ason->right) + n++; + + *bbs = xmalloc (n * sizeof (basic_block)); + (*bbs)[0] = son->data; + for (ason = son->right, n = 1; ason != son; ason = ason->right) + (*bbs)[n++] = ason->data; - *bbs = xmalloc (n_basic_blocks * sizeof (basic_block)); - n = et_forest_enumerate_sons (dom->forest, BB_NODE (dom, bb), (et_forest_node_t *)*bbs); - for (i = 0; i < n; i++) - (*bbs)[i] = et_forest_node_value (dom->forest, (et_forest_node_t)(*bbs)[i]); return n; } /* Redirect all edges pointing to BB to TO. */ void -redirect_immediate_dominators (dominance_info dom, basic_block bb, basic_block to) +redirect_immediate_dominators (enum cdi_direction dir, basic_block bb, + basic_block to) { - et_forest_node_t *bbs = xmalloc (n_basic_blocks * sizeof (basic_block)); - et_forest_node_t node = BB_NODE (dom, bb); - et_forest_node_t node2 = BB_NODE (dom, to); - int n = et_forest_enumerate_sons (dom->forest, node, bbs); - int i; + struct et_node *bb_node = bb->dom[dir], *to_node = to->dom[dir], *son; + + if (!dom_computed[dir]) + abort (); - for (i = 0; i < n; i++) + if (!bb_node->son) + return; + + while (bb_node->son) { - et_forest_remove_edge (dom->forest, node, bbs[i]); - et_forest_add_edge (dom->forest, node2, bbs[i]); + son = bb_node->son; + + et_split (son); + et_set_father (son, to_node); } - free (bbs); + + if (dom_computed[dir] == DOM_OK) + dom_computed[dir] = DOM_NO_FAST_QUERY; } /* Find first basic block in the tree dominating both BB1 and BB2. */ basic_block -nearest_common_dominator (dominance_info dom, basic_block bb1, basic_block bb2) +nearest_common_dominator (enum cdi_direction dir, basic_block bb1, basic_block bb2) { + if (!dom_computed[dir]) + abort (); + if (!bb1) return bb2; if (!bb2) return bb1; - return et_forest_node_value (dom->forest, - et_forest_common_ancestor (dom->forest, - BB_NODE (dom, bb1), - BB_NODE (dom, - bb2))); + + return et_nca (bb1->dom[dir], bb2->dom[dir])->data; } /* Return TRUE in case BB1 is dominated by BB2. */ bool -dominated_by_p (dominance_info dom, basic_block bb1, basic_block bb2) +dominated_by_p (enum cdi_direction dir, basic_block bb1, basic_block bb2) { - return nearest_common_dominator (dom, bb1, bb2) == bb2; + struct et_node *n1 = bb1->dom[dir], *n2 = bb2->dom[dir]; + + if (!dom_computed[dir]) + abort (); + + if (dom_computed[dir] == DOM_OK) + return (n1->dfs_num_in >= n2->dfs_num_in + && n1->dfs_num_out <= n2->dfs_num_out); + + return et_below (n1, n2); } /* Verify invariants of dominator structure. */ void -verify_dominators (dominance_info dom) +verify_dominators (enum cdi_direction dir) { int err = 0; basic_block bb; + if (!dom_computed[dir]) + abort (); + FOR_EACH_BB (bb) { basic_block dom_bb; - dom_bb = recount_dominator (dom, bb); - if (dom_bb != get_immediate_dominator (dom, bb)) + dom_bb = recount_dominator (dir, bb); + if (dom_bb != get_immediate_dominator (dir, bb)) { error ("dominator of %d should be %d, not %d", - bb->index, dom_bb->index, get_immediate_dominator(dom, bb)->index); + bb->index, dom_bb->index, get_immediate_dominator(dir, bb)->index); err = 1; } } @@ -701,15 +771,18 @@ verify_dominators (dominance_info dom) /* Recount dominator of BB. */ basic_block -recount_dominator (dominance_info dom, basic_block bb) +recount_dominator (enum cdi_direction dir, basic_block bb) { basic_block dom_bb = NULL; edge e; + if (!dom_computed[dir]) + abort (); + for (e = bb->pred; e; e = e->pred_next) { - if (!dominated_by_p (dom, e->src, bb)) - dom_bb = nearest_common_dominator (dom, dom_bb, e->src); + if (!dominated_by_p (dir, e->src, bb)) + dom_bb = nearest_common_dominator (dir, dom_bb, e->src); } return dom_bb; @@ -718,50 +791,85 @@ recount_dominator (dominance_info dom, basic_block bb) /* Iteratively recount dominators of BBS. The change is supposed to be local and not to grow further. */ void -iterate_fix_dominators (dominance_info dom, basic_block *bbs, int n) +iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n) { int i, changed = 1; basic_block old_dom, new_dom; + if (!dom_computed[dir]) + abort (); + while (changed) { changed = 0; for (i = 0; i < n; i++) { - old_dom = get_immediate_dominator (dom, bbs[i]); - new_dom = recount_dominator (dom, bbs[i]); + old_dom = get_immediate_dominator (dir, bbs[i]); + new_dom = recount_dominator (dir, bbs[i]); if (old_dom != new_dom) { changed = 1; - set_immediate_dominator (dom, bbs[i], new_dom); + set_immediate_dominator (dir, bbs[i], new_dom); } } } } void -add_to_dominance_info (dominance_info dom, basic_block bb) +add_to_dominance_info (enum cdi_direction dir, basic_block bb) { - VARRAY_GROW (dom->varray, last_basic_block + 3); -#ifdef ENABLE_CHECKING - if (BB_NODE (dom, bb)) + if (!dom_computed[dir]) abort (); -#endif - SET_BB_NODE (dom, bb, et_forest_add_node (dom->forest, bb)); + + if (bb->dom[dir]) + abort (); + + bb->dom[dir] = et_new_tree (bb); + + if (dom_computed[dir] == DOM_OK) + dom_computed[dir] = DOM_NO_FAST_QUERY; } void -delete_from_dominance_info (dominance_info dom, basic_block bb) +delete_from_dominance_info (enum cdi_direction dir, basic_block bb) +{ + if (!dom_computed[dir]) + abort (); + + et_free_tree (bb->dom[dir]); + bb->dom[dir] = NULL; + + if (dom_computed[dir] == DOM_OK) + dom_computed[dir] = DOM_NO_FAST_QUERY; +} + +/* Returns the first son of BB in the dominator or postdominator tree + as determined by DIR. */ + +basic_block +first_dom_son (enum cdi_direction dir, basic_block bb) { - et_forest_remove_node (dom->forest, BB_NODE (dom, bb)); - SET_BB_NODE (dom, bb, NULL); + struct et_node *son = bb->dom[dir]->son; + + return son ? son->data : NULL; +} + +/* Returns the next dominance son after BB in the dominator or postdominator + tree as determined by DIR, or NULL if it was the last one. */ + +basic_block +next_dom_son (enum cdi_direction dir, basic_block bb) +{ + struct et_node *next = bb->dom[dir]->right; + + return next->father->son == next ? NULL : next->data; } void -debug_dominance_info (dominance_info dom) +debug_dominance_info (enum cdi_direction dir) { basic_block bb, bb2; FOR_EACH_BB (bb) - if ((bb2 = get_immediate_dominator (dom, bb))) + if ((bb2 = get_immediate_dominator (dir, bb))) fprintf (stderr, "%i %i\n", bb->index, bb2->index); } diff --git a/gcc/doschk.c b/gcc/doschk.c deleted file mode 100644 index d024efc14ce..00000000000 --- a/gcc/doschk.c +++ /dev/null @@ -1,360 +0,0 @@ -/* -** DosFCheck - check file names for DOS consistency -** -** Distribute freely, it only encourages DOS compatibility! -** - DJ Delorie -*/ - -/* This file is not part of GCC. */ - -#include -#ifdef __MSDOS__ -#include -#else -#include -#endif -#include -#include - -typedef struct ENT -{ - struct ENT *next; - char *dos_name; - char *full_name; - char *path; - int tagged; -} ENT; - -ENT *eroot = 0; - -int first_inv = 1; -int first_msg = 1; - -/****************************************************************\ - * Utility routines * -\****************************************************************/ - -void -invalid_msg () -{ - if (first_inv) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following files are not valid DOS file names:\n"); - first_inv = 0; - } -} - -ENT * -alloc_ent () -{ - ENT *rv = (ENT *)malloc (sizeof (ENT)); - if (rv == 0) - { - fprintf (stderr, "Unable to allocate memory for an ENT\n"); - exit (1); - } - memset (rv, 0, sizeof (ENT)); - return rv; -} - -void -fill_ent (ent, path) -ENT *ent; -char *path; -{ - char *first = path; - char *null = path+strlen (path); - char *last_slash = strrchr (path, '/'); - char *cp, *dp; - int dots_seen, chars_seen; - - if (last_slash+1 == null) - { - * --null = '\0'; - last_slash = strrchr (path, '/'); - } - - if (!last_slash) - { - last_slash = first-1; - } - - if (null-last_slash < 13) - ent->dos_name = (char *)malloc (null-last_slash); - else - ent->dos_name = (char *)malloc (13); - ent->full_name = (char *)malloc (null-last_slash); - ent->path = (char *)malloc (last_slash-first+1); - - strcpy (ent->full_name, last_slash+1); - if (last_slash > first) - { - strncpy (ent->path, first, last_slash-first); - ent->path[last_slash-first] = '\0'; - } - else - *ent->path = '\0'; - - cp = last_slash+1; - dp = ent->dos_name; - dots_seen = 0; - chars_seen = 0; - while (1) - { - if (! *cp) - break; - switch (*cp) - { - case '.': - if (cp == last_slash+1 && strcmp (last_slash+1, ".")) - { - invalid_msg (); - printf ("%s - file name cannot start with dot\n", path); - *dp = 0; - break; - } - if (dots_seen == 1) - { - invalid_msg (); - printf ("%s - too many dots\n", path); - *dp = '\0'; - break; - } - *dp++ = '.'; - chars_seen = 0; - dots_seen++; - break; - case '"': - case '*': - case '+': - case ',': - case ';': - case '<': - case '=': - case '>': - case '?': - case '[': - case '\\': - case ']': - case '|': - invalid_msg (); - printf ("%s - invalid character `%c'\n", path, *cp); - *dp++ = '?'; - chars_seen++; - break; - default: - if (dots_seen) - { - if (chars_seen >= 3) - break; - } - else - if (chars_seen >= 8) - break; - if ((*cp <= ' ') || (*cp >= 0x7f)) - { - invalid_msg (); - printf ("%s - invalid character `%c'\n", path, *cp); - *dp++ = '?'; - chars_seen++; - break; - } - if (islower (*cp)) - *dp++ = toupper (*cp); - else - *dp++ = *cp; - chars_seen++; - break; - } - cp++; - } - *dp++ = '\0'; -} - -int -compare_ent_dosname (e1, e2) -ENT **e1; -ENT **e2; -{ - int r = strcmp ((*e1)->dos_name, (*e2)->dos_name); - if (r == 0) - r = strcmp ((*e1)->path, (*e2)->path); - if (r == 0) - r = strcmp ((*e1)->full_name, (*e2)->full_name); - return r; -} - -int -compare_ent_fullname (e1, e2) -ENT **e1; -ENT **e2; -{ - int r = strncmp ((*e1)->full_name, (*e2)->full_name, 14); - if (r == 0) - r = strcmp ((*e1)->path, (*e2)->path); - if (r == 0) - r = strcmp ((*e1)->full_name, (*e2)->full_name); - return r; -} - -char * -mpath (ent) -ENT *ent; -{ - static char buf[500]; - if (ent->path && ent->path[0]) - sprintf (buf, "%s/%s", ent->path, ent->full_name); - else - return ent->full_name; - return buf; -} - -/****************************************************************\ - * List handling routines * -\****************************************************************/ - -void -add_ent (ent) -ENT *ent; -{ - ent->next = eroot; - eroot = ent; -} - -void -handle_input (line) -char *line; -{ - ENT *ent = alloc_ent (); - fill_ent (ent, line); - add_ent (ent); -} - -void -display_problems () -{ - ENT **elist, *ent; - int ecount, i, first, first_err; - - for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++); - elist = (ENT **)malloc (sizeof (ENT *) * ecount); - for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++) - elist[ecount] = ent; - - qsort (elist, ecount, sizeof (ENT *), compare_ent_dosname); - - first = 1; - first_err = 1; - for (i=0; idos_name, elist[i+1]->dos_name) == 0) - && (strcmp (elist[i]->path, elist[i+1]->path) == 0)) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following resolve to the same DOS file names:\n"); - first_err = 0; - } - if (first) - { - printf ("%14s : %s\n", elist[i]->dos_name, mpath (elist[i])); - first = 0; - } - printf ("\t\t %s\n", mpath (elist[i+1])); - } - else - first = 1; - } - - qsort (elist, ecount, sizeof (ENT *), compare_ent_fullname); - - first = 1; - first_err = 1; - for (i=0; ifull_name, elist[i+1]->full_name, 14) == 0) - && (strcmp (elist[i]->path, elist[i+1]->path) == 0)) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following resolve to the same SysV file names:\n"); - first_err = 0; - } - if (first) - { - printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i])); - first = 0; - elist[i]->tagged = 1; - } - printf ("\t\t %s\n", mpath (elist[i+1])); - elist[i+1]->tagged = 1; - } - else - first = 1; - } - - first_err = 1; - for (i=0; ifull_name) > 14) && !elist[i]->tagged) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following file names are too long for SysV:\n"); - first_err = 0; - } - printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i])); - } - } -} - -/****************************************************************\ - * Main entry point * -\****************************************************************/ - -main (argc, argv) -int argc; -char **argv; -{ - FILE *input = stdin; - if (argc > 1) - { - input = fopen (argv[1], "r"); - if (!input) - { - perror (argv[1]); - exit (1); - } - } - while (1) - { - char line[500]; - char *lp; - fgets (line, 500, input); - if (feof (input)) - break; - lp = line+strlen (line); - while ((lp != line) && (*lp <= ' ')) - lp--; - lp[1] = 0; - handle_input (line); - } - display_problems (); -} - diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a99b2f650c4..fc9f0496793 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3332,6 +3332,7 @@ typedef struct die_struct GTY(()) dw_die_ref die_parent; dw_die_ref die_child; dw_die_ref die_sib; + dw_die_ref die_definition; /* ref from a specification to its definition */ dw_offset die_offset; unsigned long die_abbrev; int die_mark; @@ -3599,6 +3600,7 @@ static void add_AT_string (dw_die_ref, enum dwarf_attribute, const char *); static inline const char *AT_string (dw_attr_ref); static int AT_string_form (dw_attr_ref); static void add_AT_die_ref (dw_die_ref, enum dwarf_attribute, dw_die_ref); +static void add_AT_specification (dw_die_ref, dw_die_ref); static inline dw_die_ref AT_ref (dw_attr_ref); static inline int AT_ref_external (dw_attr_ref); static inline void set_AT_ref_external (dw_attr_ref, int); @@ -3738,7 +3740,7 @@ static void push_decl_scope (tree); static void pop_decl_scope (void); static dw_die_ref scope_die_for (tree, dw_die_ref); static inline int local_scope_p (dw_die_ref); -static inline int class_scope_p (dw_die_ref); +static inline int class_or_namespace_scope_p (dw_die_ref); static void add_type_attribute (dw_die_ref, tree, int, int, dw_die_ref); static const char *type_tag (tree); static tree member_declared_type (tree); @@ -3776,7 +3778,11 @@ static void gen_tagged_type_instantiation_die (tree, dw_die_ref); static void gen_block_die (tree, dw_die_ref, int); static void decls_for_scope (tree, dw_die_ref, int); static int is_redundant_typedef (tree); +static void gen_namespace_die (tree); static void gen_decl_die (tree, dw_die_ref); +static dw_die_ref force_namespace_die (tree); +static dw_die_ref setup_namespace_context (tree, dw_die_ref); +static void declare_in_namespace (tree, dw_die_ref); static unsigned lookup_filename (const char *); static void init_file_table (void); static void retry_incomplete_types (void); @@ -3866,7 +3872,7 @@ static int maybe_emit_file (int); /* Definitions of defaults for formats and names of various special (artificial) labels which may be generated within this file (when the -g - options is used and DWARF_DEBUGGING_INFO is in effect. + options is used and DWARF2_DEBUGGING_INFO is in effect. If necessary, these may be overridden from within the tm.h file, but typically, overriding these defaults is unnecessary. */ @@ -4032,6 +4038,8 @@ dwarf_tag_name (unsigned int tag) return "DW_TAG_namelist"; case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; + case DW_TAG_namespace: + return "DW_TAG_namespace"; case DW_TAG_packed_type: return "DW_TAG_packed_type"; case DW_TAG_subprogram: @@ -4664,6 +4672,18 @@ add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_ add_dwarf_attr (die, attr); } +/* Add an AT_specification attribute to a DIE, and also make the back + pointer from the specification to the definition. */ + +static inline void +add_AT_specification (dw_die_ref die, dw_die_ref targ_die) +{ + add_AT_die_ref (die, DW_AT_specification, targ_die); + if (targ_die->die_definition) + abort (); + targ_die->die_definition = die; +} + static inline dw_die_ref AT_ref (dw_attr_ref a) { @@ -8768,6 +8788,9 @@ loc_descriptor_from_tree (tree loc, int addressp) } break; + case EXPR_WITH_FILE_LOCATION: + return loc_descriptor_from_tree (EXPR_WFL_NODE (loc), addressp); + default: /* Leave front-end specific codes as simply unknown. This comes up, for instance, with the C STMT_EXPR. */ @@ -9442,6 +9465,33 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl) add_AT_location_description (die, DW_AT_location, descr); break; + case PARALLEL: + { + rtvec par_elems = XVEC (rtl, 0); + int num_elem = GET_NUM_ELEM (par_elems); + enum machine_mode mode; + int i; + + /* Create the first one, so we have something to add to. */ + descr = loc_descriptor (XEXP (RTVEC_ELT (par_elems, 0), 0)); + mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, 0), 0)); + add_loc_descr (&descr, + new_loc_descr (DW_OP_piece, GET_MODE_SIZE (mode), 0)); + for (i = 1; i < num_elem; i++) + { + dw_loc_descr_ref temp; + + temp = loc_descriptor (XEXP (RTVEC_ELT (par_elems, i), 0)); + add_loc_descr (&descr, temp); + mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, i), 0)); + add_loc_descr (&descr, + new_loc_descr (DW_OP_piece, + GET_MODE_SIZE (mode), 0)); + } + } + add_AT_location_description (die, DW_AT_location, descr); + break; + default: abort (); } @@ -9979,9 +10029,14 @@ scope_die_for (tree t, dw_die_ref context_die) containing_scope = TYPE_CONTEXT (t); - /* Ignore namespaces for the moment. */ + /* Use the containing namespace if it was passed in (for a declaration). */ if (containing_scope && TREE_CODE (containing_scope) == NAMESPACE_DECL) - containing_scope = NULL_TREE; + { + if (context_die == lookup_decl_die (containing_scope)) + /* OK */; + else + containing_scope = NULL_TREE; + } /* Ignore function type "scopes" from the C frontend. They mean that a tagged type is local to a parmlist of a function declarator, but @@ -10031,14 +10086,16 @@ local_scope_p (dw_die_ref context_die) return 0; } -/* Returns nonzero if CONTEXT_DIE is a class. */ +/* Returns nonzero if CONTEXT_DIE is a class or namespace, for deciding + whether or not to treat a DIE in this context as a declaration. */ static inline int -class_scope_p (dw_die_ref context_die) +class_or_namespace_scope_p (dw_die_ref context_die) { return (context_die && (context_die->die_tag == DW_TAG_structure_type - || context_die->die_tag == DW_TAG_union_type)); + || context_die->die_tag == DW_TAG_union_type + || context_die->die_tag == DW_TAG_namespace)); } /* Many forms of DIEs require a "type description" attribute. This @@ -10186,7 +10243,7 @@ gen_array_type_die (tree type, dw_die_ref context_die) /* The SGI compilers handle arrays of unknown bound by setting AT_declaration and not emitting any subrange DIEs. */ if (! TYPE_DOMAIN (type)) - add_AT_unsigned (array_die, DW_AT_declaration, 1); + add_AT_flag (array_die, DW_AT_declaration, 1); else #endif add_subscript_info (array_die, type); @@ -10558,7 +10615,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) tree outer_scope; dw_die_ref old_die = lookup_decl_die (decl); int declaration = (current_function_decl != decl - || class_scope_p (context_die)); + || class_or_namespace_scope_p (context_die)); /* It is possible to have both DECL_ABSTRACT and DECLARATION be true if we started to generate the abstract instance of an inline, decided to output @@ -10567,7 +10624,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) we'll get back to the abstract instance when done with the class. */ /* The class-scope declaration DIE must be the primary DIE. */ - if (origin && declaration && class_scope_p (context_die)) + if (origin && declaration && class_or_namespace_scope_p (context_die)) { origin = NULL; if (old_die) @@ -10629,7 +10686,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) else { subr_die = new_die (DW_TAG_subprogram, context_die, decl); - add_AT_die_ref (subr_die, DW_AT_specification, old_die); + add_AT_specification (subr_die, old_die); if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index) add_AT_unsigned (subr_die, DW_AT_decl_file, file_index); if (get_AT_unsigned (old_die, DW_AT_decl_line) @@ -10832,7 +10889,7 @@ gen_variable_die (tree decl, dw_die_ref context_die) dw_die_ref old_die = lookup_decl_die (decl); int declaration = (DECL_EXTERNAL (decl) - || class_scope_p (context_die)); + || class_or_namespace_scope_p (context_die)); if (origin != NULL) add_abstract_origin_attribute (var_die, origin); @@ -10849,7 +10906,7 @@ gen_variable_die (tree decl, dw_die_ref context_die) && get_AT_flag (old_die, DW_AT_declaration) == 1) { /* This is a definition of a C++ class level static. */ - add_AT_die_ref (var_die, DW_AT_specification, old_die); + add_AT_specification (var_die, old_die); if (DECL_NAME (decl)) { unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl)); @@ -10885,7 +10942,7 @@ gen_variable_die (tree decl, dw_die_ref context_die) if (declaration) add_AT_flag (var_die, DW_AT_declaration, 1); - if (class_scope_p (context_die) || DECL_ABSTRACT (decl)) + if (class_or_namespace_scope_p (context_die) || DECL_ABSTRACT (decl)) equate_decl_number_to_die (decl, var_die); if (! declaration && ! DECL_ABSTRACT (decl)) @@ -10916,14 +10973,15 @@ gen_label_die (tree decl, dw_die_ref context_die) equate_decl_number_to_die (decl, lbl_die); else { - insn = DECL_RTL (decl); + insn = DECL_RTL_IF_SET (decl); /* Deleted labels are programmer specified labels which have been eliminated because of various optimizations. We still emit them here so that it is possible to put breakpoints on them. */ - if (GET_CODE (insn) == CODE_LABEL - || ((GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))) + if (insn + && (GET_CODE (insn) == CODE_LABEL + || ((GET_CODE (insn) == NOTE + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))) { /* When optimization is enabled (via -O) some parts of the compiler (e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which @@ -11274,12 +11332,14 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die) int complete = (TYPE_SIZE (type) && (! TYPE_STUB_DECL (type) || ! TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type)))); + int ns_decl = (context_die && context_die->die_tag == DW_TAG_namespace); if (type_die && ! complete) return; if (TYPE_CONTEXT (type) != NULL_TREE - && AGGREGATE_TYPE_P (TYPE_CONTEXT (type))) + && (AGGREGATE_TYPE_P (TYPE_CONTEXT (type)) + || TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)) nested = 1; scope_die = scope_die_for (type, context_die); @@ -11294,7 +11354,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die) scope_die, type); equate_type_number_to_die (type, type_die); if (old_die) - add_AT_die_ref (type_die, DW_AT_specification, old_die); + add_AT_specification (type_die, old_die); else add_name_attribute (type_die, type_tag (type)); } @@ -11303,7 +11363,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die) /* If this type has been completed, then give it a byte_size attribute and then give a list of members. */ - if (complete) + if (complete && !ns_decl) { /* Prevent infinite recursion in cases where the type of some member of this type is expressed in terms of this type itself. */ @@ -11528,7 +11588,10 @@ gen_type_die (tree type, dw_die_ref context_die) need_pop = 1; } else - need_pop = 0; + { + declare_in_namespace (type, context_die); + need_pop = 0; + } if (TREE_CODE (type) == ENUMERAL_TYPE) gen_enumeration_type_die (type, context_die); @@ -11761,6 +11824,98 @@ is_redundant_typedef (tree decl) return 0; } +/* Returns the DIE for namespace NS or aborts. + + Note that namespaces don't really have a lexical context, so there's no + need to pass in a context_die. They always go inside their containing + namespace, or comp_unit_die if none. */ + +static dw_die_ref +force_namespace_die (tree ns) +{ + dw_die_ref ns_die; + + dwarf2out_decl (ns); + ns_die = lookup_decl_die (ns); + if (!ns_die) + abort(); + + return ns_die; +} + +/* Force out any required namespaces to be able to output DECL, + and return the new context_die for it, if it's changed. */ + +static dw_die_ref +setup_namespace_context (tree thing, dw_die_ref context_die) +{ + tree context = DECL_P (thing) ? DECL_CONTEXT (thing) : TYPE_CONTEXT (thing); + if (context && TREE_CODE (context) == NAMESPACE_DECL) + /* Force out the namespace. */ + context_die = force_namespace_die (context); + + return context_die; +} + +/* Emit a declaration DIE for THING (which is either a DECL or a tagged + type) within its namespace, if appropriate. + + For compatibility with older debuggers, namespace DIEs only contain + declarations; all definitions are emitted at CU scope. */ + +static void +declare_in_namespace (tree thing, dw_die_ref context_die) +{ + dw_die_ref ns_context; + + if (debug_info_level <= DINFO_LEVEL_TERSE) + return; + + ns_context = setup_namespace_context (thing, context_die); + + if (ns_context != context_die) + { + if (DECL_P (thing)) + gen_decl_die (thing, ns_context); + else + gen_type_die (thing, ns_context); + } +} + +/* Generate a DIE for a namespace or namespace alias. */ + +static void +gen_namespace_die (tree decl) +{ + dw_die_ref context_die = setup_namespace_context (decl, comp_unit_die); + + /* Namespace aliases have a DECL_ABSTRACT_ORIGIN of the namespace + they are an alias of. */ + if (DECL_ABSTRACT_ORIGIN (decl) == NULL) + { + /* Output a real namespace. */ + dw_die_ref namespace_die + = new_die (DW_TAG_namespace, context_die, decl); + add_name_and_src_coords_attributes (namespace_die, decl); + equate_decl_number_to_die (decl, namespace_die); + } + else + { + /* Output a namespace alias. */ + + /* Force out the namespace we are an alias of, if necessary. */ + dw_die_ref origin_die + = force_namespace_die (DECL_ABSTRACT_ORIGIN (decl)); + + /* Now create the namespace alias DIE. */ + dw_die_ref namespace_die + = new_die (DW_TAG_imported_declaration, context_die, decl); + add_name_and_src_coords_attributes (namespace_die, decl); + add_AT_die_ref (namespace_die, DW_AT_import, origin_die); + equate_decl_number_to_die (decl, namespace_die); + } +} + /* Generate Dwarf debug information for a decl described by DECL. */ static void @@ -11796,7 +11951,7 @@ gen_decl_die (tree decl, dw_die_ref context_die) emit info for the abstract instance and set up to refer to it. */ else if (cgraph_function_possibly_inlined_p (decl) && ! DECL_ABSTRACT (decl) - && ! class_scope_p (context_die) + && ! class_or_namespace_scope_p (context_die) /* dwarf2out_abstract_function won't emit a die if this is just a declaration. We must avoid setting DECL_ABSTRACT_ORIGIN in that case, because that works only if we have a die. */ @@ -11821,6 +11976,9 @@ gen_decl_die (tree decl, dw_die_ref context_die) origin = decl_class_context (decl); if (origin != NULL_TREE) gen_type_die_for_member (origin, decl, context_die); + + /* And its containing namespace. */ + declare_in_namespace (decl, context_die); } /* Now output a DIE to represent the function itself. */ @@ -11872,6 +12030,9 @@ gen_decl_die (tree decl, dw_die_ref context_die) if (origin != NULL_TREE) gen_type_die_for_member (origin, decl, context_die); + /* And its containing namespace. */ + declare_in_namespace (decl, context_die); + /* Now output the DIE to represent the data object itself. This gets complicated because of the possibility that the VAR_DECL really represents an inlined instance of a formal parameter for an inline @@ -11900,7 +12061,7 @@ gen_decl_die (tree decl, dw_die_ref context_die) break; case NAMESPACE_DECL: - /* Ignore for now. */ + gen_namespace_die (decl); break; default: @@ -12023,6 +12184,13 @@ dwarf2out_decl (tree decl) return; break; + case NAMESPACE_DECL: + if (debug_info_level <= DINFO_LEVEL_TERSE) + return; + if (lookup_decl_die (decl) != NULL) + return; + break; + case TYPE_DECL: /* Don't emit stubs for types unless they are needed by other DIEs. */ if (TYPE_DECL_SUPPRESS_DEBUG (decl)) @@ -12503,6 +12671,11 @@ prune_unused_types_mark (dw_die_ref die, int dokids) /* Mark any referenced nodes. */ prune_unused_types_walk_attribs (die); + + /* If this node is a specification, + also mark the definition, if it exists. */ + if (get_AT_flag (die, DW_AT_declaration) && die->die_definition) + prune_unused_types_mark (die->die_definition, 1); } if (dokids && die->die_mark != 2) diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c deleted file mode 100644 index 5200af5aaf6..00000000000 --- a/gcc/dwarfout.c +++ /dev/null @@ -1,6396 +0,0 @@ -/* Output Dwarf format symbol table information from GCC. - Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices. - -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 2, 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 COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* - - Notes on the GNU Implementation of DWARF Debugging Information - -------------------------------------------------------------- - Last Major Update: Sun Jul 17 08:17:42 PDT 1994 by rfg@segfault.us.com - ------------------------------------------------------------ - - This file describes special and unique aspects of the GNU implementation of - the DWARF Version 1 debugging information language, as provided in the GNU - version 2.x compiler(s). - - For general information about the DWARF debugging information language, - you should obtain the DWARF version 1.1 specification document (and perhaps - also the DWARF version 2 draft specification document) developed by the - (now defunct) UNIX International Programming Languages Special Interest Group. - - To obtain a copy of the DWARF Version 1 and/or DWARF Version 2 - specification, visit the web page for the DWARF Version 2 committee, at - - http://www.eagercon.com/dwarf/dwarf2std.htm - - The generation of DWARF debugging information by the GNU version 2.x C - compiler has now been tested rather extensively for m88k, i386, i860, and - SPARC targets. The DWARF output of the GNU C compiler appears to inter- - operate well with the standard SVR4 SDB debugger on these kinds of target - systems (but of course, there are no guarantees). - - DWARF 1 generation for the GNU g++ compiler is implemented, but limited. - C++ users should definitely use DWARF 2 instead. - - Future plans for the dwarfout.c module of the GNU compiler(s) includes the - addition of full support for GNU FORTRAN. (This should, in theory, be a - lot simpler to add than adding support for g++... but we'll see.) - - Many features of the DWARF version 2 specification have been adapted to - (and used in) the GNU implementation of DWARF (version 1). In most of - these cases, a DWARF version 2 approach is used in place of (or in addition - to) DWARF version 1 stuff simply because it is apparent that DWARF version - 1 is not sufficiently expressive to provide the kinds of information which - may be necessary to support really robust debugging. In all of these cases - however, the use of DWARF version 2 features should not interfere in any - way with the interoperability (of GNU compilers) with generally available - "classic" (pre version 1) DWARF consumer tools (e.g. SVR4 SDB). - - The DWARF generation enhancement for the GNU compiler(s) was initially - donated to the Free Software Foundation by Network Computing Devices. - (Thanks NCD!) Additional development and maintenance of dwarfout.c has - been largely supported (i.e. funded) by Intel Corporation. (Thanks Intel!) - - If you have questions or comments about the DWARF generation feature, please - send mail to me . I will be happy to investigate any bugs - reported and I may even provide fixes (but of course, I can make no promises). - - The DWARF debugging information produced by GCC may deviate in a few minor - (but perhaps significant) respects from the DWARF debugging information - currently produced by other C compilers. A serious attempt has been made - however to conform to the published specifications, to existing practice, - and to generally accepted norms in the GNU implementation of DWARF. - - ** IMPORTANT NOTE ** ** IMPORTANT NOTE ** ** IMPORTANT NOTE ** - - Under normal circumstances, the DWARF information generated by the GNU - compilers (in an assembly language file) is essentially impossible for - a human being to read. This fact can make it very difficult to debug - certain DWARF-related problems. In order to overcome this difficulty, - a feature has been added to dwarfout.c (enabled by the -dA - option) which causes additional comments to be placed into the assembly - language output file, out to the right-hand side of most bits of DWARF - material. The comments indicate (far more clearly that the obscure - DWARF hex codes do) what is actually being encoded in DWARF. Thus, the - -dA option can be highly useful for those who must study the - DWARF output from the GNU compilers in detail. - - --------- - - (Footnote: Within this file, the term `Debugging Information Entry' will - be abbreviated as `DIE'.) - - - Release Notes (aka known bugs) - ------------------------------- - - In one very obscure case involving dynamically sized arrays, the DWARF - "location information" for such an array may make it appear that the - array has been totally optimized out of existence, when in fact it - *must* actually exist. (This only happens when you are using *both* -g - *and* -O.) This is due to aggressive dead store elimination in the - compiler, and to the fact that the DECL_RTL expressions associated with - variables are not always updated to correctly reflect the effects of - GCC's aggressive dead store elimination. - - ------------------------------- - - When attempting to set a breakpoint at the "start" of a function compiled - with -g1, the debugger currently has no way of knowing exactly where the - end of the prologue code for the function is. Thus, for most targets, - all the debugger can do is to set the breakpoint at the AT_low_pc address - for the function. But if you stop there and then try to look at one or - more of the formal parameter values, they may not have been "homed" yet, - so you may get inaccurate answers (or perhaps even addressing errors). - - Some people may consider this simply a non-feature, but I consider it a - bug, and I hope to provide some GNU-specific attributes (on function - DIEs) which will specify the address of the end of the prologue and the - address of the beginning of the epilogue in a future release. - - ------------------------------- - - It is believed at this time that old bugs relating to the AT_bit_offset - values for bit-fields have been fixed. - - There may still be some very obscure bugs relating to the DWARF description - of type `long long' bit-fields for target machines (e.g. 80x86 machines) - where the alignment of type `long long' data objects is different from - (and less than) the size of a type `long long' data object. - - Please report any problems with the DWARF description of bit-fields as you - would any other GCC bug. (Procedures for bug reporting are given in the - GNU C compiler manual.) - - -------------------------------- - - At this time, GCC does not know how to handle the GNU C "nested functions" - extension. (See the GCC manual for more info on this extension to ANSI C.) - - -------------------------------- - - The GNU compilers now represent inline functions (and inlined instances - thereof) in exactly the manner described by the current DWARF version 2 - (draft) specification. The version 1 specification for handling inline - functions (and inlined instances) was known to be brain-damaged (by the - PLSIG) when the version 1 spec was finalized, but it was simply too late - in the cycle to get it removed before the version 1 spec was formally - released to the public (by UI). - - -------------------------------- - - At this time, GCC does not generate the kind of really precise information - about the exact declared types of entities with signed integral types which - is required by the current DWARF draft specification. - - Specifically, the current DWARF draft specification seems to require that - the type of a non-unsigned integral bit-field member of a struct or union - type be represented as either a "signed" type or as a "plain" type, - depending upon the exact set of keywords that were used in the - type specification for the given bit-field member. It was felt (by the - UI/PLSIG) that this distinction between "plain" and "signed" integral types - could have some significance (in the case of bit-fields) because ANSI C - does not constrain the signedness of a plain bit-field, whereas it does - constrain the signedness of an explicitly "signed" bit-field. For this - reason, the current DWARF specification calls for compilers to produce - type information (for *all* integral typed entities... not just bit-fields) - which explicitly indicates the signedness of the relevant type to be - "signed" or "plain" or "unsigned". - - Unfortunately, the GNU DWARF implementation is currently incapable of making - such distinctions. - - -------------------------------- - - - Known Interoperability Problems - ------------------------------- - - Although the GNU implementation of DWARF conforms (for the most part) with - the current UI/PLSIG DWARF version 1 specification (with many compatible - version 2 features added in as "vendor specific extensions" just for good - measure) there are a few known cases where GCC's DWARF output can cause - some confusion for "classic" (pre version 1) DWARF consumers such as the - System V Release 4 SDB debugger. These cases are described in this section. - - -------------------------------- - - The DWARF version 1 specification includes the fundamental type codes - FT_ext_prec_float, FT_complex, FT_dbl_prec_complex, and FT_ext_prec_complex. - Since GNU C is only a C compiler (and since C doesn't provide any "complex" - data types) the only one of these fundamental type codes which GCC ever - generates is FT_ext_prec_float. This fundamental type code is generated - by GCC for the `long double' data type. Unfortunately, due to an apparent - bug in the SVR4 SDB debugger, SDB can become very confused wherever any - attempt is made to print a variable, parameter, or field whose type was - given in terms of FT_ext_prec_float. - - (Actually, SVR4 SDB fails to understand *any* of the four fundamental type - codes mentioned here. This will fact will cause additional problems when - there is a GNU FORTRAN front-end.) - - -------------------------------- - - In general, it appears that SVR4 SDB is not able to effectively ignore - fundamental type codes in the "implementation defined" range. This can - cause problems when a program being debugged uses the `long long' data - type (or the signed or unsigned varieties thereof) because these types - are not defined by ANSI C, and thus, GCC must use its own private fundamental - type codes (from the implementation-defined range) to represent these types. - - -------------------------------- - - - General GNU DWARF extensions - ---------------------------- - - In the current DWARF version 1 specification, no mechanism is specified by - which accurate information about executable code from include files can be - properly (and fully) described. (The DWARF version 2 specification *does* - specify such a mechanism, but it is about 10 times more complicated than - it needs to be so I'm not terribly anxious to try to implement it right - away.) - - In the GNU implementation of DWARF version 1, a fully downward-compatible - extension has been implemented which permits the GNU compilers to specify - which executable lines come from which files. This extension places - additional information (about source file names) in GNU-specific sections - (which should be totally ignored by all non-GNU DWARF consumers) so that - this extended information can be provided (to GNU DWARF consumers) in a way - which is totally transparent (and invisible) to non-GNU DWARF consumers - (e.g. the SVR4 SDB debugger). The additional information is placed *only* - in specialized GNU-specific sections, where it should never even be seen - by non-GNU DWARF consumers. - - To understand this GNU DWARF extension, imagine that the sequence of entries - in the .lines section is broken up into several subsections. Each contiguous - sequence of .line entries which relates to a sequence of lines (or statements) - from one particular file (either a `base' file or an `include' file) could - be called a `line entries chunk' (LEC). - - For each LEC there is one entry in the .debug_srcinfo section. - - Each normal entry in the .debug_srcinfo section consists of two 4-byte - words of data as follows: - - (1) The starting address (relative to the entire .line section) - of the first .line entry in the relevant LEC. - - (2) The starting address (relative to the entire .debug_sfnames - section) of a NUL terminated string representing the - relevant filename. (This filename name be either a - relative or an absolute filename, depending upon how the - given source file was located during compilation.) - - Obviously, each .debug_srcinfo entry allows you to find the relevant filename, - and it also points you to the first .line entry that was generated as a result - of having compiled a given source line from the given source file. - - Each subsequent .line entry should also be assumed to have been produced - as a result of compiling yet more lines from the same file. The end of - any given LEC is easily found by looking at the first 4-byte pointer in - the *next* .debug_srcinfo entry. That next .debug_srcinfo entry points - to a new and different LEC, so the preceding LEC (implicitly) must have - ended with the last .line section entry which occurs at the 2 1/2 words - just before the address given in the first pointer of the new .debug_srcinfo - entry. - - The following picture may help to clarify this feature. Let's assume that - `LE' stands for `.line entry'. Also, assume that `* 'stands for a pointer. - - - .line section .debug_srcinfo section .debug_sfnames section - ---------------------------------------------------------------- - - LE <---------------------- * - LE * -----------------> "foobar.c" <--- - LE | - LE | - LE <---------------------- * | - LE * -----------------> "foobar.h" <| | - LE | | - LE | | - LE <---------------------- * | | - LE * -----------------> "inner.h" | | - LE | | - LE <---------------------- * | | - LE * ------------------------------- | - LE | - LE | - LE | - LE | - LE <---------------------- * | - LE * ----------------------------------- - LE - LE - LE - - In effect, each entry in the .debug_srcinfo section points to *both* a - filename (in the .debug_sfnames section) and to the start of a block of - consecutive LEs (in the .line section). - - Note that just like in the .line section, there are specialized first and - last entries in the .debug_srcinfo section for each object file. These - special first and last entries for the .debug_srcinfo section are very - different from the normal .debug_srcinfo section entries. They provide - additional information which may be helpful to a debugger when it is - interpreting the data in the .debug_srcinfo, .debug_sfnames, and .line - sections. - - The first entry in the .debug_srcinfo section for each compilation unit - consists of five 4-byte words of data. The contents of these five words - should be interpreted (by debuggers) as follows: - - (1) The starting address (relative to the entire .line section) - of the .line section for this compilation unit. - - (2) The starting address (relative to the entire .debug_sfnames - section) of the .debug_sfnames section for this compilation - unit. - - (3) The starting address (in the execution virtual address space) - of the .text section for this compilation unit. - - (4) The ending address plus one (in the execution virtual address - space) of the .text section for this compilation unit. - - (5) The date/time (in seconds since midnight 1/1/70) at which the - compilation of this compilation unit occurred. This value - should be interpreted as an unsigned quantity because gcc - might be configured to generate a default value of 0xffffffff - in this field (in cases where it is desired to have object - files created at different times from identical source files - be byte-for-byte identical). By default, these timestamps - are *not* generated by dwarfout.c (so that object files - compiled at different times will be byte-for-byte identical). - If you wish to enable this "timestamp" feature however, you - can simply place a #define for the symbol `DWARF_TIMESTAMPS' - in your target configuration file and then rebuild the GNU - compiler(s). - - Note that the first string placed into the .debug_sfnames section for each - compilation unit is the name of the directory in which compilation occurred. - This string ends with a `/' (to help indicate that it is the pathname of a - directory). Thus, the second word of each specialized initial .debug_srcinfo - entry for each compilation unit may be used as a pointer to the (string) - name of the compilation directory, and that string may in turn be used to - "absolutize" any relative pathnames which may appear later on in the - .debug_sfnames section entries for the same compilation unit. - - The fifth and last word of each specialized starting entry for a compilation - unit in the .debug_srcinfo section may (depending upon your configuration) - indicate the date/time of compilation, and this may be used (by a debugger) - to determine if any of the source files which contributed code to this - compilation unit are newer than the object code for the compilation unit - itself. If so, the debugger may wish to print an "out-of-date" warning - about the compilation unit. - - The .debug_srcinfo section associated with each compilation will also have - a specialized terminating entry. This terminating .debug_srcinfo section - entry will consist of the following two 4-byte words of data: - - (1) The offset, measured from the start of the .line section to - the beginning of the terminating entry for the .line section. - - (2) A word containing the value 0xffffffff. - - -------------------------------- - - In the current DWARF version 1 specification, no mechanism is specified by - which information about macro definitions and un-definitions may be provided - to the DWARF consumer. - - The DWARF version 2 (draft) specification does specify such a mechanism. - That specification was based on the GNU ("vendor specific extension") - which provided some support for macro definitions and un-definitions, - but the "official" DWARF version 2 (draft) specification mechanism for - handling macros and the GNU implementation have diverged somewhat. I - plan to update the GNU implementation to conform to the "official" - DWARF version 2 (draft) specification as soon as I get time to do that. - - Note that in the GNU implementation, additional information about macro - definitions and un-definitions is *only* provided when the -g3 level of - debug-info production is selected. (The default level is -g2 and the - plain old -g option is considered to be identical to -g2.) - - GCC records information about macro definitions and undefinitions primarily - in a section called the .debug_macinfo section. Normal entries in the - .debug_macinfo section consist of the following three parts: - - (1) A special "type" byte. - - (2) A 3-byte line-number/filename-offset field. - - (3) A NUL terminated string. - - The interpretation of the second and third parts is dependent upon the - value of the leading (type) byte. - - The type byte may have one of four values depending upon the type of the - .debug_macinfo entry which follows. The 1-byte MACINFO type codes presently - used, and their meanings are as follows: - - MACINFO_start A base file or an include file starts here. - MACINFO_resume The current base or include file ends here. - MACINFO_define A #define directive occurs here. - MACINFO_undef A #undef directive occur here. - - (Note that the MACINFO_... codes mentioned here are simply symbolic names - for constants which are defined in the GNU dwarf.h file.) - - For MACINFO_define and MACINFO_undef entries, the second (3-byte) field - contains the number of the source line (relative to the start of the current - base source file or the current include files) when the #define or #undef - directive appears. For a MACINFO_define entry, the following string field - contains the name of the macro which is defined, followed by its definition. - Note that the definition is always separated from the name of the macro - by at least one whitespace character. For a MACINFO_undef entry, the - string which follows the 3-byte line number field contains just the name - of the macro which is being undef'ed. - - For a MACINFO_start entry, the 3-byte field following the type byte contains - the offset, relative to the start of the .debug_sfnames section for the - current compilation unit, of a string which names the new source file which - is beginning its inclusion at this point. Following that 3-byte field, - each MACINFO_start entry always contains a zero length NUL terminated - string. - - For a MACINFO_resume entry, the 3-byte field following the type byte contains - the line number WITHIN THE INCLUDING FILE at which the inclusion of the - current file (whose inclusion ends here) was initiated. Following that - 3-byte field, each MACINFO_resume entry always contains a zero length NUL - terminated string. - - Each set of .debug_macinfo entries for each compilation unit is terminated - by a special .debug_macinfo entry consisting of a 4-byte zero value followed - by a single NUL byte. - - -------------------------------- - - In the current DWARF draft specification, no provision is made for providing - a separate level of (limited) debugging information necessary to support - tracebacks (only) through fully-debugged code (e.g. code in system libraries). - - A proposal to define such a level was submitted (by me) to the UI/PLSIG. - This proposal was rejected by the UI/PLSIG for inclusion into the DWARF - version 1 specification for two reasons. First, it was felt (by the PLSIG) - that the issues involved in supporting a "traceback only" subset of DWARF - were not well understood. Second, and perhaps more importantly, the PLSIG - is already having enough trouble agreeing on what it means to be "conforming" - to the DWARF specification, and it was felt that trying to specify multiple - different *levels* of conformance would only complicate our discussions of - this already divisive issue. Nonetheless, the GNU implementation of DWARF - provides an abbreviated "traceback only" level of debug-info production for - use with fully-debugged "system library" code. This level should only be - used for fully debugged system library code, and even then, it should only - be used where there is a very strong need to conserve disk space. This - abbreviated level of debug-info production can be used by specifying the - -g1 option on the compilation command line. - - -------------------------------- - - As mentioned above, the GNU implementation of DWARF currently uses the DWARF - version 2 (draft) approach for inline functions (and inlined instances - thereof). This is used in preference to the version 1 approach because - (quite simply) the version 1 approach is highly brain-damaged and probably - unworkable. - - -------------------------------- - - - GNU DWARF Representation of GNU C Extensions to ANSI C - ------------------------------------------------------ - - The file dwarfout.c has been designed and implemented so as to provide - some reasonable DWARF representation for each and every declarative - construct which is accepted by the GNU C compiler. Since the GNU C - compiler accepts a superset of ANSI C, this means that there are some - cases in which the DWARF information produced by GCC must take some - liberties in improvising DWARF representations for declarations which - are only valid in (extended) GNU C. - - In particular, GNU C provides at least three significant extensions to - ANSI C when it comes to declarations. These are (1) inline functions, - and (2) dynamic arrays, and (3) incomplete enum types. (See the GCC - manual for more information on these GNU extensions to ANSI C.) When - used, these GNU C extensions are represented (in the generated DWARF - output of GCC) in the most natural and intuitively obvious ways. - - In the case of inline functions, the DWARF representation is exactly as - called for in the DWARF version 2 (draft) specification for an identical - function written in C++; i.e. we "reuse" the representation of inline - functions which has been defined for C++ to support this GNU C extension. - - In the case of dynamic arrays, we use the most obvious representational - mechanism available; i.e. an array type in which the upper bound of - some dimension (usually the first and only dimension) is a variable - rather than a constant. (See the DWARF version 1 specification for more - details.) - - In the case of incomplete enum types, such types are represented simply - as TAG_enumeration_type DIEs which DO NOT contain either AT_byte_size - attributes or AT_element_list attributes. - - -------------------------------- - - - Future Directions - ----------------- - - The codes, formats, and other paraphernalia necessary to provide proper - support for symbolic debugging for the C++ language are still being worked - on by the UI/PLSIG. The vast majority of the additions to DWARF which will - be needed to completely support C++ have already been hashed out and agreed - upon, but a few small issues (e.g. anonymous unions, access declarations) - are still being discussed. Also, we in the PLSIG are still discussing - whether or not we need to do anything special for C++ templates. (At this - time it is not yet clear whether we even need to do anything special for - these.) - - With regard to FORTRAN, the UI/PLSIG has defined what is believed to be a - complete and sufficient set of codes and rules for adequately representing - all of FORTRAN 77, and most of Fortran 90 in DWARF. While some support for - this has been implemented in dwarfout.c, further implementation and testing - is needed. - - GNU DWARF support for other languages (i.e. Pascal and Modula) is a moot - issue until there are GNU front-ends for these other languages. - - As currently defined, DWARF only describes a (binary) language which can - be used to communicate symbolic debugging information from a compiler - through an assembler and a linker, to a debugger. There is no clear - specification of what processing should be (or must be) done by the - assembler and/or the linker. Fortunately, the role of the assembler - is easily inferred (by anyone knowledgeable about assemblers) just by - looking at examples of assembly-level DWARF code. Sadly though, the - allowable (or required) processing steps performed by a linker are - harder to infer and (perhaps) even harder to agree upon. There are - several forms of very useful `post-processing' steps which intelligent - linkers *could* (in theory) perform on object files containing DWARF, - but any and all such link-time transformations are currently both disallowed - and unspecified. - - In particular, possible link-time transformations of DWARF code which could - provide significant benefits include (but are not limited to): - - Commonization of duplicate DIEs obtained from multiple input - (object) files. - - Cross-compilation type checking based upon DWARF type information - for objects and functions. - - Other possible `compacting' transformations designed to save disk - space and to reduce linker & debugger I/O activity. - -*/ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#ifdef DWARF_DEBUGGING_INFO -#include "dwarf.h" -#include "tree.h" -#include "flags.h" -#include "function.h" -#include "rtl.h" -#include "hard-reg-set.h" -#include "insn-config.h" -#include "reload.h" -#include "output.h" -#include "dwarf2asm.h" -#include "toplev.h" -#include "tm_p.h" -#include "debug.h" -#include "target.h" -#include "langhooks.h" - -/* NOTE: In the comments in this file, many references are made to - so called "Debugging Information Entries". For the sake of brevity, - this term is abbreviated to `DIE' throughout the remainder of this - file. */ - -/* Note that the implementation of C++ support herein is (as yet) unfinished. - If you want to try to complete it, more power to you. */ - -/* How to start an assembler comment. */ -#ifndef ASM_COMMENT_START -#define ASM_COMMENT_START ";#" -#endif - -/* Define a macro which returns nonzero for any tagged type which is - used (directly or indirectly) in the specification of either some - function's return type or some formal parameter of some function. - We use this macro when we are operating in "terse" mode to help us - know what tagged types have to be represented in Dwarf (even in - terse mode) and which ones don't. - - A flag bit with this meaning really should be a part of the normal - GCC ..._TYPE nodes, but at the moment, there is no such bit defined - for these nodes. For now, we have to just fake it. It it safe for - us to simply return zero for all complete tagged types (which will - get forced out anyway if they were used in the specification of some - formal or return type) and nonzero for all incomplete tagged types. -*/ - -#define TYPE_USED_FOR_FUNCTION(tagged_type) (TYPE_SIZE (tagged_type) == 0) - -/* Define a macro which returns nonzero for a TYPE_DECL which was - implicitly generated for a tagged type. - - Note that unlike the gcc front end (which generates a NULL named - TYPE_DECL node for each complete tagged type, each array type, and - each function type node created) the g++ front end generates a - _named_ TYPE_DECL node for each tagged type node created. - These TYPE_DECLs have DECL_ARTIFICIAL set, so we know not to - generate a DW_TAG_typedef DIE for them. */ -#define TYPE_DECL_IS_STUB(decl) \ - (DECL_NAME (decl) == NULL \ - || (DECL_ARTIFICIAL (decl) \ - && is_tagged_type (TREE_TYPE (decl)) \ - && decl == TYPE_STUB_DECL (TREE_TYPE (decl)))) - -/* Maximum size (in bytes) of an artificially generated label. */ - -#define MAX_ARTIFICIAL_LABEL_BYTES 30 - -/* Structure to keep track of source filenames. */ - -struct filename_entry { - unsigned number; - const char * name; -}; - -typedef struct filename_entry filename_entry; - -/* Pointer to an array of elements, each one having the structure above. */ - -static filename_entry *filename_table; - -/* Total number of entries in the table (i.e. array) pointed to by - `filename_table'. This is the *total* and includes both used and - unused slots. */ - -static unsigned ft_entries_allocated; - -/* Number of entries in the filename_table which are actually in use. */ - -static unsigned ft_entries; - -/* Size (in elements) of increments by which we may expand the filename - table. Actually, a single hunk of space of this size should be enough - for most typical programs. */ - -#define FT_ENTRIES_INCREMENT 64 - -/* Local pointer to the name of the main input file. Initialized in - dwarfout_init. */ - -static const char *primary_filename; - -/* Counter to generate unique names for DIEs. */ - -static unsigned next_unused_dienum = 1; - -/* Number of the DIE which is currently being generated. */ - -static unsigned current_dienum; - -/* Number to use for the special "pubname" label on the next DIE which - represents a function or data object defined in this compilation - unit which has "extern" linkage. */ - -static int next_pubname_number = 0; - -#define NEXT_DIE_NUM pending_sibling_stack[pending_siblings-1] - -/* Pointer to a dynamically allocated list of pre-reserved and still - pending sibling DIE numbers. Note that this list will grow as needed. */ - -static unsigned *pending_sibling_stack; - -/* Counter to keep track of the number of pre-reserved and still pending - sibling DIE numbers. */ - -static unsigned pending_siblings; - -/* The currently allocated size of the above list (expressed in number of - list elements). */ - -static unsigned pending_siblings_allocated; - -/* Size (in elements) of increments by which we may expand the pending - sibling stack. Actually, a single hunk of space of this size should - be enough for most typical programs. */ - -#define PENDING_SIBLINGS_INCREMENT 64 - -/* Nonzero if we are performing our file-scope finalization pass and if - we should force out Dwarf descriptions of any and all file-scope - tagged types which are still incomplete types. */ - -static int finalizing = 0; - -/* A pointer to the base of a list of pending types which we haven't - generated DIEs for yet, but which we will have to come back to - later on. */ - -static tree *pending_types_list; - -/* Number of elements currently allocated for the pending_types_list. */ - -static unsigned pending_types_allocated; - -/* Number of elements of pending_types_list currently in use. */ - -static unsigned pending_types; - -/* Size (in elements) of increments by which we may expand the pending - types list. Actually, a single hunk of space of this size should - be enough for most typical programs. */ - -#define PENDING_TYPES_INCREMENT 64 - -/* A pointer to the base of a list of incomplete types which might be - completed at some later time. */ - -static tree *incomplete_types_list; - -/* Number of elements currently allocated for the incomplete_types_list. */ -static unsigned incomplete_types_allocated; - -/* Number of elements of incomplete_types_list currently in use. */ -static unsigned incomplete_types; - -/* Size (in elements) of increments by which we may expand the incomplete - types list. Actually, a single hunk of space of this size should - be enough for most typical programs. */ -#define INCOMPLETE_TYPES_INCREMENT 64 - -/* Pointer to an artificial RECORD_TYPE which we create in dwarfout_init. - This is used in a hack to help us get the DIEs describing types of - formal parameters to come *after* all of the DIEs describing the formal - parameters themselves. That's necessary in order to be compatible - with what the brain-damaged svr4 SDB debugger requires. */ - -static tree fake_containing_scope; - -/* A pointer to the ..._DECL node which we have most recently been working - on. We keep this around just in case something about it looks screwy - and we want to tell the user what the source coordinates for the actual - declaration are. */ - -static tree dwarf_last_decl; - -/* A flag indicating that we are emitting the member declarations of a - class, so member functions and variables should not be entirely emitted. - This is a kludge to avoid passing a second argument to output_*_die. */ - -static int in_class; - -/* Forward declarations for functions defined in this file. */ - -static void dwarfout_init (const char *); -static void dwarfout_finish (const char *); -static void dwarfout_define (unsigned int, const char *); -static void dwarfout_undef (unsigned int, const char *); -static void dwarfout_start_source_file (unsigned, const char *); -static void dwarfout_start_source_file_check (unsigned, const char *); -static void dwarfout_end_source_file (unsigned); -static void dwarfout_end_source_file_check (unsigned); -static void dwarfout_begin_block (unsigned, unsigned); -static void dwarfout_end_block (unsigned, unsigned); -static void dwarfout_end_epilogue (unsigned int, const char *); -static void dwarfout_source_line (unsigned int, const char *); -static void dwarfout_end_prologue (unsigned int, const char *); -static void dwarfout_end_function (unsigned int); -static void dwarfout_function_decl (tree); -static void dwarfout_global_decl (tree); -static void dwarfout_deferred_inline_function (tree); -static void dwarfout_file_scope_decl (tree , int); -static const char *dwarf_tag_name (unsigned); -static const char *dwarf_attr_name (unsigned); -static const char *dwarf_stack_op_name (unsigned); -static const char *dwarf_typemod_name (unsigned); -static const char *dwarf_fmt_byte_name (unsigned); -static const char *dwarf_fund_type_name (unsigned); -static tree decl_ultimate_origin (tree); -static tree block_ultimate_origin (tree); -static tree decl_class_context (tree); -#if 0 -static void output_unsigned_leb128 (unsigned long); -static void output_signed_leb128 (long); -#endif -static int fundamental_type_code (tree); -static tree root_type_1 (tree, int); -static tree root_type (tree); -static void write_modifier_bytes_1 (tree, int, int, int); -static void write_modifier_bytes (tree, int, int); -static inline int type_is_fundamental (tree); -static void equate_decl_number_to_die_number (tree); -static inline void equate_type_number_to_die_number (tree); -static void output_reg_number (rtx); -static void output_mem_loc_descriptor (rtx); -static void output_loc_descriptor (rtx); -static void output_bound_representation (tree, unsigned, char); -static void output_enumeral_list (tree); -static inline HOST_WIDE_INT ceiling (HOST_WIDE_INT, unsigned int); -static inline tree field_type (tree); -static inline unsigned int simple_type_align_in_bits (tree); -static inline unsigned HOST_WIDE_INT simple_type_size_in_bits (tree); -static HOST_WIDE_INT field_byte_offset (tree); -static inline void sibling_attribute (void); -static void location_attribute (rtx); -static void data_member_location_attribute (tree); -static void const_value_attribute (rtx); -static void location_or_const_value_attribute (tree); -static inline void name_attribute (const char *); -static inline void fund_type_attribute (unsigned); -static void mod_fund_type_attribute (tree, int, int); -static inline void user_def_type_attribute (tree); -static void mod_u_d_type_attribute (tree, int, int); -#ifdef USE_ORDERING_ATTRIBUTE -static inline void ordering_attribute (unsigned); -#endif /* defined(USE_ORDERING_ATTRIBUTE) */ -static void subscript_data_attribute (tree); -static void byte_size_attribute (tree); -static inline void bit_offset_attribute (tree); -static inline void bit_size_attribute (tree); -static inline void element_list_attribute (tree); -static inline void stmt_list_attribute (const char *); -static inline void low_pc_attribute (const char *); -static inline void high_pc_attribute (const char *); -static inline void body_begin_attribute (const char *); -static inline void body_end_attribute (const char *); -static inline void language_attribute (unsigned); -static inline void member_attribute (tree); -#if 0 -static inline void string_length_attribute (tree); -#endif -static inline void comp_dir_attribute (const char *); -static inline void sf_names_attribute (const char *); -static inline void src_info_attribute (const char *); -static inline void mac_info_attribute (const char *); -static inline void prototyped_attribute (tree); -static inline void producer_attribute (const char *); -static inline void inline_attribute (tree); -static inline void containing_type_attribute (tree); -static inline void abstract_origin_attribute (tree); -#ifdef DWARF_DECL_COORDINATES -static inline void src_coords_attribute (unsigned, unsigned); -#endif /* defined(DWARF_DECL_COORDINATES) */ -static inline void pure_or_virtual_attribute (tree); -static void name_and_src_coords_attributes (tree); -static void type_attribute (tree, int, int); -static const char *type_tag (tree); -static inline void dienum_push (void); -static inline void dienum_pop (void); -static inline tree member_declared_type (tree); -static const char *function_start_label (tree); -static void output_array_type_die (void *); -static void output_set_type_die (void *); -#if 0 -static void output_entry_point_die (void *); -#endif -static void output_inlined_enumeration_type_die (void *); -static void output_inlined_structure_type_die (void *); -static void output_inlined_union_type_die (void *); -static void output_enumeration_type_die (void *); -static void output_formal_parameter_die (void *); -static void output_global_subroutine_die (void *); -static void output_global_variable_die (void *); -static void output_label_die (void *); -static void output_lexical_block_die (void *); -static void output_inlined_subroutine_die (void *); -static void output_local_variable_die (void *); -static void output_member_die (void *); -#if 0 -static void output_pointer_type_die (void *); -static void output_reference_type_die (void *); -#endif -static void output_ptr_to_mbr_type_die (void *); -static void output_compile_unit_die (void *); -static void output_string_type_die (void *); -static void output_inheritance_die (void *); -static void output_structure_type_die (void *); -static void output_local_subroutine_die (void *); -static void output_subroutine_type_die (void *); -static void output_typedef_die (void *); -static void output_union_type_die (void *); -static void output_unspecified_parameters_die (void *); -static void output_padded_null_die (void *); -static void output_die (void (*)(void *), void *); -static void end_sibling_chain (void); -static void output_formal_types (tree); -static void pend_type (tree); -static int type_ok_for_scope (tree, tree); -static void output_pending_types_for_scope (tree); -static void output_type (tree, tree); -static void output_tagged_type_instantiation (tree); -static void output_block (tree, int); -static void output_decls_for_scope (tree, int); -static void output_decl (tree, tree); -static void shuffle_filename_entry (filename_entry *); -static void generate_new_sfname_entry (void); -static unsigned lookup_filename (const char *); -static void generate_srcinfo_entry (unsigned, unsigned); -static void generate_macinfo_entry (unsigned int, rtx, const char *); -static int is_pseudo_reg (rtx); -static tree type_main_variant (tree); -static int is_tagged_type (tree); -static int is_redundant_typedef (tree); -static void add_incomplete_type (tree); -static void retry_incomplete_types (void); - -/* Definitions of defaults for assembler-dependent names of various - pseudo-ops and section names. - - Theses may be overridden in your tm.h file (if necessary) for your - particular assembler. The default values provided here correspond to - what is expected by "standard" AT&T System V.4 assemblers. */ - -#ifndef FILE_ASM_OP -#define FILE_ASM_OP "\t.file\t" -#endif -#ifndef SET_ASM_OP -#define SET_ASM_OP "\t.set\t" -#endif - -/* Pseudo-ops for pushing the current section onto the section stack (and - simultaneously changing to a new section) and for popping back to the - section we were in immediately before this one. Note that most svr4 - assemblers only maintain a one level stack... you can push all the - sections you want, but you can only pop out one level. (The sparc - svr4 assembler is an exception to this general rule.) That's - OK because we only use at most one level of the section stack herein. */ - -#ifndef PUSHSECTION_ASM_OP -#define PUSHSECTION_ASM_OP "\t.section\t" -#endif -#ifndef POPSECTION_ASM_OP -#define POPSECTION_ASM_OP "\t.previous" -#endif - -/* The default format used by the ASM_OUTPUT_PUSH_SECTION macro (see below) - to print the PUSHSECTION_ASM_OP and the section name. The default here - works for almost all svr4 assemblers, except for the sparc, where the - section name must be enclosed in double quotes. (See sparcv4.h.) */ - -#ifndef PUSHSECTION_FORMAT -#define PUSHSECTION_FORMAT "%s%s\n" -#endif - -#ifndef DEBUG_SECTION -#define DEBUG_SECTION ".debug" -#endif -#ifndef LINE_SECTION -#define LINE_SECTION ".line" -#endif -#ifndef DEBUG_SFNAMES_SECTION -#define DEBUG_SFNAMES_SECTION ".debug_sfnames" -#endif -#ifndef DEBUG_SRCINFO_SECTION -#define DEBUG_SRCINFO_SECTION ".debug_srcinfo" -#endif -#ifndef DEBUG_MACINFO_SECTION -#define DEBUG_MACINFO_SECTION ".debug_macinfo" -#endif -#ifndef DEBUG_PUBNAMES_SECTION -#define DEBUG_PUBNAMES_SECTION ".debug_pubnames" -#endif -#ifndef DEBUG_ARANGES_SECTION -#define DEBUG_ARANGES_SECTION ".debug_aranges" -#endif -#ifndef TEXT_SECTION_NAME -#define TEXT_SECTION_NAME ".text" -#endif -#ifndef DATA_SECTION_NAME -#define DATA_SECTION_NAME ".data" -#endif -#ifndef DATA1_SECTION_NAME -#define DATA1_SECTION_NAME ".data1" -#endif -#ifndef RODATA_SECTION_NAME -#define RODATA_SECTION_NAME ".rodata" -#endif -#ifndef RODATA1_SECTION_NAME -#define RODATA1_SECTION_NAME ".rodata1" -#endif -#ifndef BSS_SECTION_NAME -#define BSS_SECTION_NAME ".bss" -#endif - -/* Definitions of defaults for formats and names of various special - (artificial) labels which may be generated within this file (when - the -g options is used and DWARF_DEBUGGING_INFO is in effect. - - If necessary, these may be overridden from within your tm.h file, - but typically, you should never need to override these. - - These labels have been hacked (temporarily) so that they all begin with - a `.L' sequence so as to appease the stock sparc/svr4 assembler and the - stock m88k/svr4 assembler, both of which need to see .L at the start of - a label in order to prevent that label from going into the linker symbol - table). When I get time, I'll have to fix this the right way so that we - will use ASM_GENERATE_INTERNAL_LABEL and (*targetm.asm_out.internal_label) herein, - but that will require a rather massive set of changes. For the moment, - the following definitions out to produce the right results for all svr4 - and svr3 assemblers. -- rfg -*/ - -#ifndef TEXT_BEGIN_LABEL -#define TEXT_BEGIN_LABEL "*.L_text_b" -#endif -#ifndef TEXT_END_LABEL -#define TEXT_END_LABEL "*.L_text_e" -#endif - -#ifndef DATA_BEGIN_LABEL -#define DATA_BEGIN_LABEL "*.L_data_b" -#endif -#ifndef DATA_END_LABEL -#define DATA_END_LABEL "*.L_data_e" -#endif - -#ifndef DATA1_BEGIN_LABEL -#define DATA1_BEGIN_LABEL "*.L_data1_b" -#endif -#ifndef DATA1_END_LABEL -#define DATA1_END_LABEL "*.L_data1_e" -#endif - -#ifndef RODATA_BEGIN_LABEL -#define RODATA_BEGIN_LABEL "*.L_rodata_b" -#endif -#ifndef RODATA_END_LABEL -#define RODATA_END_LABEL "*.L_rodata_e" -#endif - -#ifndef RODATA1_BEGIN_LABEL -#define RODATA1_BEGIN_LABEL "*.L_rodata1_b" -#endif -#ifndef RODATA1_END_LABEL -#define RODATA1_END_LABEL "*.L_rodata1_e" -#endif - -#ifndef BSS_BEGIN_LABEL -#define BSS_BEGIN_LABEL "*.L_bss_b" -#endif -#ifndef BSS_END_LABEL -#define BSS_END_LABEL "*.L_bss_e" -#endif - -#ifndef LINE_BEGIN_LABEL -#define LINE_BEGIN_LABEL "*.L_line_b" -#endif -#ifndef LINE_LAST_ENTRY_LABEL -#define LINE_LAST_ENTRY_LABEL "*.L_line_last" -#endif -#ifndef LINE_END_LABEL -#define LINE_END_LABEL "*.L_line_e" -#endif - -#ifndef DEBUG_BEGIN_LABEL -#define DEBUG_BEGIN_LABEL "*.L_debug_b" -#endif -#ifndef SFNAMES_BEGIN_LABEL -#define SFNAMES_BEGIN_LABEL "*.L_sfnames_b" -#endif -#ifndef SRCINFO_BEGIN_LABEL -#define SRCINFO_BEGIN_LABEL "*.L_srcinfo_b" -#endif -#ifndef MACINFO_BEGIN_LABEL -#define MACINFO_BEGIN_LABEL "*.L_macinfo_b" -#endif - -#ifndef DEBUG_ARANGES_BEGIN_LABEL -#define DEBUG_ARANGES_BEGIN_LABEL "*.L_debug_aranges_begin" -#endif -#ifndef DEBUG_ARANGES_END_LABEL -#define DEBUG_ARANGES_END_LABEL "*.L_debug_aranges_end" -#endif - -#ifndef DIE_BEGIN_LABEL_FMT -#define DIE_BEGIN_LABEL_FMT "*.L_D%u" -#endif -#ifndef DIE_END_LABEL_FMT -#define DIE_END_LABEL_FMT "*.L_D%u_e" -#endif -#ifndef PUB_DIE_LABEL_FMT -#define PUB_DIE_LABEL_FMT "*.L_P%u" -#endif -#ifndef BLOCK_BEGIN_LABEL_FMT -#define BLOCK_BEGIN_LABEL_FMT "*.L_B%u" -#endif -#ifndef BLOCK_END_LABEL_FMT -#define BLOCK_END_LABEL_FMT "*.L_B%u_e" -#endif -#ifndef SS_BEGIN_LABEL_FMT -#define SS_BEGIN_LABEL_FMT "*.L_s%u" -#endif -#ifndef SS_END_LABEL_FMT -#define SS_END_LABEL_FMT "*.L_s%u_e" -#endif -#ifndef EE_BEGIN_LABEL_FMT -#define EE_BEGIN_LABEL_FMT "*.L_e%u" -#endif -#ifndef EE_END_LABEL_FMT -#define EE_END_LABEL_FMT "*.L_e%u_e" -#endif -#ifndef MT_BEGIN_LABEL_FMT -#define MT_BEGIN_LABEL_FMT "*.L_t%u" -#endif -#ifndef MT_END_LABEL_FMT -#define MT_END_LABEL_FMT "*.L_t%u_e" -#endif -#ifndef LOC_BEGIN_LABEL_FMT -#define LOC_BEGIN_LABEL_FMT "*.L_l%u" -#endif -#ifndef LOC_END_LABEL_FMT -#define LOC_END_LABEL_FMT "*.L_l%u_e" -#endif -#ifndef BOUND_BEGIN_LABEL_FMT -#define BOUND_BEGIN_LABEL_FMT "*.L_b%u_%u_%c" -#endif -#ifndef BOUND_END_LABEL_FMT -#define BOUND_END_LABEL_FMT "*.L_b%u_%u_%c_e" -#endif -#ifndef BODY_BEGIN_LABEL_FMT -#define BODY_BEGIN_LABEL_FMT "*.L_b%u" -#endif -#ifndef BODY_END_LABEL_FMT -#define BODY_END_LABEL_FMT "*.L_b%u_e" -#endif -#ifndef FUNC_END_LABEL_FMT -#define FUNC_END_LABEL_FMT "*.L_f%u_e" -#endif -#ifndef TYPE_NAME_FMT -#define TYPE_NAME_FMT "*.L_T%u" -#endif -#ifndef DECL_NAME_FMT -#define DECL_NAME_FMT "*.L_E%u" -#endif -#ifndef LINE_CODE_LABEL_FMT -#define LINE_CODE_LABEL_FMT "*.L_LC%u" -#endif -#ifndef SFNAMES_ENTRY_LABEL_FMT -#define SFNAMES_ENTRY_LABEL_FMT "*.L_F%u" -#endif -#ifndef LINE_ENTRY_LABEL_FMT -#define LINE_ENTRY_LABEL_FMT "*.L_LE%u" -#endif - -/* Definitions of defaults for various types of primitive assembly language - output operations. - - If necessary, these may be overridden from within your tm.h file, - but typically, you shouldn't need to override these. */ - -#ifndef ASM_OUTPUT_PUSH_SECTION -#define ASM_OUTPUT_PUSH_SECTION(FILE, SECTION) \ - fprintf ((FILE), PUSHSECTION_FORMAT, PUSHSECTION_ASM_OP, SECTION) -#endif - -#ifndef ASM_OUTPUT_POP_SECTION -#define ASM_OUTPUT_POP_SECTION(FILE) \ - fprintf ((FILE), "%s\n", POPSECTION_ASM_OP) -#endif - -#ifndef ASM_OUTPUT_DWARF_DELTA2 -#define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \ - dw2_asm_output_delta (2, LABEL1, LABEL2, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_DELTA4 -#define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \ - dw2_asm_output_delta (4, LABEL1, LABEL2, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_TAG -#define ASM_OUTPUT_DWARF_TAG(FILE,TAG) \ - dw2_asm_output_data (2, TAG, "%s", dwarf_tag_name (TAG)); -#endif - -#ifndef ASM_OUTPUT_DWARF_ATTRIBUTE -#define ASM_OUTPUT_DWARF_ATTRIBUTE(FILE,ATTR) \ - dw2_asm_output_data (2, ATTR, "%s", dwarf_attr_name (ATTR)) -#endif - -#ifndef ASM_OUTPUT_DWARF_STACK_OP -#define ASM_OUTPUT_DWARF_STACK_OP(FILE,OP) \ - dw2_asm_output_data (1, OP, "%s", dwarf_stack_op_name (OP)) -#endif - -#ifndef ASM_OUTPUT_DWARF_FUND_TYPE -#define ASM_OUTPUT_DWARF_FUND_TYPE(FILE,FT) \ - dw2_asm_output_data (2, FT, "%s", dwarf_fund_type_name (FT)) -#endif - -#ifndef ASM_OUTPUT_DWARF_FMT_BYTE -#define ASM_OUTPUT_DWARF_FMT_BYTE(FILE,FMT) \ - dw2_asm_output_data (1, FMT, "%s", dwarf_fmt_byte_name (FMT)); -#endif - -#ifndef ASM_OUTPUT_DWARF_TYPE_MODIFIER -#define ASM_OUTPUT_DWARF_TYPE_MODIFIER(FILE,MOD) \ - dw2_asm_output_data (1, MOD, "%s", dwarf_typemod_name (MOD)); -#endif - -#ifndef ASM_OUTPUT_DWARF_ADDR -#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \ - dw2_asm_output_addr (4, LABEL, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_ADDR_CONST -#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \ - dw2_asm_output_addr_rtx (4, RTX, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_REF -#define ASM_OUTPUT_DWARF_REF(FILE,LABEL) \ - dw2_asm_output_addr (4, LABEL, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_DATA1 -#define ASM_OUTPUT_DWARF_DATA1(FILE,VALUE) \ - dw2_asm_output_data (1, VALUE, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_DATA2 -#define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \ - dw2_asm_output_data (2, VALUE, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_DATA4 -#define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \ - dw2_asm_output_data (4, VALUE, NULL) -#endif - -#ifndef ASM_OUTPUT_DWARF_DATA8 -#define ASM_OUTPUT_DWARF_DATA8(FILE,HIGH_VALUE,LOW_VALUE) \ - dw2_asm_output_data (8, VALUE, NULL) -#endif - -/* ASM_OUTPUT_DWARF_STRING is defined to output an ascii string, but to - NOT issue a trailing newline. We define ASM_OUTPUT_DWARF_STRING_NEWLINE - based on whether ASM_OUTPUT_DWARF_STRING is defined or not. If it is - defined, we call it, then issue the line feed. If not, we supply a - default definition of calling ASM_OUTPUT_ASCII */ - -#ifndef ASM_OUTPUT_DWARF_STRING -#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \ - ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1) -#else -#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \ - ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n") -#endif - - -/* The debug hooks structure. */ -const struct gcc_debug_hooks dwarf_debug_hooks = -{ - dwarfout_init, - dwarfout_finish, - dwarfout_define, - dwarfout_undef, - dwarfout_start_source_file_check, - dwarfout_end_source_file_check, - dwarfout_begin_block, - dwarfout_end_block, - debug_true_tree, /* ignore_block */ - dwarfout_source_line, /* source_line */ - dwarfout_source_line, /* begin_prologue */ - dwarfout_end_prologue, - dwarfout_end_epilogue, - debug_nothing_tree, /* begin_function */ - dwarfout_end_function, - dwarfout_function_decl, - dwarfout_global_decl, - dwarfout_deferred_inline_function, - debug_nothing_tree, /* outlining_inline_function */ - debug_nothing_rtx, /* label */ - debug_nothing_int /* handle_pch */ -}; - -/************************ general utility functions **************************/ - -static inline int -is_pseudo_reg (rtx rtl) -{ - return (((GET_CODE (rtl) == REG) && (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)) - || ((GET_CODE (rtl) == SUBREG) - && (REGNO (SUBREG_REG (rtl)) >= FIRST_PSEUDO_REGISTER))); -} - -static inline tree -type_main_variant (tree type) -{ - type = TYPE_MAIN_VARIANT (type); - - /* There really should be only one main variant among any group of variants - of a given type (and all of the MAIN_VARIANT values for all members of - the group should point to that one type) but sometimes the C front-end - messes this up for array types, so we work around that bug here. */ - - if (TREE_CODE (type) == ARRAY_TYPE) - { - while (type != TYPE_MAIN_VARIANT (type)) - type = TYPE_MAIN_VARIANT (type); - } - - return type; -} - -/* Return nonzero if the given type node represents a tagged type. */ - -static inline int -is_tagged_type (tree type) -{ - enum tree_code code = TREE_CODE (type); - - return (code == RECORD_TYPE || code == UNION_TYPE - || code == QUAL_UNION_TYPE || code == ENUMERAL_TYPE); -} - -static const char * -dwarf_tag_name (unsigned int tag) -{ - switch (tag) - { - case TAG_padding: return "TAG_padding"; - case TAG_array_type: return "TAG_array_type"; - case TAG_class_type: return "TAG_class_type"; - case TAG_entry_point: return "TAG_entry_point"; - case TAG_enumeration_type: return "TAG_enumeration_type"; - case TAG_formal_parameter: return "TAG_formal_parameter"; - case TAG_global_subroutine: return "TAG_global_subroutine"; - case TAG_global_variable: return "TAG_global_variable"; - case TAG_label: return "TAG_label"; - case TAG_lexical_block: return "TAG_lexical_block"; - case TAG_local_variable: return "TAG_local_variable"; - case TAG_member: return "TAG_member"; - case TAG_pointer_type: return "TAG_pointer_type"; - case TAG_reference_type: return "TAG_reference_type"; - case TAG_compile_unit: return "TAG_compile_unit"; - case TAG_string_type: return "TAG_string_type"; - case TAG_structure_type: return "TAG_structure_type"; - case TAG_subroutine: return "TAG_subroutine"; - case TAG_subroutine_type: return "TAG_subroutine_type"; - case TAG_typedef: return "TAG_typedef"; - case TAG_union_type: return "TAG_union_type"; - case TAG_unspecified_parameters: return "TAG_unspecified_parameters"; - case TAG_variant: return "TAG_variant"; - case TAG_common_block: return "TAG_common_block"; - case TAG_common_inclusion: return "TAG_common_inclusion"; - case TAG_inheritance: return "TAG_inheritance"; - case TAG_inlined_subroutine: return "TAG_inlined_subroutine"; - case TAG_module: return "TAG_module"; - case TAG_ptr_to_member_type: return "TAG_ptr_to_member_type"; - case TAG_set_type: return "TAG_set_type"; - case TAG_subrange_type: return "TAG_subrange_type"; - case TAG_with_stmt: return "TAG_with_stmt"; - - /* GNU extensions. */ - - case TAG_format_label: return "TAG_format_label"; - case TAG_namelist: return "TAG_namelist"; - case TAG_function_template: return "TAG_function_template"; - case TAG_class_template: return "TAG_class_template"; - - default: return "TAG_"; - } -} - -static const char * -dwarf_attr_name (unsigned int attr) -{ - switch (attr) - { - case AT_sibling: return "AT_sibling"; - case AT_location: return "AT_location"; - case AT_name: return "AT_name"; - case AT_fund_type: return "AT_fund_type"; - case AT_mod_fund_type: return "AT_mod_fund_type"; - case AT_user_def_type: return "AT_user_def_type"; - case AT_mod_u_d_type: return "AT_mod_u_d_type"; - case AT_ordering: return "AT_ordering"; - case AT_subscr_data: return "AT_subscr_data"; - case AT_byte_size: return "AT_byte_size"; - case AT_bit_offset: return "AT_bit_offset"; - case AT_bit_size: return "AT_bit_size"; - case AT_element_list: return "AT_element_list"; - case AT_stmt_list: return "AT_stmt_list"; - case AT_low_pc: return "AT_low_pc"; - case AT_high_pc: return "AT_high_pc"; - case AT_language: return "AT_language"; - case AT_member: return "AT_member"; - case AT_discr: return "AT_discr"; - case AT_discr_value: return "AT_discr_value"; - case AT_string_length: return "AT_string_length"; - case AT_common_reference: return "AT_common_reference"; - case AT_comp_dir: return "AT_comp_dir"; - case AT_const_value_string: return "AT_const_value_string"; - case AT_const_value_data2: return "AT_const_value_data2"; - case AT_const_value_data4: return "AT_const_value_data4"; - case AT_const_value_data8: return "AT_const_value_data8"; - case AT_const_value_block2: return "AT_const_value_block2"; - case AT_const_value_block4: return "AT_const_value_block4"; - case AT_containing_type: return "AT_containing_type"; - case AT_default_value_addr: return "AT_default_value_addr"; - case AT_default_value_data2: return "AT_default_value_data2"; - case AT_default_value_data4: return "AT_default_value_data4"; - case AT_default_value_data8: return "AT_default_value_data8"; - case AT_default_value_string: return "AT_default_value_string"; - case AT_friends: return "AT_friends"; - case AT_inline: return "AT_inline"; - case AT_is_optional: return "AT_is_optional"; - case AT_lower_bound_ref: return "AT_lower_bound_ref"; - case AT_lower_bound_data2: return "AT_lower_bound_data2"; - case AT_lower_bound_data4: return "AT_lower_bound_data4"; - case AT_lower_bound_data8: return "AT_lower_bound_data8"; - case AT_private: return "AT_private"; - case AT_producer: return "AT_producer"; - case AT_program: return "AT_program"; - case AT_protected: return "AT_protected"; - case AT_prototyped: return "AT_prototyped"; - case AT_public: return "AT_public"; - case AT_pure_virtual: return "AT_pure_virtual"; - case AT_return_addr: return "AT_return_addr"; - case AT_abstract_origin: return "AT_abstract_origin"; - case AT_start_scope: return "AT_start_scope"; - case AT_stride_size: return "AT_stride_size"; - case AT_upper_bound_ref: return "AT_upper_bound_ref"; - case AT_upper_bound_data2: return "AT_upper_bound_data2"; - case AT_upper_bound_data4: return "AT_upper_bound_data4"; - case AT_upper_bound_data8: return "AT_upper_bound_data8"; - case AT_virtual: return "AT_virtual"; - - /* GNU extensions */ - - case AT_sf_names: return "AT_sf_names"; - case AT_src_info: return "AT_src_info"; - case AT_mac_info: return "AT_mac_info"; - case AT_src_coords: return "AT_src_coords"; - case AT_body_begin: return "AT_body_begin"; - case AT_body_end: return "AT_body_end"; - - default: return "AT_"; - } -} - -static const char * -dwarf_stack_op_name (unsigned int op) -{ - switch (op) - { - case OP_REG: return "OP_REG"; - case OP_BASEREG: return "OP_BASEREG"; - case OP_ADDR: return "OP_ADDR"; - case OP_CONST: return "OP_CONST"; - case OP_DEREF2: return "OP_DEREF2"; - case OP_DEREF4: return "OP_DEREF4"; - case OP_ADD: return "OP_ADD"; - default: return "OP_"; - } -} - -static const char * -dwarf_typemod_name (unsigned int mod) -{ - switch (mod) - { - case MOD_pointer_to: return "MOD_pointer_to"; - case MOD_reference_to: return "MOD_reference_to"; - case MOD_const: return "MOD_const"; - case MOD_volatile: return "MOD_volatile"; - default: return "MOD_"; - } -} - -static const char * -dwarf_fmt_byte_name (unsigned int fmt) -{ - switch (fmt) - { - case FMT_FT_C_C: return "FMT_FT_C_C"; - case FMT_FT_C_X: return "FMT_FT_C_X"; - case FMT_FT_X_C: return "FMT_FT_X_C"; - case FMT_FT_X_X: return "FMT_FT_X_X"; - case FMT_UT_C_C: return "FMT_UT_C_C"; - case FMT_UT_C_X: return "FMT_UT_C_X"; - case FMT_UT_X_C: return "FMT_UT_X_C"; - case FMT_UT_X_X: return "FMT_UT_X_X"; - case FMT_ET: return "FMT_ET"; - default: return "FMT_"; - } -} - -static const char * -dwarf_fund_type_name (unsigned int ft) -{ - switch (ft) - { - case FT_char: return "FT_char"; - case FT_signed_char: return "FT_signed_char"; - case FT_unsigned_char: return "FT_unsigned_char"; - case FT_short: return "FT_short"; - case FT_signed_short: return "FT_signed_short"; - case FT_unsigned_short: return "FT_unsigned_short"; - case FT_integer: return "FT_integer"; - case FT_signed_integer: return "FT_signed_integer"; - case FT_unsigned_integer: return "FT_unsigned_integer"; - case FT_long: return "FT_long"; - case FT_signed_long: return "FT_signed_long"; - case FT_unsigned_long: return "FT_unsigned_long"; - case FT_pointer: return "FT_pointer"; - case FT_float: return "FT_float"; - case FT_dbl_prec_float: return "FT_dbl_prec_float"; - case FT_ext_prec_float: return "FT_ext_prec_float"; - case FT_complex: return "FT_complex"; - case FT_dbl_prec_complex: return "FT_dbl_prec_complex"; - case FT_void: return "FT_void"; - case FT_boolean: return "FT_boolean"; - case FT_ext_prec_complex: return "FT_ext_prec_complex"; - case FT_label: return "FT_label"; - - /* GNU extensions. */ - - case FT_long_long: return "FT_long_long"; - case FT_signed_long_long: return "FT_signed_long_long"; - case FT_unsigned_long_long: return "FT_unsigned_long_long"; - - case FT_int8: return "FT_int8"; - case FT_signed_int8: return "FT_signed_int8"; - case FT_unsigned_int8: return "FT_unsigned_int8"; - case FT_int16: return "FT_int16"; - case FT_signed_int16: return "FT_signed_int16"; - case FT_unsigned_int16: return "FT_unsigned_int16"; - case FT_int32: return "FT_int32"; - case FT_signed_int32: return "FT_signed_int32"; - case FT_unsigned_int32: return "FT_unsigned_int32"; - case FT_int64: return "FT_int64"; - case FT_signed_int64: return "FT_signed_int64"; - case FT_unsigned_int64: return "FT_unsigned_int64"; - case FT_int128: return "FT_int128"; - case FT_signed_int128: return "FT_signed_int128"; - case FT_unsigned_int128: return "FT_unsigned_int128"; - - case FT_real32: return "FT_real32"; - case FT_real64: return "FT_real64"; - case FT_real96: return "FT_real96"; - case FT_real128: return "FT_real128"; - - default: return "FT_"; - } -} - -/* Determine the "ultimate origin" of a decl. The decl may be an - inlined instance of an inlined instance of a decl which is local - to an inline function, so we have to trace all of the way back - through the origin chain to find out what sort of node actually - served as the original seed for the given block. */ - -static tree -decl_ultimate_origin (tree decl) -{ -#ifdef ENABLE_CHECKING - if (DECL_FROM_INLINE (DECL_ORIGIN (decl))) - /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the - most distant ancestor, this should never happen. */ - abort (); -#endif - - return DECL_ABSTRACT_ORIGIN (decl); -} - -/* Determine the "ultimate origin" of a block. The block may be an - inlined instance of an inlined instance of a block which is local - to an inline function, so we have to trace all of the way back - through the origin chain to find out what sort of node actually - served as the original seed for the given block. */ - -static tree -block_ultimate_origin (tree block) -{ - tree immediate_origin = BLOCK_ABSTRACT_ORIGIN (block); - - if (immediate_origin == NULL) - return NULL; - else - { - tree ret_val; - tree lookahead = immediate_origin; - - do - { - ret_val = lookahead; - lookahead = (TREE_CODE (ret_val) == BLOCK) - ? BLOCK_ABSTRACT_ORIGIN (ret_val) - : NULL; - } - while (lookahead != NULL && lookahead != ret_val); - return ret_val; - } -} - -/* Get the class to which DECL belongs, if any. In g++, the DECL_CONTEXT - of a virtual function may refer to a base class, so we check the 'this' - parameter. */ - -static tree -decl_class_context (tree decl) -{ - tree context = NULL_TREE; - if (TREE_CODE (decl) != FUNCTION_DECL || ! DECL_VINDEX (decl)) - context = DECL_CONTEXT (decl); - else - context = TYPE_MAIN_VARIANT - (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))))); - - if (context && !TYPE_P (context)) - context = NULL_TREE; - - return context; -} - -#if 0 -static void -output_unsigned_leb128 (unsigned long value) -{ - unsigned long orig_value = value; - - do - { - unsigned byte = (value & 0x7f); - - value >>= 7; - if (value != 0) /* more bytes to follow */ - byte |= 0x80; - dw2_asm_output_data (1, byte, "\t%s ULEB128 number - value = %lu", - orig_value); - } - while (value != 0); -} - -static void -output_signed_leb128 (long value) -{ - long orig_value = value; - int negative = (value < 0); - int more; - - do - { - unsigned byte = (value & 0x7f); - - value >>= 7; - if (negative) - value |= 0xfe000000; /* manually sign extend */ - if (((value == 0) && ((byte & 0x40) == 0)) - || ((value == -1) && ((byte & 0x40) == 1))) - more = 0; - else - { - byte |= 0x80; - more = 1; - } - dw2_asm_output_data (1, byte, "\t%s SLEB128 number - value = %ld", - orig_value); - } - while (more); -} -#endif - -/**************** utility functions for attribute functions ******************/ - -/* Given a pointer to a tree node for some type, return a Dwarf fundamental - type code for the given type. - - This routine must only be called for GCC type nodes that correspond to - Dwarf fundamental types. - - The current Dwarf draft specification calls for Dwarf fundamental types - to accurately reflect the fact that a given type was either a "plain" - integral type or an explicitly "signed" integral type. Unfortunately, - we can't always do this, because GCC may already have thrown away the - information about the precise way in which the type was originally - specified, as in: - - typedef signed int my_type; - - struct s { my_type f; }; - - Since we may be stuck here without enough information to do exactly - what is called for in the Dwarf draft specification, we do the best - that we can under the circumstances and always use the "plain" integral - fundamental type codes for int, short, and long types. That's probably - good enough. The additional accuracy called for in the current DWARF - draft specification is probably never even useful in practice. */ - -static int -fundamental_type_code (tree type) -{ - if (TREE_CODE (type) == ERROR_MARK) - return 0; - - switch (TREE_CODE (type)) - { - case ERROR_MARK: - return FT_void; - - case VOID_TYPE: - return FT_void; - - case INTEGER_TYPE: - /* Carefully distinguish all the standard types of C, - without messing up if the language is not C. - Note that we check only for the names that contain spaces; - other names might occur by coincidence in other languages. */ - if (TYPE_NAME (type) != 0 - && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (type)) != 0 - && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE) - { - const char *const name = - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); - - if (!strcmp (name, "unsigned char")) - return FT_unsigned_char; - if (!strcmp (name, "signed char")) - return FT_signed_char; - if (!strcmp (name, "unsigned int")) - return FT_unsigned_integer; - if (!strcmp (name, "short int")) - return FT_short; - if (!strcmp (name, "short unsigned int")) - return FT_unsigned_short; - if (!strcmp (name, "long int")) - return FT_long; - if (!strcmp (name, "long unsigned int")) - return FT_unsigned_long; - if (!strcmp (name, "long long int")) - return FT_long_long; /* Not grok'ed by svr4 SDB */ - if (!strcmp (name, "long long unsigned int")) - return FT_unsigned_long_long; /* Not grok'ed by svr4 SDB */ - } - - /* Most integer types will be sorted out above, however, for the - sake of special `array index' integer types, the following code - is also provided. */ - - if (TYPE_PRECISION (type) == INT_TYPE_SIZE) - return (TREE_UNSIGNED (type) ? FT_unsigned_integer : FT_integer); - - if (TYPE_PRECISION (type) == LONG_TYPE_SIZE) - return (TREE_UNSIGNED (type) ? FT_unsigned_long : FT_long); - - if (TYPE_PRECISION (type) == LONG_LONG_TYPE_SIZE) - return (TREE_UNSIGNED (type) ? FT_unsigned_long_long : FT_long_long); - - if (TYPE_PRECISION (type) == SHORT_TYPE_SIZE) - return (TREE_UNSIGNED (type) ? FT_unsigned_short : FT_short); - - if (TYPE_PRECISION (type) == CHAR_TYPE_SIZE) - return (TREE_UNSIGNED (type) ? FT_unsigned_char : FT_char); - - if (TYPE_MODE (type) == TImode) - return (TREE_UNSIGNED (type) ? FT_unsigned_int128 : FT_int128); - - /* In C++, __java_boolean is an INTEGER_TYPE with precision == 1 */ - if (TYPE_PRECISION (type) == 1) - return FT_boolean; - - abort (); - - case REAL_TYPE: - /* Carefully distinguish all the standard types of C, - without messing up if the language is not C. */ - if (TYPE_NAME (type) != 0 - && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (type)) != 0 - && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE) - { - const char *const name = - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); - - /* Note that here we can run afoul of a serious bug in "classic" - svr4 SDB debuggers. They don't seem to understand the - FT_ext_prec_float type (even though they should). */ - - if (!strcmp (name, "long double")) - return FT_ext_prec_float; - } - - if (TYPE_PRECISION (type) == DOUBLE_TYPE_SIZE) - { - /* On the SH, when compiling with -m3e or -m4-single-only, both - float and double are 32 bits. But since the debugger doesn't - know about the subtarget, it always thinks double is 64 bits. - So we have to tell the debugger that the type is float to - make the output of the 'print' command etc. readable. */ - if (DOUBLE_TYPE_SIZE == FLOAT_TYPE_SIZE && FLOAT_TYPE_SIZE == 32) - return FT_float; - return FT_dbl_prec_float; - } - if (TYPE_PRECISION (type) == FLOAT_TYPE_SIZE) - return FT_float; - - /* Note that here we can run afoul of a serious bug in "classic" - svr4 SDB debuggers. They don't seem to understand the - FT_ext_prec_float type (even though they should). */ - - if (TYPE_PRECISION (type) == LONG_DOUBLE_TYPE_SIZE) - return FT_ext_prec_float; - abort (); - - case COMPLEX_TYPE: - return FT_complex; /* GNU FORTRAN COMPLEX type. */ - - case CHAR_TYPE: - return FT_char; /* GNU Pascal CHAR type. Not used in C. */ - - case BOOLEAN_TYPE: - return FT_boolean; /* GNU FORTRAN BOOLEAN type. */ - - default: - abort (); /* No other TREE_CODEs are Dwarf fundamental types. */ - } - return 0; -} - -/* Given a pointer to an arbitrary ..._TYPE tree node, return a pointer to - the Dwarf "root" type for the given input type. The Dwarf "root" type - of a given type is generally the same as the given type, except that if - the given type is a pointer or reference type, then the root type of - the given type is the root type of the "basis" type for the pointer or - reference type. (This definition of the "root" type is recursive.) - Also, the root type of a `const' qualified type or a `volatile' - qualified type is the root type of the given type without the - qualifiers. */ - -static tree -root_type_1 (tree type, int count) -{ - /* Give up after searching 1000 levels, in case this is a recursive - pointer type. Such types are possible in Ada, but it is not possible - to represent them in DWARF1 debug info. */ - if (count > 1000) - return error_mark_node; - - switch (TREE_CODE (type)) - { - case ERROR_MARK: - return error_mark_node; - - case POINTER_TYPE: - case REFERENCE_TYPE: - return root_type_1 (TREE_TYPE (type), count+1); - - default: - return type; - } -} - -static tree -root_type (tree type) -{ - type = root_type_1 (type, 0); - if (type != error_mark_node) - type = type_main_variant (type); - return type; -} - -/* Given a pointer to an arbitrary ..._TYPE tree node, write out a sequence - of zero or more Dwarf "type-modifier" bytes applicable to the type. */ - -static void -write_modifier_bytes_1 (tree type, int decl_const, int decl_volatile, int count) -{ - if (TREE_CODE (type) == ERROR_MARK) - return; - - /* Give up after searching 1000 levels, in case this is a recursive - pointer type. Such types are possible in Ada, but it is not possible - to represent them in DWARF1 debug info. */ - if (count > 1000) - return; - - if (TYPE_READONLY (type) || decl_const) - ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_const); - if (TYPE_VOLATILE (type) || decl_volatile) - ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_volatile); - switch (TREE_CODE (type)) - { - case POINTER_TYPE: - ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_pointer_to); - write_modifier_bytes_1 (TREE_TYPE (type), 0, 0, count+1); - return; - - case REFERENCE_TYPE: - ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_reference_to); - write_modifier_bytes_1 (TREE_TYPE (type), 0, 0, count+1); - return; - - case ERROR_MARK: - default: - return; - } -} - -static void -write_modifier_bytes (tree type, int decl_const, int decl_volatile) -{ - write_modifier_bytes_1 (type, decl_const, decl_volatile, 0); -} - -/* Given a pointer to an arbitrary ..._TYPE tree node, return nonzero if the - given input type is a Dwarf "fundamental" type. Otherwise return zero. */ - -static inline int -type_is_fundamental (tree type) -{ - switch (TREE_CODE (type)) - { - case ERROR_MARK: - case VOID_TYPE: - case INTEGER_TYPE: - case REAL_TYPE: - case COMPLEX_TYPE: - case BOOLEAN_TYPE: - case CHAR_TYPE: - return 1; - - case SET_TYPE: - case ARRAY_TYPE: - case RECORD_TYPE: - case UNION_TYPE: - case QUAL_UNION_TYPE: - case ENUMERAL_TYPE: - case FUNCTION_TYPE: - case METHOD_TYPE: - case POINTER_TYPE: - case REFERENCE_TYPE: - case FILE_TYPE: - case OFFSET_TYPE: - case LANG_TYPE: - case VECTOR_TYPE: - return 0; - - default: - abort (); - } - return 0; -} - -/* Given a pointer to some ..._DECL tree node, generate an assembly language - equate directive which will associate a symbolic name with the current DIE. - - The name used is an artificial label generated from the DECL_UID number - associated with the given decl node. The name it gets equated to is the - symbolic label that we (previously) output at the start of the DIE that - we are currently generating. - - Calling this function while generating some "decl related" form of DIE - makes it possible to later refer to the DIE which represents the given - decl simply by re-generating the symbolic name from the ..._DECL node's - UID number. */ - -static void -equate_decl_number_to_die_number (tree decl) -{ - /* In the case where we are generating a DIE for some ..._DECL node - which represents either some inline function declaration or some - entity declared within an inline function declaration/definition, - setup a symbolic name for the current DIE so that we have a name - for this DIE that we can easily refer to later on within - AT_abstract_origin attributes. */ - - char decl_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char die_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (decl_label, DECL_NAME_FMT, DECL_UID (decl)); - sprintf (die_label, DIE_BEGIN_LABEL_FMT, current_dienum); - ASM_OUTPUT_DEF (asm_out_file, decl_label, die_label); -} - -/* Given a pointer to some ..._TYPE tree node, generate an assembly language - equate directive which will associate a symbolic name with the current DIE. - - The name used is an artificial label generated from the TYPE_UID number - associated with the given type node. The name it gets equated to is the - symbolic label that we (previously) output at the start of the DIE that - we are currently generating. - - Calling this function while generating some "type related" form of DIE - makes it easy to later refer to the DIE which represents the given type - simply by re-generating the alternative name from the ..._TYPE node's - UID number. */ - -static inline void -equate_type_number_to_die_number (tree type) -{ - char type_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char die_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* We are generating a DIE to represent the main variant of this type - (i.e the type without any const or volatile qualifiers) so in order - to get the equate to come out right, we need to get the main variant - itself here. */ - - type = type_main_variant (type); - - sprintf (type_label, TYPE_NAME_FMT, TYPE_UID (type)); - sprintf (die_label, DIE_BEGIN_LABEL_FMT, current_dienum); - ASM_OUTPUT_DEF (asm_out_file, type_label, die_label); -} - -static void -output_reg_number (rtx rtl) -{ - unsigned regno = REGNO (rtl); - - if (regno >= DWARF_FRAME_REGISTERS) - { - warning ("%Jinternal regno botch: '%D' has regno = %d\n", - dwarf_last_decl, dwarf_last_decl, regno); - regno = 0; - } - dw2_assemble_integer (4, GEN_INT (DBX_REGISTER_NUMBER (regno))); - if (flag_debug_asm) - { - fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); - PRINT_REG (rtl, 0, asm_out_file); - } - fputc ('\n', asm_out_file); -} - -/* The following routine is a nice and simple transducer. It converts the - RTL for a variable or parameter (resident in memory) into an equivalent - Dwarf representation of a mechanism for getting the address of that same - variable onto the top of a hypothetical "address evaluation" stack. - - When creating memory location descriptors, we are effectively trans- - forming the RTL for a memory-resident object into its Dwarf postfix - expression equivalent. This routine just recursively descends an - RTL tree, turning it into Dwarf postfix code as it goes. */ - -static void -output_mem_loc_descriptor (rtx rtl) -{ - /* Note that for a dynamically sized array, the location we will - generate a description of here will be the lowest numbered location - which is actually within the array. That's *not* necessarily the - same as the zeroth element of the array. */ - - rtl = (*targetm.delegitimize_address) (rtl); - - switch (GET_CODE (rtl)) - { - case SUBREG: - - /* The case of a subreg may arise when we have a local (register) - variable or a formal (register) parameter which doesn't quite - fill up an entire register. For now, just assume that it is - legitimate to make the Dwarf info refer to the whole register - which contains the given subreg. */ - - rtl = SUBREG_REG (rtl); - /* Drop thru. */ - - case REG: - - /* Whenever a register number forms a part of the description of - the method for calculating the (dynamic) address of a memory - resident object, DWARF rules require the register number to - be referred to as a "base register". This distinction is not - based in any way upon what category of register the hardware - believes the given register belongs to. This is strictly - DWARF terminology we're dealing with here. - - Note that in cases where the location of a memory-resident data - object could be expressed as: - - OP_ADD (OP_BASEREG (basereg), OP_CONST (0)) - - the actual DWARF location descriptor that we generate may just - be OP_BASEREG (basereg). This may look deceptively like the - object in question was allocated to a register (rather than - in memory) so DWARF consumers need to be aware of the subtle - distinction between OP_REG and OP_BASEREG. */ - - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG); - output_reg_number (rtl); - break; - - case MEM: - output_mem_loc_descriptor (XEXP (rtl, 0)); - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_DEREF4); - break; - - case CONST: - case SYMBOL_REF: - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADDR); - ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, rtl); - break; - - case PLUS: - output_mem_loc_descriptor (XEXP (rtl, 0)); - output_mem_loc_descriptor (XEXP (rtl, 1)); - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADD); - break; - - case CONST_INT: - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_CONST); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, INTVAL (rtl)); - break; - - case MULT: - /* If a pseudo-reg is optimized away, it is possible for it to - be replaced with a MEM containing a multiply. Use a GNU extension - to describe it. */ - output_mem_loc_descriptor (XEXP (rtl, 0)); - output_mem_loc_descriptor (XEXP (rtl, 1)); - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_MULT); - break; - - default: - abort (); - } -} - -/* Output a proper Dwarf location descriptor for a variable or parameter - which is either allocated in a register or in a memory location. For - a register, we just generate an OP_REG and the register number. For a - memory location we provide a Dwarf postfix expression describing how to - generate the (dynamic) address of the object onto the address stack. */ - -static void -output_loc_descriptor (rtx rtl) -{ - switch (GET_CODE (rtl)) - { - case SUBREG: - - /* The case of a subreg may arise when we have a local (register) - variable or a formal (register) parameter which doesn't quite - fill up an entire register. For now, just assume that it is - legitimate to make the Dwarf info refer to the whole register - which contains the given subreg. */ - - rtl = SUBREG_REG (rtl); - /* Drop thru. */ - - case REG: - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG); - output_reg_number (rtl); - break; - - case MEM: - output_mem_loc_descriptor (XEXP (rtl, 0)); - break; - - default: - abort (); /* Should never happen */ - } -} - -/* Given a tree node describing an array bound (either lower or upper) - output a representation for that bound. DIM_NUM is used for - multi-dimensional arrays and U_OR_L designates upper or lower - bound. */ - -static void -output_bound_representation (tree bound, unsigned int dim_num, char u_or_l) -{ - switch (TREE_CODE (bound)) - { - - case ERROR_MARK: - return; - - /* All fixed-bounds are represented by INTEGER_CST nodes. */ - - case INTEGER_CST: - if (host_integerp (bound, 0)) - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, tree_low_cst (bound, 0)); - break; - - default: - - /* Dynamic bounds may be represented by NOP_EXPR nodes containing - SAVE_EXPR nodes, in which case we can do something, or as - an expression, which we cannot represent. */ - { - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (begin_label, BOUND_BEGIN_LABEL_FMT, - current_dienum, dim_num, u_or_l); - - sprintf (end_label, BOUND_END_LABEL_FMT, - current_dienum, dim_num, u_or_l); - - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* If optimization is turned on, the SAVE_EXPRs that describe - how to access the upper bound values are essentially bogus. - They only describe (at best) how to get at these values at - the points in the generated code right after they have just - been computed. Worse yet, in the typical case, the upper - bound values will not even *be* computed in the optimized - code, so these SAVE_EXPRs are entirely bogus. - - In order to compensate for this fact, we check here to see - if optimization is enabled, and if so, we effectively create - an empty location description for the (unknown and unknowable) - upper bound. - - This should not cause too much trouble for existing (stupid?) - debuggers because they have to deal with empty upper bounds - location descriptions anyway in order to be able to deal with - incomplete array types. - - Of course an intelligent debugger (GDB?) should be able to - comprehend that a missing upper bound specification in a - array type used for a storage class `auto' local array variable - indicates that the upper bound is both unknown (at compile- - time) and unknowable (at run-time) due to optimization. */ - - if (! optimize) - { - while (TREE_CODE (bound) == NOP_EXPR - || TREE_CODE (bound) == CONVERT_EXPR) - bound = TREE_OPERAND (bound, 0); - - if (TREE_CODE (bound) == SAVE_EXPR - && SAVE_EXPR_RTL (bound)) - output_loc_descriptor - (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX)); - } - - ASM_OUTPUT_LABEL (asm_out_file, end_label); - } - break; - - } -} - -/* Recursive function to output a sequence of value/name pairs for - enumeration constants in reversed order. This is called from - enumeration_type_die. */ - -static void -output_enumeral_list (tree link) -{ - if (link) - { - output_enumeral_list (TREE_CHAIN (link)); - - if (host_integerp (TREE_VALUE (link), 0)) - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, - tree_low_cst (TREE_VALUE (link), 0)); - - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, - IDENTIFIER_POINTER (TREE_PURPOSE (link))); - } -} - -/* Given an unsigned value, round it up to the lowest multiple of `boundary' - which is not less than the value itself. */ - -static inline HOST_WIDE_INT -ceiling (HOST_WIDE_INT value, unsigned int boundary) -{ - return (((value + boundary - 1) / boundary) * boundary); -} - -/* Given a pointer to what is assumed to be a FIELD_DECL node, return a - pointer to the declared type for the relevant field variable, or return - `integer_type_node' if the given node turns out to be an ERROR_MARK node. */ - -static inline tree -field_type (tree decl) -{ - tree type; - - if (TREE_CODE (decl) == ERROR_MARK) - return integer_type_node; - - type = DECL_BIT_FIELD_TYPE (decl); - if (type == NULL) - type = TREE_TYPE (decl); - return type; -} - -/* Given a pointer to a tree node, assumed to be some kind of a ..._TYPE - node, return the alignment in bits for the type, or else return - BITS_PER_WORD if the node actually turns out to be an ERROR_MARK node. */ - -static inline unsigned int -simple_type_align_in_bits (tree type) -{ - return (TREE_CODE (type) != ERROR_MARK) ? TYPE_ALIGN (type) : BITS_PER_WORD; -} - -/* Given a pointer to a tree node, assumed to be some kind of a ..._TYPE - node, return the size in bits for the type if it is a constant, or - else return the alignment for the type if the type's size is not - constant, or else return BITS_PER_WORD if the type actually turns out - to be an ERROR_MARK node. */ - -static inline unsigned HOST_WIDE_INT -simple_type_size_in_bits (tree type) -{ - tree type_size_tree; - - if (TREE_CODE (type) == ERROR_MARK) - return BITS_PER_WORD; - type_size_tree = TYPE_SIZE (type); - - if (type_size_tree == NULL_TREE) - return 0; - if (! host_integerp (type_size_tree, 1)) - return TYPE_ALIGN (type); - return tree_low_cst (type_size_tree, 1); -} - -/* Given a pointer to what is assumed to be a FIELD_DECL node, compute and - return the byte offset of the lowest addressed byte of the "containing - object" for the given FIELD_DECL, or return 0 if we are unable to deter- - mine what that offset is, either because the argument turns out to be a - pointer to an ERROR_MARK node, or because the offset is actually variable. - (We can't handle the latter case just yet.) */ - -static HOST_WIDE_INT -field_byte_offset (tree decl) -{ - unsigned int type_align_in_bytes; - unsigned int type_align_in_bits; - unsigned HOST_WIDE_INT type_size_in_bits; - HOST_WIDE_INT object_offset_in_align_units; - HOST_WIDE_INT object_offset_in_bits; - HOST_WIDE_INT object_offset_in_bytes; - tree type; - tree field_size_tree; - HOST_WIDE_INT bitpos_int; - HOST_WIDE_INT deepest_bitpos; - unsigned HOST_WIDE_INT field_size_in_bits; - - if (TREE_CODE (decl) == ERROR_MARK) - return 0; - - if (TREE_CODE (decl) != FIELD_DECL) - abort (); - - type = field_type (decl); - field_size_tree = DECL_SIZE (decl); - - /* The size could be unspecified if there was an error, or for - a flexible array member. */ - if (! field_size_tree) - field_size_tree = bitsize_zero_node; - - /* We cannot yet cope with fields whose positions or sizes are variable, - so for now, when we see such things, we simply return 0. Someday, - we may be able to handle such cases, but it will be damn difficult. */ - - if (! host_integerp (bit_position (decl), 0) - || ! host_integerp (field_size_tree, 1)) - return 0; - - bitpos_int = int_bit_position (decl); - field_size_in_bits = tree_low_cst (field_size_tree, 1); - - type_size_in_bits = simple_type_size_in_bits (type); - type_align_in_bits = simple_type_align_in_bits (type); - type_align_in_bytes = type_align_in_bits / BITS_PER_UNIT; - - /* Note that the GCC front-end doesn't make any attempt to keep track - of the starting bit offset (relative to the start of the containing - structure type) of the hypothetical "containing object" for a bit- - field. Thus, when computing the byte offset value for the start of - the "containing object" of a bit-field, we must deduce this infor- - mation on our own. - - This can be rather tricky to do in some cases. For example, handling - the following structure type definition when compiling for an i386/i486 - target (which only aligns long long's to 32-bit boundaries) can be very - tricky: - - struct S { - int field1; - long long field2:31; - }; - - Fortunately, there is a simple rule-of-thumb which can be used in such - cases. When compiling for an i386/i486, GCC will allocate 8 bytes for - the structure shown above. It decides to do this based upon one simple - rule for bit-field allocation. Quite simply, GCC allocates each "con- - taining object" for each bit-field at the first (i.e. lowest addressed) - legitimate alignment boundary (based upon the required minimum alignment - for the declared type of the field) which it can possibly use, subject - to the condition that there is still enough available space remaining - in the containing object (when allocated at the selected point) to - fully accommodate all of the bits of the bit-field itself. - - This simple rule makes it obvious why GCC allocates 8 bytes for each - object of the structure type shown above. When looking for a place to - allocate the "containing object" for `field2', the compiler simply tries - to allocate a 64-bit "containing object" at each successive 32-bit - boundary (starting at zero) until it finds a place to allocate that 64- - bit field such that at least 31 contiguous (and previously unallocated) - bits remain within that selected 64 bit field. (As it turns out, for - the example above, the compiler finds that it is OK to allocate the - "containing object" 64-bit field at bit-offset zero within the - structure type.) - - Here we attempt to work backwards from the limited set of facts we're - given, and we try to deduce from those facts, where GCC must have - believed that the containing object started (within the structure type). - - The value we deduce is then used (by the callers of this routine) to - generate AT_location and AT_bit_offset attributes for fields (both - bit-fields and, in the case of AT_location, regular fields as well). */ - - /* Figure out the bit-distance from the start of the structure to the - "deepest" bit of the bit-field. */ - deepest_bitpos = bitpos_int + field_size_in_bits; - - /* This is the tricky part. Use some fancy footwork to deduce where the - lowest addressed bit of the containing object must be. */ - object_offset_in_bits - = ceiling (deepest_bitpos, type_align_in_bits) - type_size_in_bits; - - /* Compute the offset of the containing object in "alignment units". */ - object_offset_in_align_units = object_offset_in_bits / type_align_in_bits; - - /* Compute the offset of the containing object in bytes. */ - object_offset_in_bytes = object_offset_in_align_units * type_align_in_bytes; - - /* The above code assumes that the field does not cross an alignment - boundary. This can happen if PCC_BITFIELD_TYPE_MATTERS is not defined, - or if the structure is packed. If this happens, then we get an object - which starts after the bitfield, which means that the bit offset is - negative. Gdb fails when given negative bit offsets. We avoid this - by recomputing using the first bit of the bitfield. This will give - us an object which does not completely contain the bitfield, but it - will be aligned, and it will contain the first bit of the bitfield. - - However, only do this for a BYTES_BIG_ENDIAN target. For a - ! BYTES_BIG_ENDIAN target, bitpos_int + field_size_in_bits is the first - first bit of the bitfield. If we recompute using bitpos_int + 1 below, - then we end up computing the object byte offset for the wrong word of the - desired bitfield, which in turn causes the field offset to be negative - in bit_offset_attribute. */ - if (BYTES_BIG_ENDIAN - && object_offset_in_bits > bitpos_int) - { - deepest_bitpos = bitpos_int + 1; - object_offset_in_bits - = ceiling (deepest_bitpos, type_align_in_bits) - type_size_in_bits; - object_offset_in_align_units = (object_offset_in_bits - / type_align_in_bits); - object_offset_in_bytes = (object_offset_in_align_units - * type_align_in_bytes); - } - - return object_offset_in_bytes; -} - -/****************************** attributes *********************************/ - -/* The following routines are responsible for writing out the various types - of Dwarf attributes (and any following data bytes associated with them). - These routines are listed in order based on the numerical codes of their - associated attributes. */ - -/* Generate an AT_sibling attribute. */ - -static inline void -sibling_attribute (void) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_sibling); - sprintf (label, DIE_BEGIN_LABEL_FMT, NEXT_DIE_NUM); - ASM_OUTPUT_DWARF_REF (asm_out_file, label); -} - -/* Output the form of location attributes suitable for whole variables and - whole parameters. Note that the location attributes for struct fields - are generated by the routine `data_member_location_attribute' below. */ - -static void -location_attribute (rtx rtl) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_location); - sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, LOC_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* Handle a special case. If we are about to output a location descriptor - for a variable or parameter which has been optimized out of existence, - don't do that. Instead we output a zero-length location descriptor - value as part of the location attribute. - - A variable which has been optimized out of existence will have a - DECL_RTL value which denotes a pseudo-reg. - - Currently, in some rare cases, variables can have DECL_RTL values - which look like (MEM (REG pseudo-reg#)). These cases are due to - bugs elsewhere in the compiler. We treat such cases - as if the variable(s) in question had been optimized out of existence. - - Note that in all cases where we wish to express the fact that a - variable has been optimized out of existence, we do not simply - suppress the generation of the entire location attribute because - the absence of a location attribute in certain kinds of DIEs is - used to indicate something else entirely... i.e. that the DIE - represents an object declaration, but not a definition. So saith - the PLSIG. - */ - - if (! is_pseudo_reg (rtl) - && (GET_CODE (rtl) != MEM || ! is_pseudo_reg (XEXP (rtl, 0)))) - output_loc_descriptor (rtl); - - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -/* Output the specialized form of location attribute used for data members - of struct and union types. - - In the special case of a FIELD_DECL node which represents a bit-field, - the "offset" part of this special location descriptor must indicate the - distance in bytes from the lowest-addressed byte of the containing - struct or union type to the lowest-addressed byte of the "containing - object" for the bit-field. (See the `field_byte_offset' function above.) - - For any given bit-field, the "containing object" is a hypothetical - object (of some integral or enum type) within which the given bit-field - lives. The type of this hypothetical "containing object" is always the - same as the declared type of the individual bit-field itself (for GCC - anyway... the DWARF spec doesn't actually mandate this). - - Note that it is the size (in bytes) of the hypothetical "containing - object" which will be given in the AT_byte_size attribute for this - bit-field. (See the `byte_size_attribute' function below.) It is - also used when calculating the value of the AT_bit_offset attribute. - (See the `bit_offset_attribute' function below.) */ - -static void -data_member_location_attribute (tree t) -{ - unsigned object_offset_in_bytes; - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - if (TREE_CODE (t) == TREE_VEC) - object_offset_in_bytes = tree_low_cst (BINFO_OFFSET (t), 0); - else - object_offset_in_bytes = field_byte_offset (t); - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_location); - sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, LOC_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_CONST); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, object_offset_in_bytes); - ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADD); - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -/* Output an AT_const_value attribute for a variable or a parameter which - does not have a "location" either in memory or in a register. These - things can arise in GNU C when a constant is passed as an actual - parameter to an inlined function. They can also arise in C++ where - declared constants do not necessarily get memory "homes". */ - -static void -const_value_attribute (rtx rtl) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_const_value_block4); - sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, LOC_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - switch (GET_CODE (rtl)) - { - case CONST_INT: - /* Note that a CONST_INT rtx could represent either an integer or - a floating-point constant. A CONST_INT is used whenever the - constant will fit into a single word. In all such cases, the - original mode of the constant value is wiped out, and the - CONST_INT rtx is assigned VOIDmode. Since we no longer have - precise mode information for these constants, we always just - output them using 4 bytes. */ - - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) INTVAL (rtl)); - break; - - case CONST_DOUBLE: - /* Note that a CONST_DOUBLE rtx could represent either an integer - or a floating-point constant. A CONST_DOUBLE is used whenever - the constant requires more than one word in order to be adequately - represented. In all such cases, the original mode of the constant - value is preserved as the mode of the CONST_DOUBLE rtx, but for - simplicity we always just output CONST_DOUBLEs using 8 bytes. */ - - ASM_OUTPUT_DWARF_DATA8 (asm_out_file, - (unsigned int) CONST_DOUBLE_HIGH (rtl), - (unsigned int) CONST_DOUBLE_LOW (rtl)); - break; - - case CONST_STRING: - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, XSTR (rtl, 0)); - break; - - case SYMBOL_REF: - case LABEL_REF: - case CONST: - ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, rtl); - break; - - case PLUS: - /* In cases where an inlined instance of an inline function is passed - the address of an `auto' variable (which is local to the caller) - we can get a situation where the DECL_RTL of the artificial - local variable (for the inlining) which acts as a stand-in for - the corresponding formal parameter (of the inline function) - will look like (plus:SI (reg:SI FRAME_PTR) (const_int ...)). - This is not exactly a compile-time constant expression, but it - isn't the address of the (artificial) local variable either. - Rather, it represents the *value* which the artificial local - variable always has during its lifetime. We currently have no - way to represent such quasi-constant values in Dwarf, so for now - we just punt and generate an AT_const_value attribute with form - FORM_BLOCK4 and a length of zero. */ - break; - - default: - abort (); /* No other kinds of rtx should be possible here. */ - } - - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -/* Generate *either* an AT_location attribute or else an AT_const_value - data attribute for a variable or a parameter. We generate the - AT_const_value attribute only in those cases where the given - variable or parameter does not have a true "location" either in - memory or in a register. This can happen (for example) when a - constant is passed as an actual argument in a call to an inline - function. (It's possible that these things can crop up in other - ways also.) Note that one type of constant value which can be - passed into an inlined function is a constant pointer. This can - happen for example if an actual argument in an inlined function - call evaluates to a compile-time constant address. */ - -static void -location_or_const_value_attribute (tree decl) -{ - rtx rtl; - - if (TREE_CODE (decl) == ERROR_MARK) - return; - - if ((TREE_CODE (decl) != VAR_DECL) && (TREE_CODE (decl) != PARM_DECL)) - { - /* Should never happen. */ - abort (); - return; - } - - /* Here we have to decide where we are going to say the parameter "lives" - (as far as the debugger is concerned). We only have a couple of choices. - GCC provides us with DECL_RTL and with DECL_INCOMING_RTL. DECL_RTL - normally indicates where the parameter lives during most of the activa- - tion of the function. If optimization is enabled however, this could - be either NULL or else a pseudo-reg. Both of those cases indicate that - the parameter doesn't really live anywhere (as far as the code generation - parts of GCC are concerned) during most of the function's activation. - That will happen (for example) if the parameter is never referenced - within the function. - - We could just generate a location descriptor here for all non-NULL - non-pseudo values of DECL_RTL and ignore all of the rest, but we can - be a little nicer than that if we also consider DECL_INCOMING_RTL in - cases where DECL_RTL is NULL or is a pseudo-reg. - - Note however that we can only get away with using DECL_INCOMING_RTL as - a backup substitute for DECL_RTL in certain limited cases. In cases - where DECL_ARG_TYPE(decl) indicates the same type as TREE_TYPE(decl) - we can be sure that the parameter was passed using the same type as it - is declared to have within the function, and that its DECL_INCOMING_RTL - points us to a place where a value of that type is passed. In cases - where DECL_ARG_TYPE(decl) and TREE_TYPE(decl) are different types - however, we cannot (in general) use DECL_INCOMING_RTL as a backup - substitute for DECL_RTL because in these cases, DECL_INCOMING_RTL - points us to a value of some type which is *different* from the type - of the parameter itself. Thus, if we tried to use DECL_INCOMING_RTL - to generate a location attribute in such cases, the debugger would - end up (for example) trying to fetch a `float' from a place which - actually contains the first part of a `double'. That would lead to - really incorrect and confusing output at debug-time, and we don't - want that now do we? - - So in general, we DO NOT use DECL_INCOMING_RTL as a backup for DECL_RTL - in cases where DECL_ARG_TYPE(decl) != TREE_TYPE(decl). There are a - couple of cute exceptions however. On little-endian machines we can - get away with using DECL_INCOMING_RTL even when DECL_ARG_TYPE(decl) is - not the same as TREE_TYPE(decl) but only when DECL_ARG_TYPE(decl) is - an integral type which is smaller than TREE_TYPE(decl). These cases - arise when (on a little-endian machine) a non-prototyped function has - a parameter declared to be of type `short' or `char'. In such cases, - TREE_TYPE(decl) will be `short' or `char', DECL_ARG_TYPE(decl) will be - `int', and DECL_INCOMING_RTL will point to the lowest-order byte of the - passed `int' value. If the debugger then uses that address to fetch a - `short' or a `char' (on a little-endian machine) the result will be the - correct data, so we allow for such exceptional cases below. - - Note that our goal here is to describe the place where the given formal - parameter lives during most of the function's activation (i.e. between - the end of the prologue and the start of the epilogue). We'll do that - as best as we can. Note however that if the given formal parameter is - modified sometime during the execution of the function, then a stack - backtrace (at debug-time) will show the function as having been called - with the *new* value rather than the value which was originally passed - in. This happens rarely enough that it is not a major problem, but it - *is* a problem, and I'd like to fix it. A future version of dwarfout.c - may generate two additional attributes for any given TAG_formal_parameter - DIE which will describe the "passed type" and the "passed location" for - the given formal parameter in addition to the attributes we now generate - to indicate the "declared type" and the "active location" for each - parameter. This additional set of attributes could be used by debuggers - for stack backtraces. - - Separately, note that sometimes DECL_RTL can be NULL and DECL_INCOMING_RTL - can be NULL also. This happens (for example) for inlined-instances of - inline function formal parameters which are never referenced. This really - shouldn't be happening. All PARM_DECL nodes should get valid non-NULL - DECL_INCOMING_RTL values, but integrate.c doesn't currently generate - these values for inlined instances of inline function parameters, so - when we see such cases, we are just out-of-luck for the time - being (until integrate.c gets fixed). - */ - - /* Use DECL_RTL as the "location" unless we find something better. */ - rtl = DECL_RTL (decl); - - if (TREE_CODE (decl) == PARM_DECL) - if (rtl == NULL_RTX || is_pseudo_reg (rtl)) - { - /* This decl represents a formal parameter which was optimized out. */ - tree declared_type = type_main_variant (TREE_TYPE (decl)); - tree passed_type = type_main_variant (DECL_ARG_TYPE (decl)); - - /* Note that DECL_INCOMING_RTL may be NULL in here, but we handle - *all* cases where (rtl == NULL_RTX) just below. */ - - if (declared_type == passed_type) - rtl = DECL_INCOMING_RTL (decl); - else if (! BYTES_BIG_ENDIAN) - if (TREE_CODE (declared_type) == INTEGER_TYPE) - /* NMS WTF? */ - if (TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type)) - rtl = DECL_INCOMING_RTL (decl); - } - - if (rtl == NULL_RTX) - return; - - rtl = eliminate_regs (rtl, 0, NULL_RTX); -#ifdef LEAF_REG_REMAP - if (current_function_uses_only_leaf_regs) - leaf_renumber_regs_insn (rtl); -#endif - - switch (GET_CODE (rtl)) - { - case ADDRESSOF: - /* The address of a variable that was optimized away; don't emit - anything. */ - break; - - case CONST_INT: - case CONST_DOUBLE: - case CONST_STRING: - case SYMBOL_REF: - case LABEL_REF: - case CONST: - case PLUS: /* DECL_RTL could be (plus (reg ...) (const_int ...)) */ - const_value_attribute (rtl); - break; - - case MEM: - case REG: - case SUBREG: - location_attribute (rtl); - break; - - case CONCAT: - /* ??? CONCAT is used for complex variables, which may have the real - part stored in one place and the imag part stored somewhere else. - DWARF1 has no way to describe a variable that lives in two different - places, so we just describe where the first part lives, and hope that - the second part is stored after it. */ - location_attribute (XEXP (rtl, 0)); - break; - - default: - abort (); /* Should never happen. */ - } -} - -/* Generate an AT_name attribute given some string value to be included as - the value of the attribute. */ - -static inline void -name_attribute (const char *name_string) -{ - if (name_string && *name_string) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_name); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, name_string); - } -} - -static inline void -fund_type_attribute (unsigned int ft_code) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_fund_type); - ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, ft_code); -} - -static void -mod_fund_type_attribute (tree type, int decl_const, int decl_volatile) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mod_fund_type); - sprintf (begin_label, MT_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, MT_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - write_modifier_bytes (type, decl_const, decl_volatile); - ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, - fundamental_type_code (root_type (type))); - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -static inline void -user_def_type_attribute (tree type) -{ - char ud_type_name[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_user_def_type); - sprintf (ud_type_name, TYPE_NAME_FMT, TYPE_UID (type)); - ASM_OUTPUT_DWARF_REF (asm_out_file, ud_type_name); -} - -static void -mod_u_d_type_attribute (tree type, int decl_const, int decl_volatile) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char ud_type_name[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mod_u_d_type); - sprintf (begin_label, MT_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, MT_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - write_modifier_bytes (type, decl_const, decl_volatile); - sprintf (ud_type_name, TYPE_NAME_FMT, TYPE_UID (root_type (type))); - ASM_OUTPUT_DWARF_REF (asm_out_file, ud_type_name); - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -#ifdef USE_ORDERING_ATTRIBUTE -static inline void -ordering_attribute (unsigned ordering) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_ordering); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, ordering); -} -#endif /* defined(USE_ORDERING_ATTRIBUTE) */ - -/* Note that the block of subscript information for an array type also - includes information about the element type of type given array type. */ - -static void -subscript_data_attribute (tree type) -{ - unsigned dimension_number; - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_subscr_data); - sprintf (begin_label, SS_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, SS_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* The GNU compilers represent multidimensional array types as sequences - of one dimensional array types whose element types are themselves array - types. Here we squish that down, so that each multidimensional array - type gets only one array_type DIE in the Dwarf debugging info. The - draft Dwarf specification say that we are allowed to do this kind - of compression in C (because there is no difference between an - array or arrays and a multidimensional array in C) but for other - source languages (e.g. Ada) we probably shouldn't do this. */ - - for (dimension_number = 0; - TREE_CODE (type) == ARRAY_TYPE; - type = TREE_TYPE (type), dimension_number++) - { - tree domain = TYPE_DOMAIN (type); - - /* Arrays come in three flavors. Unspecified bounds, fixed - bounds, and (in GNU C only) variable bounds. Handle all - three forms here. */ - - if (domain) - { - /* We have an array type with specified bounds. */ - - tree lower = TYPE_MIN_VALUE (domain); - tree upper = TYPE_MAX_VALUE (domain); - - /* Handle only fundamental types as index types for now. */ - if (! type_is_fundamental (domain)) - abort (); - - /* Output the representation format byte for this dimension. */ - ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, - FMT_CODE (1, TREE_CODE (lower) == INTEGER_CST, - upper && TREE_CODE (upper) == INTEGER_CST)); - - /* Output the index type for this dimension. */ - ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, - fundamental_type_code (domain)); - - /* Output the representation for the lower bound. */ - output_bound_representation (lower, dimension_number, 'l'); - - /* Output the representation for the upper bound. */ - if (upper) - output_bound_representation (upper, dimension_number, 'u'); - else - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0); - } - else - { - /* We have an array type with an unspecified length. For C and - C++ we can assume that this really means that (a) the index - type is an integral type, and (b) the lower bound is zero. - Note that Dwarf defines the representation of an unspecified - (upper) bound as being a zero-length location description. */ - - /* Output the array-bounds format byte. */ - - ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, FMT_FT_C_X); - - /* Output the (assumed) index type. */ - - ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, FT_integer); - - /* Output the (assumed) lower bound (constant) value. */ - - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - - /* Output the (empty) location description for the upper bound. */ - - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0); - } - } - - /* Output the prefix byte that says that the element type is coming up. */ - - ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, FMT_ET); - - /* Output a representation of the type of the elements of this array type. */ - - type_attribute (type, 0, 0); - - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -static void -byte_size_attribute (tree tree_node) -{ - unsigned size; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_byte_size); - switch (TREE_CODE (tree_node)) - { - case ERROR_MARK: - size = 0; - break; - - case ENUMERAL_TYPE: - case RECORD_TYPE: - case UNION_TYPE: - case QUAL_UNION_TYPE: - case ARRAY_TYPE: - size = int_size_in_bytes (tree_node); - break; - - case FIELD_DECL: - /* For a data member of a struct or union, the AT_byte_size is - generally given as the number of bytes normally allocated for - an object of the *declared* type of the member itself. This - is true even for bit-fields. */ - size = simple_type_size_in_bits (field_type (tree_node)) - / BITS_PER_UNIT; - break; - - default: - abort (); - } - - /* Note that `size' might be -1 when we get to this point. If it - is, that indicates that the byte size of the entity in question - is variable. We have no good way of expressing this fact in Dwarf - at the present time, so just let the -1 pass on through. */ - - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, size); -} - -/* For a FIELD_DECL node which represents a bit-field, output an attribute - which specifies the distance in bits from the highest order bit of the - "containing object" for the bit-field to the highest order bit of the - bit-field itself. - - For any given bit-field, the "containing object" is a hypothetical - object (of some integral or enum type) within which the given bit-field - lives. The type of this hypothetical "containing object" is always the - same as the declared type of the individual bit-field itself. - - The determination of the exact location of the "containing object" for - a bit-field is rather complicated. It's handled by the `field_byte_offset' - function (above). - - Note that it is the size (in bytes) of the hypothetical "containing - object" which will be given in the AT_byte_size attribute for this - bit-field. (See `byte_size_attribute' above.) */ - -static inline void -bit_offset_attribute (tree decl) -{ - HOST_WIDE_INT object_offset_in_bytes = field_byte_offset (decl); - tree type = DECL_BIT_FIELD_TYPE (decl); - HOST_WIDE_INT bitpos_int; - HOST_WIDE_INT highest_order_object_bit_offset; - HOST_WIDE_INT highest_order_field_bit_offset; - HOST_WIDE_INT bit_offset; - - /* Must be a bit field. */ - if (!type - || TREE_CODE (decl) != FIELD_DECL) - abort (); - - /* We can't yet handle bit-fields whose offsets or sizes are variable, so - if we encounter such things, just return without generating any - attribute whatsoever. */ - - if (! host_integerp (bit_position (decl), 0) - || ! host_integerp (DECL_SIZE (decl), 1)) - return; - - bitpos_int = int_bit_position (decl); - - /* Note that the bit offset is always the distance (in bits) from the - highest-order bit of the "containing object" to the highest-order - bit of the bit-field itself. Since the "high-order end" of any - object or field is different on big-endian and little-endian machines, - the computation below must take account of these differences. */ - - highest_order_object_bit_offset = object_offset_in_bytes * BITS_PER_UNIT; - highest_order_field_bit_offset = bitpos_int; - - if (! BYTES_BIG_ENDIAN) - { - highest_order_field_bit_offset += tree_low_cst (DECL_SIZE (decl), 1); - highest_order_object_bit_offset += simple_type_size_in_bits (type); - } - - bit_offset = - (! BYTES_BIG_ENDIAN - ? highest_order_object_bit_offset - highest_order_field_bit_offset - : highest_order_field_bit_offset - highest_order_object_bit_offset); - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_bit_offset); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, bit_offset); -} - -/* For a FIELD_DECL node which represents a bit field, output an attribute - which specifies the length in bits of the given field. */ - -static inline void -bit_size_attribute (tree decl) -{ - /* Must be a field and a bit field. */ - if (TREE_CODE (decl) != FIELD_DECL - || ! DECL_BIT_FIELD_TYPE (decl)) - abort (); - - if (host_integerp (DECL_SIZE (decl), 1)) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_bit_size); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, - tree_low_cst (DECL_SIZE (decl), 1)); - } -} - -/* The following routine outputs the `element_list' attribute for enumeration - type DIEs. The element_lits attribute includes the names and values of - all of the enumeration constants associated with the given enumeration - type. */ - -static inline void -element_list_attribute (tree element) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_element_list); - sprintf (begin_label, EE_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, EE_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* Here we output a list of value/name pairs for each enumeration constant - defined for this enumeration type (as required), but we do it in REVERSE - order. The order is the one required by the draft #5 Dwarf specification - published by the UI/PLSIG. */ - - output_enumeral_list (element); /* Recursively output the whole list. */ - - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -/* Generate an AT_stmt_list attribute. These are normally present only in - DIEs with a TAG_compile_unit tag. */ - -static inline void -stmt_list_attribute (const char *label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_stmt_list); - /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, label); -} - -/* Generate an AT_low_pc attribute for a label DIE, a lexical_block DIE or - for a subroutine DIE. */ - -static inline void -low_pc_attribute (const char *asm_low_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_low_pc); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_low_label); -} - -/* Generate an AT_high_pc attribute for a lexical_block DIE or for a - subroutine DIE. */ - -static inline void -high_pc_attribute (const char *asm_high_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_high_pc); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_high_label); -} - -/* Generate an AT_body_begin attribute for a subroutine DIE. */ - -static inline void -body_begin_attribute (const char *asm_begin_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_body_begin); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_begin_label); -} - -/* Generate an AT_body_end attribute for a subroutine DIE. */ - -static inline void -body_end_attribute (const char *asm_end_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_body_end); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_end_label); -} - -/* Generate an AT_language attribute given a LANG value. These attributes - are used only within TAG_compile_unit DIEs. */ - -static inline void -language_attribute (unsigned int language_code) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_language); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, language_code); -} - -static inline void -member_attribute (tree context) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* Generate this attribute only for members in C++. */ - - if (context != NULL && is_tagged_type (context)) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_member); - sprintf (label, TYPE_NAME_FMT, TYPE_UID (context)); - ASM_OUTPUT_DWARF_REF (asm_out_file, label); - } -} - -#if 0 -#ifndef SL_BEGIN_LABEL_FMT -#define SL_BEGIN_LABEL_FMT "*.L_sl%u" -#endif -#ifndef SL_END_LABEL_FMT -#define SL_END_LABEL_FMT "*.L_sl%u_e" -#endif - -static inline void -string_length_attribute (tree upper_bound) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_string_length); - sprintf (begin_label, SL_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, SL_END_LABEL_FMT, current_dienum); - ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - output_bound_representation (upper_bound, 0, 'u'); - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} -#endif - -static inline void -comp_dir_attribute (const char *dirname) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_comp_dir); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname); -} - -static inline void -sf_names_attribute (const char *sf_names_start_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_sf_names); - /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, sf_names_start_label); -} - -static inline void -src_info_attribute (const char *src_info_start_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_src_info); - /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, src_info_start_label); -} - -static inline void -mac_info_attribute (const char *mac_info_start_label) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mac_info); - /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, mac_info_start_label); -} - -static inline void -prototyped_attribute (tree func_type) -{ - if ((strcmp (lang_hooks.name, "GNU C") == 0) - && (TYPE_ARG_TYPES (func_type) != NULL)) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_prototyped); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } -} - -static inline void -producer_attribute (const char *producer) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_producer); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, producer); -} - -static inline void -inline_attribute (tree decl) -{ - if (DECL_INLINE (decl)) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_inline); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } -} - -static inline void -containing_type_attribute (tree containing_type) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_containing_type); - sprintf (label, TYPE_NAME_FMT, TYPE_UID (containing_type)); - ASM_OUTPUT_DWARF_REF (asm_out_file, label); -} - -static inline void -abstract_origin_attribute (tree origin) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_abstract_origin); - switch (TREE_CODE_CLASS (TREE_CODE (origin))) - { - case 'd': - sprintf (label, DECL_NAME_FMT, DECL_UID (origin)); - break; - - case 't': - sprintf (label, TYPE_NAME_FMT, TYPE_UID (origin)); - break; - - default: - abort (); /* Should never happen. */ - - } - ASM_OUTPUT_DWARF_REF (asm_out_file, label); -} - -#ifdef DWARF_DECL_COORDINATES -static inline void -src_coords_attribute (unsigned src_fileno, unsigned src_lineno) -{ - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_src_coords); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, src_fileno); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, src_lineno); -} -#endif /* defined(DWARF_DECL_COORDINATES) */ - -static inline void -pure_or_virtual_attribute (tree func_decl) -{ - if (DECL_VIRTUAL_P (func_decl)) - { -#if 0 /* DECL_ABSTRACT_VIRTUAL_P is C++-specific. */ - if (DECL_ABSTRACT_VIRTUAL_P (func_decl)) - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_pure_virtual); - else -#endif - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } -} - -/************************* end of attributes *****************************/ - -/********************* utility routines for DIEs *************************/ - -/* Output an AT_name attribute and an AT_src_coords attribute for the - given decl, but only if it actually has a name. */ - -static void -name_and_src_coords_attributes (tree decl) -{ - tree decl_name = DECL_NAME (decl); - - if (decl_name && IDENTIFIER_POINTER (decl_name)) - { - name_attribute (IDENTIFIER_POINTER (decl_name)); -#ifdef DWARF_DECL_COORDINATES - { - register unsigned file_index; - - /* This is annoying, but we have to pop out of the .debug section - for a moment while we call `lookup_filename' because calling it - may cause a temporary switch into the .debug_sfnames section and - most svr4 assemblers are not smart enough to be able to nest - section switches to any depth greater than one. Note that we - also can't skirt this issue by delaying all output to the - .debug_sfnames section unit the end of compilation because that - would cause us to have inter-section forward references and - Fred Fish sez that m68k/svr4 assemblers botch those. */ - - ASM_OUTPUT_POP_SECTION (asm_out_file); - file_index = lookup_filename (DECL_SOURCE_FILE (decl)); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION); - - src_coords_attribute (file_index, DECL_SOURCE_LINE (decl)); - } -#endif /* defined(DWARF_DECL_COORDINATES) */ - } -} - -/* Many forms of DIEs contain a "type description" part. The following - routine writes out these "type descriptor" parts. */ - -static void -type_attribute (tree type, int decl_const, int decl_volatile) -{ - enum tree_code code = TREE_CODE (type); - int root_type_modified; - - if (code == ERROR_MARK) - return; - - /* Handle a special case. For functions whose return type is void, - we generate *no* type attribute. (Note that no object may have - type `void', so this only applies to function return types. */ - - if (code == VOID_TYPE) - return; - - /* If this is a subtype, find the underlying type. Eventually, - this should write out the appropriate subtype info. */ - while ((code == INTEGER_TYPE || code == REAL_TYPE) - && TREE_TYPE (type) != 0) - type = TREE_TYPE (type), code = TREE_CODE (type); - - root_type_modified = (code == POINTER_TYPE || code == REFERENCE_TYPE - || decl_const || decl_volatile - || TYPE_READONLY (type) || TYPE_VOLATILE (type)); - - if (type_is_fundamental (root_type (type))) - { - if (root_type_modified) - mod_fund_type_attribute (type, decl_const, decl_volatile); - else - fund_type_attribute (fundamental_type_code (type)); - } - else - { - if (root_type_modified) - mod_u_d_type_attribute (type, decl_const, decl_volatile); - else - /* We have to get the type_main_variant here (and pass that to the - `user_def_type_attribute' routine) because the ..._TYPE node we - have might simply be a *copy* of some original type node (where - the copy was created to help us keep track of typedef names) - and that copy might have a different TYPE_UID from the original - ..._TYPE node. (Note that when `equate_type_number_to_die_number' - is labeling a given type DIE for future reference, it always and - only creates labels for DIEs representing *main variants*, and it - never even knows about non-main-variants.) */ - user_def_type_attribute (type_main_variant (type)); - } -} - -/* Given a tree pointer to a struct, class, union, or enum type node, return - a pointer to the (string) tag name for the given type, or zero if the - type was declared without a tag. */ - -static const char * -type_tag (tree type) -{ - const char *name = 0; - - if (TYPE_NAME (type) != 0) - { - tree t = 0; - - /* Find the IDENTIFIER_NODE for the type name. */ - if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - t = TYPE_NAME (type); - - /* The g++ front end makes the TYPE_NAME of *each* tagged type point to - a TYPE_DECL node, regardless of whether or not a `typedef' was - involved. */ - else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL - && ! DECL_IGNORED_P (TYPE_NAME (type))) - t = DECL_NAME (TYPE_NAME (type)); - - /* Now get the name as a string, or invent one. */ - if (t != 0) - name = IDENTIFIER_POINTER (t); - } - - return (name == 0 || *name == '\0') ? 0 : name; -} - -static inline void -dienum_push (void) -{ - /* Start by checking if the pending_sibling_stack needs to be expanded. - If necessary, expand it. */ - - if (pending_siblings == pending_siblings_allocated) - { - pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT; - pending_sibling_stack - = xrealloc (pending_sibling_stack, - pending_siblings_allocated * sizeof(unsigned)); - } - - pending_siblings++; - NEXT_DIE_NUM = next_unused_dienum++; -} - -/* Pop the sibling stack so that the most recently pushed DIEnum becomes the - NEXT_DIE_NUM. */ - -static inline void -dienum_pop (void) -{ - pending_siblings--; -} - -static inline tree -member_declared_type (tree member) -{ - return (DECL_BIT_FIELD_TYPE (member)) - ? DECL_BIT_FIELD_TYPE (member) - : TREE_TYPE (member); -} - -/* Get the function's label, as described by its RTL. - This may be different from the DECL_NAME name used - in the source file. */ - -static const char * -function_start_label (tree decl) -{ - rtx x; - const char *fnname; - - x = DECL_RTL (decl); - if (GET_CODE (x) != MEM) - abort (); - x = XEXP (x, 0); - if (GET_CODE (x) != SYMBOL_REF) - abort (); - fnname = XSTR (x, 0); - return fnname; -} - - -/******************************* DIEs ************************************/ - -/* Output routines for individual types of DIEs. */ - -/* Note that every type of DIE (except a null DIE) gets a sibling. */ - -static void -output_array_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_array_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - - /* I believe that we can default the array ordering. SDB will probably - do the right things even if AT_ordering is not present. It's not - even an issue until we start to get into multidimensional arrays - anyway. If SDB is ever caught doing the Wrong Thing for multi- - dimensional arrays, then we'll have to put the AT_ordering attribute - back in. (But if and when we find out that we need to put these in, - we will only do so for multidimensional arrays. After all, we don't - want to waste space in the .debug section now do we?) */ - -#ifdef USE_ORDERING_ATTRIBUTE - ordering_attribute (ORD_row_major); -#endif /* defined(USE_ORDERING_ATTRIBUTE) */ - - subscript_data_attribute (type); -} - -static void -output_set_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_set_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - type_attribute (TREE_TYPE (type), 0, 0); -} - -#if 0 -/* Implement this when there is a GNU FORTRAN or GNU Ada front end. */ - -static void -output_entry_point_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_entry_point); - sibling_attribute (); - dienum_push (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - name_and_src_coords_attributes (decl); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (TREE_TYPE (decl)), 0, 0); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - low_pc_attribute (function_start_label (decl)); -} -#endif - -/* Output a DIE to represent an inlined instance of an enumeration type. */ - -static void -output_inlined_enumeration_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_enumeration_type); - sibling_attribute (); - if (!TREE_ASM_WRITTEN (type)) - abort (); - abstract_origin_attribute (type); -} - -/* Output a DIE to represent an inlined instance of a structure type. */ - -static void -output_inlined_structure_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_structure_type); - sibling_attribute (); - if (!TREE_ASM_WRITTEN (type)) - abort (); - abstract_origin_attribute (type); -} - -/* Output a DIE to represent an inlined instance of a union type. */ - -static void -output_inlined_union_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_union_type); - sibling_attribute (); - if (!TREE_ASM_WRITTEN (type)) - abort (); - abstract_origin_attribute (type); -} - -/* Output a DIE to represent an enumeration type. Note that these DIEs - include all of the information about the enumeration values also. - This information is encoded into the element_list attribute. */ - -static void -output_enumeration_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_enumeration_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - name_attribute (type_tag (type)); - member_attribute (TYPE_CONTEXT (type)); - - /* Handle a GNU C/C++ extension, i.e. incomplete enum types. If the - given enum type is incomplete, do not generate the AT_byte_size - attribute or the AT_element_list attribute. */ - - if (COMPLETE_TYPE_P (type)) - { - byte_size_attribute (type); - element_list_attribute (TYPE_FIELDS (type)); - } -} - -/* Output a DIE to represent either a real live formal parameter decl or - to represent just the type of some formal parameter position in some - function type. - - Note that this routine is a bit unusual because its argument may be - a ..._DECL node (i.e. either a PARM_DECL or perhaps a VAR_DECL which - represents an inlining of some PARM_DECL) or else some sort of a - ..._TYPE node. If it's the former then this function is being called - to output a DIE to represent a formal parameter object (or some inlining - thereof). If it's the latter, then this function is only being called - to output a TAG_formal_parameter DIE to stand as a placeholder for some - formal argument type of some subprogram type. */ - -static void -output_formal_parameter_die (void *arg) -{ - tree node = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_formal_parameter); - sibling_attribute (); - - switch (TREE_CODE_CLASS (TREE_CODE (node))) - { - case 'd': /* We were called with some kind of a ..._DECL node. */ - { - register tree origin = decl_ultimate_origin (node); - - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - name_and_src_coords_attributes (node); - type_attribute (TREE_TYPE (node), - TREE_READONLY (node), TREE_THIS_VOLATILE (node)); - } - if (DECL_ABSTRACT (node)) - equate_decl_number_to_die_number (node); - else - location_or_const_value_attribute (node); - } - break; - - case 't': /* We were called with some kind of a ..._TYPE node. */ - type_attribute (node, 0, 0); - break; - - default: - abort (); /* Should never happen. */ - } -} - -/* Output a DIE to represent a declared function (either file-scope - or block-local) which has "external linkage" (according to ANSI-C). */ - -static void -output_global_subroutine_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_global_subroutine); - sibling_attribute (); - dienum_push (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - tree type = TREE_TYPE (decl); - - name_and_src_coords_attributes (decl); - inline_attribute (decl); - prototyped_attribute (type); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (type), 0, 0); - pure_or_virtual_attribute (decl); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - { - if (! DECL_EXTERNAL (decl) && ! in_class - && decl == current_function_decl) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - low_pc_attribute (function_start_label (decl)); - sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); - high_pc_attribute (label); - if (use_gnu_debug_info_extensions) - { - sprintf (label, BODY_BEGIN_LABEL_FMT, - current_function_funcdef_no); - body_begin_attribute (label); - sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); - body_end_attribute (label); - } - } - } -} - -/* Output a DIE to represent a declared data object (either file-scope - or block-local) which has "external linkage" (according to ANSI-C). */ - -static void -output_global_variable_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_global_variable); - sibling_attribute (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - name_and_src_coords_attributes (decl); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (decl), - TREE_READONLY (decl), TREE_THIS_VOLATILE (decl)); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - { - if (! DECL_EXTERNAL (decl) && ! in_class - && current_function_decl == decl_function_context (decl)) - location_or_const_value_attribute (decl); - } -} - -static void -output_label_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_label); - sibling_attribute (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - name_and_src_coords_attributes (decl); - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - { - rtx insn = DECL_RTL (decl); - - /* Deleted labels are programmer specified labels which have been - eliminated because of various optimizations. We still emit them - here so that it is possible to put breakpoints on them. */ - if (GET_CODE (insn) == CODE_LABEL - || ((GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* When optimization is enabled (via -O) some parts of the compiler - (e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which - represent source-level labels which were explicitly declared by - the user. This really shouldn't be happening though, so catch - it if it ever does happen. */ - - if (INSN_DELETED_P (insn)) - abort (); /* Should never happen. */ - - ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (insn)); - low_pc_attribute (label); - } - } -} - -static void -output_lexical_block_die (void *arg) -{ - tree stmt = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_lexical_block); - sibling_attribute (); - dienum_push (); - if (! BLOCK_ABSTRACT (stmt)) - { - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (begin_label, BLOCK_BEGIN_LABEL_FMT, BLOCK_NUMBER (stmt)); - low_pc_attribute (begin_label); - sprintf (end_label, BLOCK_END_LABEL_FMT, BLOCK_NUMBER (stmt)); - high_pc_attribute (end_label); - } -} - -static void -output_inlined_subroutine_die (void *arg) -{ - tree stmt = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inlined_subroutine); - sibling_attribute (); - dienum_push (); - abstract_origin_attribute (block_ultimate_origin (stmt)); - if (! BLOCK_ABSTRACT (stmt)) - { - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (begin_label, BLOCK_BEGIN_LABEL_FMT, BLOCK_NUMBER (stmt)); - low_pc_attribute (begin_label); - sprintf (end_label, BLOCK_END_LABEL_FMT, BLOCK_NUMBER (stmt)); - high_pc_attribute (end_label); - } -} - -/* Output a DIE to represent a declared data object (either file-scope - or block-local) which has "internal linkage" (according to ANSI-C). */ - -static void -output_local_variable_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_local_variable); - sibling_attribute (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - name_and_src_coords_attributes (decl); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (decl), - TREE_READONLY (decl), TREE_THIS_VOLATILE (decl)); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - location_or_const_value_attribute (decl); -} - -static void -output_member_die (void *arg) -{ - tree decl = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_member); - sibling_attribute (); - name_and_src_coords_attributes (decl); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (member_declared_type (decl), - TREE_READONLY (decl), TREE_THIS_VOLATILE (decl)); - if (DECL_BIT_FIELD_TYPE (decl)) /* If this is a bit field... */ - { - byte_size_attribute (decl); - bit_size_attribute (decl); - bit_offset_attribute (decl); - } - data_member_location_attribute (decl); -} - -#if 0 -/* Don't generate either pointer_type DIEs or reference_type DIEs. Use - modified types instead. - - We keep this code here just in case these types of DIEs may be - needed to represent certain things in other languages (e.g. Pascal) - someday. */ - -static void -output_pointer_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_pointer_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - type_attribute (TREE_TYPE (type), 0, 0); -} - -static void -output_reference_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_reference_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - type_attribute (TREE_TYPE (type), 0, 0); -} -#endif - -static void -output_ptr_to_mbr_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_ptr_to_member_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - containing_type_attribute (TYPE_OFFSET_BASETYPE (type)); - type_attribute (TREE_TYPE (type), 0, 0); -} - -static void -output_compile_unit_die (void *arg) -{ - const char *main_input_filename = arg; - const char *language_string = lang_hooks.name; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_compile_unit); - sibling_attribute (); - dienum_push (); - name_attribute (main_input_filename); - - { - char producer[250]; - - sprintf (producer, "%s %s", language_string, version_string); - producer_attribute (producer); - } - - if (strcmp (language_string, "GNU C++") == 0) - language_attribute (LANG_C_PLUS_PLUS); - else if (strcmp (language_string, "GNU Ada") == 0) - language_attribute (LANG_ADA83); - else if (strcmp (language_string, "GNU F77") == 0) - language_attribute (LANG_FORTRAN77); - else if (strcmp (language_string, "GNU Pascal") == 0) - language_attribute (LANG_PASCAL83); - else if (strcmp (language_string, "GNU Java") == 0) - language_attribute (LANG_JAVA); - else - language_attribute (LANG_C89); - low_pc_attribute (TEXT_BEGIN_LABEL); - high_pc_attribute (TEXT_END_LABEL); - if (debug_info_level >= DINFO_LEVEL_NORMAL) - stmt_list_attribute (LINE_BEGIN_LABEL); - - { - const char *wd = get_src_pwd (); - if (wd) - comp_dir_attribute (wd); - } - - if (debug_info_level >= DINFO_LEVEL_NORMAL && use_gnu_debug_info_extensions) - { - sf_names_attribute (SFNAMES_BEGIN_LABEL); - src_info_attribute (SRCINFO_BEGIN_LABEL); - if (debug_info_level >= DINFO_LEVEL_VERBOSE) - mac_info_attribute (MACINFO_BEGIN_LABEL); - } -} - -static void -output_string_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_string_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - member_attribute (TYPE_CONTEXT (type)); - /* This is a fixed length string. */ - byte_size_attribute (type); -} - -static void -output_inheritance_die (void *arg) -{ - tree binfo = ((tree *)arg)[0]; - tree access = ((tree *)arg)[1]; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inheritance); - sibling_attribute (); - type_attribute (BINFO_TYPE (binfo), 0, 0); - data_member_location_attribute (binfo); - if (TREE_VIA_VIRTUAL (binfo)) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } - if (access == access_public_node) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_public); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } - else if (access == access_protected_node) - { - ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_protected); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - } -} - -static void -output_structure_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_structure_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - name_attribute (type_tag (type)); - member_attribute (TYPE_CONTEXT (type)); - - /* If this type has been completed, then give it a byte_size attribute - and prepare to give a list of members. Otherwise, don't do either of - these things. In the latter case, we will not be generating a list - of members (since we don't have any idea what they might be for an - incomplete type). */ - - if (COMPLETE_TYPE_P (type)) - { - dienum_push (); - byte_size_attribute (type); - } -} - -/* Output a DIE to represent a declared function (either file-scope - or block-local) which has "internal linkage" (according to ANSI-C). */ - -static void -output_local_subroutine_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_subroutine); - sibling_attribute (); - dienum_push (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - tree type = TREE_TYPE (decl); - - name_and_src_coords_attributes (decl); - inline_attribute (decl); - prototyped_attribute (type); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (type), 0, 0); - pure_or_virtual_attribute (decl); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); - else - { - /* Avoid getting screwed up in cases where a function was declared - static but where no definition was ever given for it. */ - - if (TREE_ASM_WRITTEN (decl)) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - low_pc_attribute (function_start_label (decl)); - sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); - high_pc_attribute (label); - if (use_gnu_debug_info_extensions) - { - sprintf (label, BODY_BEGIN_LABEL_FMT, - current_function_funcdef_no); - body_begin_attribute (label); - sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); - body_end_attribute (label); - } - } - } -} - -static void -output_subroutine_type_die (void *arg) -{ - tree type = arg; - tree return_type = TREE_TYPE (type); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_subroutine_type); - sibling_attribute (); - dienum_push (); - equate_type_number_to_die_number (type); - prototyped_attribute (type); - member_attribute (TYPE_CONTEXT (type)); - type_attribute (return_type, 0, 0); -} - -static void -output_typedef_die (void *arg) -{ - tree decl = arg; - tree origin = decl_ultimate_origin (decl); - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_typedef); - sibling_attribute (); - if (origin != NULL) - abstract_origin_attribute (origin); - else - { - name_and_src_coords_attributes (decl); - member_attribute (DECL_CONTEXT (decl)); - type_attribute (TREE_TYPE (decl), - TREE_READONLY (decl), TREE_THIS_VOLATILE (decl)); - } - if (DECL_ABSTRACT (decl)) - equate_decl_number_to_die_number (decl); -} - -static void -output_union_type_die (void *arg) -{ - tree type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_union_type); - sibling_attribute (); - equate_type_number_to_die_number (type); - name_attribute (type_tag (type)); - member_attribute (TYPE_CONTEXT (type)); - - /* If this type has been completed, then give it a byte_size attribute - and prepare to give a list of members. Otherwise, don't do either of - these things. In the latter case, we will not be generating a list - of members (since we don't have any idea what they might be for an - incomplete type). */ - - if (COMPLETE_TYPE_P (type)) - { - dienum_push (); - byte_size_attribute (type); - } -} - -/* Generate a special type of DIE used as a stand-in for a trailing ellipsis - at the end of an (ANSI prototyped) formal parameters list. */ - -static void -output_unspecified_parameters_die (void *arg) -{ - tree decl_or_type = arg; - - ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_unspecified_parameters); - sibling_attribute (); - - /* This kludge is here only for the sake of being compatible with what - the USL CI5 C compiler does. The specification of Dwarf Version 1 - doesn't say that TAG_unspecified_parameters DIEs should contain any - attributes other than the AT_sibling attribute, but they are certainly - allowed to contain additional attributes, and the CI5 compiler - generates AT_name, AT_fund_type, and AT_location attributes within - TAG_unspecified_parameters DIEs which appear in the child lists for - DIEs representing function definitions, so we do likewise here. */ - - if (TREE_CODE (decl_or_type) == FUNCTION_DECL && DECL_INITIAL (decl_or_type)) - { - name_attribute ("..."); - fund_type_attribute (FT_pointer); - /* location_attribute (?); */ - } -} - -static void -output_padded_null_die (void *arg ATTRIBUTE_UNUSED) -{ - ASM_OUTPUT_ALIGN (asm_out_file, 2); /* 2**2 == 4 */ -} - -/*************************** end of DIEs *********************************/ - -/* Generate some type of DIE. This routine generates the generic outer - wrapper stuff which goes around all types of DIE's (regardless of their - TAGs. All forms of DIEs start with a DIE-specific label, followed by a - DIE-length word, followed by the guts of the DIE itself. After the guts - of the DIE, there must always be a terminator label for the DIE. */ - -static void -output_die (void (*die_specific_output_function) (void *), void *param) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - current_dienum = NEXT_DIE_NUM; - NEXT_DIE_NUM = next_unused_dienum; - - sprintf (begin_label, DIE_BEGIN_LABEL_FMT, current_dienum); - sprintf (end_label, DIE_END_LABEL_FMT, current_dienum); - - /* Write a label which will act as the name for the start of this DIE. */ - - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* Write the DIE-length word. */ - - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label); - - /* Fill in the guts of the DIE. */ - - next_unused_dienum++; - die_specific_output_function (param); - - /* Write a label which will act as the name for the end of this DIE. */ - - ASM_OUTPUT_LABEL (asm_out_file, end_label); -} - -static void -end_sibling_chain (void) -{ - char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - current_dienum = NEXT_DIE_NUM; - NEXT_DIE_NUM = next_unused_dienum; - - sprintf (begin_label, DIE_BEGIN_LABEL_FMT, current_dienum); - - /* Write a label which will act as the name for the start of this DIE. */ - - ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - /* Write the DIE-length word. */ - - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 4); - - dienum_pop (); -} - -/* Generate a list of nameless TAG_formal_parameter DIEs (and perhaps a - TAG_unspecified_parameters DIE) to represent the types of the formal - parameters as specified in some function type specification (except - for those which appear as part of a function *definition*). - - Note that we must be careful here to output all of the parameter - DIEs *before* we output any DIEs needed to represent the types of - the formal parameters. This keeps svr4 SDB happy because it - (incorrectly) thinks that the first non-parameter DIE it sees ends - the formal parameter list. */ - -static void -output_formal_types (tree function_or_method_type) -{ - tree link; - tree formal_type = NULL; - tree first_parm_type = TYPE_ARG_TYPES (function_or_method_type); - - /* Set TREE_ASM_WRITTEN while processing the parameters, lest we - get bogus recursion when outputting tagged types local to a - function declaration. */ - int save_asm_written = TREE_ASM_WRITTEN (function_or_method_type); - TREE_ASM_WRITTEN (function_or_method_type) = 1; - - /* In the case where we are generating a formal types list for a C++ - non-static member function type, skip over the first thing on the - TYPE_ARG_TYPES list because it only represents the type of the - hidden `this pointer'. The debugger should be able to figure - out (without being explicitly told) that this non-static member - function type takes a `this pointer' and should be able to figure - what the type of that hidden parameter is from the AT_member - attribute of the parent TAG_subroutine_type DIE. */ - - if (TREE_CODE (function_or_method_type) == METHOD_TYPE) - first_parm_type = TREE_CHAIN (first_parm_type); - - /* Make our first pass over the list of formal parameter types and output - a TAG_formal_parameter DIE for each one. */ - - for (link = first_parm_type; link; link = TREE_CHAIN (link)) - { - formal_type = TREE_VALUE (link); - if (formal_type == void_type_node) - break; - - /* Output a (nameless) DIE to represent the formal parameter itself. */ - - output_die (output_formal_parameter_die, formal_type); - } - - /* If this function type has an ellipsis, add a TAG_unspecified_parameters - DIE to the end of the parameter list. */ - - if (formal_type != void_type_node) - output_die (output_unspecified_parameters_die, function_or_method_type); - - /* Make our second (and final) pass over the list of formal parameter types - and output DIEs to represent those types (as necessary). */ - - for (link = TYPE_ARG_TYPES (function_or_method_type); - link; - link = TREE_CHAIN (link)) - { - formal_type = TREE_VALUE (link); - if (formal_type == void_type_node) - break; - - output_type (formal_type, function_or_method_type); - } - - TREE_ASM_WRITTEN (function_or_method_type) = save_asm_written; -} - -/* Remember a type in the pending_types_list. */ - -static void -pend_type (tree type) -{ - if (pending_types == pending_types_allocated) - { - pending_types_allocated += PENDING_TYPES_INCREMENT; - pending_types_list - = xrealloc (pending_types_list, - sizeof (tree) * pending_types_allocated); - } - pending_types_list[pending_types++] = type; - - /* Mark the pending type as having been output already (even though - it hasn't been). This prevents the type from being added to the - pending_types_list more than once. */ - - TREE_ASM_WRITTEN (type) = 1; -} - -/* Return nonzero if it is legitimate to output DIEs to represent a - given type while we are generating the list of child DIEs for some - DIE (e.g. a function or lexical block DIE) associated with a given scope. - - See the comments within the function for a description of when it is - considered legitimate to output DIEs for various kinds of types. - - Note that TYPE_CONTEXT(type) may be NULL (to indicate global scope) - or it may point to a BLOCK node (for types local to a block), or to a - FUNCTION_DECL node (for types local to the heading of some function - definition), or to a FUNCTION_TYPE node (for types local to the - prototyped parameter list of a function type specification), or to a - RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node - (in the case of C++ nested types). - - The `scope' parameter should likewise be NULL or should point to a - BLOCK node, a FUNCTION_DECL node, a FUNCTION_TYPE node, a RECORD_TYPE - node, a UNION_TYPE node, or a QUAL_UNION_TYPE node. - - This function is used only for deciding when to "pend" and when to - "un-pend" types to/from the pending_types_list. - - Note that we sometimes make use of this "type pending" feature in a - rather twisted way to temporarily delay the production of DIEs for the - types of formal parameters. (We do this just to make svr4 SDB happy.) - It order to delay the production of DIEs representing types of formal - parameters, callers of this function supply `fake_containing_scope' as - the `scope' parameter to this function. Given that fake_containing_scope - is a tagged type which is *not* the containing scope for *any* other type, - the desired effect is achieved, i.e. output of DIEs representing types - is temporarily suspended, and any type DIEs which would have otherwise - been output are instead placed onto the pending_types_list. Later on, - we force these (temporarily pended) types to be output simply by calling - `output_pending_types_for_scope' with an actual argument equal to the - true scope of the types we temporarily pended. */ - -static inline int -type_ok_for_scope (tree type, tree scope) -{ - /* Tagged types (i.e. struct, union, and enum types) must always be - output only in the scopes where they actually belong (or else the - scoping of their own tag names and the scoping of their member - names will be incorrect). Non-tagged-types on the other hand can - generally be output anywhere, except that svr4 SDB really doesn't - want to see them nested within struct or union types, so here we - say it is always OK to immediately output any such a (non-tagged) - type, so long as we are not within such a context. Note that the - only kinds of non-tagged types which we will be dealing with here - (for C and C++ anyway) will be array types and function types. */ - - return is_tagged_type (type) - ? (TYPE_CONTEXT (type) == scope - /* Ignore namespaces for the moment. */ - || (scope == NULL_TREE - && TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL) - || (scope == NULL_TREE && is_tagged_type (TYPE_CONTEXT (type)) - && TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))) - : (scope == NULL_TREE || ! is_tagged_type (scope)); -} - -/* Output any pending types (from the pending_types list) which we can output - now (taking into account the scope that we are working on now). - - For each type output, remove the given type from the pending_types_list - *before* we try to output it. - - Note that we have to process the list in beginning-to-end order, - because the call made here to output_type may cause yet more types - to be added to the end of the list, and we may have to output some - of them too. */ - -static void -output_pending_types_for_scope (tree containing_scope) -{ - unsigned i; - - for (i = 0; i < pending_types; ) - { - tree type = pending_types_list[i]; - - if (type_ok_for_scope (type, containing_scope)) - { - tree *mover; - tree *limit; - - pending_types--; - limit = &pending_types_list[pending_types]; - for (mover = &pending_types_list[i]; mover < limit; mover++) - *mover = *(mover+1); - - /* Un-mark the type as having been output already (because it - hasn't been, really). Then call output_type to generate a - Dwarf representation of it. */ - - TREE_ASM_WRITTEN (type) = 0; - output_type (type, containing_scope); - - /* Don't increment the loop counter in this case because we - have shifted all of the subsequent pending types down one - element in the pending_types_list array. */ - } - else - i++; - } -} - -/* Remember a type in the incomplete_types_list. */ - -static void -add_incomplete_type (tree type) -{ - if (incomplete_types == incomplete_types_allocated) - { - incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT; - incomplete_types_list - = xrealloc (incomplete_types_list, - sizeof (tree) * incomplete_types_allocated); - } - - incomplete_types_list[incomplete_types++] = type; -} - -/* Walk through the list of incomplete types again, trying once more to - emit full debugging info for them. */ - -static void -retry_incomplete_types (void) -{ - tree type; - - finalizing = 1; - while (incomplete_types) - { - --incomplete_types; - type = incomplete_types_list[incomplete_types]; - output_type (type, NULL_TREE); - } -} - -static void -output_type (tree type, tree containing_scope) -{ - if (type == 0 || type == error_mark_node) - return; - - /* We are going to output a DIE to represent the unqualified version of - this type (i.e. without any const or volatile qualifiers) so get - the main variant (i.e. the unqualified version) of this type now. */ - - type = type_main_variant (type); - - if (TREE_ASM_WRITTEN (type)) - { - if (finalizing && AGGREGATE_TYPE_P (type)) - { - tree member; - - /* Some of our nested types might not have been defined when we - were written out before; force them out now. */ - - for (member = TYPE_FIELDS (type); member; - member = TREE_CHAIN (member)) - if (TREE_CODE (member) == TYPE_DECL - && ! TREE_ASM_WRITTEN (TREE_TYPE (member))) - output_type (TREE_TYPE (member), containing_scope); - } - return; - } - - /* If this is a nested type whose containing class hasn't been - written out yet, writing it out will cover this one, too. */ - - if (TYPE_CONTEXT (type) - && TYPE_P (TYPE_CONTEXT (type)) - && ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type))) - { - output_type (TYPE_CONTEXT (type), containing_scope); - return; - } - - /* Don't generate any DIEs for this type now unless it is OK to do so - (based upon what `type_ok_for_scope' tells us). */ - - if (! type_ok_for_scope (type, containing_scope)) - { - pend_type (type); - return; - } - - switch (TREE_CODE (type)) - { - case ERROR_MARK: - break; - - case VECTOR_TYPE: - output_type (TYPE_DEBUG_REPRESENTATION_TYPE (type), containing_scope); - break; - - case POINTER_TYPE: - case REFERENCE_TYPE: - /* Prevent infinite recursion in cases where this is a recursive - type. Recursive types are possible in Ada. */ - TREE_ASM_WRITTEN (type) = 1; - /* For these types, all that is required is that we output a DIE - (or a set of DIEs) to represent the "basis" type. */ - output_type (TREE_TYPE (type), containing_scope); - break; - - case OFFSET_TYPE: - /* This code is used for C++ pointer-to-data-member types. */ - /* Output a description of the relevant class type. */ - output_type (TYPE_OFFSET_BASETYPE (type), containing_scope); - /* Output a description of the type of the object pointed to. */ - output_type (TREE_TYPE (type), containing_scope); - /* Now output a DIE to represent this pointer-to-data-member type - itself. */ - output_die (output_ptr_to_mbr_type_die, type); - break; - - case SET_TYPE: - output_type (TYPE_DOMAIN (type), containing_scope); - output_die (output_set_type_die, type); - break; - - case FILE_TYPE: - output_type (TREE_TYPE (type), containing_scope); - abort (); /* No way to represent these in Dwarf yet! */ - break; - - case FUNCTION_TYPE: - /* Force out return type (in case it wasn't forced out already). */ - output_type (TREE_TYPE (type), containing_scope); - output_die (output_subroutine_type_die, type); - output_formal_types (type); - end_sibling_chain (); - break; - - case METHOD_TYPE: - /* Force out return type (in case it wasn't forced out already). */ - output_type (TREE_TYPE (type), containing_scope); - output_die (output_subroutine_type_die, type); - output_formal_types (type); - end_sibling_chain (); - break; - - case ARRAY_TYPE: - if (TYPE_STRING_FLAG (type) && TREE_CODE(TREE_TYPE(type)) == CHAR_TYPE) - { - output_type (TREE_TYPE (type), containing_scope); - output_die (output_string_type_die, type); - } - else - { - tree element_type; - - element_type = TREE_TYPE (type); - while (TREE_CODE (element_type) == ARRAY_TYPE) - element_type = TREE_TYPE (element_type); - - output_type (element_type, containing_scope); - output_die (output_array_type_die, type); - } - break; - - case ENUMERAL_TYPE: - case RECORD_TYPE: - case UNION_TYPE: - case QUAL_UNION_TYPE: - - /* For a non-file-scope tagged type, we can always go ahead and - output a Dwarf description of this type right now, even if - the type in question is still incomplete, because if this - local type *was* ever completed anywhere within its scope, - that complete definition would already have been attached to - this RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE - node by the time we reach this point. That's true because of the - way the front-end does its processing of file-scope declarations (of - functions and class types) within which other types might be - nested. The C and C++ front-ends always gobble up such "local - scope" things en-mass before they try to output *any* debugging - information for any of the stuff contained inside them and thus, - we get the benefit here of what is (in effect) a pre-resolution - of forward references to tagged types in local scopes. - - Note however that for file-scope tagged types we cannot assume - that such pre-resolution of forward references has taken place. - A given file-scope tagged type may appear to be incomplete when - we reach this point, but it may yet be given a full definition - (at file-scope) later on during compilation. In order to avoid - generating a premature (and possibly incorrect) set of Dwarf - DIEs for such (as yet incomplete) file-scope tagged types, we - generate nothing at all for as-yet incomplete file-scope tagged - types here unless we are making our special "finalization" pass - for file-scope things at the very end of compilation. At that - time, we will certainly know as much about each file-scope tagged - type as we are ever going to know, so at that point in time, we - can safely generate correct Dwarf descriptions for these file- - scope tagged types. */ - - if (!COMPLETE_TYPE_P (type) - && (TYPE_CONTEXT (type) == NULL - || AGGREGATE_TYPE_P (TYPE_CONTEXT (type)) - || TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL) - && !finalizing) - { - /* We don't need to do this for function-local types. */ - if (! decl_function_context (TYPE_STUB_DECL (type))) - add_incomplete_type (type); - return; /* EARLY EXIT! Avoid setting TREE_ASM_WRITTEN. */ - } - - /* Prevent infinite recursion in cases where the type of some - member of this type is expressed in terms of this type itself. */ - - TREE_ASM_WRITTEN (type) = 1; - - /* Output a DIE to represent the tagged type itself. */ - - switch (TREE_CODE (type)) - { - case ENUMERAL_TYPE: - output_die (output_enumeration_type_die, type); - return; /* a special case -- nothing left to do so just return */ - - case RECORD_TYPE: - output_die (output_structure_type_die, type); - break; - - case UNION_TYPE: - case QUAL_UNION_TYPE: - output_die (output_union_type_die, type); - break; - - default: - abort (); /* Should never happen. */ - } - - /* If this is not an incomplete type, output descriptions of - each of its members. - - Note that as we output the DIEs necessary to represent the - members of this record or union type, we will also be trying - to output DIEs to represent the *types* of those members. - However the `output_type' function (above) will specifically - avoid generating type DIEs for member types *within* the list - of member DIEs for this (containing) type except for those - types (of members) which are explicitly marked as also being - members of this (containing) type themselves. The g++ front- - end can force any given type to be treated as a member of some - other (containing) type by setting the TYPE_CONTEXT of the - given (member) type to point to the TREE node representing the - appropriate (containing) type. - */ - - if (COMPLETE_TYPE_P (type)) - { - tree binfo = TYPE_BINFO (type); - - /* First output info about the base classes. */ - if (binfo) - { - tree bases = BINFO_BASETYPES (binfo); - tree accesses = BINFO_BASEACCESSES (binfo); - register int n_bases = BINFO_N_BASETYPES (binfo); - register int i; - - for (i = 0; i < n_bases; i++) - { - tree arg[2]; - - arg[0] = TREE_VEC_ELT (bases, i); - arg[1] = (accesses ? TREE_VEC_ELT (accesses, i) - : access_public_node); - output_type (BINFO_TYPE (binfo), containing_scope); - output_die (output_inheritance_die, arg); - } - } - - ++in_class; - - { - tree normal_member; - - /* Now output info about the data members and type members. */ - - for (normal_member = TYPE_FIELDS (type); - normal_member; - normal_member = TREE_CHAIN (normal_member)) - output_decl (normal_member, type); - } - - { - tree func_member; - - /* Now output info about the function members (if any). */ - - for (func_member = TYPE_METHODS (type); - func_member; - func_member = TREE_CHAIN (func_member)) - { - /* Don't include clones in the member list. */ - if (DECL_ABSTRACT_ORIGIN (func_member)) - continue; - - output_decl (func_member, type); - } - } - - --in_class; - - /* RECORD_TYPEs, UNION_TYPEs, and QUAL_UNION_TYPEs are themselves - scopes (at least in C++) so we must now output any nested - pending types which are local just to this type. */ - - output_pending_types_for_scope (type); - - end_sibling_chain (); /* Terminate member chain. */ - } - - break; - - case VOID_TYPE: - case INTEGER_TYPE: - case REAL_TYPE: - case COMPLEX_TYPE: - case BOOLEAN_TYPE: - case CHAR_TYPE: - break; /* No DIEs needed for fundamental types. */ - - case LANG_TYPE: /* No Dwarf representation currently defined. */ - break; - - default: - abort (); - } - - TREE_ASM_WRITTEN (type) = 1; -} - -static void -output_tagged_type_instantiation (tree type) -{ - if (type == 0 || type == error_mark_node) - return; - - /* We are going to output a DIE to represent the unqualified version of - this type (i.e. without any const or volatile qualifiers) so make - sure that we have the main variant (i.e. the unqualified version) of - this type now. */ - - if (type != type_main_variant (type)) - abort (); - - if (!TREE_ASM_WRITTEN (type)) - abort (); - - switch (TREE_CODE (type)) - { - case ERROR_MARK: - break; - - case ENUMERAL_TYPE: - output_die (output_inlined_enumeration_type_die, type); - break; - - case RECORD_TYPE: - output_die (output_inlined_structure_type_die, type); - break; - - case UNION_TYPE: - case QUAL_UNION_TYPE: - output_die (output_inlined_union_type_die, type); - break; - - default: - abort (); /* Should never happen. */ - } -} - -/* Output a TAG_lexical_block DIE followed by DIEs to represent all of - the things which are local to the given block. */ - -static void -output_block (tree stmt, int depth) -{ - int must_output_die = 0; - tree origin; - enum tree_code origin_code; - - /* Ignore blocks never really used to make RTL. */ - - if (! stmt || ! TREE_USED (stmt) - || (!TREE_ASM_WRITTEN (stmt) && !BLOCK_ABSTRACT (stmt))) - return; - - /* Determine the "ultimate origin" of this block. This block may be an - inlined instance of an inlined instance of inline function, so we - have to trace all of the way back through the origin chain to find - out what sort of node actually served as the original seed for the - creation of the current block. */ - - origin = block_ultimate_origin (stmt); - origin_code = (origin != NULL) ? TREE_CODE (origin) : ERROR_MARK; - - /* Determine if we need to output any Dwarf DIEs at all to represent this - block. */ - - if (origin_code == FUNCTION_DECL) - /* The outer scopes for inlinings *must* always be represented. We - generate TAG_inlined_subroutine DIEs for them. (See below.) */ - must_output_die = 1; - else - { - /* In the case where the current block represents an inlining of the - "body block" of an inline function, we must *NOT* output any DIE - for this block because we have already output a DIE to represent - the whole inlined function scope and the "body block" of any - function doesn't really represent a different scope according to - ANSI C rules. So we check here to make sure that this block does - not represent a "body block inlining" before trying to set the - `must_output_die' flag. */ - - if (! is_body_block (origin ? origin : stmt)) - { - /* Determine if this block directly contains any "significant" - local declarations which we will need to output DIEs for. */ - - if (debug_info_level > DINFO_LEVEL_TERSE) - /* We are not in terse mode so *any* local declaration counts - as being a "significant" one. */ - must_output_die = (BLOCK_VARS (stmt) != NULL); - else - { - tree decl; - - /* We are in terse mode, so only local (nested) function - definitions count as "significant" local declarations. */ - - for (decl = BLOCK_VARS (stmt); decl; decl = TREE_CHAIN (decl)) - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl)) - { - must_output_die = 1; - break; - } - } - } - } - - /* It would be a waste of space to generate a Dwarf TAG_lexical_block - DIE for any block which contains no significant local declarations - at all. Rather, in such cases we just call `output_decls_for_scope' - so that any needed Dwarf info for any sub-blocks will get properly - generated. Note that in terse mode, our definition of what constitutes - a "significant" local declaration gets restricted to include only - inlined function instances and local (nested) function definitions. */ - - if (origin_code == FUNCTION_DECL && BLOCK_ABSTRACT (stmt)) - /* We don't care about an abstract inlined subroutine. */; - else if (must_output_die) - { - output_die ((origin_code == FUNCTION_DECL) - ? output_inlined_subroutine_die - : output_lexical_block_die, - stmt); - output_decls_for_scope (stmt, depth); - end_sibling_chain (); - } - else - output_decls_for_scope (stmt, depth); -} - -/* Output all of the decls declared within a given scope (also called - a `binding contour') and (recursively) all of it's sub-blocks. */ - -static void -output_decls_for_scope (tree stmt, int depth) -{ - /* Ignore blocks never really used to make RTL. */ - - if (! stmt || ! TREE_USED (stmt)) - return; - - /* Output the DIEs to represent all of the data objects, functions, - typedefs, and tagged types declared directly within this block - but not within any nested sub-blocks. */ - - { - tree decl; - - for (decl = BLOCK_VARS (stmt); decl; decl = TREE_CHAIN (decl)) - output_decl (decl, stmt); - } - - output_pending_types_for_scope (stmt); - - /* Output the DIEs to represent all sub-blocks (and the items declared - therein) of this block. */ - - { - tree subblocks; - - for (subblocks = BLOCK_SUBBLOCKS (stmt); - subblocks; - subblocks = BLOCK_CHAIN (subblocks)) - output_block (subblocks, depth + 1); - } -} - -/* Is this a typedef we can avoid emitting? */ - -static inline int -is_redundant_typedef (tree decl) -{ - if (TYPE_DECL_IS_STUB (decl)) - return 1; - if (DECL_ARTIFICIAL (decl) - && DECL_CONTEXT (decl) - && is_tagged_type (DECL_CONTEXT (decl)) - && TREE_CODE (TYPE_NAME (DECL_CONTEXT (decl))) == TYPE_DECL - && DECL_NAME (decl) == DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl)))) - /* Also ignore the artificial member typedef for the class name. */ - return 1; - return 0; -} - -/* Output Dwarf .debug information for a decl described by DECL. */ - -static void -output_decl (tree decl, tree containing_scope) -{ - /* Make a note of the decl node we are going to be working on. We may - need to give the user the source coordinates of where it appeared in - case we notice (later on) that something about it looks screwy. */ - - dwarf_last_decl = decl; - - if (TREE_CODE (decl) == ERROR_MARK) - return; - - /* If a structure is declared within an initialization, e.g. as the - operand of a sizeof, then it will not have a name. We don't want - to output a DIE for it, as the tree nodes are in the temporary obstack */ - - if ((TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE - || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE) - && ((DECL_NAME (decl) == 0 && TYPE_NAME (TREE_TYPE (decl)) == 0) - || (TYPE_FIELDS (TREE_TYPE (decl)) - && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK)))) - return; - - /* If this ..._DECL node is marked to be ignored, then ignore it. */ - - if (DECL_IGNORED_P (decl)) - return; - - switch (TREE_CODE (decl)) - { - case CONST_DECL: - /* The individual enumerators of an enum type get output when we - output the Dwarf representation of the relevant enum type itself. */ - break; - - case FUNCTION_DECL: - /* If we are in terse mode, don't output any DIEs to represent - mere function declarations. Also, if we are conforming - to the DWARF version 1 specification, don't output DIEs for - mere function declarations. */ - - if (DECL_INITIAL (decl) == NULL_TREE) -#if (DWARF_VERSION > 1) - if (debug_info_level <= DINFO_LEVEL_TERSE) -#endif - break; - - /* Before we describe the FUNCTION_DECL itself, make sure that we - have described its return type. */ - - output_type (TREE_TYPE (TREE_TYPE (decl)), containing_scope); - - { - /* And its containing type. */ - register tree origin = decl_class_context (decl); - if (origin) - output_type (origin, containing_scope); - } - - /* If we're emitting an out-of-line copy of an inline function, - set up to refer to the abstract instance emitted from - dwarfout_deferred_inline_function. */ - if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl) - && ! (containing_scope && TYPE_P (containing_scope))) - set_decl_origin_self (decl); - - /* If the following DIE will represent a function definition for a - function with "extern" linkage, output a special "pubnames" DIE - label just ahead of the actual DIE. A reference to this label - was already generated in the .debug_pubnames section sub-entry - for this function definition. */ - - if (TREE_PUBLIC (decl)) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number++); - ASM_OUTPUT_LABEL (asm_out_file, label); - } - - /* Now output a DIE to represent the function itself. */ - - output_die (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl) - ? output_global_subroutine_die - : output_local_subroutine_die, - decl); - - /* Now output descriptions of the arguments for this function. - This gets (unnecessarily?) complex because of the fact that - the DECL_ARGUMENT list for a FUNCTION_DECL doesn't indicate - cases where there was a trailing `...' at the end of the formal - parameter list. In order to find out if there was a trailing - ellipsis or not, we must instead look at the type associated - with the FUNCTION_DECL. This will be a node of type FUNCTION_TYPE. - If the chain of type nodes hanging off of this FUNCTION_TYPE node - ends with a void_type_node then there should *not* be an ellipsis - at the end. */ - - /* In the case where we are describing a mere function declaration, all - we need to do here (and all we *can* do here) is to describe - the *types* of its formal parameters. */ - - if (decl != current_function_decl || in_class) - output_formal_types (TREE_TYPE (decl)); - else - { - /* Generate DIEs to represent all known formal parameters. */ - - tree arg_decls = DECL_ARGUMENTS (decl); - tree parm; - - /* WARNING! Kludge zone ahead! Here we have a special - hack for svr4 SDB compatibility. Instead of passing the - current FUNCTION_DECL node as the second parameter (i.e. - the `containing_scope' parameter) to `output_decl' (as - we ought to) we instead pass a pointer to our own private - fake_containing_scope node. That node is a RECORD_TYPE - node which NO OTHER TYPE may ever actually be a member of. - - This pointer will ultimately get passed into `output_type' - as its `containing_scope' parameter. `Output_type' will - then perform its part in the hack... i.e. it will pend - the type of the formal parameter onto the pending_types - list. Later on, when we are done generating the whole - sequence of formal parameter DIEs for this function - definition, we will un-pend all previously pended types - of formal parameters for this function definition. - - This whole kludge prevents any type DIEs from being - mixed in with the formal parameter DIEs. That's good - because svr4 SDB believes that the list of formal - parameter DIEs for a function ends wherever the first - non-formal-parameter DIE appears. Thus, we have to - keep the formal parameter DIEs segregated. They must - all appear (consecutively) at the start of the list of - children for the DIE representing the function definition. - Then (and only then) may we output any additional DIEs - needed to represent the types of these formal parameters. - */ - - /* - When generating DIEs, generate the unspecified_parameters - DIE instead if we come across the arg "__builtin_va_alist" - */ - - for (parm = arg_decls; parm; parm = TREE_CHAIN (parm)) - if (TREE_CODE (parm) == PARM_DECL) - { - if (DECL_NAME(parm) && - !strcmp(IDENTIFIER_POINTER(DECL_NAME(parm)), - "__builtin_va_alist") ) - output_die (output_unspecified_parameters_die, decl); - else - output_decl (parm, fake_containing_scope); - } - - /* - Now that we have finished generating all of the DIEs to - represent the formal parameters themselves, force out - any DIEs needed to represent their types. We do this - simply by un-pending all previously pended types which - can legitimately go into the chain of children DIEs for - the current FUNCTION_DECL. - */ - - output_pending_types_for_scope (decl); - - /* - Decide whether we need an unspecified_parameters DIE at the end. - There are 2 more cases to do this for: - 1) the ansi ... declaration - this is detectable when the end - of the arg list is not a void_type_node - 2) an unprototyped function declaration (not a definition). This - just means that we have no info about the parameters at all. - */ - - { - tree fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl)); - - if (fn_arg_types) - { - /* This is the prototyped case, check for.... */ - if (TREE_VALUE (tree_last (fn_arg_types)) != void_type_node) - output_die (output_unspecified_parameters_die, decl); - } - else - { - /* This is unprototyped, check for undefined (just declaration). */ - if (!DECL_INITIAL (decl)) - output_die (output_unspecified_parameters_die, decl); - } - } - - /* Output Dwarf info for all of the stuff within the body of the - function (if it has one - it may be just a declaration). */ - - { - tree outer_scope = DECL_INITIAL (decl); - - if (outer_scope && TREE_CODE (outer_scope) != ERROR_MARK) - { - /* Note that here, `outer_scope' is a pointer to the outermost - BLOCK node created to represent a function. - This outermost BLOCK actually represents the outermost - binding contour for the function, i.e. the contour in which - the function's formal parameters and labels get declared. - - Curiously, it appears that the front end doesn't actually - put the PARM_DECL nodes for the current function onto the - BLOCK_VARS list for this outer scope. (They are strung - off of the DECL_ARGUMENTS list for the function instead.) - The BLOCK_VARS list for the `outer_scope' does provide us - with a list of the LABEL_DECL nodes for the function however, - and we output DWARF info for those here. - - Just within the `outer_scope' there will be a BLOCK node - representing the function's outermost pair of curly braces, - and any blocks used for the base and member initializers of - a C++ constructor function. */ - - output_decls_for_scope (outer_scope, 0); - - /* Finally, force out any pending types which are local to the - outermost block of this function definition. These will - all have a TYPE_CONTEXT which points to the FUNCTION_DECL - node itself. */ - - output_pending_types_for_scope (decl); - } - } - } - - /* Generate a terminator for the list of stuff `owned' by this - function. */ - - end_sibling_chain (); - - break; - - case TYPE_DECL: - /* If we are in terse mode, don't generate any DIEs to represent - any actual typedefs. Note that even when we are in terse mode, - we must still output DIEs to represent those tagged types which - are used (directly or indirectly) in the specification of either - a return type or a formal parameter type of some function. */ - - if (debug_info_level <= DINFO_LEVEL_TERSE) - if (! TYPE_DECL_IS_STUB (decl) - || (! TYPE_USED_FOR_FUNCTION (TREE_TYPE (decl)) && ! in_class)) - return; - - /* In the special case of a TYPE_DECL node representing - the declaration of some type tag, if the given TYPE_DECL is - marked as having been instantiated from some other (original) - TYPE_DECL node (e.g. one which was generated within the original - definition of an inline function) we have to generate a special - (abbreviated) TAG_structure_type, TAG_union_type, or - TAG_enumeration-type DIE here. */ - - if (TYPE_DECL_IS_STUB (decl) && DECL_ABSTRACT_ORIGIN (decl)) - { - output_tagged_type_instantiation (TREE_TYPE (decl)); - return; - } - - output_type (TREE_TYPE (decl), containing_scope); - - if (! is_redundant_typedef (decl)) - /* Output a DIE to represent the typedef itself. */ - output_die (output_typedef_die, decl); - break; - - case LABEL_DECL: - if (debug_info_level >= DINFO_LEVEL_NORMAL) - output_die (output_label_die, decl); - break; - - case VAR_DECL: - /* If we are conforming to the DWARF version 1 specification, don't - generated any DIEs to represent mere external object declarations. */ - -#if (DWARF_VERSION <= 1) - if (DECL_EXTERNAL (decl) && ! TREE_PUBLIC (decl)) - break; -#endif - - /* If we are in terse mode, don't generate any DIEs to represent - any variable declarations or definitions. */ - - if (debug_info_level <= DINFO_LEVEL_TERSE) - break; - - /* Output any DIEs that are needed to specify the type of this data - object. */ - - output_type (TREE_TYPE (decl), containing_scope); - - { - /* And its containing type. */ - register tree origin = decl_class_context (decl); - if (origin) - output_type (origin, containing_scope); - } - - /* If the following DIE will represent a data object definition for a - data object with "extern" linkage, output a special "pubnames" DIE - label just ahead of the actual DIE. A reference to this label - was already generated in the .debug_pubnames section sub-entry - for this data object definition. */ - - if (TREE_PUBLIC (decl) && ! DECL_ABSTRACT (decl)) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number++); - ASM_OUTPUT_LABEL (asm_out_file, label); - } - - /* Now output the DIE to represent the data object itself. This gets - complicated because of the possibility that the VAR_DECL really - represents an inlined instance of a formal parameter for an inline - function. */ - - { - void (*func) (void *); - register tree origin = decl_ultimate_origin (decl); - - if (origin != NULL && TREE_CODE (origin) == PARM_DECL) - func = output_formal_parameter_die; - else - { - if (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl)) - func = output_global_variable_die; - else - func = output_local_variable_die; - } - output_die (func, decl); - } - break; - - case FIELD_DECL: - /* Ignore the nameless fields that are used to skip bits. */ - if (DECL_NAME (decl) != 0) - { - output_type (member_declared_type (decl), containing_scope); - output_die (output_member_die, decl); - } - break; - - case PARM_DECL: - /* Force out the type of this formal, if it was not forced out yet. - Note that here we can run afoul of a bug in "classic" svr4 SDB. - It should be able to grok the presence of type DIEs within a list - of TAG_formal_parameter DIEs, but it doesn't. */ - - output_type (TREE_TYPE (decl), containing_scope); - output_die (output_formal_parameter_die, decl); - break; - - case NAMESPACE_DECL: - /* Ignore for now. */ - break; - - default: - abort (); - } -} - -/* Output debug information for a function. */ -static void -dwarfout_function_decl (tree decl) -{ - dwarfout_file_scope_decl (decl, 0); -} - -/* Debug information for a global DECL. Called from toplev.c after - compilation proper has finished. */ -static void -dwarfout_global_decl (tree decl) -{ - /* Output DWARF information for file-scope tentative data object - declarations, file-scope (extern) function declarations (which - had no corresponding body) and file-scope tagged type - declarations and definitions which have not yet been forced out. */ - - if (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) - dwarfout_file_scope_decl (decl, 1); -} - -/* DECL is an inline function, whose body is present, but which is not - being output at this point. (We're putting that off until we need - to do it.) */ -static void -dwarfout_deferred_inline_function (tree decl) -{ - /* Generate the DWARF info for the "abstract" instance of a function - which we may later generate inlined and/or out-of-line instances - of. */ - if ((DECL_INLINE (decl) || DECL_ABSTRACT (decl)) - && ! DECL_ABSTRACT_ORIGIN (decl)) - { - /* The front-end may not have set CURRENT_FUNCTION_DECL, but the - DWARF code expects it to be set in this case. Intuitively, - DECL is the function we just finished defining, so setting - CURRENT_FUNCTION_DECL is sensible. */ - tree saved_cfd = current_function_decl; - int was_abstract = DECL_ABSTRACT (decl); - current_function_decl = decl; - - /* Let the DWARF code do its work. */ - set_decl_abstract_flags (decl, 1); - dwarfout_file_scope_decl (decl, 0); - if (! was_abstract) - set_decl_abstract_flags (decl, 0); - - /* Reset CURRENT_FUNCTION_DECL. */ - current_function_decl = saved_cfd; - } -} - -static void -dwarfout_file_scope_decl (tree decl, int set_finalizing) -{ - if (TREE_CODE (decl) == ERROR_MARK) - return; - - /* If this ..._DECL node is marked to be ignored, then ignore it. */ - - if (DECL_IGNORED_P (decl)) - return; - - switch (TREE_CODE (decl)) - { - case FUNCTION_DECL: - - /* Ignore this FUNCTION_DECL if it refers to a builtin declaration of - a builtin function. Explicit programmer-supplied declarations of - these same functions should NOT be ignored however. */ - - if (DECL_EXTERNAL (decl) && DECL_FUNCTION_CODE (decl)) - return; - - /* What we would really like to do here is to filter out all mere - file-scope declarations of file-scope functions which are never - referenced later within this translation unit (and keep all of - ones that *are* referenced later on) but we aren't clairvoyant, - so we have no idea which functions will be referenced in the - future (i.e. later on within the current translation unit). - So here we just ignore all file-scope function declarations - which are not also definitions. If and when the debugger needs - to know something about these functions, it will have to hunt - around and find the DWARF information associated with the - *definition* of the function. - - Note that we can't just check `DECL_EXTERNAL' to find out which - FUNCTION_DECL nodes represent definitions and which ones represent - mere declarations. We have to check `DECL_INITIAL' instead. That's - because the C front-end supports some weird semantics for "extern - inline" function definitions. These can get inlined within the - current translation unit (an thus, we need to generate DWARF info - for their abstract instances so that the DWARF info for the - concrete inlined instances can have something to refer to) but - the compiler never generates any out-of-lines instances of such - things (despite the fact that they *are* definitions). The - important point is that the C front-end marks these "extern inline" - functions as DECL_EXTERNAL, but we need to generate DWARF for them - anyway. - - Note that the C++ front-end also plays some similar games for inline - function definitions appearing within include files which also - contain `#pragma interface' pragmas. */ - - if (DECL_INITIAL (decl) == NULL_TREE) - return; - - if (TREE_PUBLIC (decl) - && ! DECL_EXTERNAL (decl) - && ! DECL_ABSTRACT (decl)) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* Output a .debug_pubnames entry for a public function - defined in this compilation unit. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION); - sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, label); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, - IDENTIFIER_POINTER (DECL_NAME (decl))); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - break; - - case VAR_DECL: - - /* Ignore this VAR_DECL if it refers to a file-scope extern data - object declaration and if the declaration was never even - referenced from within this entire compilation unit. We - suppress these DIEs in order to save space in the .debug section - (by eliminating entries which are probably useless). Note that - we must not suppress block-local extern declarations (whether - used or not) because that would screw-up the debugger's name - lookup mechanism and cause it to miss things which really ought - to be in scope at a given point. */ - - if (DECL_EXTERNAL (decl) && !TREE_USED (decl)) - return; - - if (TREE_PUBLIC (decl) - && ! DECL_EXTERNAL (decl) - && GET_CODE (DECL_RTL (decl)) == MEM - && ! DECL_ABSTRACT (decl)) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - if (debug_info_level >= DINFO_LEVEL_NORMAL) - { - /* Output a .debug_pubnames entry for a public variable - defined in this compilation unit. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION); - sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, label); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, - IDENTIFIER_POINTER (DECL_NAME (decl))); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - if (DECL_INITIAL (decl) == NULL) - { - /* Output a .debug_aranges entry for a public variable - which is tentatively defined in this compilation unit. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, - (unsigned) int_size_in_bytes (TREE_TYPE (decl))); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - } - - /* If we are in terse mode, don't generate any DIEs to represent - any variable declarations or definitions. */ - - if (debug_info_level <= DINFO_LEVEL_TERSE) - return; - - break; - - case TYPE_DECL: - /* Don't bother trying to generate any DIEs to represent any of the - normal built-in types for the language we are compiling, except - in cases where the types in question are *not* DWARF fundamental - types. We make an exception in the case of non-fundamental types - for the sake of Objective-C (and perhaps C++) because the GNU - front-ends for these languages may in fact create certain "built-in" - types which are (for example) RECORD_TYPEs. In such cases, we - really need to output these (non-fundamental) types because other - DIEs may contain references to them. */ - - /* Also ignore language dependent types here, because they are probably - also built-in types. If we didn't ignore them, then we would get - references to undefined labels because output_type doesn't support - them. So, for now, we need to ignore them to avoid assembler - errors. */ - - /* ??? This code is different than the equivalent code in dwarf2out.c. - The dwarf2out.c code is probably more correct. */ - - if (DECL_SOURCE_LINE (decl) == 0 - && (type_is_fundamental (TREE_TYPE (decl)) - || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE)) - return; - - /* If we are in terse mode, don't generate any DIEs to represent - any actual typedefs. Note that even when we are in terse mode, - we must still output DIEs to represent those tagged types which - are used (directly or indirectly) in the specification of either - a return type or a formal parameter type of some function. */ - - if (debug_info_level <= DINFO_LEVEL_TERSE) - if (! TYPE_DECL_IS_STUB (decl) - || ! TYPE_USED_FOR_FUNCTION (TREE_TYPE (decl))) - return; - - break; - - default: - return; - } - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION); - finalizing = set_finalizing; - output_decl (decl, NULL_TREE); - - /* NOTE: The call above to `output_decl' may have caused one or more - file-scope named types (i.e. tagged types) to be placed onto the - pending_types_list. We have to get those types off of that list - at some point, and this is the perfect time to do it. If we didn't - take them off now, they might still be on the list when cc1 finally - exits. That might be OK if it weren't for the fact that when we put - types onto the pending_types_list, we set the TREE_ASM_WRITTEN flag - for these types, and that causes them never to be output unless - `output_pending_types_for_scope' takes them off of the list and un-sets - their TREE_ASM_WRITTEN flags. */ - - output_pending_types_for_scope (NULL_TREE); - - /* The above call should have totally emptied the pending_types_list - if this is not a nested function or class. If this is a nested type, - then the remaining pending_types will be emitted when the containing type - is handled. */ - - if (! DECL_CONTEXT (decl)) - { - if (pending_types != 0) - abort (); - } - - ASM_OUTPUT_POP_SECTION (asm_out_file); -} - -/* Output a marker (i.e. a label) for the beginning of the generated code - for a lexical block. */ - -static void -dwarfout_begin_block (unsigned int line ATTRIBUTE_UNUSED, - unsigned int blocknum) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - function_section (current_function_decl); - sprintf (label, BLOCK_BEGIN_LABEL_FMT, blocknum); - ASM_OUTPUT_LABEL (asm_out_file, label); -} - -/* Output a marker (i.e. a label) for the end of the generated code - for a lexical block. */ - -static void -dwarfout_end_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int blocknum) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - function_section (current_function_decl); - sprintf (label, BLOCK_END_LABEL_FMT, blocknum); - ASM_OUTPUT_LABEL (asm_out_file, label); -} - -/* Output a marker (i.e. a label) for the point in the generated code where - the real body of the function begins (after parameters have been moved - to their home locations). */ - -static void -dwarfout_end_prologue (unsigned int line ATTRIBUTE_UNUSED, - const char *file ATTRIBUTE_UNUSED) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - if (! use_gnu_debug_info_extensions) - return; - - function_section (current_function_decl); - sprintf (label, BODY_BEGIN_LABEL_FMT, current_function_funcdef_no); - ASM_OUTPUT_LABEL (asm_out_file, label); -} - -/* Output a marker (i.e. a label) for the point in the generated code where - the real body of the function ends (just before the epilogue code). */ - -static void -dwarfout_end_function (unsigned int line ATTRIBUTE_UNUSED) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - if (! use_gnu_debug_info_extensions) - return; - function_section (current_function_decl); - sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); - ASM_OUTPUT_LABEL (asm_out_file, label); -} - -/* Output a marker (i.e. a label) for the absolute end of the generated code - for a function definition. This gets called *after* the epilogue code - has been generated. */ - -static void -dwarfout_end_epilogue (unsigned int line ATTRIBUTE_UNUSED, - const char *file ATTRIBUTE_UNUSED) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* Output a label to mark the endpoint of the code generated for this - function. */ - - sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); - ASM_OUTPUT_LABEL (asm_out_file, label); -} - -static void -shuffle_filename_entry (filename_entry *new_zeroth) -{ - filename_entry temp_entry; - filename_entry *limit_p; - filename_entry *move_p; - - if (new_zeroth == &filename_table[0]) - return; - - temp_entry = *new_zeroth; - - /* Shift entries up in the table to make room at [0]. */ - - limit_p = &filename_table[0]; - for (move_p = new_zeroth; move_p > limit_p; move_p--) - *move_p = *(move_p-1); - - /* Install the found entry at [0]. */ - - filename_table[0] = temp_entry; -} - -/* Create a new (string) entry for the .debug_sfnames section. */ - -static void -generate_new_sfname_entry (void) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION); - sprintf (label, SFNAMES_ENTRY_LABEL_FMT, filename_table[0].number); - ASM_OUTPUT_LABEL (asm_out_file, label); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, - filename_table[0].name - ? filename_table[0].name - : ""); - ASM_OUTPUT_POP_SECTION (asm_out_file); -} - -/* Lookup a filename (in the list of filenames that we know about here in - dwarfout.c) and return its "index". The index of each (known) filename - is just a unique number which is associated with only that one filename. - We need such numbers for the sake of generating labels (in the - .debug_sfnames section) and references to those unique labels (in the - .debug_srcinfo and .debug_macinfo sections). - - If the filename given as an argument is not found in our current list, - add it to the list and assign it the next available unique index number. - - Whatever we do (i.e. whether we find a pre-existing filename or add a new - one), we shuffle the filename found (or added) up to the zeroth entry of - our list of filenames (which is always searched linearly). We do this so - as to optimize the most common case for these filename lookups within - dwarfout.c. The most common case by far is the case where we call - lookup_filename to lookup the very same filename that we did a lookup - on the last time we called lookup_filename. We make sure that this - common case is fast because such cases will constitute 99.9% of the - lookups we ever do (in practice). - - If we add a new filename entry to our table, we go ahead and generate - the corresponding entry in the .debug_sfnames section right away. - Doing so allows us to avoid tickling an assembler bug (present in some - m68k assemblers) which yields assembly-time errors in cases where the - difference of two label addresses is taken and where the two labels - are in a section *other* than the one where the difference is being - calculated, and where at least one of the two symbol references is a - forward reference. (This bug could be tickled by our .debug_srcinfo - entries if we don't output their corresponding .debug_sfnames entries - before them.) */ - -static unsigned -lookup_filename (const char *file_name) -{ - filename_entry *search_p; - filename_entry *limit_p = &filename_table[ft_entries]; - - for (search_p = filename_table; search_p < limit_p; search_p++) - if (!strcmp (file_name, search_p->name)) - { - /* When we get here, we have found the filename that we were - looking for in the filename_table. Now we want to make sure - that it gets moved to the zero'th entry in the table (if it - is not already there) so that subsequent attempts to find the - same filename will find it as quickly as possible. */ - - shuffle_filename_entry (search_p); - return filename_table[0].number; - } - - /* We come here whenever we have a new filename which is not registered - in the current table. Here we add it to the table. */ - - /* Prepare to add a new table entry by making sure there is enough space - in the table to do so. If not, expand the current table. */ - - if (ft_entries == ft_entries_allocated) - { - ft_entries_allocated += FT_ENTRIES_INCREMENT; - filename_table - = xrealloc (filename_table, - ft_entries_allocated * sizeof (filename_entry)); - } - - /* Initially, add the new entry at the end of the filename table. */ - - filename_table[ft_entries].number = ft_entries; - filename_table[ft_entries].name = xstrdup (file_name); - - /* Shuffle the new entry into filename_table[0]. */ - - shuffle_filename_entry (&filename_table[ft_entries]); - - if (debug_info_level >= DINFO_LEVEL_NORMAL) - generate_new_sfname_entry (); - - ft_entries++; - return filename_table[0].number; -} - -static void -generate_srcinfo_entry (unsigned int line_entry_num, unsigned int files_entry_num) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION); - sprintf (label, LINE_ENTRY_LABEL_FMT, line_entry_num); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, LINE_BEGIN_LABEL); - sprintf (label, SFNAMES_ENTRY_LABEL_FMT, files_entry_num); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, SFNAMES_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); -} - -static void -dwarfout_source_line (unsigned int line, const char *filename) -{ - if (debug_info_level >= DINFO_LEVEL_NORMAL - /* We can't emit line number info for functions in separate sections, - because the assembler can't subtract labels in different sections. */ - && DECL_SECTION_NAME (current_function_decl) == NULL_TREE) - { - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - static unsigned last_line_entry_num = 0; - static unsigned prev_file_entry_num = (unsigned) -1; - unsigned this_file_entry_num; - - function_section (current_function_decl); - sprintf (label, LINE_CODE_LABEL_FMT, ++last_line_entry_num); - ASM_OUTPUT_LABEL (asm_out_file, label); - - fputc ('\n', asm_out_file); - - if (use_gnu_debug_info_extensions) - this_file_entry_num = lookup_filename (filename); - else - this_file_entry_num = (unsigned) -1; - - ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION); - if (this_file_entry_num != prev_file_entry_num) - { - char line_entry_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - sprintf (line_entry_label, LINE_ENTRY_LABEL_FMT, last_line_entry_num); - ASM_OUTPUT_LABEL (asm_out_file, line_entry_label); - } - - { - const char *tail = strrchr (filename, '/'); - - if (tail != NULL) - filename = tail; - } - - dw2_asm_output_data (4, line, "%s:%u", filename, line); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0xffff); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, TEXT_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (this_file_entry_num != prev_file_entry_num) - generate_srcinfo_entry (last_line_entry_num, this_file_entry_num); - prev_file_entry_num = this_file_entry_num; - } -} - -/* Generate an entry in the .debug_macinfo section. */ - -static void -generate_macinfo_entry (unsigned int type, rtx offset, const char *string) -{ - if (! use_gnu_debug_info_extensions) - return; - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); - assemble_integer (gen_rtx_PLUS (SImode, GEN_INT (type << 24), offset), - 4, BITS_PER_UNIT, 1); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, string); - ASM_OUTPUT_POP_SECTION (asm_out_file); -} - -/* Wrapper for toplev.c callback to check debug info level. */ -static void -dwarfout_start_source_file_check (unsigned int line, const char *filename) -{ - if (debug_info_level == DINFO_LEVEL_VERBOSE) - dwarfout_start_source_file (line, filename); -} - -static void -dwarfout_start_source_file (unsigned int line ATTRIBUTE_UNUSED, - const char *filename) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - const char *label1, *label2; - - sprintf (label, SFNAMES_ENTRY_LABEL_FMT, lookup_filename (filename)); - label1 = (*label == '*') + label; - label2 = (*SFNAMES_BEGIN_LABEL == '*') + SFNAMES_BEGIN_LABEL; - generate_macinfo_entry (MACINFO_start, - gen_rtx_MINUS (Pmode, - gen_rtx_SYMBOL_REF (Pmode, label1), - gen_rtx_SYMBOL_REF (Pmode, label2)), - ""); -} - -/* Wrapper for toplev.c callback to check debug info level. */ -static void -dwarfout_end_source_file_check (unsigned int lineno) -{ - if (debug_info_level == DINFO_LEVEL_VERBOSE) - dwarfout_end_source_file (lineno); -} - -static void -dwarfout_end_source_file (unsigned int lineno) -{ - generate_macinfo_entry (MACINFO_resume, GEN_INT (lineno), ""); -} - -/* Called from check_newline in c-parse.y. The `buffer' parameter - contains the tail part of the directive line, i.e. the part which - is past the initial whitespace, #, whitespace, directive-name, - whitespace part. */ - -static void -dwarfout_define (unsigned int lineno, const char *buffer) -{ - static int initialized = 0; - - if (!initialized) - { - dwarfout_start_source_file (0, primary_filename); - initialized = 1; - } - generate_macinfo_entry (MACINFO_define, GEN_INT (lineno), buffer); -} - -/* Called from check_newline in c-parse.y. The `buffer' parameter - contains the tail part of the directive line, i.e. the part which - is past the initial whitespace, #, whitespace, directive-name, - whitespace part. */ - -static void -dwarfout_undef (unsigned int lineno, const char *buffer) -{ - generate_macinfo_entry (MACINFO_undef, GEN_INT (lineno), buffer); -} - -/* Set up for Dwarf output at the start of compilation. */ - -static void -dwarfout_init (const char *main_input_filename) -{ - warning ("support for the DWARF1 debugging format is deprecated"); - - /* Remember the name of the primary input file. */ - - primary_filename = main_input_filename; - - /* Allocate the initial hunk of the pending_sibling_stack. */ - - pending_sibling_stack - = xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned)); - pending_siblings_allocated = PENDING_SIBLINGS_INCREMENT; - pending_siblings = 1; - - /* Allocate the initial hunk of the filename_table. */ - - filename_table = xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry)); - ft_entries_allocated = FT_ENTRIES_INCREMENT; - ft_entries = 0; - - /* Allocate the initial hunk of the pending_types_list. */ - - pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree)); - pending_types_allocated = PENDING_TYPES_INCREMENT; - pending_types = 0; - - /* Create an artificial RECORD_TYPE node which we can use in our hack - to get the DIEs representing types of formal parameters to come out - only *after* the DIEs for the formal parameters themselves. */ - - fake_containing_scope = make_node (RECORD_TYPE); - - /* Output a starting label for the .text section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, TEXT_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, TEXT_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - /* Output a starting label for the .data section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, DATA_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - -#if 0 /* GNU C doesn't currently use .data1. */ - /* Output a starting label for the .data1 section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA1_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, DATA1_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); -#endif - - /* Output a starting label for the .rodata section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, RODATA_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - -#if 0 /* GNU C doesn't currently use .rodata1. */ - /* Output a starting label for the .rodata1 section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA1_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, RODATA1_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); -#endif - - /* Output a starting label for the .bss section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, BSS_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, BSS_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (debug_info_level >= DINFO_LEVEL_NORMAL) - { - if (use_gnu_debug_info_extensions) - { - /* Output a starting label and an initial (compilation directory) - entry for the .debug_sfnames section. The starting label will be - referenced by the initial entry in the .debug_srcinfo section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL); - { - const char *pwd = get_src_pwd (); - char *dirname; - - if (!pwd) - fatal_error ("can't get current directory: %m"); - - dirname = concat (pwd, "/", NULL); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname); - free (dirname); - } - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - if (debug_info_level >= DINFO_LEVEL_VERBOSE - && use_gnu_debug_info_extensions) - { - /* Output a starting label for the .debug_macinfo section. This - label will be referenced by the AT_mac_info attribute in the - TAG_compile_unit DIE. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, MACINFO_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - /* Generate the initial entry for the .line section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, LINE_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, LINE_END_LABEL, LINE_BEGIN_LABEL); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (use_gnu_debug_info_extensions) - { - /* Generate the initial entry for the .debug_srcinfo section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, SRCINFO_BEGIN_LABEL); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, LINE_BEGIN_LABEL); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, SFNAMES_BEGIN_LABEL); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_END_LABEL); -#ifdef DWARF_TIMESTAMPS - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, time (NULL)); -#else - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, -1); -#endif - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - /* Generate the initial entry for the .debug_pubnames section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, DEBUG_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - /* Generate the initial entry for the .debug_aranges section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, - DEBUG_ARANGES_END_LABEL, - DEBUG_ARANGES_BEGIN_LABEL); - ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 1); - ASM_OUTPUT_DWARF_ADDR (asm_out_file, DEBUG_BEGIN_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - /* Setup first DIE number == 1. */ - NEXT_DIE_NUM = next_unused_dienum++; - - /* Generate the initial DIE for the .debug section. Note that the - (string) value given in the AT_name attribute of the TAG_compile_unit - DIE will (typically) be a relative pathname and that this pathname - should be taken as being relative to the directory from which the - compiler was invoked when the given (base) source file was compiled. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, DEBUG_BEGIN_LABEL); - output_die (output_compile_unit_die, (void *) main_input_filename); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - fputc ('\n', asm_out_file); -} - -/* Output stuff that dwarf requires at the end of every file. */ - -static void -dwarfout_finish (const char *main_input_filename ATTRIBUTE_UNUSED) -{ - char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION); - retry_incomplete_types (); - fputc ('\n', asm_out_file); - - /* Mark the end of the chain of siblings which represent all file-scope - declarations in this compilation unit. */ - - /* The (null) DIE which represents the terminator for the (sibling linked) - list of file-scope items is *special*. Normally, we would just call - end_sibling_chain at this point in order to output a word with the - value `4' and that word would act as the terminator for the list of - DIEs describing file-scope items. Unfortunately, if we were to simply - do that, the label that would follow this DIE in the .debug section - (i.e. `..D2') would *not* be properly aligned (as it must be on some - machines) to a 4 byte boundary. - - In order to force the label `..D2' to get aligned to a 4 byte boundary, - the trick used is to insert extra (otherwise useless) padding bytes - into the (null) DIE that we know must precede the ..D2 label in the - .debug section. The amount of padding required can be anywhere between - 0 and 3 bytes. The length word at the start of this DIE (i.e. the one - with the padding) would normally contain the value 4, but now it will - also have to include the padding bytes, so it will instead have some - value in the range 4..7. - - Fortunately, the rules of Dwarf say that any DIE whose length word - contains *any* value less than 8 should be treated as a null DIE, so - this trick works out nicely. Clever, eh? Don't give me any credit - (or blame). I didn't think of this scheme. I just conformed to it. - */ - - output_die (output_padded_null_die, (void *) 0); - dienum_pop (); - - sprintf (label, DIE_BEGIN_LABEL_FMT, NEXT_DIE_NUM); - ASM_OUTPUT_LABEL (asm_out_file, label); /* should be ..D2 */ - ASM_OUTPUT_POP_SECTION (asm_out_file); - - /* Output a terminator label for the .text section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, TEXT_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, TEXT_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - /* Output a terminator label for the .data section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, DATA_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - -#if 0 /* GNU C doesn't currently use .data1. */ - /* Output a terminator label for the .data1 section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA1_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, DATA1_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); -#endif - - /* Output a terminator label for the .rodata section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, RODATA_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - -#if 0 /* GNU C doesn't currently use .rodata1. */ - /* Output a terminator label for the .rodata1 section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA1_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, RODATA1_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); -#endif - - /* Output a terminator label for the .bss section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, BSS_SECTION_NAME); - ASM_OUTPUT_LABEL (asm_out_file, BSS_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (debug_info_level >= DINFO_LEVEL_NORMAL) - { - /* Output a terminating entry for the .line section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, LINE_LAST_ENTRY_LABEL); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0xffff); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, TEXT_END_LABEL, TEXT_BEGIN_LABEL); - ASM_OUTPUT_LABEL (asm_out_file, LINE_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (use_gnu_debug_info_extensions) - { - /* Output a terminating entry for the .debug_srcinfo section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, - LINE_LAST_ENTRY_LABEL, LINE_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, -1); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - if (debug_info_level >= DINFO_LEVEL_VERBOSE) - { - /* Output terminating entries for the .debug_macinfo section. */ - - dwarfout_end_source_file (0); - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - /* Generate the terminating entry for the .debug_pubnames section. */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, ""); - ASM_OUTPUT_POP_SECTION (asm_out_file); - - /* Generate the terminating entries for the .debug_aranges section. - - Note that we want to do this only *after* we have output the end - labels (for the various program sections) which we are going to - refer to here. This allows us to work around a bug in the m68k - svr4 assembler. That assembler gives bogus assembly-time errors - if (within any given section) you try to take the difference of - two relocatable symbols, both of which are located within some - other section, and if one (or both?) of the symbols involved is - being forward-referenced. By generating the .debug_aranges - entries at this late point in the assembly output, we skirt the - issue simply by avoiding forward-references. - */ - - fputc ('\n', asm_out_file); - ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION); - - ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, TEXT_END_LABEL, TEXT_BEGIN_LABEL); - - ASM_OUTPUT_DWARF_ADDR (asm_out_file, DATA_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, DATA_END_LABEL, DATA_BEGIN_LABEL); - -#if 0 /* GNU C doesn't currently use .data1. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, DATA1_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, DATA1_END_LABEL, - DATA1_BEGIN_LABEL); -#endif - - ASM_OUTPUT_DWARF_ADDR (asm_out_file, RODATA_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, RODATA_END_LABEL, - RODATA_BEGIN_LABEL); - -#if 0 /* GNU C doesn't currently use .rodata1. */ - ASM_OUTPUT_DWARF_ADDR (asm_out_file, RODATA1_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, RODATA1_END_LABEL, - RODATA1_BEGIN_LABEL); -#endif - - ASM_OUTPUT_DWARF_ADDR (asm_out_file, BSS_BEGIN_LABEL); - ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, BSS_END_LABEL, BSS_BEGIN_LABEL); - - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0); - - ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_END_LABEL); - ASM_OUTPUT_POP_SECTION (asm_out_file); - } - - /* There should not be any pending types left at the end. We need - this now because it may not have been checked on the last call to - dwarfout_file_scope_decl. */ - if (pending_types != 0) - abort (); -} - -#endif /* DWARF_DEBUGGING_INFO */ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 1f355e8a400..6558fa73fe9 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -77,7 +77,7 @@ static GTY(()) int label_num = 1; static int last_label_num; -/* Value label_num had when set_new_first_and_last_label_number was called. +/* Value label_num had when set_new_last_label_num was called. If label_num has not changed since then, last_label_num is valid. */ static int base_label_num; @@ -180,7 +180,6 @@ static rtx make_jump_insn_raw (rtx); static rtx make_call_insn_raw (rtx); static rtx find_line_note (rtx); static rtx change_address_1 (rtx, enum machine_mode, rtx, int); -static void unshare_all_rtl_1 (rtx); static void unshare_all_decls (tree); static void reset_used_decls (tree); static void mark_label_nuses (rtx); @@ -199,6 +198,7 @@ static reg_attrs *get_reg_attrs (tree, int); static tree component_ref_for_mem_expr (tree); static rtx gen_const_vector_0 (enum machine_mode); static rtx gen_complex_constant_part (enum machine_mode, rtx, int); +static void copy_rtx_if_shared_1 (rtx *orig); /* Probability of the conditional branch currently proceeded by try_split. Set to -1 otherwise. */ @@ -971,7 +971,7 @@ mark_reg_pointer (rtx reg, int align) REGNO_POINTER_ALIGN (REGNO (reg)) = align; } else if (align && align < REGNO_POINTER_ALIGN (REGNO (reg))) - /* We can no-longer be sure just how aligned this pointer is */ + /* We can no-longer be sure just how aligned this pointer is. */ REGNO_POINTER_ALIGN (REGNO (reg)) = align; } @@ -1323,7 +1323,7 @@ subreg_realpart_p (rtx x) abort (); return ((unsigned int) SUBREG_BYTE (x) - < GET_MODE_UNIT_SIZE (GET_MODE (SUBREG_REG (x)))); + < (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (SUBREG_REG (x)))); } /* Assuming that X is an rtx (e.g., MEM, REG or SUBREG) for a value, @@ -1356,6 +1356,8 @@ gen_lowpart (enum machine_mode mode, rtx x) /* The following exposes the use of "x" to CSE. */ if (GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD && SCALAR_INT_MODE_P (GET_MODE (x)) + && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), + GET_MODE_BITSIZE (GET_MODE (x))) && ! no_new_pseudos) return gen_lowpart (mode, force_reg (GET_MODE (x), x)); @@ -1389,7 +1391,7 @@ gen_highpart (enum machine_mode mode, rtx x) /* This case loses if X is a subreg. To catch bugs early, complain if an invalid MODE is used even in other cases. */ if (msize > UNITS_PER_WORD - && msize != GET_MODE_UNIT_SIZE (GET_MODE (x))) + && msize != (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (x))) abort (); result = simplify_gen_subreg (mode, x, GET_MODE (x), @@ -1825,6 +1827,8 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, return; type = TYPE_P (t) ? t : TREE_TYPE (t); + if (type == error_mark_node) + return; /* If we have already set DECL_RTL = ref, get_alias_set will get the wrong answer, as it assumes that DECL_RTL already has the right alias @@ -2402,17 +2406,6 @@ set_new_first_and_last_insn (rtx first, rtx last) cur_insn_uid++; } -/* Set the range of label numbers found in the current function. - This is used when belatedly compiling an inline function. */ - -void -set_new_first_and_last_label_num (int first, int last) -{ - base_label_num = label_num; - first_label_num = first; - last_label_num = last; -} - /* Set the last label number found in the current function. This is used when belatedly compiling an inline function. */ @@ -2448,7 +2441,7 @@ unshare_all_rtl (tree fndecl, rtx insn) unshare_all_decls (DECL_INITIAL (fndecl)); /* Unshare just about everything else. */ - unshare_all_rtl_1 (insn); + unshare_all_rtl_in_chain (insn); /* Make sure the addresses of stack slots found outside the insn chain (such as, in DECL_RTL of a variable) are not shared @@ -2490,11 +2483,138 @@ unshare_all_rtl_again (rtx insn) unshare_all_rtl (cfun->decl, insn); } +/* Check that ORIG is not marked when it should not be and mark ORIG as in use, + Recursively does the same for subexpressions. */ + +static void +verify_rtx_sharing (rtx orig, rtx insn) +{ + rtx x = orig; + int i; + enum rtx_code code; + const char *format_ptr; + + if (x == 0) + return; + + code = GET_CODE (x); + + /* These types may be freely shared. */ + + switch (code) + { + case REG: + case QUEUED: + case CONST_INT: + case CONST_DOUBLE: + case CONST_VECTOR: + case SYMBOL_REF: + case LABEL_REF: + case CODE_LABEL: + case PC: + case CC0: + case SCRATCH: + /* SCRATCH must be shared because they represent distinct values. */ + return; + + case CONST: + /* CONST can be shared if it contains a SYMBOL_REF. If it contains + a LABEL_REF, it isn't sharable. */ + if (GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) + return; + break; + + case MEM: + /* A MEM is allowed to be shared if its address is constant. */ + if (CONSTANT_ADDRESS_P (XEXP (x, 0)) + || reload_completed || reload_in_progress) + return; + + break; + + default: + break; + } + + /* This rtx may not be shared. If it has already been seen, + replace it with a copy of itself. */ + + if (RTX_FLAG (x, used)) + { + error ("Invalid rtl sharing found in the insn"); + debug_rtx (insn); + error ("Shared rtx"); + debug_rtx (x); + abort (); + } + RTX_FLAG (x, used) = 1; + + /* Now scan the subexpressions recursively. */ + + format_ptr = GET_RTX_FORMAT (code); + + for (i = 0; i < GET_RTX_LENGTH (code); i++) + { + switch (*format_ptr++) + { + case 'e': + verify_rtx_sharing (XEXP (x, i), insn); + break; + + case 'E': + if (XVEC (x, i) != NULL) + { + int j; + int len = XVECLEN (x, i); + + for (j = 0; j < len; j++) + { + /* We allow sharing of ASM_OPERANDS inside single instruction. */ + if (j && GET_CODE (XVECEXP (x, i, j)) == SET + && GET_CODE (SET_SRC (XVECEXP (x, i, j))) == ASM_OPERANDS) + verify_rtx_sharing (SET_DEST (XVECEXP (x, i, j)), insn); + else + verify_rtx_sharing (XVECEXP (x, i, j), insn); + } + } + break; + } + } + return; +} + +/* Go through all the RTL insn bodies and check that there is no unexpected + sharing in between the subexpressions. */ + +void +verify_rtl_sharing (void) +{ + rtx p; + + for (p = get_insns (); p; p = NEXT_INSN (p)) + if (INSN_P (p)) + { + reset_used_flags (PATTERN (p)); + reset_used_flags (REG_NOTES (p)); + reset_used_flags (LOG_LINKS (p)); + } + + for (p = get_insns (); p; p = NEXT_INSN (p)) + if (INSN_P (p)) + { + verify_rtx_sharing (PATTERN (p), p); + verify_rtx_sharing (REG_NOTES (p), p); + verify_rtx_sharing (LOG_LINKS (p), p); + } +} + /* Go through all the RTL insn bodies and copy any invalid shared structure. Assumes the mark bits are cleared at entry. */ -static void -unshare_all_rtl_1 (rtx insn) +void +unshare_all_rtl_in_chain (rtx insn) { for (; insn; insn = NEXT_INSN (insn)) if (INSN_P (insn)) @@ -2640,19 +2760,36 @@ copy_most_rtx (rtx orig, rtx may_share) } /* Mark ORIG as in use, and return a copy of it if it was already in use. - Recursively does the same for subexpressions. */ + Recursively does the same for subexpressions. Uses + copy_rtx_if_shared_1 to reduce stack space. */ rtx copy_rtx_if_shared (rtx orig) { - rtx x = orig; + copy_rtx_if_shared_1 (&orig); + return orig; +} + +/* Mark *ORIG1 as in use, and set it to a copy of it if it was already in + use. Recursively does the same for subexpressions. */ + +static void +copy_rtx_if_shared_1 (rtx *orig1) +{ + rtx x; int i; enum rtx_code code; + rtx *last_ptr; const char *format_ptr; int copied = 0; + int length; + + /* Repeat is used to turn tail-recursion into iteration. */ +repeat: + x = *orig1; if (x == 0) - return 0; + return; code = GET_CODE (x); @@ -2666,12 +2803,13 @@ copy_rtx_if_shared (rtx orig) case CONST_DOUBLE: case CONST_VECTOR: case SYMBOL_REF: + case LABEL_REF: case CODE_LABEL: case PC: case CC0: case SCRATCH: /* SCRATCH must be shared because they represent distinct values. */ - return x; + return; case CONST: /* CONST can be shared if it contains a SYMBOL_REF. If it contains @@ -2679,7 +2817,7 @@ copy_rtx_if_shared (rtx orig) if (GET_CODE (XEXP (x, 0)) == PLUS && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) - return x; + return; break; case INSN: @@ -2688,21 +2826,7 @@ copy_rtx_if_shared (rtx orig) case NOTE: case BARRIER: /* The chain of insns is not being copied. */ - return x; - - case MEM: - /* A MEM is allowed to be shared if its address is constant. - - We used to allow sharing of MEMs which referenced - virtual_stack_vars_rtx or virtual_incoming_args_rtx, but - that can lose. instantiate_virtual_regs will not unshare - the MEMs, and combine may change the structure of the address - because it looks safe and profitable in one context, but - in some other context it creates unrecognizable RTL. */ - if (CONSTANT_ADDRESS_P (XEXP (x, 0))) - return x; - - break; + return; default: break; @@ -2728,13 +2852,17 @@ copy_rtx_if_shared (rtx orig) must be copied if X was copied. */ format_ptr = GET_RTX_FORMAT (code); - - for (i = 0; i < GET_RTX_LENGTH (code); i++) + length = GET_RTX_LENGTH (code); + last_ptr = NULL; + + for (i = 0; i < length; i++) { switch (*format_ptr++) { case 'e': - XEXP (x, i) = copy_rtx_if_shared (XEXP (x, i)); + if (last_ptr) + copy_rtx_if_shared_1 (last_ptr); + last_ptr = &XEXP (x, i); break; case 'E': @@ -2742,16 +2870,30 @@ copy_rtx_if_shared (rtx orig) { int j; int len = XVECLEN (x, i); - + + /* Copy the vector iff I copied the rtx and the length + is nonzero. */ if (copied && len > 0) XVEC (x, i) = gen_rtvec_v (len, XVEC (x, i)->elem); + + /* Call recsusively on all inside the vector. */ for (j = 0; j < len; j++) - XVECEXP (x, i, j) = copy_rtx_if_shared (XVECEXP (x, i, j)); + { + if (last_ptr) + copy_rtx_if_shared_1 (last_ptr); + last_ptr = &XVECEXP (x, i, j); + } } break; } } - return x; + *orig1 = x; + if (last_ptr) + { + orig1 = last_ptr; + goto repeat; + } + return; } /* Clear all the USED bits in X to allow copy_rtx_if_shared to be used @@ -2763,7 +2905,10 @@ reset_used_flags (rtx x) int i, j; enum rtx_code code; const char *format_ptr; + int length; + /* Repeat is used to turn tail-recursion into iteration. */ +repeat: if (x == 0) return; @@ -2801,11 +2946,18 @@ reset_used_flags (rtx x) RTX_FLAG (x, used) = 0; format_ptr = GET_RTX_FORMAT (code); - for (i = 0; i < GET_RTX_LENGTH (code); i++) + length = GET_RTX_LENGTH (code); + + for (i = 0; i < length; i++) { switch (*format_ptr++) { case 'e': + if (i == length-1) + { + x = XEXP (x, i); + goto repeat; + } reset_used_flags (XEXP (x, i)); break; @@ -2816,6 +2968,69 @@ reset_used_flags (rtx x) } } } + +/* Set all the USED bits in X to allow copy_rtx_if_shared to be used + to look for shared sub-parts. */ + +void +set_used_flags (rtx x) +{ + int i, j; + enum rtx_code code; + const char *format_ptr; + + if (x == 0) + return; + + code = GET_CODE (x); + + /* These types may be freely shared so we needn't do any resetting + for them. */ + + switch (code) + { + case REG: + case QUEUED: + case CONST_INT: + case CONST_DOUBLE: + case CONST_VECTOR: + case SYMBOL_REF: + case CODE_LABEL: + case PC: + case CC0: + return; + + case INSN: + case JUMP_INSN: + case CALL_INSN: + case NOTE: + case LABEL_REF: + case BARRIER: + /* The chain of insns is not being copied. */ + return; + + default: + break; + } + + RTX_FLAG (x, used) = 1; + + format_ptr = GET_RTX_FORMAT (code); + for (i = 0; i < GET_RTX_LENGTH (code); i++) + { + switch (*format_ptr++) + { + case 'e': + set_used_flags (XEXP (x, i)); + break; + + case 'E': + for (j = 0; j < XVECLEN (x, i); j++) + set_used_flags (XVECEXP (x, i, j)); + break; + } + } +} /* Copy X if necessary so that it won't be altered by changes in OTHER. Return X or the rtx for the pseudo reg the value of X was copied into. @@ -3582,12 +3797,12 @@ add_insn_after (rtx insn, rtx after) bb->flags |= BB_DIRTY; /* Should not happen as first in the BB is always either NOTE or LABEL. */ - if (bb->end == after + if (BB_END (bb) == after /* Avoid clobbering of structure when creating new BB. */ && GET_CODE (insn) != BARRIER && (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)) - bb->end = insn; + BB_END (bb) = insn; } NEXT_INSN (after) = insn; @@ -3650,7 +3865,7 @@ add_insn_before (rtx insn, rtx before) bb->flags |= BB_DIRTY; /* Should not happen as first in the BB is always either NOTE or LABEl. */ - if (bb->head == insn + if (BB_HEAD (bb) == insn /* Avoid clobbering of structure when creating new BB. */ && GET_CODE (insn) != BARRIER && (GET_CODE (insn) != NOTE @@ -3725,16 +3940,16 @@ remove_insn (rtx insn) { if (INSN_P (insn)) bb->flags |= BB_DIRTY; - if (bb->head == insn) + if (BB_HEAD (bb) == insn) { /* Never ever delete the basic block note without deleting whole basic block. */ if (GET_CODE (insn) == NOTE) abort (); - bb->head = next; + BB_HEAD (bb) = next; } - if (bb->end == insn) - bb->end = prev; + if (BB_END (bb) == insn) + BB_END (bb) = prev; } } @@ -3827,13 +4042,13 @@ reorder_insns (rtx from, rtx to, rtx after) if (GET_CODE (from) != BARRIER && (bb2 = BLOCK_FOR_INSN (from))) { - if (bb2->end == to) - bb2->end = prev; + if (BB_END (bb2) == to) + BB_END (bb2) = prev; bb2->flags |= BB_DIRTY; } - if (bb->end == after) - bb->end = to; + if (BB_END (bb) == after) + BB_END (bb) = to; for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x)) set_block_for_insn (x, bb); @@ -4222,8 +4437,8 @@ emit_insn_after_1 (rtx first, rtx after) set_block_for_insn (last, bb); if (GET_CODE (last) != BARRIER) set_block_for_insn (last, bb); - if (bb->end == after) - bb->end = last; + if (BB_END (bb) == after) + BB_END (bb) = last; } else for (last = first; NEXT_INSN (last); last = NEXT_INSN (last)) diff --git a/gcc/et-forest.c b/gcc/et-forest.c index ffdce1d76bd..ea7793f83b3 100644 --- a/gcc/et-forest.c +++ b/gcc/et-forest.c @@ -30,638 +30,714 @@ Boston, MA 02111-1307, USA. #include "et-forest.h" #include "alloc-pool.h" -struct et_forest_occurrence; -typedef struct et_forest_occurrence* et_forest_occurrence_t; +/* We do not enable this with ENABLE_CHECKING, since it is awfully slow. */ +#undef DEBUG_ET -/* The ET-forest type. */ -struct et_forest -{ - /* Linked list of nodes is used to destroy the structure. */ - int nnodes; - alloc_pool node_pool; - alloc_pool occur_pool; -}; +#ifdef DEBUG_ET +#include "basic-block.h" +#endif -/* Single occurrence of node in ET-forest. - A single node may have multiple occurrences. - */ -struct et_forest_occurrence +/* The occurence of a node in the et tree. */ +struct et_occ { - /* Parent in the splay-tree. */ - et_forest_occurrence_t parent; + struct et_node *of; /* The node. */ + + struct et_occ *parent; /* Parent in the splay-tree. */ + struct et_occ *prev; /* Left son in the splay-tree. */ + struct et_occ *next; /* Right son in the splay-tree. */ + + int depth; /* The depth of the node is the sum of depth + fields on the path to the root. */ + int min; /* The minimum value of the depth in the subtree + is obtained by adding sum of depth fields + on the path to the root. */ + struct et_occ *min_occ; /* The occurence in the subtree with the minimal + depth. */ +}; - /* Children in the splay-tree. */ - et_forest_occurrence_t left, right; +static alloc_pool et_nodes; +static alloc_pool et_occurences; - /* Counts of vertices in the two splay-subtrees. */ - int count_left, count_right; +/* Changes depth of OCC to D. */ - /* Next occurrence of this node in the sequence. */ - et_forest_occurrence_t next; +static inline void +set_depth (struct et_occ *occ, int d) +{ + if (!occ) + return; - /* The node, which this occurrence is of. */ - et_forest_node_t node; -}; + occ->min += d - occ->depth; + occ->depth = d; +} +/* Adds D to the depth of OCC. */ -/* ET-forest node. */ -struct et_forest_node +static inline void +set_depth_add (struct et_occ *occ, int d) { - et_forest_t forest; - void *value; - - /* First and last occurrence of this node in the sequence. */ - et_forest_occurrence_t first, last; -}; + if (!occ) + return; + occ->min += d; + occ->depth += d; +} -static et_forest_occurrence_t splay (et_forest_occurrence_t); -static void remove_all_occurrences (et_forest_t, et_forest_node_t); -static inline et_forest_occurrence_t find_leftmost_node - (et_forest_occurrence_t); -static inline et_forest_occurrence_t find_rightmost_node - (et_forest_occurrence_t); -static int calculate_value (et_forest_occurrence_t); +/* Sets prev field of OCC to P. */ -/* Return leftmost node present in the tree roted by OCC. */ -static inline et_forest_occurrence_t -find_leftmost_node (et_forest_occurrence_t occ) +static inline void +set_prev (struct et_occ *occ, struct et_occ *t) { - while (occ->left) - occ = occ->left; +#ifdef DEBUG_ET + if (occ == t) + abort (); +#endif - return occ; + occ->prev = t; + if (t) + t->parent = occ; } -/* Return rightmost node present in the tree roted by OCC. */ -static inline et_forest_occurrence_t -find_rightmost_node (et_forest_occurrence_t occ) +/* Sets next field of OCC to P. */ + +static inline void +set_next (struct et_occ *occ, struct et_occ *t) { - while (occ->right) - occ = occ->right; - return occ; +#ifdef DEBUG_ET + if (occ == t) + abort (); +#endif + + occ->next = t; + if (t) + t->parent = occ; } +/* Recompute minimum for occurence OCC. */ -/* Operation splay for splay tree structure representing occurrences. */ -static et_forest_occurrence_t -splay (et_forest_occurrence_t node) +static inline void +et_recomp_min (struct et_occ *occ) { - et_forest_occurrence_t parent; - et_forest_occurrence_t grandparent; + struct et_occ *mson = occ->prev; - while (1) - { - parent = node->parent; + if (!mson + || (occ->next + && mson->min > occ->next->min)) + mson = occ->next; - if (! parent) - return node; /* node == root. */ + if (mson && mson->min < 0) + { + occ->min = mson->min + occ->depth; + occ->min_occ = mson->min_occ; + } + else + { + occ->min = occ->depth; + occ->min_occ = occ; + } +} - grandparent = parent->parent; +#ifdef DEBUG_ET +/* Checks whether neighbourhood of OCC seems sane. */ - if (! grandparent) - break; +static void +et_check_occ_sanity (struct et_occ *occ) +{ + if (!occ) + return; - /* Now there are four possible combinations: */ + if (occ->parent == occ) + abort (); - if (node == parent->left) - { - if (parent == grandparent->left) - { - et_forest_occurrence_t node1, node2; - int count1, count2; - - node1 = node->right; - count1 = node->count_right; - node2 = parent->right; - count2 = parent->count_right; - - grandparent->left = node2; - grandparent->count_left = count2; - if (node2) - node2->parent = grandparent; - parent->left = node1; - parent->count_left = count1; - if (node1) - node1->parent = parent; - parent->right = grandparent; - parent->count_right = count2 + grandparent->count_right + 1; - node->right = parent; - node->count_right = count1 + parent->count_right + 1; - - node->parent = grandparent->parent; - parent->parent = node; - grandparent->parent = parent; - - if (node->parent) - { - if (node->parent->left == grandparent) - node->parent->left = node; - else - node->parent->right = node; - } - } - else - { - /* parent == grandparent->right && node == parent->left*/ - et_forest_occurrence_t node1, node2; - int count1, count2; - - node1 = node->left; - count1 = node->count_left; - node2 = node->right; - count2 = node->count_right; - - grandparent->right = node1; - grandparent->count_right = count1; - if (node1) - node1->parent = grandparent; - parent->left = node2; - parent->count_left = count2; - if (node2) - node2->parent = parent; - node->left = grandparent; - node->count_left = grandparent->count_left + count1 + 1; - node->right = parent; - node->count_right = parent->count_right + count2 + 1; - - node->parent = grandparent->parent; - parent->parent = node; - grandparent->parent = node; - - if (node->parent) - { - if (node->parent->left == grandparent) - node->parent->left = node; - else - node->parent->right = node; - } - } - } - else - { - /* node == parent->right. */ - if (parent == grandparent->left) - { - et_forest_occurrence_t node1, node2; - int count1, count2; - - node1 = node->left; - count1 = node->count_left; - node2 = node->right; - count2 = node->count_right; - - parent->right = node1; - parent->count_right = count1; - if (node1) - node1->parent = parent; - grandparent->left = node2; - grandparent->count_left = count2; - if (node2) - node2->parent = grandparent; - node->left = parent; - node->count_left = parent->count_left + count1 + 1; - node->right = grandparent; - node->count_right = grandparent->count_right + count2 + 1; - - node->parent = grandparent->parent; - parent->parent = node; - grandparent->parent = node; - - if (node->parent) - { - if (node->parent->left == grandparent) - node->parent->left = node; - else - node->parent->right = node; - } - } - else - { - /* parent == grandparent->right && node == parent->right*/ - et_forest_occurrence_t node1, node2; - int count1, count2; - - node1 = node->left; - count1 = node->count_left; - node2 = parent->left; - count2 = parent->count_left; - - grandparent->right = node2; - grandparent->count_right = count2; - if (node2) - node2->parent = grandparent; - parent->right = node1; - parent->count_right = count1; - if (node1) - node1->parent = parent; - parent->left = grandparent; - parent->count_left = count2 + grandparent->count_left + 1; - node->left = parent; - node->count_left = count1 + parent->count_left + 1; - - node->parent = grandparent->parent; - parent->parent = node; - grandparent->parent = parent; - - if (node->parent) - { - if (node->parent->left == grandparent) - node->parent->left = node; - else - node->parent->right = node; - } - } - } + if (occ->prev == occ) + abort (); - } + if (occ->next == occ) + abort (); - /* parent == root. */ - /* There are two possible combinations: */ + if (occ->next && occ->next == occ->prev) + abort (); - if (node == parent->left) + if (occ->next) { - et_forest_occurrence_t node1; - int count1; - - node1 = node->right; - count1 = node->count_right; - - parent->left = node1; - parent->count_left = count1; - if (node1) - node1->parent = parent; - node->right = parent; - node->count_right = parent->count_right + 1 + count1; - node->parent = parent->parent; /* the same as = 0; */ - parent->parent = node; - - if (node->parent) - { - if (node->parent->left == parent) - node->parent->left = node; - else - node->parent->right = node; - } + if (occ->next == occ->parent) + abort (); + + if (occ->next->parent != occ) + abort (); } - else + + if (occ->prev) { - /* node == parent->right. */ - et_forest_occurrence_t node1; - int count1; - - node1 = node->left; - count1 = node->count_left; - - parent->right = node1; - parent->count_right = count1; - if (node1) - node1->parent = parent; - node->left = parent; - node->count_left = parent->count_left + 1 + count1; - node->parent = parent->parent; /* the same as = 0; */ - parent->parent = node; - - if (node->parent) - { - if (node->parent->left == parent) - node->parent->left = node; - else - node->parent->right = node; - } + if (occ->prev == occ->parent) + abort (); + + if (occ->prev->parent != occ) + abort (); } - return node; + if (occ->parent + && occ->parent->prev != occ + && occ->parent->next != occ) + abort (); } -/* Remove all occurrences of the given node before destroying the node. */ +/* Checks whether tree rooted at OCC is sane. */ + static void -remove_all_occurrences (et_forest_t forest, et_forest_node_t forest_node) +et_check_sanity (struct et_occ *occ) { - et_forest_occurrence_t first = forest_node->first; - et_forest_occurrence_t last = forest_node->last; - et_forest_occurrence_t node; + et_check_occ_sanity (occ); + if (occ->prev) + et_check_sanity (occ->prev); + if (occ->next) + et_check_sanity (occ->next); +} - splay (first); +/* Checks whether tree containing OCC is sane. */ - if (first->left) - first->left->parent = 0; - if (first->right) - first->right->parent = 0; +static void +et_check_tree_sanity (struct et_occ *occ) +{ + while (occ->parent) + occ = occ->parent; - if (last != first) - { - splay (last); + et_check_sanity (occ); +} - if (last->left) - last->left->parent = 0; - if (last->right) - last->right->parent = 0; - } +/* For recording the paths. */ - if (last->right && first->left) /* actually, first->left would suffice. */ - { - /* Need to join them. */ - et_forest_occurrence_t prev_node, next_node; - - prev_node = splay (find_rightmost_node (first->left)); - next_node = splay (find_leftmost_node (last->right)); - /* prev_node and next_node are consecutive occurrences - of the same node. */ - if (prev_node->next != next_node) - abort (); +static int len; +static void *datas[100000]; +static int depths[100000]; - prev_node->right = next_node->right; - prev_node->count_right = next_node->count_right; - prev_node->next = next_node->next; - if (prev_node->right) - prev_node->right->parent = prev_node; +/* Records the path represented by OCC, with depth incremented by DEPTH. */ - if (prev_node->node->last == next_node) - prev_node->node->last = prev_node; +static int +record_path_before_1 (struct et_occ *occ, int depth) +{ + int mn, m; - pool_free (forest->occur_pool, next_node); + depth += occ->depth; + mn = depth; + + if (occ->prev) + { + m = record_path_before_1 (occ->prev, depth); + if (m < mn) + mn = m; } - if (first != last) + fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth); + depths[len] = depth; + datas[len] = occ->of; + len++; + + if (occ->next) { - node = first->next; + m = record_path_before_1 (occ->next, depth); + if (m < mn) + mn = m; + } - while (node != last) - { - et_forest_occurrence_t next_node; + if (mn != occ->min + depth - occ->depth) + abort (); - splay (node); + return mn; +} - if (node->left) - node->left->parent = 0; - if (node->right) - node->right->parent = 0; +/* Records the path represented by a tree containing OCC. */ - next_node = node->next; - pool_free (forest->occur_pool, node); - node = next_node; - } - } +static void +record_path_before (struct et_occ *occ) +{ + while (occ->parent) + occ = occ->parent; - pool_free (forest->occur_pool, first); - if (first != last) - pool_free (forest->occur_pool, last); + len = 0; + record_path_before_1 (occ, 0); + fprintf (stderr, "\n"); } -/* Calculate ET value of the given node. */ -static inline int -calculate_value (et_forest_occurrence_t node) +/* Checks whether the path represented by OCC, with depth incremented by DEPTH, + was not changed since the last recording. */ + +static int +check_path_after_1 (struct et_occ *occ, int depth) { - int value = node->count_left; + int mn, m; + + depth += occ->depth; + mn = depth; - while (node->parent) + if (occ->next) { - if (node == node->parent->right) - value += node->parent->count_left + 1; + m = check_path_after_1 (occ->next, depth); + if (m < mn) + mn = m; + } - node = node->parent; + len--; + if (depths[len] != depth + || datas[len] != occ->of) + abort (); + + if (occ->prev) + { + m = check_path_after_1 (occ->prev, depth); + if (m < mn) + mn = m; } - return value; + if (mn != occ->min + depth - occ->depth) + abort (); + + return mn; } +/* Checks whether the path represented by a tree containing OCC was + not changed since the last recording. */ + +static void +check_path_after (struct et_occ *occ) +{ + while (occ->parent) + occ = occ->parent; + + check_path_after_1 (occ, 0); + if (len != 0) + abort (); +} +#endif +/* Splay the occurence OCC to the root of the tree. */ -/* Create ET-forest structure. */ -et_forest_t -et_forest_create (void) +static inline void +et_splay (struct et_occ *occ) { - et_forest_t forest = xmalloc (sizeof (struct et_forest)); + struct et_occ *f, *gf, *ggf; + int occ_depth, f_depth, gf_depth; + +#ifdef DEBUG_ET + record_path_before (occ); + et_check_tree_sanity (occ); +#endif + + while (occ->parent) + { + occ_depth = occ->depth; - forest->nnodes = 0; - forest->occur_pool = create_alloc_pool ("et_forest_occurrence pool", sizeof (struct et_forest_occurrence), 300); - forest->node_pool = create_alloc_pool ("et_forest_node pool", sizeof (struct et_forest_node), 300); - return forest; -} + f = occ->parent; + f_depth = f->depth; + gf = f->parent; + if (!gf) + { + set_depth_add (occ, f_depth); + occ->min_occ = f->min_occ; + occ->min = f->min; -/* Deallocate the structure. */ -void -et_forest_delete (et_forest_t forest) + if (f->prev == occ) + { + /* zig */ + set_prev (f, occ->next); + set_next (occ, f); + set_depth_add (f->prev, occ_depth); + } + else + { + /* zag */ + set_next (f, occ->prev); + set_prev (occ, f); + set_depth_add (f->next, occ_depth); + } + set_depth (f, -occ_depth); + occ->parent = NULL; + + et_recomp_min (f); +#ifdef DEBUG_ET + et_check_tree_sanity (occ); + check_path_after (occ); +#endif + return; + } + + gf_depth = gf->depth; + + set_depth_add (occ, f_depth + gf_depth); + occ->min_occ = gf->min_occ; + occ->min = gf->min; + + ggf = gf->parent; + + if (gf->prev == f) + { + if (f->prev == occ) + { + /* zig zig */ + set_prev (gf, f->next); + set_prev (f, occ->next); + set_next (occ, f); + set_next (f, gf); + + set_depth (f, -occ_depth); + set_depth_add (f->prev, occ_depth); + set_depth (gf, -f_depth); + set_depth_add (gf->prev, f_depth); + } + else + { + /* zag zig */ + set_prev (gf, occ->next); + set_next (f, occ->prev); + set_prev (occ, f); + set_next (occ, gf); + + set_depth (f, -occ_depth); + set_depth_add (f->next, occ_depth); + set_depth (gf, -occ_depth - f_depth); + set_depth_add (gf->prev, occ_depth + f_depth); + } + } + else + { + if (f->prev == occ) + { + /* zig zag */ + set_next (gf, occ->prev); + set_prev (f, occ->next); + set_prev (occ, gf); + set_next (occ, f); + + set_depth (f, -occ_depth); + set_depth_add (f->prev, occ_depth); + set_depth (gf, -occ_depth - f_depth); + set_depth_add (gf->next, occ_depth + f_depth); + } + else + { + /* zag zag */ + set_next (gf, f->prev); + set_next (f, occ->prev); + set_prev (occ, f); + set_prev (f, gf); + + set_depth (f, -occ_depth); + set_depth_add (f->next, occ_depth); + set_depth (gf, -f_depth); + set_depth_add (gf->next, f_depth); + } + } + + occ->parent = ggf; + if (ggf) + { + if (ggf->prev == gf) + ggf->prev = occ; + else + ggf->next = occ; + } + + et_recomp_min (gf); + et_recomp_min (f); +#ifdef DEBUG_ET + et_check_tree_sanity (occ); +#endif + } + +#ifdef DEBUG_ET + et_check_sanity (occ); + check_path_after (occ); +#endif +} + +/* Create a new et tree occurence of NODE. */ + +static struct et_occ * +et_new_occ (struct et_node *node) { - if (forest->nnodes) - abort (); - free_alloc_pool (forest->occur_pool); - free_alloc_pool (forest->node_pool); - free (forest); + struct et_occ *nw; + + if (!et_occurences) + et_occurences = create_alloc_pool ("et_occ pool", sizeof (struct et_occ), 300); + nw = pool_alloc (et_occurences); + + nw->of = node; + nw->parent = NULL; + nw->prev = NULL; + nw->next = NULL; + + nw->depth = 0; + nw->min_occ = nw; + nw->min = 0; + + return nw; } -/* Create new node with VALUE and return the edge. - Return NULL when memory allocation failed. */ -et_forest_node_t -et_forest_add_node (et_forest_t forest, void *value) +/* Create a new et tree containing DATA. */ + +struct et_node * +et_new_tree (void *data) { - /* Create node with one occurrence. */ - et_forest_node_t node; - et_forest_occurrence_t occ; - - node = pool_alloc (forest->node_pool); - occ = pool_alloc (forest->occur_pool); - - node->first = node->last = occ; - node->value = value; - forest->nnodes++; - - occ->node = node; - occ->left = occ->right = occ->parent = 0; - occ->next = 0; - occ->count_left = occ->count_right = 0; - return node; + struct et_node *nw; + + if (!et_nodes) + et_nodes = create_alloc_pool ("et_node pool", sizeof (struct et_node), 300); + nw = pool_alloc (et_nodes); + + nw->data = data; + nw->father = NULL; + nw->left = NULL; + nw->right = NULL; + nw->son = NULL; + + nw->rightmost_occ = et_new_occ (nw); + nw->parent_occ = NULL; + + return nw; } -/* Add new edge to the tree, return 1 if successful. - 0 indicates that creation of the edge will close the cycle in graph. */ -int -et_forest_add_edge (et_forest_t forest ATTRIBUTE_UNUSED, - et_forest_node_t parent_node, et_forest_node_t child_node) +/* Releases et tree T. */ + +void +et_free_tree (struct et_node *t) { - et_forest_occurrence_t new_occ, parent_occ, child_occ; + while (t->son) + et_split (t->son); - if (! parent_node || ! child_node) - abort (); + if (t->father) + et_split (t); - parent_occ = parent_node->first; - child_occ = child_node->first; - - splay (parent_occ); - splay (child_occ); - - if (parent_occ->parent) - return 0; /* Both child and parent are in the same tree. */ - - if (child_occ->left) - abort (); /* child must be root of its containing tree. */ - - new_occ = pool_alloc (forest->occur_pool); - - new_occ->node = parent_node; - new_occ->left = child_occ; - new_occ->count_left = child_occ->count_right + 1; /* count_left is 0. */ - new_occ->right = parent_occ->right; - new_occ->count_right = parent_occ->count_right; - new_occ->parent = parent_occ; - new_occ->next = parent_occ->next; - child_occ->parent = new_occ; - parent_occ->right = new_occ; - parent_occ->count_right = new_occ->count_left + new_occ->count_right + 1; - parent_occ->next = new_occ; - if (new_occ->right) - new_occ->right->parent = new_occ; - - if (parent_node->last == parent_occ) - parent_node->last = new_occ; - return 1; + pool_free (et_occurences, t->rightmost_occ); + pool_free (et_nodes, t); } -/* Remove NODE from the tree and all connected edges. */ +/* Sets father of et tree T to FATHER. */ + void -et_forest_remove_node (et_forest_t forest, et_forest_node_t node) +et_set_father (struct et_node *t, struct et_node *father) { - remove_all_occurrences (forest, node); - forest->nnodes--; + struct et_node *left, *right; + struct et_occ *rmost, *left_part, *new_f_occ, *p; - pool_free (forest->node_pool, node); -} + /* Update the path represented in the splay tree. */ + new_f_occ = et_new_occ (father); -/* Remove edge from the tree, return 1 if successful, - 0 indicates nonexisting edge. */ -int -et_forest_remove_edge (et_forest_t forest ATTRIBUTE_UNUSED, - et_forest_node_t parent_node, - et_forest_node_t child_node) -{ - et_forest_occurrence_t parent_pre_occ, parent_post_occ; + rmost = father->rightmost_occ; + et_splay (rmost); - splay (child_node->first); + left_part = rmost->prev; - if (! child_node->first->left) - return 0; + p = t->rightmost_occ; + et_splay (p); - parent_pre_occ = find_rightmost_node (child_node->first->left); - if (parent_pre_occ->node != parent_node) - abort (); + set_prev (new_f_occ, left_part); + set_next (new_f_occ, p); + + p->depth++; + p->min++; + et_recomp_min (new_f_occ); - splay (parent_pre_occ); - parent_pre_occ->right->parent = 0; + set_prev (rmost, new_f_occ); - parent_post_occ = parent_pre_occ->next; - splay (parent_post_occ); + if (new_f_occ->min + rmost->depth < rmost->min) + { + rmost->min = new_f_occ->min + rmost->depth; + rmost->min_occ = new_f_occ->min_occ; + } - parent_post_occ->left->parent = 0; + t->parent_occ = new_f_occ; - parent_pre_occ->right = parent_post_occ->right; - parent_pre_occ->count_right = parent_post_occ->count_right; - if (parent_post_occ->right) - parent_post_occ->right->parent = parent_pre_occ; + /* Update the tree. */ + t->father = father; + right = father->son; + if (right) + left = right->left; + else + left = right = t; - parent_pre_occ->next = parent_post_occ->next; + left->right = t; + right->left = t; + t->left = left; + t->right = right; - if (parent_post_occ == parent_node->last) - parent_node->last = parent_pre_occ; + father->son = t; - pool_free (forest->occur_pool, parent_post_occ); - return 1; +#ifdef DEBUG_ET + et_check_tree_sanity (rmost); + record_path_before (rmost); +#endif } -/* Return the parent of the NODE if any, NULL otherwise. */ -et_forest_node_t -et_forest_parent (et_forest_t forest ATTRIBUTE_UNUSED, et_forest_node_t node) +/* Splits the edge from T to its father. */ + +void +et_split (struct et_node *t) { - splay (node->first); + struct et_node *father = t->father; + struct et_occ *r, *l, *rmost, *p_occ; - if (node->first->left) - return find_rightmost_node (node->first->left)->node; - else - return 0; -} + /* Update the path represented by the splay tree. */ + rmost = t->rightmost_occ; + et_splay (rmost); + for (r = rmost->next; r->prev; r = r->prev) + continue; + et_splay (r); -/* Return nearest common ancestor of NODE1 and NODE2. - Return NULL of they are in different trees. */ -et_forest_node_t -et_forest_common_ancestor (et_forest_t forest ATTRIBUTE_UNUSED, - et_forest_node_t node1, et_forest_node_t node2) -{ - int value1, value2, max_value; - et_forest_node_t ancestor; + r->prev->parent = NULL; + p_occ = t->parent_occ; + et_splay (p_occ); + t->parent_occ = NULL; - if (node1 == node2) - return node1; + l = p_occ->prev; + p_occ->next->parent = NULL; - if (! node1 || ! node2) - abort (); + set_prev (r, l); - splay (node1->first); - splay (node2->first); + et_recomp_min (r); - if (! node1->first->parent) /* The two vertices are in different trees. */ - return 0; + et_splay (rmost); + rmost->depth = 0; + rmost->min = 0; - value2 = calculate_value (node2->first); - value1 = calculate_value (node1->first); + pool_free (et_occurences, p_occ); - if (value1 < value2) + /* Update the tree. */ + if (father->son == t) + father->son = t->right; + if (father->son == t) + father->son = NULL; + else { - ancestor = node1; - max_value = value2; + t->left->right = t->right; + t->right->left = t->left; + } + t->left = t->right = NULL; + t->father = NULL; + +#ifdef DEBUG_ET + et_check_tree_sanity (rmost); + record_path_before (rmost); + + et_check_tree_sanity (r); + record_path_before (r); +#endif +} + +/* Finds the nearest common ancestor of the nodes N1 and N2. */ + +struct et_node * +et_nca (struct et_node *n1, struct et_node *n2) +{ + struct et_occ *o1 = n1->rightmost_occ, *o2 = n2->rightmost_occ, *om; + struct et_occ *l, *r, *ret; + int mn; + + if (n1 == n2) + return n1; + + et_splay (o1); + l = o1->prev; + r = o1->next; + if (l) + l->parent = NULL; + if (r) + r->parent = NULL; + et_splay (o2); + + if (l == o2 || (l && l->parent != NULL)) + { + ret = o2->next; + + set_prev (o1, o2); + if (r) + r->parent = o1; } else { - ancestor = node2; - max_value = value1; + ret = o2->prev; + + set_next (o1, o2); + if (l) + l->parent = o1; } - while (calculate_value (ancestor->last) < max_value) + if (0 < o2->depth) { - /* Find parent node. */ - splay (ancestor->first); - ancestor = find_rightmost_node (ancestor->first->left) ->node; + om = o1; + mn = o1->depth; + } + else + { + om = o2; + mn = o2->depth + o1->depth; } - return ancestor; -} +#ifdef DEBUG_ET + et_check_tree_sanity (o2); +#endif -/* Return the value pointer of node set during it's creation. */ -void * -et_forest_node_value (et_forest_t forest ATTRIBUTE_UNUSED, - et_forest_node_t node) -{ - /* Alloc threading NULL as a special node of the forest. */ - if (!node) - return NULL; - return node->value; + if (ret && ret->min + o1->depth + o2->depth < mn) + return ret->min_occ->of; + else + return om->of; } -/* Find all sons of NODE and store them into ARRAY allocated by the caller. - Return number of nodes found. */ -int -et_forest_enumerate_sons (et_forest_t forest ATTRIBUTE_UNUSED, - et_forest_node_t node, et_forest_node_t *array) +/* Checks whether the node UP is an ancestor of the node DOWN. */ + +bool +et_below (struct et_node *down, struct et_node *up) { - int n = 0; - et_forest_occurrence_t occ = node->first, stop = node->last, occ1; + struct et_occ *u = up->rightmost_occ, *d = down->rightmost_occ; + struct et_occ *l, *r; + + if (up == down) + return true; + + et_splay (u); + l = u->prev; + r = u->next; + + if (!l) + return false; + + l->parent = NULL; + + if (r) + r->parent = NULL; - /* Parent is the rightmost node of the left successor. - Look for all occurrences having no right successor - and lookup the sons. */ - while (occ != stop) + et_splay (d); + + if (l == d || l->parent != NULL) { - splay (occ); - if (occ->right) - { - occ1 = find_leftmost_node (occ->right); - if (occ1->node->first == occ1) - array[n++] = occ1->node; - } - occ = occ->next; + if (r) + r->parent = u; + set_prev (u, d); +#ifdef DEBUG_ET + et_check_tree_sanity (u); +#endif } - return n; + else + { + l->parent = u; + + /* In case O1 and O2 are in two different trees, we must just restore the + original state. */ + if (r && r->parent != NULL) + set_next (u, d); + else + set_next (u, r); + +#ifdef DEBUG_ET + et_check_tree_sanity (u); +#endif + return false; + } + + if (0 >= d->depth) + return false; + + return !d->next || d->next->min + d->depth >= 0; } diff --git a/gcc/et-forest.h b/gcc/et-forest.h index 66aec4897c0..833146d6147 100644 --- a/gcc/et-forest.h +++ b/gcc/et-forest.h @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ for tree operations (insertion and removal of nodes and edges) and poly-logarithmic time for nearest common ancestor. - ET tree stores its structue as a sequence of symbols obtained + ET tree stores its structure as a sequence of symbols obtained by dfs(root) dfs (node) @@ -55,26 +55,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern "C" { #endif /* __cplusplus */ -typedef struct et_forest *et_forest_t; -typedef struct et_forest_node *et_forest_node_t; - -extern et_forest_t et_forest_create (void); - -extern void et_forest_delete (et_forest_t); - -extern et_forest_node_t et_forest_add_node (et_forest_t, void *); -extern int et_forest_add_edge (et_forest_t, et_forest_node_t, - et_forest_node_t); -extern void et_forest_remove_node (et_forest_t, et_forest_node_t); -extern int et_forest_remove_edge (et_forest_t, et_forest_node_t, - et_forest_node_t); -extern et_forest_node_t et_forest_parent (et_forest_t, et_forest_node_t); -extern et_forest_node_t et_forest_common_ancestor (et_forest_t, - et_forest_node_t, - et_forest_node_t); -extern void * et_forest_node_value (et_forest_t, et_forest_node_t); -extern int et_forest_enumerate_sons (et_forest_t, et_forest_node_t, - et_forest_node_t *); +/* The node representing the node in an et tree. */ +struct et_node +{ + void *data; /* The data represented by the node. */ + + int dfs_num_in, dfs_num_out; /* Number of the node in the dfs ordering. */ + + struct et_node *father; /* Father of the node. */ + struct et_node *son; /* The first of the sons of the node. */ + struct et_node *left; + struct et_node *right; /* The brothers of the node. */ + + struct et_occ *rightmost_occ; /* The rightmost occurence. */ + struct et_occ *parent_occ; /* The occurence of the parent node. */ +}; + +struct et_node *et_new_tree (void *data); +void et_free_tree (struct et_node *); +void et_set_father (struct et_node *, struct et_node *); +void et_split (struct et_node *); +struct et_node *et_nca (struct et_node *, struct et_node *); +bool et_below (struct et_node *, struct et_node *); #ifdef __cplusplus } diff --git a/gcc/except.c b/gcc/except.c index edbcda10cf4..5958eae290f 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2047,8 +2047,12 @@ sjlj_emit_function_enter (rtx dispatch_label) if (cfun->uses_eh_lsda) { char buf[20]; + rtx sym; + ASM_GENERATE_INTERNAL_LABEL (buf, "LLSDA", current_function_funcdef_no); - emit_move_insn (mem, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf))); + sym = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); + SYMBOL_REF_FLAGS (sym) = SYMBOL_FLAG_LOCAL; + emit_move_insn (mem, sym); } else emit_move_insn (mem, const0_rtx); diff --git a/gcc/explow.c b/gcc/explow.c index 56f9a3ff04a..9e04bd896f9 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -444,7 +444,7 @@ memory_address (enum machine_mode mode, rtx x) x = convert_memory_address (Pmode, x); - /* By passing constant addresses thru registers + /* By passing constant addresses through registers we get a chance to cse them. */ if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x)) x = force_reg (Pmode, x); diff --git a/gcc/expmed.c b/gcc/expmed.c index cb30ff35db6..98a26a14c1e 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -326,17 +326,13 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, If the target is memory, storing any naturally aligned field can be done with a simple store. For targets that support fast unaligned - memory, any naturally sized, unit aligned field can be done directly. - - It's okay if the requested bitsize is greater than fieldmode's - bitsize; that just means the mode has padding bits. */ + memory, any naturally sized, unit aligned field can be done directly. */ byte_offset = (bitnum % BITS_PER_WORD) / BITS_PER_UNIT + (offset * UNITS_PER_WORD); if (bitpos == 0 - && GET_MODE_BITSIZE (fieldmode) != 0 - && bitsize >= GET_MODE_BITSIZE (fieldmode) + && bitsize == GET_MODE_BITSIZE (fieldmode) && (GET_CODE (op0) != MEM ? ((GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD || GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode)) @@ -1033,12 +1029,9 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, if (GET_CODE (op0) == REG && mode == GET_MODE (op0) && bitnum == 0 - && GET_MODE_BITSIZE (GET_MODE (op0)) != 0 - && bitsize >= GET_MODE_BITSIZE (GET_MODE (op0))) + && bitsize == GET_MODE_BITSIZE (GET_MODE (op0))) { - /* We're trying to extract a full register from itself. - (If the requested bitsize is greater than the bitsize of op0, - that just means op0's mode has padding bits.) */ + /* We're trying to extract a full register from itself. */ return op0; } @@ -1086,13 +1079,18 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, If that's wrong, the solution is to test for it and set TARGET to 0 if needed. */ - mode1 = (VECTOR_MODE_P (tmode) - ? mode - : mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0)); + /* Only scalar integer modes can be converted via subregs. There is an + additional problem for FP modes here in that they can have a precision + which is different from the size. mode_for_size uses precision, but + we want a mode based on the size, so we must avoid calling it for FP + modes. */ + mode1 = (SCALAR_INT_MODE_P (tmode) + ? mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0) + : mode); if (((bitsize >= BITS_PER_WORD && bitsize == GET_MODE_BITSIZE (mode) && bitpos % BITS_PER_WORD == 0) - || (mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0) != BLKmode + || (mode1 != BLKmode /* ??? The big endian test here is wrong. This is correct if the value is in a register, and if mode_for_size is not the same mode as op0. This causes us to get unnecessarily diff --git a/gcc/expr.c b/gcc/expr.c index cd37495badd..93ab7e0c796 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -47,6 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "langhooks.h" #include "intl.h" #include "tm_p.h" +#include "target.h" /* Decide whether a function's arguments should be processed from first to last or from last to first. @@ -605,9 +606,9 @@ convert_move (rtx to, rtx from, int unsignedp) rtx value, insns; convert_optab tab; - if (GET_MODE_BITSIZE (from_mode) < GET_MODE_BITSIZE (to_mode)) + if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode)) tab = sext_optab; - else if (GET_MODE_BITSIZE (from_mode) > GET_MODE_BITSIZE (to_mode)) + else if (GET_MODE_PRECISION (from_mode) > GET_MODE_PRECISION (to_mode)) tab = trunc_optab; else abort (); @@ -2121,10 +2122,10 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize) set of registers starting with SRCREG into TGTBLK. If TGTBLK is null, a stack temporary is created. TGTBLK is returned. - The primary purpose of this routine is to handle functions - that return BLKmode structures in registers. Some machines - (the PA for example) want to return all small structures - in registers regardless of the structure's alignment. */ + The purpose of this routine is to handle functions that return + BLKmode structures in registers. Some machines (the PA for example) + want to return all small structures in registers regardless of the + structure's alignment. */ rtx copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type) @@ -2132,7 +2133,7 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type) unsigned HOST_WIDE_INT bytes = int_size_in_bytes (type); rtx src = NULL, dst = NULL; unsigned HOST_WIDE_INT bitsize = MIN (TYPE_ALIGN (type), BITS_PER_WORD); - unsigned HOST_WIDE_INT bitpos, xbitpos, big_endian_correction = 0; + unsigned HOST_WIDE_INT bitpos, xbitpos, padding_correction = 0; if (tgtblk == 0) { @@ -2150,13 +2151,20 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type) && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD) srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type)); - /* Structures whose size is not a multiple of a word are aligned - to the least significant byte (to the right). On a BYTES_BIG_ENDIAN - machine, this means we must skip the empty high order bytes when - calculating the bit offset. */ - if (BYTES_BIG_ENDIAN - && bytes % UNITS_PER_WORD) - big_endian_correction + /* If the structure doesn't take up a whole number of words, see whether + SRCREG is padded on the left or on the right. If it's on the left, + set PADDING_CORRECTION to the number of bits to skip. + + In most ABIs, the structure will be returned at the least end of + the register, which translates to right padding on little-endian + targets and left padding on big-endian targets. The opposite + holds if the structure is returned at the most significant + end of the register. */ + if (bytes % UNITS_PER_WORD != 0 + && (targetm.calls.return_in_msb (type) + ? !BYTES_BIG_ENDIAN + : BYTES_BIG_ENDIAN)) + padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) * BITS_PER_UNIT)); /* Copy the structure BITSIZE bites at a time. @@ -2164,15 +2172,15 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type) We could probably emit more efficient code for machines which do not use strict alignment, but it doesn't seem worth the effort at the current time. */ - for (bitpos = 0, xbitpos = big_endian_correction; + for (bitpos = 0, xbitpos = padding_correction; bitpos < bytes * BITS_PER_UNIT; bitpos += bitsize, xbitpos += bitsize) { /* We need a new source operand each time xbitpos is on a - word boundary and when xbitpos == big_endian_correction + word boundary and when xbitpos == padding_correction (the first time through). */ if (xbitpos % BITS_PER_WORD == 0 - || xbitpos == big_endian_correction) + || xbitpos == padding_correction) src = operand_subword_force (srcreg, xbitpos / BITS_PER_WORD, GET_MODE (srcreg)); @@ -3466,9 +3474,19 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, rtx temp; int used = partial * UNITS_PER_WORD; - int offset = used % (PARM_BOUNDARY / BITS_PER_UNIT); + int offset; int skip; + if (reg && GET_CODE (reg) == PARALLEL) + { + /* Use the size of the elt to compute offset. */ + rtx elt = XEXP (XVECEXP (reg, 0, 0), 0); + used = partial * GET_MODE_SIZE (GET_MODE (elt)); + offset = used % (PARM_BOUNDARY / BITS_PER_UNIT); + } + else + offset = used % (PARM_BOUNDARY / BITS_PER_UNIT); + if (size == 0) abort (); @@ -3826,7 +3844,11 @@ expand_assignment (tree to, tree from, int want_value) } if (TREE_CODE (to) == COMPONENT_REF - && TREE_READONLY (TREE_OPERAND (to, 1))) + && TREE_READONLY (TREE_OPERAND (to, 1)) + /* We can't assert that a MEM won't be set more than once + if the component is not addressable because another + non-addressable component may be referenced by the same MEM. */ + && ! (GET_CODE (to_rtx) == MEM && ! can_address_p (to))) { if (to_rtx == orig_to_rtx) to_rtx = copy_rtx (to_rtx); @@ -4621,7 +4643,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) highest_pow2_factor (offset)); } - if (TREE_READONLY (field)) + /* If the constructor has been cleared, setting RTX_UNCHANGING_P + on the MEM might lead to scheduling the clearing after the + store. */ + if (TREE_READONLY (field) && !cleared) { if (GET_CODE (to_rtx) == MEM) to_rtx = copy_rtx (to_rtx); @@ -5918,60 +5943,6 @@ var_rtx (tree exp) return 0; } } - -#ifdef MAX_INTEGER_COMPUTATION_MODE - -void -check_max_integer_computation_mode (tree exp) -{ - enum tree_code code; - enum machine_mode mode; - - /* Strip any NOPs that don't change the mode. */ - STRIP_NOPS (exp); - code = TREE_CODE (exp); - - /* We must allow conversions of constants to MAX_INTEGER_COMPUTATION_MODE. */ - if (code == NOP_EXPR - && TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST) - return; - - /* First check the type of the overall operation. We need only look at - unary, binary and relational operations. */ - if (TREE_CODE_CLASS (code) == '1' - || TREE_CODE_CLASS (code) == '2' - || TREE_CODE_CLASS (code) == '<') - { - mode = TYPE_MODE (TREE_TYPE (exp)); - if (GET_MODE_CLASS (mode) == MODE_INT - && mode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - } - - /* Check operand of a unary op. */ - if (TREE_CODE_CLASS (code) == '1') - { - mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); - if (GET_MODE_CLASS (mode) == MODE_INT - && mode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - } - - /* Check operands of a binary/comparison op. */ - if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<') - { - mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); - if (GET_MODE_CLASS (mode) == MODE_INT - && mode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - - mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1))); - if (GET_MODE_CLASS (mode) == MODE_INT - && mode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - } -} -#endif /* Return the highest power of two that EXP is known to be a multiple of. This is used in updating alignment of MEMs in array references. */ @@ -6275,49 +6246,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, target = 0; } -#ifdef MAX_INTEGER_COMPUTATION_MODE - /* Only check stuff here if the mode we want is different from the mode - of the expression; if it's the same, check_max_integer_computation_mode - will handle it. Do we really need to check this stuff at all? */ - - if (target - && GET_MODE (target) != mode - && TREE_CODE (exp) != INTEGER_CST - && TREE_CODE (exp) != PARM_DECL - && TREE_CODE (exp) != ARRAY_REF - && TREE_CODE (exp) != ARRAY_RANGE_REF - && TREE_CODE (exp) != COMPONENT_REF - && TREE_CODE (exp) != BIT_FIELD_REF - && TREE_CODE (exp) != INDIRECT_REF - && TREE_CODE (exp) != CALL_EXPR - && TREE_CODE (exp) != VAR_DECL - && TREE_CODE (exp) != RTL_EXPR) - { - enum machine_mode mode = GET_MODE (target); - - if (GET_MODE_CLASS (mode) == MODE_INT - && mode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - } - - if (tmode != mode - && TREE_CODE (exp) != INTEGER_CST - && TREE_CODE (exp) != PARM_DECL - && TREE_CODE (exp) != ARRAY_REF - && TREE_CODE (exp) != ARRAY_RANGE_REF - && TREE_CODE (exp) != COMPONENT_REF - && TREE_CODE (exp) != BIT_FIELD_REF - && TREE_CODE (exp) != INDIRECT_REF - && TREE_CODE (exp) != VAR_DECL - && TREE_CODE (exp) != CALL_EXPR - && TREE_CODE (exp) != RTL_EXPR - && GET_MODE_CLASS (tmode) == MODE_INT - && tmode > MAX_INTEGER_COMPUTATION_MODE) - internal_error ("unsupported wide integer operation"); - - check_max_integer_computation_mode (exp); -#endif - /* If will do cse, generate all results into pseudo registers since 1) that allows cse to find more things and 2) otherwise cse could produce an insn the machine @@ -6943,7 +6871,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, && modifier != EXPAND_MEMORY && TREE_READONLY (array) && ! TREE_SIDE_EFFECTS (array) && TREE_CODE (array) == VAR_DECL && DECL_INITIAL (array) - && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK) + && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK + && targetm.binds_local_p (array)) { if (TREE_CODE (index) == INTEGER_CST) { @@ -7130,10 +7059,9 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0); #endif - /* A constant address in OP0 can have VOIDmode, we must not try - to call force_reg for that case. Avoid that case. */ - if (GET_CODE (op0) == MEM - && GET_MODE (op0) == BLKmode + if (GET_MODE (op0) == BLKmode + /* A constant address in OP0 can have VOIDmode, we must + not try to call force_reg in that case. */ && GET_MODE (XEXP (op0, 0)) != VOIDmode && bitsize != 0 && (bitpos % bitsize) == 0 @@ -7190,7 +7118,10 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, fetch it as a bit field. */ || (mode1 != BLKmode && (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode) - || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)) + || (bitpos % GET_MODE_ALIGNMENT (mode) != 0) + || (GET_CODE (op0) == MEM + && (MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1) + || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0)))) && ((modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_INITIALIZER) ? STRICT_ALIGNMENT @@ -7854,16 +7785,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, EXPAND_SUM); - /* If we knew for certain that this is arithmetic for an array - reference, and we knew the bounds of the array, then we could - apply the distributive law across (PLUS X C) for constant C. - Without such knowledge, we risk overflowing the computation - when both X and C are large, but X+C isn't. */ - /* ??? Could perhaps special-case EXP being unsigned and C being - positive. In that case we are certain that X+C is no smaller - than X and so the transformed expression will overflow iff the - original would have. */ - if (GET_CODE (op0) != REG) op0 = force_operand (op0, NULL_RTX); if (GET_CODE (op0) != REG) @@ -9328,7 +9249,7 @@ expand_increment (tree exp, int post, int ignore) { /* We have a true reference to the value in OP0. If there is an insn to add or subtract in this mode, queue it. - Queueing the increment insn avoids the register shuffling + Queuing the increment insn avoids the register shuffling that often results if we must increment now and first save the old value for subsequent use. */ @@ -9775,7 +9696,7 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label, if (mode != Pmode) index = convert_to_mode (Pmode, index, 1); - /* Don't let a MEM slip thru, because then INDEX that comes + /* Don't let a MEM slip through, because then INDEX that comes out of PIC_CASE_VECTOR_ADDRESS won't be a valid address, and break_out_memory_refs will go to work on it and mess it up. */ #ifdef PIC_CASE_VECTOR_ADDRESS diff --git a/gcc/expr.h b/gcc/expr.h index c598ff7193a..abd7f5b049d 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -331,6 +331,7 @@ extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx); /* Functions from builtins.c: */ extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int); +extern tree std_build_builtin_va_list (void); extern void std_expand_builtin_va_start (tree, rtx); extern rtx std_expand_builtin_va_arg (tree, tree); extern rtx expand_builtin_va_arg (tree, tree); diff --git a/gcc/f/.cvsignore b/gcc/f/.cvsignore deleted file mode 100644 index ef942f0cd74..00000000000 --- a/gcc/f/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -g77.info* -g77.1 diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 12cdc27cf27..3dcc5628f70 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,66 @@ +2003-12-29 Roger Sayle + + PR fortran/12632 + * com.c (ffecom_subscript_check_): Take as an extra argument the + (possibly NULL) decl of the array. Don't create unnecessary tree + nodes if the array index is known to be safe at compile-time. + If the array index is unsafe, force the array decl into memory to + avoid RTL expansion problems. + (ffecom_array_ref_): Update calls to ffecom_subscript_check_. + (ffecom_char_args_x_): Likewise. + +2003-12-06 Kelley Cook + + * Make-lang.in (G77_CROSS_NAME): Delete. + (g77.install_common, g77.install-man, g77.uninstall): Adjust for above. + +2003-11-30 Andreas Jaeger + + * Make-lang.in (f77.rebuilt): Fix dependency on g77.info. + +2003-11-24 Toon Moene + + PR fortran/12633 + * expr.c (ffeexpr_reduced_ugly2log_): Revert + change allowing logical .and. logical to be + integer in expressions when -fugly-logint. + +2003-11-21 Kelley Cook + + * .cvsignore: Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (f77.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (check-f77, lang_checks): Add. + +2003-11-16 Jason Merrill + + * Make-lang.in (f77.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-12 Andreas Jaeger + + * intdoc.in (Signal Intrinsic (subroutine)): Fix texinfo warning + using @code. + * intdoc.texi: Regenerated. + +2003-11-03 Kelley Cook + + * Make-lang.in (dvi): Move targets to $(docobjdir). + (g77.dvi): Simplify rule. + (g77.info): Sinplify rule. + (g77.1): Delete. + (g77.pod): New intermediate rule. + +2003-10-31 Jakub Jelinek + + * com.c (ffecom_sym_transform_): Set tree type of offset + to ssizetype. + 2003-10-21 Kelley Cook * Make-lang.in (f/g77.1): Honor $(docobjdir). diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in index a5256c893c3..b54b83c1f5e 100644 --- a/gcc/f/Make-lang.in +++ b/gcc/f/Make-lang.in @@ -1,4 +1,4 @@ -# Top level makefile fragment for GNU Fortran. -*-makefile-*- +# Top level -*- makefile -*- fragment for GNU Fortran. # Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. #This file is part of GNU Fortran. @@ -24,7 +24,7 @@ # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-normal, foo.install-common, foo.install-man, # foo.uninstall, -# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. @@ -40,9 +40,6 @@ # Actual name to use when installing a native compiler. G77_INSTALL_NAME = `echo g77|sed '$(program_transform_name)'` -# Actual name to use when installing a cross-compiler. -G77_CROSS_NAME = `echo g77|sed '$(program_transform_cross_name)'` - # Some versions of `touch' (such as the version on Solaris 2.8) # do not correctly set the timestamp due to buggy versions of `utime' # in the kernel. So, we use `echo' instead. @@ -61,7 +58,7 @@ F77 f77: f771$(exeext) f77.install-normal \ f77.install-common f77.install-man \ f77.uninstall f77.mostlyclean f77.clean f77.distclean \ - f77.extraclean f77.maintainer-clean f77.rebuilt \ + f77.maintainer-clean f77.rebuilt \ f77.stage1 f77.stage2 f77.stage3 f77.stage4 \ f77.stageprofile f77.stagefeedback @@ -146,12 +143,16 @@ f77.start.encap: g77$(exeext) f77.rest.encap: f77.tags: force - cd $(srcdir)/f; etags *.c *.h + cd $(srcdir)/f; etags -o TAGS.sub *.c *.h; \ + etags --include TAGS.sub --include ../TAGS.sub info:: $(docobjdir)/g77.info -dvi:: f/g77.dvi +dvi:: $(docobjdir)/g77.dvi generated-manpages:: $(docobjdir)/g77.1 +check-f77 : check-g77 +lang_checks += check-g77 + # g77 documentation. $(docobjdir)/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ $(srcdir)/f/ffe.texi $(srcdir)/f/invoke.texi \ @@ -163,25 +164,22 @@ $(docobjdir)/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ stmp-docobjdir if [ x$(BUILD_INFO) = xinfo ]; then \ rm -f $(@)*; \ - cd $(srcdir)/f && $(MAKEINFO) -I../doc/include -o $@ g77.texi; \ + $(MAKEINFO) -I$(docdir)/include -I$(srcdir)/f -o $@ $<; \ else true; fi -f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ +$(docobjdir)/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ $(srcdir)/f/ffe.texi $(srcdir)/f/invoke.texi \ $(srcdir)/f/news.texi $(srcdir)/f/intdoc.texi \ $(srcdir)/f/root.texi $(docdir)/include/fdl.texi \ $(docdir)/include/gpl.texi \ $(docdir)/include/funding.texi \ - $(docdir)/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - cd f && $(TEXI2DVI) -I $$s/doc/include $$s/f/g77.texi + $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -I $(srcdir)/f -I $(docdir)/include -o $@ $< -$(docobjdir)/g77.1: $(srcdir)/f/invoke.texi - -$(TEXI2POD) < $(srcdir)/f/invoke.texi > f/g77.pod; \ - ($(POD2MAN) --section=1 f/g77.pod > f/g77.1.T$$$$ && \ - mv -f f/g77.1.T$$$$ $(docobjdir)/g77.1) || \ - (rm -f f/g77.1.T$$$$ && exit 1); \ - rm -f f/g77.pod; \ +.INTERMEDIATE: g77.pod +g77.pod: f/invoke.texi + -$(TEXI2POD) < $< > $@ # This dance is all about producing accurate documentation for g77's # intrinsics with minimum fuss. f/ansify appends "\n\" to C strings @@ -238,7 +236,7 @@ $(srcdir)/f/NEWS: f/news0.texi f/news.texi f/root.texi cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \ --no-validate -I../doc/include -o NEWS news0.texi -f77.rebuilt: f/g77.info $(srcdir)/f/BUGS \ +f77.rebuilt: $(docobjdir)/g77.info $(srcdir)/f/BUGS \ $(srcdir)/f/NEWS # @@ -251,15 +249,9 @@ f77.install-normal: # and also as either g77 (if native) or $(tooldir)/bin/g77. f77.install-common: installdirs -if [ -f f771$(exeext) ] ; then \ - if [ -f g77-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) g77-cross$(exeext) $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \ - else \ - rm -f $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) g77$(exeext) $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ - fi ; \ + rm -f $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) g77$(exeext) $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ + chmod a+x $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ else true; fi @if [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]; then \ echo ''; \ @@ -275,15 +267,9 @@ install-info:: $(DESTDIR)$(infodir)/g77.info f77.install-man: $(GENERATED_MANPAGES) installdirs -if [ -f f771$(exeext) ] ; then \ - if [ -f g77-cross$(exeext) ] ; then \ - rm -f $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \ - else \ - rm -f $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ - fi; \ + rm -f $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ + $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ + chmod a-x $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ else true; fi f77.uninstall: installdirs @@ -292,9 +278,7 @@ f77.uninstall: installdirs install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/g77.info || : ; \ else : ; fi rm -rf $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \ - rm -rf $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \ rm -rf $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \ - rm -rf $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \ rm -rf $(DESTDIR)$(infodir)/g77.info* # # Clean hooks: @@ -312,9 +296,8 @@ f77.clean: -rm -f g77spec.o f77.distclean: -rm -f f/Makefile -f77.extraclean: f77.maintainer-clean: - -rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/NEWS f/intdoc.texi + -rm -f f/g77.info* f/g77.*aux f/TAGS f/TAGS.sub f/BUGS f/NEWS f/intdoc.texi # # Stage hooks: # The main makefile has already created stage?/f. diff --git a/gcc/f/com.c b/gcc/f/com.c index e992cb90b77..a64ef86b172 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -638,15 +638,16 @@ static GTY(()) tree shadowed_labels; /* Return the subscript expression, modified to do range-checking. - `array' is the array to be checked against. + `array' is the array type to be checked against. `element' is the subscript expression to check. `dim' is the dimension number (starting at 0). `total_dims' is the total number of dimensions (0 for CHARACTER substring). + `item' is the array decl or NULL_TREE. */ static tree ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims, - const char *array_name) + const char *array_name, tree item) { tree low = TYPE_MIN_VALUE (TYPE_DOMAIN (array)); tree high = TYPE_MAX_VALUE (TYPE_DOMAIN (array)); @@ -713,6 +714,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims, } } + /* If the array index is safe at compile-time, return element. */ + if (integer_nonzerop (cond)) + return element; + { int len; char *proc; @@ -807,13 +812,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims, TREE_SIDE_EFFECTS (die) = 1; die = convert (void_type_node, die); - element = ffecom_3 (COND_EXPR, - TREE_TYPE (element), - cond, - element, - die); + if (integer_zerop (cond) && item) + ffe_mark_addressable (item); - return element; + return ffecom_3 (COND_EXPR, TREE_TYPE (element), cond, element, die); } /* Return the computed element of an array reference. @@ -899,7 +901,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr) element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE); if (flag_bounds_check) element = ffecom_subscript_check_ (array, element, i, total_dims, - array_name); + array_name, item); if (element == error_mark_node) return element; @@ -945,7 +947,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr) element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE); if (flag_bounds_check) element = ffecom_subscript_check_ (array, element, i, total_dims, - array_name); + array_name, item); if (element == error_mark_node) return element; @@ -2037,7 +2039,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null) end_tree = ffecom_expr (end); if (flag_bounds_check) end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0, - char_name); + char_name, NULL_TREE); end_tree = convert (ffecom_f2c_ftnlen_type_node, end_tree); @@ -2055,7 +2057,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null) start_tree = ffecom_expr (start); if (flag_bounds_check) start_tree = ffecom_subscript_check_ (array, start_tree, 0, 0, - char_name); + char_name, NULL_TREE); start_tree = convert (ffecom_f2c_ftnlen_type_node, start_tree); @@ -2088,7 +2090,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null) end_tree = ffecom_expr (end); if (flag_bounds_check) end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0, - char_name); + char_name, NULL_TREE); end_tree = convert (ffecom_f2c_ftnlen_type_node, end_tree); @@ -7919,6 +7921,7 @@ ffecom_sym_transform_ (ffesymbol s) { ffetargetOffset offset; ffestorag cst; + tree toffset; cst = ffestorag_parent (st); assert (cst == ffesymbol_storage (cs)); @@ -7935,9 +7938,10 @@ ffecom_sym_transform_ (ffesymbol s) ffecom_1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (ct)), ct)); + toffset = build_int_2 (offset, 0); + TREE_TYPE (toffset) = ssizetype; t = ffecom_2 (PLUS_EXPR, TREE_TYPE (t), - t, - build_int_2 (offset, 0)); + t, toffset); t = convert (build_pointer_type (type), t); TREE_CONSTANT (t) = 1; diff --git a/gcc/f/expr.c b/gcc/f/expr.c index 6aeddafe4c2..f7ee46bb56b 100644 --- a/gcc/f/expr.c +++ b/gcc/f/expr.c @@ -10593,24 +10593,6 @@ ffeexpr_reduced_ugly2log_ (ffebld reduced, ffeexprExpr_ l, ffeexprExpr_ op, /* else Leave it alone. */ } - if (lbt == FFEINFO_basictypeLOGICAL) - { - ffebld_set_left (reduced, ffeexpr_convert (ffebld_left (reduced), - l->token, op->token, FFEINFO_basictypeINTEGER, - FFEINFO_kindtypeINTEGERDEFAULT, 0, - FFETARGET_charactersizeNONE, - FFEEXPR_contextLET)); - } - - if (rbt == FFEINFO_basictypeLOGICAL) - { - ffebld_set_right (reduced, ffeexpr_convert (ffebld_right (reduced), - r->token, op->token, FFEINFO_basictypeINTEGER, - FFEINFO_kindtypeINTEGERDEFAULT, 0, - FFETARGET_charactersizeNONE, - FFEEXPR_contextLET)); - } - return reduced; } diff --git a/gcc/f/intdoc.in b/gcc/f/intdoc.in index 55d426ad930..6f2423f6cac 100644 --- a/gcc/f/intdoc.in +++ b/gcc/f/intdoc.in @@ -2401,7 +2401,7 @@ See @code{signal(2)}. Note that @var{@2@} will be called using C conventions, so the value of its argument in Fortran terms -Fortran terms is obtained by applying @code{%LOC()} (or @var{LOC()}) to it. +Fortran terms is obtained by applying @code{%LOC()} (or @code{LOC()}) to it. The value returned by @code{signal(2)} is written to @var{@3@}, if that argument is supplied. @@ -2451,7 +2451,7 @@ See @code{signal(2)}. Note that @var{@2@} will be called using C conventions, so the value of its argument in Fortran terms -is obtained by applying @code{%LOC()} (or @var{LOC()}) to it. +is obtained by applying @code{%LOC()} (or @code{LOC()}) to it. The value returned by @code{signal(2)} is returned. diff --git a/gcc/f/intdoc.texi b/gcc/f/intdoc.texi index 7de42578d1a..e657510a060 100644 --- a/gcc/f/intdoc.texi +++ b/gcc/f/intdoc.texi @@ -9500,7 +9500,7 @@ See @code{signal(2)}. Note that @var{Handler} will be called using C conventions, so the value of its argument in Fortran terms -Fortran terms is obtained by applying @code{%LOC()} (or @var{LOC()}) to it. +Fortran terms is obtained by applying @code{%LOC()} (or @code{LOC()}) to it. The value returned by @code{signal(2)} is written to @var{Status}, if that argument is supplied. @@ -9579,7 +9579,7 @@ See @code{signal(2)}. Note that @var{Handler} will be called using C conventions, so the value of its argument in Fortran terms -is obtained by applying @code{%LOC()} (or @var{LOC()}) to it. +is obtained by applying @code{%LOC()} (or @code{LOC()}) to it. The value returned by @code{signal(2)} is returned. diff --git a/gcc/final.c b/gcc/final.c index 20ceff8b7c0..3310a40d691 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -170,9 +170,15 @@ CC_STATUS cc_prev_status; char regs_ever_live[FIRST_PSEUDO_REGISTER]; +/* Like regs_ever_live, but 1 if a reg is set or clobbered from an asm. + Unlike regs_ever_live, elements of this array corresponding to + eliminable regs like the frame pointer are set if an asm sets them. */ + +char regs_asm_clobbered[FIRST_PSEUDO_REGISTER]; + /* Nonzero means current function must be given a frame pointer. - Set in stmt.c if anything is allocated on the stack there. - Set in reload1.c if anything is allocated on the stack there. */ + Initialized in function.c to 0. Set only in reload1.c as per + the needs of the function. */ int frame_pointer_needed; @@ -667,7 +673,7 @@ compute_alignments (void) FOR_EACH_BB (bb) { - rtx label = bb->head; + rtx label = BB_HEAD (bb); int fallthru_frequency = 0, branch_frequency = 0, has_fallthru = 0; edge e; @@ -1336,19 +1342,6 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, this_is_asm_operands = 0; -#ifdef NON_SAVING_SETJMP - /* A function that calls setjmp should save and restore all the - call-saved registers on a system where longjmp clobbers them. */ - if (NON_SAVING_SETJMP && current_function_calls_setjmp) - { - int i; - - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (!call_used_regs[i]) - regs_ever_live[i] = 1; - } -#endif - last_filename = locator_file (prologue_locator); last_linenum = locator_line (prologue_locator); @@ -1437,7 +1430,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED) function_section (current_function_decl); #if defined(ASM_OUTPUT_REG_PUSH) - if (sval && GET_CODE (svrtx) == REG) + if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG) ASM_OUTPUT_REG_PUSH (file, REGNO (svrtx)); #endif @@ -1468,7 +1461,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED) #endif #if defined(ASM_OUTPUT_REG_PUSH) - if (sval && GET_CODE (svrtx) == REG) + if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG) ASM_OUTPUT_REG_POP (file, REGNO (svrtx)); #endif } @@ -1847,10 +1840,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if (prescan > 0) break; -#ifdef FINAL_PRESCAN_LABEL - FINAL_PRESCAN_INSN (insn, NULL, 0); -#endif - if (LABEL_NAME (insn)) (*debug_hooks->label) (insn); @@ -1918,7 +1907,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* An INSN, JUMP_INSN or CALL_INSN. First check for special kinds that recog doesn't recognize. */ - if (GET_CODE (body) == USE /* These are just declarations */ + if (GET_CODE (body) == USE /* These are just declarations. */ || GET_CODE (body) == CLOBBER) break; @@ -2153,10 +2142,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if (optimize) { -#if 0 - rtx set = single_set (insn); -#endif - if (set && GET_CODE (SET_DEST (set)) == CC0 && insn != last_ignored_compare) diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 7fdecb5d150..ad23793a406 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -645,7 +645,7 @@ read_scan_file (char *in_fname, int argc, char **argv) } if (i < argc) - cpp_error (scan_in, DL_ERROR, "invalid option `%s'", argv[i]); + cpp_error (scan_in, CPP_DL_ERROR, "invalid option `%s'", argv[i]); if (cpp_errors (scan_in)) exit (FATAL_EXIT_CODE); diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 08e29593334..160960563ab 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Saturday October 25, 2003 at 10:36:26 AM PDT + * It has been AutoGen-ed Thursday December 18, 2003 at 01:49:23 PM PST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Sat Oct 25 10:36:26 PDT 2003 +/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Dec 18 13:49:23 PST 2003 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 161 fixup descriptions. + * This file contains 163 fixup descriptions. * * See README for more information. * @@ -973,6 +973,43 @@ static const char* apzAlpha_SbrkPatch[] = { "void *sbrk(", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Alpha_Wchar fix + */ +tSCC zAlpha_WcharName[] = + "alpha_wchar"; + +/* + * File name selection pattern + */ +tSCC zAlpha_WcharList[] = + "|wchar.h|"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzAlpha_WcharMachs[] = { + "alpha*-dec-osf4*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zAlpha_WcharSelect0[] = + "#define wcstok wcstok_r"; + +#define ALPHA_WCHAR_TEST_CT 1 +static tTestDesc aAlpha_WcharTests[] = { + { TT_EGREP, zAlpha_WcharSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Alpha_Wchar + */ +static const char* apzAlpha_WcharPatch[] = { "sed", + "-e", "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@", + "-e", "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Avoid_Bool_Define fix @@ -1492,6 +1529,44 @@ extern \"C\" {\n\ #endif\n", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Darwin_Private_Extern fix + */ +tSCC zDarwin_Private_ExternName[] = + "darwin_private_extern"; + +/* + * File name selection pattern + */ +tSCC zDarwin_Private_ExternList[] = + "|mach-o/dyld.h|"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzDarwin_Private_ExternMachs[] = { + "*-*-darwin*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zDarwin_Private_ExternSelect0[] = + "__private_extern__ [a-z_]+ _dyld_"; + +#define DARWIN_PRIVATE_EXTERN_TEST_CT 1 +static tTestDesc aDarwin_Private_ExternTests[] = { + { TT_EGREP, zDarwin_Private_ExternSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Darwin_Private_Extern + */ +static const char* apzDarwin_Private_ExternPatch[] = { + "format", + "extern", + "__private_extern__", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Dec_Intern_Asm fix @@ -4384,8 +4459,7 @@ static tTestDesc aStdio_Va_ListTests[] = { * Fix Command Arguments for Stdio_Va_List */ static const char* apzStdio_Va_ListPatch[] = { "sed", - "-e", "s@ va_list @ __gnuc_va_list @\n\ -s@ va_list)@ __gnuc_va_list)@\n\ + "-e", "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n\ s@(va_list)&@(__gnuc_va_list)\\&@\n\ s@ _VA_LIST_));@ __gnuc_va_list));@\n\ s@ __VA_LIST__));@ __gnuc_va_list));@\n\ @@ -6379,9 +6453,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 181 +#define REGEX_COUNT 183 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 161 +#define FIX_COUNT 163 /* * Enumerate the fixes @@ -6408,6 +6482,7 @@ typedef enum { ALPHA_PTHREAD_FIXIDX, ALPHA_PTHREAD_GCC_FIXIDX, ALPHA_SBRK_FIXIDX, + ALPHA_WCHAR_FIXIDX, AVOID_BOOL_DEFINE_FIXIDX, AVOID_BOOL_TYPE_FIXIDX, AVOID_WCHAR_T_TYPE_FIXIDX, @@ -6421,6 +6496,7 @@ typedef enum { CTRL_QUOTES_DEF_FIXIDX, CTRL_QUOTES_USE_FIXIDX, CXX_UNREADY_FIXIDX, + DARWIN_PRIVATE_EXTERN_FIXIDX, DEC_INTERN_ASM_FIXIDX, DJGPP_WCHAR_H_FIXIDX, ECD_CURSOR_FIXIDX, @@ -6656,6 +6732,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ALPHA_SBRK_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aAlpha_SbrkTests, apzAlpha_SbrkPatch, 0 }, + { zAlpha_WcharName, zAlpha_WcharList, + apzAlpha_WcharMachs, + ALPHA_WCHAR_TEST_CT, FD_MACH_ONLY, + aAlpha_WcharTests, apzAlpha_WcharPatch, 0 }, + { zAvoid_Bool_DefineName, zAvoid_Bool_DefineList, apzAvoid_Bool_DefineMachs, AVOID_BOOL_DEFINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, @@ -6721,6 +6802,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aCxx_UnreadyTests, apzCxx_UnreadyPatch, 0 }, + { zDarwin_Private_ExternName, zDarwin_Private_ExternList, + apzDarwin_Private_ExternMachs, + DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Private_ExternTests, apzDarwin_Private_ExternPatch, 0 }, + { zDec_Intern_AsmName, zDec_Intern_AsmList, apzDec_Intern_AsmMachs, DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 432d0166512..95a5534d15f 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -633,6 +633,23 @@ fix = { }; +/* + * Change external names of wcstok/wcsftime via asm instead of macros on + * Tru64 UNIX V4.0. + */ +fix = { + hackname = alpha_wchar; + files = wchar.h; + + mach = "alpha*-dec-osf4*"; + select = "#define wcstok wcstok_r"; + sed = "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@"; + sed = "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@"; + test_text = "#define wcstok wcstok_r\n" + "#define wcsftime __wcsftime_isoc"; +}; + + /* * For C++, avoid any typedef or macro definition of bool, * and use the built in type instead. @@ -918,6 +935,24 @@ fix = { }; +/* + * __private_extern__ doesn't exist in FSF GCC. Even if it did, + * why would you ever put it in a system header file? + */ +fix = { + hackname = darwin_private_extern; + mach = "*-*-darwin*"; + files = mach-o/dyld.h; + select = "__private_extern__ [a-z_]+ _dyld_"; + c_fix = format; + c_fix_arg = "extern"; + c_fix_arg = "__private_extern__"; + test_text = "__private_extern__ int _dyld_func_lookup(\n" + "const char *dyld_func_name,\n" + "unsigned long *address);\n"; +}; + + /* * Fix on Digital UNIX V4.0: * It contains a prototype for a DEC C internal asm() function, @@ -2469,8 +2504,7 @@ fix = { * instead of va_list. * Don't claim to have defined va_list. */ - sed = "s@ va_list @ __gnuc_va_list @\n" - "s@ va_list)@ __gnuc_va_list)@\n" + sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n" "s@(va_list)&@(__gnuc_va_list)\\&@\n" "s@ _VA_LIST_));@ __gnuc_va_list));@\n" "s@ __VA_LIST__));@ __gnuc_va_list));@\n" diff --git a/gcc/fixinc/tests/base/wchar.h b/gcc/fixinc/tests/base/wchar.h new file mode 100644 index 00000000000..5c0b9dfe86a --- /dev/null +++ b/gcc/fixinc/tests/base/wchar.h @@ -0,0 +1,15 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/wchar.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( ALPHA_WCHAR_CHECK ) +extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__("wcstok_r"); +extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__("__wcsftime_isoc"); +#endif /* ALPHA_WCHAR_CHECK */ diff --git a/gcc/flags.h b/gcc/flags.h index c2b2fad8f17..f172ec34a8b 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -549,10 +549,6 @@ extern int flag_dump_rtl_in_asm; in generated assembly code. */ extern int flag_leading_underscore; -/* -fgnu-linker specifies use of the GNU linker for initializations. - -fno-gnu-linker says that collect will be used. */ -extern int flag_gnu_linker; - /* Tag all structures with __attribute__(packed) */ extern int flag_pack_struct; diff --git a/gcc/flow.c b/gcc/flow.c index 2694a0b07e0..c146310cb0a 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -136,20 +136,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "recog.h" #include "expr.h" -#include "ssa.h" #include "timevar.h" #include "obstack.h" #include "splay-tree.h" -/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, - the stack pointer does not matter. The value is tested only in - functions that have frame pointers. - No definition is equivalent to always zero. */ -#ifndef EXIT_IGNORE_STACK -#define EXIT_IGNORE_STACK 0 -#endif - #ifndef HAVE_epilogue #define HAVE_epilogue 0 #endif @@ -160,9 +151,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define HAVE_sibcall_epilogue 0 #endif -#ifndef LOCAL_REGNO -#define LOCAL_REGNO(REGNO) 0 -#endif #ifndef EPILOGUE_USES #define EPILOGUE_USES(REGNO) 0 #endif @@ -293,7 +281,6 @@ static void notice_stack_pointer_modification_1 (rtx, rtx, void *); static void notice_stack_pointer_modification (rtx); static void mark_reg (rtx, void *); static void mark_regs_live_at_end (regset); -static int set_phi_alternative_reg (rtx, int, int, void *); static void calculate_global_regs_live (sbitmap, sbitmap, int); static void propagate_block_delete_insn (rtx); static rtx propagate_block_delete_libcall (rtx, rtx); @@ -328,6 +315,7 @@ static void add_to_mem_set_list (struct propagate_block_info *, rtx); static int invalidate_mems_from_autoinc (rtx *, void *); static void invalidate_mems_from_set (struct propagate_block_info *, rtx); static void clear_log_links (sbitmap); +static int count_or_remove_death_notes_bb (basic_block, int); void @@ -380,7 +368,7 @@ first_insn_after_basic_block_note (basic_block block) rtx insn; /* Get the first instruction in the block. */ - insn = block->head; + insn = BB_HEAD (block); if (insn == NULL_RTX) return NULL_RTX; @@ -465,7 +453,10 @@ life_analysis (rtx f, FILE *file, int flags) is not immediately handy. */ if (flags & PROP_REG_INFO) - memset (regs_ever_live, 0, sizeof (regs_ever_live)); + { + memset (regs_ever_live, 0, sizeof (regs_ever_live)); + memset (regs_asm_clobbered, 0, sizeof (regs_asm_clobbered)); + } update_life_info (NULL, UPDATE_LIFE_GLOBAL, flags); /* Clean up. */ @@ -506,7 +497,7 @@ verify_wide_reg_1 (rtx *px, void *pregno) static void verify_wide_reg (int regno, basic_block bb) { - rtx head = bb->head, end = bb->end; + rtx head = BB_HEAD (bb), end = BB_END (bb); while (1) { @@ -596,6 +587,9 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb) generates subregs of a multi-word pseudo, current life analysis will lose the kill. So we _can_ have a pseudo go live. How irritating. + It is also not true when a peephole decides that it doesn't need one + or more of the inputs. + Including PROP_REG_INFO does not properly refresh regs_ever_live unless the caller resets it to zero. */ @@ -820,7 +814,7 @@ delete_noop_moves (rtx f ATTRIBUTE_UNUSED) FOR_EACH_BB (bb) { - for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = next) + for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next) { next = NEXT_INSN (insn); if (INSN_P (insn) && noop_move_p (insn)) @@ -1033,20 +1027,6 @@ mark_regs_live_at_end (regset set) diddle_return_value (mark_reg, set); } -/* Callback function for for_each_successor_phi. DATA is a regset. - Sets the SRC_REGNO, the regno of the phi alternative for phi node - INSN, in the regset. */ - -static int -set_phi_alternative_reg (rtx insn ATTRIBUTE_UNUSED, - int dest_regno ATTRIBUTE_UNUSED, int src_regno, - void *data) -{ - regset live = (regset) data; - SET_REGNO_REG_SET (live, src_regno); - return 0; -} - /* Propagate global life info around the graph of basic blocks. Begin considering blocks with their corresponding bit set in BLOCKS_IN. If BLOCKS_IN is null, consider it the universal set. @@ -1208,14 +1188,6 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM); } - /* Regs used in phi nodes are not included in - global_live_at_start, since they are live only along a - particular edge. Set those regs that are live because of a - phi node alternative corresponding to this particular block. */ - if (in_ssa_form) - for_each_successor_phi (bb, &set_phi_alternative_reg, - new_live_at_end); - if (bb == ENTRY_BLOCK_PTR) { COPY_REG_SET (bb->global_live_at_end, new_live_at_end); @@ -1864,8 +1836,8 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, /* If this block ends in a conditional branch, for each register live from one side of the branch and not the other, record the register as conditionally dead. */ - if (GET_CODE (bb->end) == JUMP_INSN - && any_condjump_p (bb->end)) + if (GET_CODE (BB_END (bb)) == JUMP_INSN + && any_condjump_p (BB_END (bb))) { regset_head diff_head; regset diff = INITIALIZE_REG_SET (diff_head); @@ -1890,7 +1862,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, else { /* This can happen with a conditional jump to the next insn. */ - if (JUMP_LABEL (bb->end) != bb_true->head) + if (JUMP_LABEL (BB_END (bb)) != BB_HEAD (bb_true)) abort (); /* Simplest way to do nothing. */ @@ -1902,7 +1874,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, bb_false->global_live_at_start, BITMAP_XOR)) { /* Extract the condition from the branch. */ - rtx set_src = SET_SRC (pc_set (bb->end)); + rtx set_src = SET_SRC (pc_set (BB_END (bb))); rtx cond_true = XEXP (set_src, 0); rtx reg = XEXP (cond_true, 0); @@ -1971,7 +1943,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, && ! current_function_calls_eh_return))) { rtx insn, set; - for (insn = bb->end; insn != bb->head; insn = PREV_INSN (insn)) + for (insn = BB_END (bb); insn != BB_HEAD (bb); insn = PREV_INSN (insn)) if (GET_CODE (insn) == INSN && (set = single_set (insn)) && GET_CODE (SET_DEST (set)) == MEM) @@ -2051,7 +2023,7 @@ propagate_block (basic_block bb, regset live, regset local_set, /* Scan the block an insn at a time from end to beginning. */ changed = 0; - for (insn = bb->end;; insn = prev) + for (insn = BB_END (bb); ; insn = prev) { /* If this is a call to `setjmp' et al, warn if any non-volatile datum is live. */ @@ -2066,7 +2038,7 @@ propagate_block (basic_block bb, regset live, regset local_set, else changed |= NEXT_INSN (prev) != insn; - if (insn == bb->head) + if (insn == BB_HEAD (bb)) break; } @@ -2465,6 +2437,7 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn) rtx cond = NULL_RTX; rtx link; enum rtx_code code; + int flags = pbi->flags; if (insn) for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) @@ -2473,14 +2446,17 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn) mark_set_1 (pbi, SET, XEXP (link, 0), (GET_CODE (x) == COND_EXEC ? COND_EXEC_TEST (x) : NULL_RTX), - insn, pbi->flags); + insn, flags); } retry: switch (code = GET_CODE (x)) { case SET: + if (GET_CODE (XEXP (x, 1)) == ASM_OPERANDS) + flags |= PROP_ASM_SCAN; + /* Fall through */ case CLOBBER: - mark_set_1 (pbi, code, SET_DEST (x), cond, insn, pbi->flags); + mark_set_1 (pbi, code, SET_DEST (x), cond, insn, flags); return; case COND_EXEC: @@ -2492,7 +2468,9 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn) { int i; - for (i = XVECLEN (x, 0) - 1; i >= 0; i--) + /* We must scan forwards. If we have an asm, we need to set + the PROP_ASM_SCAN flag before scanning the clobbers. */ + for (i = 0; i < XVECLEN (x, 0); i++) { rtx sub = XVECEXP (x, 0, i); switch (code = GET_CODE (sub)) @@ -2503,13 +2481,24 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn) cond = COND_EXEC_TEST (sub); sub = COND_EXEC_CODE (sub); - if (GET_CODE (sub) != SET && GET_CODE (sub) != CLOBBER) - break; - /* Fall through. */ + if (GET_CODE (sub) == SET) + goto mark_set; + if (GET_CODE (sub) == CLOBBER) + goto mark_clob; + break; case SET: + mark_set: + if (GET_CODE (XEXP (sub, 1)) == ASM_OPERANDS) + flags |= PROP_ASM_SCAN; + /* Fall through */ case CLOBBER: - mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, pbi->flags); + mark_clob: + mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, flags); + break; + + case ASM_OPERANDS: + flags |= PROP_ASM_SCAN; break; default: @@ -2733,6 +2722,9 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c { for (i = regno_first; i <= regno_last; i++) regs_ever_live[i] = 1; + if (flags & PROP_ASM_SCAN) + for (i = regno_first; i <= regno_last; i++) + regs_asm_clobbered[i] = 1; } else { @@ -2818,6 +2810,14 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c { if (flags & (PROP_LOG_LINKS | PROP_AUTOINC)) pbi->reg_next_use[regno_first] = 0; + + if ((flags & PROP_REG_INFO) != 0 + && (flags & PROP_ASM_SCAN) != 0 + && regno_first < FIRST_PSEUDO_REGISTER) + { + for (i = regno_first; i <= regno_last; i++) + regs_asm_clobbered[i] = 1; + } } /* If this is the last pass and this is a SCRATCH, show it will be dying @@ -3311,8 +3311,8 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn, new insn(s) and do the updates. */ emit_insn_before (insns, insn); - if (pbi->bb->head == insn) - pbi->bb->head = insns; + if (BB_HEAD (pbi->bb) == insn) + BB_HEAD (pbi->bb) = insns; /* INCR will become a NOTE and INSN won't contain a use of INCR_REG. If a use of INCR_REG was just placed in @@ -3908,14 +3908,6 @@ mark_used_regs (struct propagate_block_info *pbi, rtx x, rtx cond, rtx insn) x = COND_EXEC_CODE (x); goto retry; - case PHI: - /* We _do_not_ want to scan operands of phi nodes. Operands of - a phi function are evaluated only when control reaches this - block along a particular edge. Therefore, regs that appear - as arguments to phi should not be added to the global live at - start. */ - return; - default: break; } @@ -4197,65 +4189,95 @@ int count_or_remove_death_notes (sbitmap blocks, int kill) { int count = 0; + int i; basic_block bb; - FOR_EACH_BB_REVERSE (bb) + + /* This used to be a loop over all the blocks with a membership test + inside the loop. That can be amazingly expensive on a large CFG + when only a small number of bits are set in BLOCKs (for example, + the calls from the scheduler typically have very few bits set). + + For extra credit, someone should convert BLOCKS to a bitmap rather + than an sbitmap. */ + if (blocks) { - rtx insn; + EXECUTE_IF_SET_IN_SBITMAP (blocks, 0, i, + { + count += count_or_remove_death_notes_bb (BASIC_BLOCK (i), kill); + }); + } + else + { + FOR_EACH_BB (bb) + { + count += count_or_remove_death_notes_bb (bb, kill); + } + } - if (blocks && ! TEST_BIT (blocks, bb->index)) - continue; + return count; +} + +/* Optionally removes all the REG_DEAD and REG_UNUSED notes from basic + block BB. Returns a count of the number of registers that died. */ - for (insn = bb->head;; insn = NEXT_INSN (insn)) +static int +count_or_remove_death_notes_bb (basic_block bb, int kill) +{ + int count = 0; + rtx insn; + + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) + { + if (INSN_P (insn)) { - if (INSN_P (insn)) - { - rtx *pprev = ®_NOTES (insn); - rtx link = *pprev; + rtx *pprev = ®_NOTES (insn); + rtx link = *pprev; - while (link) + while (link) + { + switch (REG_NOTE_KIND (link)) { - switch (REG_NOTE_KIND (link)) + case REG_DEAD: + if (GET_CODE (XEXP (link, 0)) == REG) + { + rtx reg = XEXP (link, 0); + int n; + + if (REGNO (reg) >= FIRST_PSEUDO_REGISTER) + n = 1; + else + n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)); + count += n; + } + + /* Fall through. */ + + case REG_UNUSED: + if (kill) { - case REG_DEAD: - if (GET_CODE (XEXP (link, 0)) == REG) - { - rtx reg = XEXP (link, 0); - int n; - - if (REGNO (reg) >= FIRST_PSEUDO_REGISTER) - n = 1; - else - n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)); - count += n; - } - /* Fall through. */ - - case REG_UNUSED: - if (kill) - { - rtx next = XEXP (link, 1); - free_EXPR_LIST_node (link); - *pprev = link = next; - break; - } - /* Fall through. */ - - default: - pprev = &XEXP (link, 1); - link = *pprev; + rtx next = XEXP (link, 1); + free_EXPR_LIST_node (link); + *pprev = link = next; break; } + /* Fall through. */ + + default: + pprev = &XEXP (link, 1); + link = *pprev; + break; } } - - if (insn == bb->end) - break; } + + if (insn == BB_END (bb)) + break; } return count; } + /* Clear LOG_LINKS fields of insns in a selected blocks or whole chain if blocks is NULL. */ @@ -4276,7 +4298,7 @@ clear_log_links (sbitmap blocks) { basic_block bb = BASIC_BLOCK (i); - for (insn = bb->head; insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) free_INSN_LIST_list (&LOG_LINKS (insn)); diff --git a/gcc/fold-const.c b/gcc/fold-const.c index f248cd6ba51..7a939c49666 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4433,8 +4433,11 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) if (code == MULT_EXPR || integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0))) { - op1 = const_binop (code, convert (ctype, op1), convert (ctype, c), 0); - if (op1 == 0 || TREE_OVERFLOW (op1)) + op1 = const_binop (code, convert (ctype, op1), + convert (ctype, c), 0); + /* We allow the constant to overflow with wrapping semantics. */ + if (op1 == 0 + || (TREE_OVERFLOW (op1) && ! flag_wrapv)) break; } else @@ -5036,7 +5039,7 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, int bitnum = tree_log2 (TREE_OPERAND (arg0, 1)); enum machine_mode operand_mode = TYPE_MODE (type); int ops_unsigned; - tree signed_type, unsigned_type; + tree signed_type, unsigned_type, intermediate_type; tree arg00; /* If we have (A & C) != 0 where C is the sign bit of A, convert @@ -5082,22 +5085,23 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, signed_type = (*lang_hooks.types.type_for_mode) (operand_mode, 0); unsigned_type = (*lang_hooks.types.type_for_mode) (operand_mode, 1); + intermediate_type = ops_unsigned ? unsigned_type : signed_type; + inner = convert (intermediate_type, inner); if (bitnum != 0) - inner = build (RSHIFT_EXPR, ops_unsigned ? unsigned_type : signed_type, + inner = build (RSHIFT_EXPR, intermediate_type, inner, size_int (bitnum)); if (code == EQ_EXPR) - inner = build (BIT_XOR_EXPR, ops_unsigned ? unsigned_type : signed_type, + inner = build (BIT_XOR_EXPR, intermediate_type, inner, integer_one_node); /* Put the AND last so it can combine with more things. */ - inner = build (BIT_AND_EXPR, ops_unsigned ? unsigned_type : signed_type, + inner = build (BIT_AND_EXPR, intermediate_type, inner, integer_one_node); /* Make sure to return the proper type. */ - if (TREE_TYPE (inner) != result_type) - inner = convert (result_type, inner); + inner = convert (result_type, inner); return inner; } @@ -5201,9 +5205,6 @@ fold (tree expr) if (kind == 'c') return t; -#ifdef MAX_INTEGER_COMPUTATION_MODE - check_max_integer_computation_mode (expr); -#endif orig_t = t; if (code == NOP_EXPR || code == FLOAT_EXPR || code == CONVERT_EXPR) @@ -7714,7 +7715,8 @@ fold (tree expr) && (optimize || TREE_CODE (arg1) == INTEGER_CST)) { t1 = optimize_bit_field_compare (code, type, arg0, arg1); - return t1 ? t1 : t; + if (t1) + return t1; } /* If this is a comparison of complex values and either or both sides @@ -7862,9 +7864,17 @@ fold (tree expr) /* Pedantic ANSI C says that a conditional expression is never an lvalue, so all simple results must be passed through pedantic_non_lvalue. */ if (TREE_CODE (arg0) == INTEGER_CST) - return pedantic_non_lvalue - (TREE_OPERAND (t, (integer_zerop (arg0) ? 2 : 1))); - else if (operand_equal_p (arg1, TREE_OPERAND (expr, 2), 0)) + { + tem = TREE_OPERAND (t, (integer_zerop (arg0) ? 2 : 1)); + /* Only optimize constant conditions when the selected branch + has the same type as the COND_EXPR. This avoids optimizing + away "c ? x : throw", where the throw has a void type. */ + if (! VOID_TYPE_P (TREE_TYPE (tem)) + || VOID_TYPE_P (TREE_TYPE (t))) + return pedantic_non_lvalue (tem); + return t; + } + if (operand_equal_p (arg1, TREE_OPERAND (expr, 2), 0)) return pedantic_omit_one_operand (type, arg1, arg0); /* If we have A op B ? A : C, we may be able to convert this to a diff --git a/gcc/function.c b/gcc/function.c index 6531c022f9e..1da182af4dc 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -295,7 +295,7 @@ static tree split_complex_args (tree); static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED; /* Pointer to chain of `struct function' for containing functions. */ -static GTY(()) struct function *outer_function_chain; +struct function *outer_function_chain; /* List of insns that were postponed by purge_addressof_1. */ static rtx postponed_insns; @@ -452,6 +452,7 @@ free_after_compilation (struct function *f) f->x_nonlocal_goto_stack_level = NULL; f->x_cleanup_label = NULL; f->x_return_label = NULL; + f->x_naked_return_label = NULL; f->computed_goto_common_label = NULL; f->computed_goto_common_reg = NULL; f->x_save_expr_regs = NULL; @@ -2091,7 +2092,23 @@ fixup_var_refs_1 (rtx var, enum machine_mode promoted_mode, rtx *loc, rtx insn, replacement = find_fixup_replacement (replacements, x); if (replacement->new) { + enum machine_mode mode = GET_MODE (x); *loc = replacement->new; + + /* Careful! We may have just replaced a SUBREG by a MEM, which + means that the insn may have become invalid again. We can't + in this case make a new replacement since we already have one + and we must deal with MATCH_DUPs. */ + if (GET_CODE (replacement->new) == MEM) + { + INSN_CODE (insn) = -1; + if (recog_memoized (insn) >= 0) + return; + + fixup_var_refs_1 (replacement->new, mode, &PATTERN (insn), + insn, replacements, no_share); + } + return; } @@ -2851,7 +2868,17 @@ gen_mem_addressof (rtx reg, tree decl, int rescan) fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), reg, 0); } else if (rescan) - fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0); + { + /* This can only happen during reload. Clear the same flag bits as + reload. */ + MEM_VOLATILE_P (reg) = 0; + RTX_UNCHANGING_P (reg) = 0; + MEM_IN_STRUCT_P (reg) = 0; + MEM_SCALAR_P (reg) = 0; + MEM_ATTRS (reg) = 0; + + fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0); + } return reg; } @@ -2929,6 +2956,7 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, int i, j; const char *fmt; bool result = true; + bool libcall = false; /* Re-start here to avoid recursion in common cases. */ restart: @@ -2937,6 +2965,10 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, if (x == 0) return true; + /* Is this a libcall? */ + if (!insn) + libcall = REG_NOTE_KIND (*loc) == REG_RETVAL; + code = GET_CODE (x); /* If we don't return in any of the cases below, we will recurse inside @@ -3070,28 +3102,27 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, which can be succinctly described with a simple SUBREG. Note that removing the REG_EQUAL note is not an option on the last insn of a libcall, so we must do a replacement. */ - if (! purge_addressof_replacements - && ! purge_bitfield_addressof_replacements) + + /* In compile/990107-1.c:7 compiled at -O1 -m1 for sh-elf, + we got + (mem:DI (addressof:SI (reg/v:DF 160) 159 0x401c8510) + [0 S8 A32]), which can be expressed with a simple + same-size subreg */ + if ((GET_MODE_SIZE (GET_MODE (x)) + <= GET_MODE_SIZE (GET_MODE (sub))) + /* Again, invalid pointer casts (as in + compile/990203-1.c) can require paradoxical + subregs. */ + || (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD + && (GET_MODE_SIZE (GET_MODE (x)) + > GET_MODE_SIZE (GET_MODE (sub))) + && libcall)) { - /* In compile/990107-1.c:7 compiled at -O1 -m1 for sh-elf, - we got - (mem:DI (addressof:SI (reg/v:DF 160) 159 0x401c8510) - [0 S8 A32]), which can be expressed with a simple - same-size subreg */ - if ((GET_MODE_SIZE (GET_MODE (x)) - == GET_MODE_SIZE (GET_MODE (sub))) - /* Again, invalid pointer casts (as in - compile/990203-1.c) can require paradoxical - subregs. */ - || (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (x)) - > GET_MODE_SIZE (GET_MODE (sub))))) - { - *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0); - return true; - } - /* ??? Are there other cases we should handle? */ + *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0); + return true; } + /* ??? Are there other cases we should handle? */ + /* Sometimes we may not be able to find the replacement. For example when the original insn was a MEM in a wider mode, and the note is part of a sign extension of a narrowed @@ -4256,7 +4287,7 @@ assign_parms (tree fndecl) the function returns a structure. */ tree function_result_decl = 0; int varargs_setup = 0; - int reg_parm_stack_space = 0; + int reg_parm_stack_space ATTRIBUTE_UNUSED = 0; rtx conversion_insns = 0; /* Nonzero if function takes extra anonymous args. @@ -4700,6 +4731,40 @@ assign_parms (tree fndecl) Set DECL_RTL to that place. */ + if (GET_CODE (entry_parm) == PARALLEL && nominal_mode != BLKmode + && XVECLEN (entry_parm, 0) > 1) + { + /* Reconstitute objects the size of a register or larger using + register operations instead of the stack. */ + rtx parmreg = gen_reg_rtx (nominal_mode); + + if (REG_P (parmreg)) + { + unsigned int regno = REGNO (parmreg); + + emit_group_store (parmreg, entry_parm, TREE_TYPE (parm), + int_size_in_bytes (TREE_TYPE (parm))); + SET_DECL_RTL (parm, parmreg); + + if (regno >= max_parm_reg) + { + rtx *new; + int old_max_parm_reg = max_parm_reg; + + /* It's slow to expand this one register at a time, + but it's also rare and we need max_parm_reg to be + precisely correct. */ + max_parm_reg = regno + 1; + new = ggc_realloc (parm_reg_stack_loc, + max_parm_reg * sizeof (rtx)); + memset (new + old_max_parm_reg, 0, + (max_parm_reg - old_max_parm_reg) * sizeof (rtx)); + parm_reg_stack_loc = new; + parm_reg_stack_loc[regno] = stack_parm; + } + } + } + if (nominal_mode == BLKmode #ifdef BLOCK_REG_PADDING || (locate.where_pad == (BYTES_BIG_ENDIAN ? upward : downward) @@ -4723,7 +4788,8 @@ assign_parms (tree fndecl) assign_stack_local if space was not allocated in the argument list. If it was, this will not work if PARM_BOUNDARY is not a multiple of BITS_PER_WORD. It isn't clear how to fix this - if it becomes a problem. */ + if it becomes a problem. Exception is when BLKmode arrives + with arguments not conforming to word_mode. */ if (stack_parm == 0) { @@ -4731,7 +4797,9 @@ assign_parms (tree fndecl) PUT_MODE (stack_parm, GET_MODE (entry_parm)); set_mem_attributes (stack_parm, parm, 1); } - + else if (GET_CODE (entry_parm) == PARALLEL + && GET_MODE(entry_parm) == BLKmode) + ; else if (PARM_BOUNDARY % BITS_PER_WORD != 0) abort (); @@ -4794,7 +4862,10 @@ assign_parms (tree fndecl) move_block_from_reg (REGNO (entry_parm), mem, size_stored / UNITS_PER_WORD); } - SET_DECL_RTL (parm, stack_parm); + /* If parm is already bound to register pair, don't change + this binding. */ + if (! DECL_RTL_SET_P (parm)) + SET_DECL_RTL (parm, stack_parm); } else if (! ((! optimize && ! DECL_REGISTER (parm)) @@ -4943,13 +5014,13 @@ assign_parms (tree fndecl) else if (passed_pointer && FUNCTION_ARG_CALLEE_COPIES (args_so_far, - TYPE_MODE (DECL_ARG_TYPE (parm)), - DECL_ARG_TYPE (parm), + TYPE_MODE (TREE_TYPE (passed_type)), + TREE_TYPE (passed_type), named_arg) - && ! TREE_ADDRESSABLE (DECL_ARG_TYPE (parm))) + && ! TREE_ADDRESSABLE (TREE_TYPE (passed_type))) { rtx copy; - tree type = DECL_ARG_TYPE (parm); + tree type = TREE_TYPE (passed_type); /* This sequence may involve a library call perhaps clobbering registers that haven't been copied to pseudos yet. */ @@ -6337,8 +6408,6 @@ allocate_struct_function (tree fndecl) DECL_SAVED_INSNS (fndecl) = cfun; cfun->decl = fndecl; - current_function_name = (*lang_hooks.decl_printable_name) (fndecl, 2); - result = DECL_RESULT (fndecl); if (aggregate_value_p (result, fndecl)) { @@ -6681,7 +6750,7 @@ expand_function_start (tree subr, int parms_have_cleanups) tem = decl_function_context (tem); if (tem == 0) break; - /* Chain thru stack frames, assuming pointer to next lexical frame + /* Chain through stack frames, assuming pointer to next lexical frame is found at the place we always store it. */ #ifdef FRAME_GROWS_DOWNWARD last_ptr = plus_constant (last_ptr, @@ -6986,16 +7055,14 @@ expand_function_end (void) /* If we had calls to alloca, and this machine needs an accurate stack pointer to exit the function, insert some code to save and restore the stack pointer. */ -#ifdef EXIT_IGNORE_STACK - if (! EXIT_IGNORE_STACK) -#endif - if (current_function_calls_alloca) - { - rtx tem = 0; + if (! EXIT_IGNORE_STACK + && current_function_calls_alloca) + { + rtx tem = 0; - emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn); - emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX); - } + emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn); + emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX); + } /* If scalar return value was computed in a pseudo-reg, or was a named return value that got dumped to the stack, copy that to the hard @@ -7107,6 +7174,11 @@ expand_function_end (void) cfun->x_clobber_return_insn = after; } + /* Output the label for the naked return from the function, if one is + expected. This is currently used only by __builtin_return. */ + if (naked_return_label) + emit_label (naked_return_label); + /* ??? This should no longer be necessary since stupid is no longer with us, but there are some parts of the compiler (eg reload_combine, and sh mach_dep_reorg) that still try and compute their own lifetime info @@ -7246,9 +7318,9 @@ sibcall_epilogue_contains (rtx insn) static void emit_return_into_block (basic_block bb, rtx line_note) { - emit_jump_insn_after (gen_return (), bb->end); + emit_jump_insn_after (gen_return (), BB_END (bb)); if (line_note) - emit_note_copy_after (line_note, PREV_INSN (bb->end)); + emit_note_copy_after (line_note, PREV_INSN (BB_END (bb))); } #endif /* HAVE_return */ @@ -7292,9 +7364,12 @@ struct epi_info rtx equiv_reg_src; /* If nonzero, the value that SP_EQUIV_REG should be set to once we no longer need its value. */ + rtx const_equiv[FIRST_PSEUDO_REGISTER]; /* Any known constant equivalences + for registers. */ }; static void handle_epilogue_set (rtx, struct epi_info *); +static void update_epilogue_consts (rtx, rtx, void *); static void emit_equiv_load (struct epi_info *); /* Modify INSN, a list of one or more insns that is part of the epilogue, to @@ -7307,8 +7382,7 @@ keep_stack_depressed (rtx insns) struct epi_info info; rtx insn, next; - /* If the epilogue is just a single instruction, it ust be OK as is. */ - + /* If the epilogue is just a single instruction, it must be OK as is. */ if (NEXT_INSN (insns) == NULL_RTX) return insns; @@ -7320,6 +7394,9 @@ keep_stack_depressed (rtx insns) info.sp_offset = 0; info.equiv_reg_src = 0; + for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) + info.const_equiv[j] = 0; + insn = insns; next = NULL_RTX; while (insn != NULL_RTX) @@ -7411,7 +7488,8 @@ keep_stack_depressed (rtx insns) && !refers_to_regno_p (regno, regno + HARD_REGNO_NREGS (regno, Pmode), - info.equiv_reg_src, NULL)) + info.equiv_reg_src, NULL) + && info.const_equiv[regno] == 0) break; if (regno == FIRST_PSEUDO_REGISTER) @@ -7467,6 +7545,8 @@ keep_stack_depressed (rtx insns) info.sp_equiv_reg = info.new_sp_equiv_reg; info.sp_offset = info.new_sp_offset; + /* Now update any constants this insn sets. */ + note_stores (PATTERN (insn), update_epilogue_consts, &info); insn = next; } @@ -7490,11 +7570,18 @@ handle_epilogue_set (rtx set, struct epi_info *p) if (SET_DEST (set) != stack_pointer_rtx) abort (); - if (GET_CODE (SET_SRC (set)) == PLUS - && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT) + if (GET_CODE (SET_SRC (set)) == PLUS) { p->new_sp_equiv_reg = XEXP (SET_SRC (set), 0); - p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1)); + if (GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT) + p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1)); + else if (GET_CODE (XEXP (SET_SRC (set), 1)) == REG + && REGNO (XEXP (SET_SRC (set), 1)) < FIRST_PSEUDO_REGISTER + && p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))] != 0) + p->new_sp_offset + = INTVAL (p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))]); + else + abort (); } else p->new_sp_equiv_reg = SET_SRC (set), p->new_sp_offset = 0; @@ -7517,11 +7604,16 @@ handle_epilogue_set (rtx set, struct epi_info *p) there seems little point in handling that case. Note that we have to allow for the case where we are setting the register set in the previous part of a PARALLEL inside a single insn. But use the - old offset for any updates within this insn. */ + old offset for any updates within this insn. We must allow for the case + where the register is being set in a different (usually wider) mode than + Pmode). */ else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set)) { - if (!rtx_equal_p (p->new_sp_equiv_reg, SET_DEST (set)) - || p->equiv_reg_src != 0) + if (p->equiv_reg_src != 0 + || GET_CODE (p->new_sp_equiv_reg) != REG + || GET_CODE (SET_DEST (set)) != REG + || GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) > BITS_PER_WORD + || REGNO (p->new_sp_equiv_reg) != REGNO (SET_DEST (set))) abort (); else p->equiv_reg_src @@ -7544,15 +7636,38 @@ handle_epilogue_set (rtx set, struct epi_info *p) } } +/* Update the tracking information for registers set to constants. */ + +static void +update_epilogue_consts (rtx dest, rtx x, void *data) +{ + struct epi_info *p = (struct epi_info *) data; + + if (GET_CODE (dest) != REG || REGNO (dest) >= FIRST_PSEUDO_REGISTER) + return; + else if (GET_CODE (x) == CLOBBER || ! rtx_equal_p (dest, SET_DEST (x)) + || GET_CODE (SET_SRC (x)) != CONST_INT) + p->const_equiv[REGNO (dest)] = 0; + else + p->const_equiv[REGNO (dest)] = SET_SRC (x); +} + /* Emit an insn to do the load shown in p->equiv_reg_src, if needed. */ static void emit_equiv_load (struct epi_info *p) { if (p->equiv_reg_src != 0) - emit_move_insn (p->sp_equiv_reg, p->equiv_reg_src); + { + rtx dest = p->sp_equiv_reg; + + if (GET_MODE (p->equiv_reg_src) != GET_MODE (dest)) + dest = gen_rtx_REG (GET_MODE (p->equiv_reg_src), + REGNO (p->sp_equiv_reg)); - p->equiv_reg_src = 0; + emit_move_insn (dest, p->equiv_reg_src); + p->equiv_reg_src = 0; + } } #endif @@ -7630,7 +7745,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) last = e->src; /* Verify that there are no active instructions in the last block. */ - label = last->end; + label = BB_END (last); while (label && GET_CODE (label) != CODE_LABEL) { if (active_insn_p (label)) @@ -7638,7 +7753,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) label = PREV_INSN (label); } - if (last->head == label && GET_CODE (label) == CODE_LABEL) + if (BB_HEAD (last) == label && GET_CODE (label) == CODE_LABEL) { rtx epilogue_line_note = NULL_RTX; @@ -7662,7 +7777,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) if (bb == ENTRY_BLOCK_PTR) continue; - jump = bb->end; + jump = BB_END (bb); if ((GET_CODE (jump) != JUMP_INSN) || JUMP_LABEL (jump) != label) continue; @@ -7697,9 +7812,9 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) /* Emit a return insn for the exit fallthru block. Whether this is still reachable will be determined later. */ - emit_barrier_after (last->end); + emit_barrier_after (BB_END (last)); emit_return_into_block (last, epilogue_line_note); - epilogue_end = last->end; + epilogue_end = BB_END (last); last->succ->flags &= ~EDGE_FALLTHRU; goto epilogue_done; } @@ -7755,7 +7870,7 @@ epilogue_done: for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) { basic_block bb = e->src; - rtx insn = bb->end; + rtx insn = BB_END (bb); rtx i; rtx newinsn; @@ -7812,7 +7927,7 @@ epilogue_done: } /* Find the last line number note in the first block. */ - for (insn = ENTRY_BLOCK_PTR->next_bb->end; + for (insn = BB_END (ENTRY_BLOCK_PTR->next_bb); insn != prologue_end && insn; insn = PREV_INSN (insn)) if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) diff --git a/gcc/function.h b/gcc/function.h index 9c06d95a095..44fcb3fc378 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -183,9 +183,6 @@ struct function GTY(()) /* For function.c. */ - /* Name of this function. */ - const char *name; - /* Points to the FUNCTION_DECL of this function. */ tree decl; @@ -270,6 +267,11 @@ struct function GTY(()) on machines which require execution of the epilogue on all returns. */ rtx x_return_label; + /* Label that will go on the end of function epilogue. + Jumping to this label serves as a "naked return" instruction + on machines which require execution of the epilogue on all returns. */ + rtx x_naked_return_label; + /* Label and register for unswitching computed gotos. */ rtx computed_goto_common_label; rtx computed_goto_common_reg; @@ -455,9 +457,10 @@ struct function GTY(()) /* Nonzero if the function being compiled issues a computed jump. */ unsigned int has_computed_jump : 1; - /* Nonzero if the current function is a thunk (a lightweight function that - just adjusts one of its arguments and forwards to another function), so - we should try to cut corners where we can. */ + /* Nonzero if the current function is a thunk, i.e., a lightweight + function implemented by the output_mi_thunk hook) that just + adjusts one of its arguments and forwards to another + function. */ unsigned int is_thunk : 1; /* This bit is used by the exception handling logic. It is set if all @@ -519,6 +522,9 @@ struct function GTY(()) /* The function currently being compiled. */ extern GTY(()) struct function *cfun; +/* Pointer to chain of `struct function' for containing functions. */ +extern GTY(()) struct function *outer_function_chain; + /* Nonzero if we've already converted virtual regs to hard regs. */ extern int virtuals_instantiated; @@ -526,7 +532,6 @@ extern int virtuals_instantiated; extern int trampolines_created; /* For backward compatibility... eventually these should all go away. */ -#define current_function_name (cfun->name) #define current_function_pops_args (cfun->pops_args) #define current_function_returns_struct (cfun->returns_struct) #define current_function_returns_pcc_struct (cfun->returns_pcc_struct) @@ -563,6 +568,7 @@ extern int trampolines_created; #define parm_reg_stack_loc (cfun->x_parm_reg_stack_loc) #define cleanup_label (cfun->x_cleanup_label) #define return_label (cfun->x_return_label) +#define naked_return_label (cfun->x_naked_return_label) #define save_expr_regs (cfun->x_save_expr_regs) #define stack_slot_list (cfun->x_stack_slot_list) #define parm_birth_insn (cfun->x_parm_birth_insn) diff --git a/gcc/future.options b/gcc/future.options deleted file mode 100644 index 6654dd0b84e..00000000000 --- a/gcc/future.options +++ /dev/null @@ -1,40 +0,0 @@ -From: friedman@gnu.ai.mit.edu (Noah Friedman) -To: roland@gnu.ai.mit.edu (Roland McGrath), - rms@gnu.ai.mit.edu (Richard Stallman), - jimb@gnu.ai.mit.edu (Jim Blandy), - mib@gnu.ai.mit.edu (Michael Bushnell) -Cc: cgw@sol.acs.unt.edu (chris williams), - clc@gnu.ai.mit.edu (Christian Longshore Claiborn) -Subject: Some gcc options we'd like to see. -Date: Mon, 28 Jun 93 00:45:09 EST -Reply-To: friedman@gnu.ai.mit.edu - --Waggravate-return --Wcast-spell --Wcaste-align --Win --Wmissing-protons --Wredundant-repetitions --antsy --fbungee-jump --fexpensive-operations --fextra-strength --fjesus-saves --fkeep-programmers-inline --fno-peeping-toms --fruit-roll-ups --fshort-enough --mno-dialogue --pedophile --vomit-frame-pointer - -From: Alexandre Oliva -Date: 06 Jan 2002 17:37:07 -0200 - -On Jan 2, 2002, in a long, heated thread concerning the interpretation -of certain passages of the C standard, jtv wrote: - -> (Yes, I'm a pedant. I'm pining for the day when gcc will support the -> options "-ffascist -Wanal") - -How about introducing the options `-flame -War' :-) diff --git a/gcc/gcc.c b/gcc/gcc.c index b54fc0796f7..20d54074f24 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -73,6 +73,7 @@ compilation is specified by a string called a "spec". */ #include "config.h" #include "system.h" #include "coretypes.h" +#include "multilib.h" /* before tm.h */ #include "tm.h" #include #if ! defined( SIGCHLD ) && defined( SIGCLD ) @@ -676,7 +677,7 @@ proper position among the other output files. */ %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ - %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs:-lgcov}\ + %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}\ %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" #endif @@ -791,7 +792,6 @@ static const char *multilib_select; static const char *multilib_matches; static const char *multilib_defaults; static const char *multilib_exclusions; -#include "multilib.h" /* Check whether a particular argument is a default argument. */ @@ -1633,12 +1633,14 @@ init_spec (void) #else "-lgcc_s%M" #endif + , + "-lgcc", + "-lgcc_eh" #ifdef USE_LIBUNWIND_EXCEPTIONS " -lunwind" #endif - , - "-lgcc", - "-lgcc_eh"); + ); + p += 5; in_sep = 0; } @@ -1654,7 +1656,11 @@ init_spec (void) #endif , "libgcc.a%s", - "libgcc_eh.a%s"); + "libgcc_eh.a%s" +#ifdef USE_LIBUNWIND_EXCEPTIONS + " -lunwind" +#endif + ); p += 10; in_sep = 0; } @@ -2678,7 +2684,14 @@ execute (void) } fflush (stderr); if (verbose_only_flag != 0) - return 0; + { + /* verbose_only_flag should act as if the spec was + executed, so increment execution_count before + returning. This prevents spurious warnings about + unused linker input files, etc. */ + execution_count++; + return 0; + } #ifdef DEBUG notice ("\nGo ahead? (y or n) "); fflush (stderr); @@ -2809,7 +2822,7 @@ execute (void) fatal ("\ Internal error: %s (program %s)\n\ Please submit a full bug report.\n\ -See %s for instructions.", +Send email to %s for instructions.", strsignal (WTERMSIG (status)), commands[j].prog, bug_report_url); signal_count++; @@ -4082,29 +4095,41 @@ set_collect_gcc_options (void) if (switches[i].live_cond == SWITCH_IGNORE) continue; - obstack_grow (&collect_obstack, "'-", 2); +#if defined(_WIN32) && !defined(__CYGWIN__) +#define QUOTE_STR "\"" +#define QUOTE_CHAR '"' +#define QUOTED_QUOTE_STR "\"\\\"\"" +#else +#define QUOTE_STR "\'" +#define QUOTE_CHAR '\'' +#define QUOTED_QUOTE_STR "'\\''" +#endif + + obstack_grow (&collect_obstack, QUOTE_STR "-", 2); q = switches[i].part1; - while ((p = strchr (q, '\''))) + while ((p = strchr (q, QUOTE_CHAR))) { obstack_grow (&collect_obstack, q, p - q); - obstack_grow (&collect_obstack, "'\\''", 4); + obstack_grow (&collect_obstack, QUOTED_QUOTE_STR, + strlen (QUOTED_QUOTE_STR)); q = ++p; } obstack_grow (&collect_obstack, q, strlen (q)); - obstack_grow (&collect_obstack, "'", 1); + obstack_grow (&collect_obstack, QUOTE_STR, 1); for (args = switches[i].args; args && *args; args++) { - obstack_grow (&collect_obstack, " '", 2); + obstack_grow (&collect_obstack, " " QUOTE_STR, 2); q = *args; - while ((p = strchr (q, '\''))) + while ((p = strchr (q, QUOTE_CHAR))) { obstack_grow (&collect_obstack, q, p - q); - obstack_grow (&collect_obstack, "'\\''", 4); + obstack_grow (&collect_obstack, QUOTED_QUOTE_STR, + strlen (QUOTED_QUOTE_STR)); q = ++p; } obstack_grow (&collect_obstack, q, strlen (q)); - obstack_grow (&collect_obstack, "'", 1); + obstack_grow (&collect_obstack, QUOTE_STR, 1); } } obstack_grow (&collect_obstack, "\0", 1); diff --git a/gcc/gcov.c b/gcc/gcov.c index d3037c775b8..f95334a4319 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -906,7 +906,7 @@ read_graph_file (void) } gcov_close (); - /* We built everything backwards, so nreverse them all */ + /* We built everything backwards, so nreverse them all. */ /* Reverse sources. Not strictly necessary, but we'll then process them in the 'expected' order. */ diff --git a/gcc/gcse.c b/gcc/gcse.c index 3e09f02252b..cf845af0da7 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -150,6 +150,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "rtl.h" +#include "tree.h" #include "tm_p.h" #include "regs.h" #include "hard-reg-set.h" @@ -160,6 +161,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "basic-block.h" #include "output.h" #include "function.h" +#include "langhooks.h" #include "expr.h" #include "except.h" #include "ggc.h" @@ -468,7 +470,7 @@ struct ls_expr struct ls_expr * next; /* Next in the list. */ int invalid; /* Invalid for some reason. */ int index; /* If it maps to a bitmap index. */ - int hash_index; /* Index when in a hash table. */ + unsigned int hash_index; /* Index when in a hash table. */ rtx reaching_reg; /* Register to use when re-writing. */ }; @@ -679,6 +681,7 @@ static void compute_ld_motion_mems (void); static void trim_ld_motion_mems (void); static void update_ld_motion_stores (struct expr *); static void reg_set_info (rtx, rtx, void *); +static void reg_clear_last_set (rtx, rtx, void *); static bool store_ops_ok (rtx, int *); static rtx extract_mentioned_regs (rtx); static rtx extract_mentioned_regs_helper (rtx, rtx); @@ -853,7 +856,8 @@ gcse_main (rtx f, FILE *file) if (file) { fprintf (file, "GCSE of %s: %d basic blocks, ", - current_function_name, n_basic_blocks); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + n_basic_blocks); fprintf (file, "%d pass%s, %d bytes\n\n", pass, pass > 1 ? "es" : "", max_pass_bytes); } @@ -1513,12 +1517,14 @@ oprs_available_p (rtx x, rtx insn) MODE is only used if X is a CONST_INT. DO_NOT_RECORD_P is a boolean indicating if a volatile operand is found or if the expression contains - something we don't want to insert in the table. + something we don't want to insert in the table. HASH_TABLE_SIZE is + the current size of the hash table to be probed. ??? One might want to merge this with canon_hash. Later. */ static unsigned int -hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p, int hash_table_size) +hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p, + int hash_table_size) { unsigned int hash; @@ -2200,12 +2206,12 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table) /* A copy is not available if its src or dest is subsequently modified. Here we want to search from INSN+1 on, but oprs_available_p searches from INSN on. */ - && (insn == BLOCK_END (BLOCK_NUM (insn)) + && (insn == BB_END (BLOCK_FOR_INSN (insn)) || ((tmp = next_nonnote_insn (insn)) != NULL_RTX && oprs_available_p (pat, tmp)))) insert_set_in_table (pat, insn, table); } - /* In case of store we want to consider the memory value as avaiable in + /* In case of store we want to consider the memory value as available in the REG stored in that memory. This makes it possible to remove redundant loads from due to stores to the same location. */ else if (flag_gcse_las && GET_CODE (src) == REG && GET_CODE (dest) == MEM) @@ -2507,8 +2513,8 @@ compute_hash_table_work (struct hash_table *table) ??? hard-reg reg_set_in_block computation could be moved to compute_sets since they currently don't change. */ - for (insn = current_bb->head; - insn && insn != NEXT_INSN (current_bb->end); + for (insn = BB_HEAD (current_bb); + insn && insn != NEXT_INSN (BB_END (current_bb)); insn = NEXT_INSN (insn)) { if (! INSN_P (insn)) @@ -2538,12 +2544,12 @@ compute_hash_table_work (struct hash_table *table) if (table->set_p && implicit_sets[current_bb->index] != NULL_RTX) hash_scan_set (implicit_sets[current_bb->index], - current_bb->head, table); + BB_HEAD (current_bb), table); /* The next pass builds the hash table. */ - for (insn = current_bb->head, in_libcall_block = 0; - insn && insn != NEXT_INSN (current_bb->end); + for (insn = BB_HEAD (current_bb), in_libcall_block = 0; + insn && insn != NEXT_INSN (BB_END (current_bb)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) { @@ -3537,8 +3543,8 @@ classic_gcse (void) start of the block]. */ reset_opr_set_tables (); - for (insn = bb->head; - insn != NULL && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { /* Is insn of form (set (pseudo-reg) ...)? */ @@ -3610,7 +3616,8 @@ one_classic_gcse_pass (int pass) { fprintf (gcse_file, "\n"); fprintf (gcse_file, "GCSE of %s, pass %d: %d bytes needed, %d substs,", - current_function_name, pass, bytes_used, gcse_subst_count); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + pass, bytes_used, gcse_subst_count); fprintf (gcse_file, "%d insns created\n", gcse_create_count); } @@ -4474,8 +4481,8 @@ cprop (int alter_jumps) start of the block]. */ reset_opr_set_tables (); - for (insn = bb->head; - insn != NULL && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) { @@ -4556,6 +4563,38 @@ fis_get_condition (rtx jump) return tmp; } +/* Check the comparison COND to see if we can safely form an implicit set from + it. COND is either an EQ or NE comparison. */ + +static bool +implicit_set_cond_p (rtx cond) +{ + enum machine_mode mode = GET_MODE (XEXP (cond, 0)); + rtx cst = XEXP (cond, 1); + + /* We can't perform this optimization if either operand might be or might + contain a signed zero. */ + if (HONOR_SIGNED_ZEROS (mode)) + { + /* It is sufficient to check if CST is or contains a zero. We must + handle float, complex, and vector. If any subpart is a zero, then + the optimization can't be performed. */ + /* ??? The complex and vector checks are not implemented yet. We just + always return zero for them. */ + if (GET_CODE (cst) == CONST_DOUBLE) + { + REAL_VALUE_TYPE d; + REAL_VALUE_FROM_CONST_DOUBLE (d, cst); + if (REAL_VALUES_EQUAL (d, dconst0)) + return 0; + } + else + return 0; + } + + return gcse_constant_p (cst); +} + /* Find the implicit sets of a function. An "implicit set" is a constraint on the value of a variable, implied by a conditional jump. For example, following "if (x == 2)", the then branch may be optimized as though the @@ -4575,13 +4614,13 @@ find_implicit_sets (void) /* Check for more than one successor. */ if (bb->succ && bb->succ->succ_next) { - cond = fis_get_condition (bb->end); + cond = fis_get_condition (BB_END (bb)); if (cond && (GET_CODE (cond) == EQ || GET_CODE (cond) == NE) && GET_CODE (XEXP (cond, 0)) == REG && REGNO (XEXP (cond, 0)) >= FIRST_PSEUDO_REGISTER - && gcse_constant_p (XEXP (cond, 1))) + && implicit_set_cond_p (cond)) { dest = GET_CODE (cond) == EQ ? BRANCH_EDGE (bb)->dest : FALLTHRU_EDGE (bb)->dest; @@ -4650,7 +4689,8 @@ one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps) if (gcse_file) { fprintf (gcse_file, "CPROP of %s, pass %d: %d bytes needed, ", - current_function_name, pass, bytes_used); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + pass, bytes_used); fprintf (gcse_file, "%d const props, %d copy props\n\n", const_prop_count, copy_prop_count); } @@ -4898,8 +4938,8 @@ bypass_conditional_jumps (void) if (bb->pred && bb->pred->pred_next) { setcc = NULL_RTX; - for (insn = bb->head; - insn != NULL && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) if (GET_CODE (insn) == INSN) { @@ -5190,7 +5230,7 @@ process_insert_insn (struct expr *expr) static void insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) { - rtx insn = bb->end; + rtx insn = BB_END (bb); rtx new_insn; rtx reg = expr->reaching_reg; int regno = REGNO (reg); @@ -5271,7 +5311,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) /* Since different machines initialize their parameter registers in different orders, assume nothing. Collect the set of all parameter registers. */ - insn = find_first_parameter_load (insn, bb->head); + insn = find_first_parameter_load (insn, BB_HEAD (bb)); /* If we found all the parameter loads, then we want to insert before the first parameter load. @@ -5752,7 +5792,8 @@ one_pre_gcse_pass (int pass) if (gcse_file) { fprintf (gcse_file, "\nPRE GCSE of %s, pass %d: %d bytes needed, ", - current_function_name, pass, bytes_used); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + pass, bytes_used); fprintf (gcse_file, "%d substs, %d insns created\n", gcse_subst_count, gcse_create_count); } @@ -5831,7 +5872,7 @@ compute_transpout (void) /* Note that flow inserted a nop a the end of basic blocks that end in call instructions for reasons other than abnormal control flow. */ - if (GET_CODE (bb->end) != CALL_INSN) + if (GET_CODE (BB_END (bb)) != CALL_INSN) continue; for (i = 0; i < expr_hash_table.size; i++) @@ -5913,8 +5954,8 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin, /* Scan each insn in the basic block looking for memory references and register sets. */ - stop_insn = NEXT_INSN (current_block->end); - for (insn = current_block->head; + stop_insn = NEXT_INSN (BB_HEAD (current_block)); + for (insn = BB_HEAD (current_block); insn != stop_insn; insn = NEXT_INSN (insn)) { @@ -5969,7 +6010,7 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin, against zero. */ FOR_EACH_BB (bb) { - rtx last_insn = bb->end; + rtx last_insn = BB_END (bb); rtx condition, earliest; int compare_and_branch; @@ -6019,7 +6060,7 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin, delete_insn (earliest); purge_dead_edges (bb); - /* Don't check this block again. (Note that BLOCK_END is + /* Don't check this block again. (Note that BB_END is invalid here; we deleted the last instruction in the block.) */ block_reg[bb->index] = 0; @@ -6085,7 +6126,7 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED) block_reg = xcalloc (last_basic_block, sizeof (int)); FOR_EACH_BB (bb) { - rtx last_insn = bb->end; + rtx last_insn = BB_END (bb); rtx condition, earliest, reg; /* We only want conditional branches. */ @@ -6146,9 +6187,6 @@ static sbitmap *hoist_vbeout; /* Hoistable expressions. */ static sbitmap *hoist_exprs; -/* Dominator bitmaps. */ -dominance_info dominators; - /* ??? We could compute post dominators and run this algorithm in reverse to perform tail merging, doing so would probably be more effective than the tail merging code in jump.c. @@ -6185,7 +6223,7 @@ free_code_hoist_mem (void) sbitmap_vector_free (hoist_exprs); sbitmap_vector_free (transpout); - free_dominance_info (dominators); + free_dominance_info (CDI_DOMINATORS); } /* Compute the very busy expressions at entry/exit from each block. @@ -6234,7 +6272,7 @@ compute_code_hoist_data (void) compute_local_properties (transp, comp, antloc, &expr_hash_table); compute_transpout (); compute_code_hoist_vbeinout (); - dominators = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); if (gcse_file) fprintf (gcse_file, "\n"); } @@ -6326,7 +6364,7 @@ hoist_code (void) int found = 0; int insn_inserted_p; - domby_len = get_dominated_by (dominators, bb, &domby); + domby_len = get_dominated_by (CDI_DOMINATORS, bb, &domby); /* Examine each expression that is very busy at the exit of this block. These are the potentially hoistable expressions. */ for (i = 0; i < hoist_vbeout[bb->index]->n_bits; i++) @@ -6519,28 +6557,29 @@ one_code_hoisting_pass (void) static struct ls_expr * ldst_entry (rtx x) { + int do_not_record_p = 0; struct ls_expr * ptr; + unsigned int hash; - for (ptr = first_ls_expr(); ptr != NULL; ptr = next_ls_expr (ptr)) - if (expr_equiv_p (ptr->pattern, x)) - break; + hash = hash_expr_1 (x, GET_MODE (x), & do_not_record_p); - if (!ptr) - { - ptr = xmalloc (sizeof (struct ls_expr)); + for (ptr = pre_ldst_mems; ptr != NULL; ptr = ptr->next) + if (ptr->hash_index == hash && expr_equiv_p (ptr->pattern, x)) + return ptr; - ptr->next = pre_ldst_mems; - ptr->expr = NULL; - ptr->pattern = x; - ptr->pattern_regs = NULL_RTX; - ptr->loads = NULL_RTX; - ptr->stores = NULL_RTX; - ptr->reaching_reg = NULL_RTX; - ptr->invalid = 0; - ptr->index = 0; - ptr->hash_index = 0; - pre_ldst_mems = ptr; - } + ptr = xmalloc (sizeof (struct ls_expr)); + + ptr->next = pre_ldst_mems; + ptr->expr = NULL; + ptr->pattern = x; + ptr->pattern_regs = NULL_RTX; + ptr->loads = NULL_RTX; + ptr->stores = NULL_RTX; + ptr->reaching_reg = NULL_RTX; + ptr->invalid = 0; + ptr->index = 0; + ptr->hash_index = hash; + pre_ldst_mems = ptr; return ptr; } @@ -6743,8 +6782,8 @@ compute_ld_motion_mems (void) FOR_EACH_BB (bb) { - for (insn = bb->head; - insn && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { if (INSN_P (insn)) @@ -6800,56 +6839,41 @@ compute_ld_motion_mems (void) static void trim_ld_motion_mems (void) { - struct ls_expr * last = NULL; - struct ls_expr * ptr = first_ls_expr (); + struct ls_expr * * last = & pre_ldst_mems; + struct ls_expr * ptr = pre_ldst_mems; while (ptr != NULL) { - int del = ptr->invalid; - struct expr * expr = NULL; + struct expr * expr; /* Delete if entry has been made invalid. */ - if (!del) + if (! ptr->invalid) { - unsigned int i; - - del = 1; /* Delete if we cannot find this mem in the expression list. */ - for (i = 0; i < expr_hash_table.size && del; i++) - { - for (expr = expr_hash_table.table[i]; - expr != NULL; - expr = expr->next_same_hash) - if (expr_equiv_p (expr->expr, ptr->pattern)) - { - del = 0; - break; - } - } - } + unsigned int hash = ptr->hash_index % expr_hash_table.size; - if (del) - { - if (last != NULL) - { - last->next = ptr->next; - free_ldst_entry (ptr); - ptr = last->next; - } - else - { - pre_ldst_mems = pre_ldst_mems->next; - free_ldst_entry (ptr); - ptr = pre_ldst_mems; - } + for (expr = expr_hash_table.table[hash]; + expr != NULL; + expr = expr->next_same_hash) + if (expr_equiv_p (expr->expr, ptr->pattern)) + break; } else + expr = (struct expr *) 0; + + if (expr) { /* Set the expression field if we are keeping it. */ - last = ptr; ptr->expr = expr; + last = & ptr->next; ptr = ptr->next; } + else + { + *last = ptr->next; + free_ldst_entry (ptr); + ptr = * last; + } } /* Show the world what we've found. */ @@ -6933,17 +6957,41 @@ static sbitmap * st_antloc; /* Global holding the number of store expressions we are dealing with. */ static int num_stores; -/* Checks to set if we need to mark a register set. Called from note_stores. */ +/* Checks to set if we need to mark a register set. Called from + note_stores. */ static void reg_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) + void *data) { + sbitmap bb_reg = data; + if (GET_CODE (dest) == SUBREG) dest = SUBREG_REG (dest); if (GET_CODE (dest) == REG) - regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn); + { + regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn); + if (bb_reg) + SET_BIT (bb_reg, REGNO (dest)); + } +} + +/* Clear any mark that says that this insn sets dest. Called from + note_stores. */ + +static void +reg_clear_last_set (rtx dest, rtx setter ATTRIBUTE_UNUSED, + void *data) +{ + int *dead_vec = data; + + if (GET_CODE (dest) == SUBREG) + dest = SUBREG_REG (dest); + + if (GET_CODE (dest) == REG && + dead_vec[REGNO (dest)] == INSN_UID (compute_store_table_current_insn)) + dead_vec[REGNO (dest)] = 0; } /* Return zero if some of the registers in list X are killed @@ -7143,7 +7191,7 @@ find_moveable_store (rtx insn, int *regs_set_before, int *regs_set_after) failed last time. */ if (LAST_AVAIL_CHECK_FAILURE (ptr)) { - for (tmp = bb->end; + for (tmp = BB_END (bb); tmp != insn && tmp != LAST_AVAIL_CHECK_FAILURE (ptr); tmp = PREV_INSN (tmp)) continue; @@ -7177,18 +7225,17 @@ compute_store_table (void) max_gcse_regno); sbitmap_vector_zero (reg_set_in_block, last_basic_block); pre_ldst_mems = 0; - last_set_in = xmalloc (sizeof (int) * max_gcse_regno); + last_set_in = xcalloc (max_gcse_regno, sizeof (int)); already_set = xmalloc (sizeof (int) * max_gcse_regno); /* Find all the stores we care about. */ FOR_EACH_BB (bb) { /* First compute the registers set in this block. */ - memset (last_set_in, 0, sizeof (int) * max_gcse_regno); regvec = last_set_in; - for (insn = bb->head; - insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { if (! INSN_P (insn)) @@ -7206,24 +7253,22 @@ compute_store_table (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (clobbers_all || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) - last_set_in[regno] = INSN_UID (insn); + { + last_set_in[regno] = INSN_UID (insn); + SET_BIT (reg_set_in_block[bb->index], regno); + } } pat = PATTERN (insn); compute_store_table_current_insn = insn; - note_stores (pat, reg_set_info, NULL); + note_stores (pat, reg_set_info, reg_set_in_block[bb->index]); } - /* Record the set registers. */ - for (regno = 0; regno < max_gcse_regno; regno++) - if (last_set_in[regno]) - SET_BIT (reg_set_in_block[bb->index], regno); - /* Now find the stores. */ memset (already_set, 0, sizeof (int) * max_gcse_regno); regvec = already_set; - for (insn = bb->head; - insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { if (! INSN_P (insn)) @@ -7251,11 +7296,32 @@ compute_store_table (void) find_moveable_store (insn, already_set, last_set_in); /* Unmark regs that are no longer set. */ - for (regno = 0; regno < max_gcse_regno; regno++) - if (last_set_in[regno] == INSN_UID (insn)) - last_set_in[regno] = 0; + compute_store_table_current_insn = insn; + note_stores (pat, reg_clear_last_set, last_set_in); + if (GET_CODE (insn) == CALL_INSN) + { + bool clobbers_all = false; +#ifdef NON_SAVING_SETJMP + if (NON_SAVING_SETJMP + && find_reg_note (insn, REG_SETJMP, NULL_RTX)) + clobbers_all = true; +#endif + + for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) + if ((clobbers_all + || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + && last_set_in[regno] == INSN_UID (insn)) + last_set_in[regno] = 0; + } } +#ifdef ENABLE_CHECKING + /* last_set_in should now be all-zero. */ + for (regno = 0; regno < max_gcse_regno; regno++) + if (last_set_in[regno] != 0) + abort (); +#endif + /* Clear temporary marks. */ for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr)) { @@ -7435,7 +7501,7 @@ static bool store_killed_after (rtx x, rtx x_regs, rtx insn, basic_block bb, int *regs_set_after, rtx *fail_insn) { - rtx last = bb->end, act; + rtx last = BB_END (bb), act; if (!store_ops_ok (x_regs, regs_set_after)) { @@ -7464,7 +7530,7 @@ static bool store_killed_before (rtx x, rtx x_regs, rtx insn, basic_block bb, int *regs_set_before) { - rtx first = bb->head; + rtx first = BB_HEAD (bb); if (!store_ops_ok (x_regs, regs_set_before)) return true; @@ -7539,7 +7605,7 @@ build_store_vectors (void) for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr)) { - if (store_killed_after (ptr->pattern, ptr->pattern_regs, bb->head, + if (store_killed_after (ptr->pattern, ptr->pattern_regs, BB_HEAD (bb), bb, regs_set_in_block, NULL)) { /* It should not be necessary to consider the expression @@ -7565,14 +7631,14 @@ build_store_vectors (void) } /* Insert an instruction at the beginning of a basic block, and update - the BLOCK_HEAD if needed. */ + the BB_HEAD if needed. */ static void insert_insn_start_bb (rtx insn, basic_block bb) { /* Insert at start of successor block. */ - rtx prev = PREV_INSN (bb->head); - rtx before = bb->head; + rtx prev = PREV_INSN (BB_HEAD (bb)); + rtx before = BB_HEAD (bb); while (before != 0) { if (GET_CODE (before) != CODE_LABEL @@ -7580,7 +7646,7 @@ insert_insn_start_bb (rtx insn, basic_block bb) || NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK)) break; prev = before; - if (prev == bb->end) + if (prev == BB_END (bb)) break; before = NEXT_INSN (before); } @@ -7715,9 +7781,9 @@ remove_reachable_equiv_notes (basic_block bb, struct ls_expr *smexpr) last = XEXP (last, 0); } else - last = NEXT_INSN (bb->end); + last = NEXT_INSN (BB_END (bb)); - for (insn = bb->head; insn != last; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn != last; insn = NEXT_INSN (insn)) if (INSN_P (insn)) { note = find_reg_equal_equiv_note (insn); @@ -7771,7 +7837,7 @@ replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr) /* Now we must handle REG_EQUAL notes whose contents is equal to the mem; they are no longer accurate provided that they are reached by this definition, so drop them. */ - for (; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn)) + for (; insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) { set = single_set (insn); @@ -7926,7 +7992,7 @@ bypass_jumps (FILE *file) if (file) dump_flow_info (file); - /* Return if there's nothing to do, or it is too expensive */ + /* Return if there's nothing to do, or it is too expensive. */ if (n_basic_blocks <= 1 || is_too_expensive (_ ("jump bypassing disabled"))) return 0; @@ -7956,7 +8022,8 @@ bypass_jumps (FILE *file) if (file) { fprintf (file, "BYPASS of %s: %d basic blocks, ", - current_function_name, n_basic_blocks); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + n_basic_blocks); fprintf (file, "%d bytes\n\n", bytes_used); } diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 7024c01793b..ccf82c68a2a 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -100,6 +100,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), integrated)) #define ATTR_EQ_ATTR_P(RTX) (RTX_FLAG((RTX), volatil)) +#if 0 +#define strcmp_check(S1, S2) ((S1) == (S2) \ + ? 0 \ + : (strcmp ((S1), (S2)) \ + ? 1 \ + : (abort (), 0))) +#else +#define strcmp_check(S1, S2) ((S1) != (S2)) +#endif + #include "bconfig.h" #include "system.h" #include "coretypes.h" @@ -339,6 +349,10 @@ static rtx true_rtx, false_rtx; /* Used to reduce calls to `strcmp' */ static char *alternative_name; +static const char *length_str; +static const char *delay_type_str; +static const char *delay_1_0_str; +static const char *num_delay_slots_str; /* Indicate that REG_DEAD notes are valid if dead_or_set_p is ever called. */ @@ -365,6 +379,8 @@ int optimize = 0; (EXP) = (XSTR ((EXP), 1) == current_alternative_string \ ? true_rtx : false_rtx); +#define DEF_ATTR_STRING(S) (attr_string ((S), strlen (S))) + /* These are referenced by rtlanal.c and hence need to be defined somewhere. They won't actually be used. */ @@ -407,7 +423,6 @@ static rtx test_for_current_value (struct dimension *, int); static rtx simplify_with_current_value (rtx, struct dimension *, int); static rtx simplify_with_current_value_aux (rtx); static void clear_struct_flag (rtx); -static int count_sub_rtxs (rtx, int); static void remove_insn_ent (struct attr_value *, struct insn_ent *); static void insert_insn_ent (struct attr_value *, struct insn_ent *); static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int); @@ -450,7 +465,7 @@ static int write_expr_attr_cache (rtx, struct attr_desc *); static void write_toplevel_expr (rtx); static void write_const_num_delay_slots (void); static char *next_comma_elt (const char **); -static struct attr_desc *find_attr (const char *, int); +static struct attr_desc *find_attr (const char **, int); static struct attr_value *find_most_used (struct attr_desc *); static rtx find_single_value (struct attr_desc *); static void extend_range (struct range *, int, int); @@ -459,6 +474,13 @@ static const char *attr_numeral (int); static int attr_equal_p (rtx, rtx); static rtx attr_copy_rtx (rtx); static int attr_rtx_cost (rtx); +static bool attr_alt_subset_p (rtx, rtx); +static bool attr_alt_subset_of_compl_p (rtx, rtx); +static rtx attr_alt_intersection (rtx, rtx); +static rtx attr_alt_union (rtx, rtx); +static rtx attr_alt_complement (rtx); +static bool attr_alt_bit_p (rtx, int); +static rtx mk_attr_alt (int); #define oballoc(size) obstack_alloc (hash_obstack, size) @@ -606,8 +628,7 @@ attr_rtx_1 (enum rtx_code code, va_list p) { char *arg0 = va_arg (p, char *); - if (code == SYMBOL_REF) - arg0 = attr_string (arg0, strlen (arg0)); + arg0 = DEF_ATTR_STRING (arg0); hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0)); for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next) @@ -736,14 +757,13 @@ attr_printf (unsigned int len, const char *fmt, ...) vsprintf (str, fmt, p); va_end (p); - return attr_string (str, strlen (str)); + return DEF_ATTR_STRING (str); } static rtx attr_eq (const char *name, const char *value) { - return attr_rtx (EQ_ATTR, attr_string (name, strlen (name)), - attr_string (value, strlen (value))); + return attr_rtx (EQ_ATTR, DEF_ATTR_STRING (name), DEF_ATTR_STRING (value)); } static const char * @@ -916,16 +936,11 @@ check_attr_test (rtx exp, int is_const, int lineno) else if (n_comma_elts (XSTR (exp, 1)) == 1) { - attr = find_attr (XSTR (exp, 0), 0); + attr = find_attr (&XSTR (exp, 0), 0); if (attr == NULL) { if (! strcmp (XSTR (exp, 0), "alternative")) - { - XSTR (exp, 0) = alternative_name; - /* This can't be simplified any further. */ - ATTR_IND_SIMPLIFIED_P (exp) = 1; - return exp; - } + return mk_attr_alt (1 << atoi (XSTR (exp, 1))); else fatal ("unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0)); } @@ -965,16 +980,29 @@ check_attr_test (rtx exp, int is_const, int lineno) } else { - /* Make an IOR tree of the possible values. */ - orexp = false_rtx; - name_ptr = XSTR (exp, 1); - while ((p = next_comma_elt (&name_ptr)) != NULL) + if (! strcmp (XSTR (exp, 0), "alternative")) { - newexp = attr_eq (XSTR (exp, 0), p); - orexp = insert_right_side (IOR, orexp, newexp, -2, -2); + int set = 0; + + name_ptr = XSTR (exp, 1); + while ((p = next_comma_elt (&name_ptr)) != NULL) + set |= 1 << atoi (p); + + return mk_attr_alt (set); } + else + { + /* Make an IOR tree of the possible values. */ + orexp = false_rtx; + name_ptr = XSTR (exp, 1); + while ((p = next_comma_elt (&name_ptr)) != NULL) + { + newexp = attr_eq (XSTR (exp, 0), p); + orexp = insert_right_side (IOR, orexp, newexp, -2, -2); + } - return check_attr_test (orexp, is_const, lineno); + return check_attr_test (orexp, is_const, lineno); + } } break; @@ -1166,7 +1194,7 @@ check_attr_value (rtx exp, struct attr_desc *attr) case ATTR: { - struct attr_desc *attr2 = find_attr (XSTR (exp, 0), 0); + struct attr_desc *attr2 = find_attr (&XSTR (exp, 0), 0); if (attr2 == NULL) { message_with_line (attr ? attr->lineno : 0, @@ -1326,7 +1354,7 @@ check_defs (void) if (value == NULL_RTX) continue; - if ((attr = find_attr (XSTR (XEXP (value, 0), 0), 0)) == NULL) + if ((attr = find_attr (&XSTR (XEXP (value, 0), 0), 0)) == NULL) { message_with_line (id->lineno, "unknown attribute %s", XSTR (XEXP (value, 0), 0)); @@ -1364,6 +1392,8 @@ make_canonical (struct attr_desc *attr, rtx exp) fatal ("(attr_value \"*\") used in invalid context"); exp = attr->default_val->value; } + else + XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0)); break; @@ -1424,6 +1454,17 @@ copy_boolean (rtx exp) if (GET_CODE (exp) == AND || GET_CODE (exp) == IOR) return attr_rtx (GET_CODE (exp), copy_boolean (XEXP (exp, 0)), copy_boolean (XEXP (exp, 1))); + if (GET_CODE (exp) == MATCH_OPERAND) + { + XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1)); + XSTR (exp, 2) = DEF_ATTR_STRING (XSTR (exp, 2)); + } + else if (GET_CODE (exp) == EQ_ATTR) + { + XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0)); + XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1)); + } + return exp; } @@ -1504,7 +1545,7 @@ expand_delays (void) = make_numeric_value (XVECLEN (delay->def, 1) / 3); } - make_internal_attr ("*num_delay_slots", condexp, ATTR_NONE); + make_internal_attr (num_delay_slots_str, condexp, ATTR_NONE); /* If more than one delay type, do the same for computing the delay type. */ if (num_delays > 1) @@ -1519,7 +1560,7 @@ expand_delays (void) XVECEXP (condexp, 0, i + 1) = make_numeric_value (delay->num); } - make_internal_attr ("*delay_type", condexp, ATTR_SPECIAL); + make_internal_attr (delay_type_str, condexp, ATTR_SPECIAL); } /* For each delay possibility and delay slot, compute an eligibility @@ -2186,6 +2227,7 @@ encode_units_mask (rtx x) case PC: case CC0: case EQ_ATTR: + case EQ_ATTR_ALT: return x; default: @@ -2239,8 +2281,8 @@ fill_attr (struct attr_desc *attr) value = NULL; if (XVEC (id->def, id->vec_idx)) for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++) - if (! strcmp (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0), - attr->name)) + if (! strcmp_check (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0), + attr->name)) value = XEXP (XVECEXP (id->def, id->vec_idx, i), 1); if (value == NULL) @@ -2337,9 +2379,12 @@ substitute_address (rtx exp, rtx (*no_address_fn) (rtx), static void make_length_attrs (void) { - static const char *const new_names[] = {"*insn_default_length", - "*insn_variable_length_p", - "*insn_current_length"}; + static const char *new_names[] = + { + "*insn_default_length", + "*insn_variable_length_p", + "*insn_current_length" + }; static rtx (*const no_address_fn[]) (rtx) = {identity_fn, zero_fn, zero_fn}; static rtx (*const address_fn[]) (rtx) = {max_fn, one_fn, identity_fn}; size_t i; @@ -2349,7 +2394,7 @@ make_length_attrs (void) /* See if length attribute is defined. If so, it must be numeric. Make it special so we don't output anything for it. */ - length_attr = find_attr ("length", 0); + length_attr = find_attr (&length_str, 0); if (length_attr == 0) return; @@ -2366,7 +2411,7 @@ make_length_attrs (void) substitute_address (length_attr->default_val->value, no_address_fn[i], address_fn[i]), ATTR_NONE); - new_attr = find_attr (new_names[i], 0); + new_attr = find_attr (&new_names[i], 0); for (av = length_attr->first_value; av; av = av->next) for (ie = av->first_insn; ie; ie = ie->next) { @@ -2412,7 +2457,7 @@ max_fn (rtx exp) static void write_length_unit_log (void) { - struct attr_desc *length_attr = find_attr ("length", 0); + struct attr_desc *length_attr = find_attr (&length_str, 0); struct attr_value *av; struct insn_ent *ie; unsigned int length_unit_log, length_or; @@ -2496,6 +2541,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index) /* If test is false, discard it and its value. */ for (j = i; j < len - 2; j++) tests[j] = tests[j + 2]; + i -= 2; len -= 2; } @@ -2512,6 +2558,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index) for (j = i; j < len - 2; j++) tests[j] = tests[j + 2]; len -= 2; + i -= 2; } else @@ -2682,6 +2729,16 @@ compute_alternative_mask (rtx exp, enum rtx_code code) && XSTR (exp, 0) == alternative_name) string = XSTR (exp, 1); + else if (GET_CODE (exp) == EQ_ATTR_ALT) + { + if (code == AND && XINT (exp, 1)) + return XINT (exp, 0); + + if (code == IOR && !XINT (exp, 1)) + return XINT (exp, 0); + + return 0; + } else return 0; @@ -2696,17 +2753,7 @@ compute_alternative_mask (rtx exp, enum rtx_code code) static rtx make_alternative_compare (int mask) { - rtx newexp; - int i; - - /* Find the bit. */ - for (i = 0; (mask & (1 << i)) == 0; i++) - ; - - newexp = attr_rtx (EQ_ATTR, alternative_name, attr_numeral (i)); - ATTR_IND_SIMPLIFIED_P (newexp) = 1; - - return newexp; + return mk_attr_alt (mask); } /* If we are processing an (eq_attr "attr" "value") test, we find the value @@ -2728,7 +2775,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) if (GET_CODE (value) == CONST_STRING) { - if (! strcmp (XSTR (value, 0), XSTR (exp, 1))) + if (! strcmp_check (XSTR (value, 0), XSTR (exp, 1))) newexp = true_rtx; else newexp = false_rtx; @@ -2752,7 +2799,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) newexp = attr_rtx (EQ, value, attr_rtx (SYMBOL_REF, - attr_string (string, strlen (string)))); + DEF_ATTR_STRING (string))); } else if (GET_CODE (value) == COND) { @@ -2853,7 +2900,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) right = simplify_and_tree (XEXP (exp, 1), pterm, insn_code, insn_index); if (left != XEXP (exp, 0) || right != XEXP (exp, 1)) { - newexp = attr_rtx (GET_CODE (exp), left, right); + newexp = attr_rtx (AND, left, right); exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index); } @@ -2876,7 +2923,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) if (left != XEXP (exp, 0) || right != XEXP (exp, 1)) { - newexp = attr_rtx (GET_CODE (exp), left, right); + newexp = attr_rtx (IOR, left, right); exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index); } @@ -2894,12 +2941,26 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) else if (GET_CODE (*pterm) == NOT && exp == XEXP (*pterm, 0)) return false_rtx; + else if (GET_CODE (exp) == EQ_ATTR_ALT && GET_CODE (*pterm) == EQ_ATTR_ALT) + { + if (attr_alt_subset_p (*pterm, exp)) + return true_rtx; + + if (attr_alt_subset_of_compl_p (*pterm, exp)) + return false_rtx; + + if (attr_alt_subset_p (exp, *pterm)) + *pterm = true_rtx; + + return exp; + } + else if (GET_CODE (exp) == EQ_ATTR && GET_CODE (*pterm) == EQ_ATTR) { if (XSTR (exp, 0) != XSTR (*pterm, 0)) return exp; - if (! strcmp (XSTR (exp, 1), XSTR (*pterm, 1))) + if (! strcmp_check (XSTR (exp, 1), XSTR (*pterm, 1))) return true_rtx; else return false_rtx; @@ -2911,7 +2972,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) if (XSTR (*pterm, 0) != XSTR (XEXP (exp, 0), 0)) return exp; - if (! strcmp (XSTR (*pterm, 1), XSTR (XEXP (exp, 0), 1))) + if (! strcmp_check (XSTR (*pterm, 1), XSTR (XEXP (exp, 0), 1))) return false_rtx; else return true_rtx; @@ -2923,7 +2984,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) if (XSTR (exp, 0) != XSTR (XEXP (*pterm, 0), 0)) return exp; - if (! strcmp (XSTR (exp, 1), XSTR (XEXP (*pterm, 0), 1))) + if (! strcmp_check (XSTR (exp, 1), XSTR (XEXP (*pterm, 0), 1))) return false_rtx; else *pterm = true_rtx; @@ -3037,9 +3098,13 @@ attr_rtx_cost (rtx x) return 10; else return 0; + + case EQ_ATTR_ALT: + return 0; + case EQ_ATTR: /* Alternatives don't result into function call. */ - if (!strcmp (XSTR (x, 0), "alternative")) + if (!strcmp_check (XSTR (x, 0), alternative_name)) return 0; else return 5; @@ -3087,6 +3152,146 @@ simplify_test_exp_in_temp (rtx exp, int insn_code, int insn_index) return attr_copy_rtx (x); } +/* Returns true if S1 is a subset of S2. */ + +static bool +attr_alt_subset_p (rtx s1, rtx s2) +{ + switch ((XINT (s1, 1) << 1) | XINT (s2, 1)) + { + case (0 << 1) | 0: + return !(XINT (s1, 0) &~ XINT (s2, 0)); + + case (0 << 1) | 1: + return !(XINT (s1, 0) & XINT (s2, 0)); + + case (1 << 1) | 0: + return false; + + case (1 << 1) | 1: + return !(XINT (s2, 0) &~ XINT (s1, 0)); + + default: + abort (); + } +} + +/* Returns true if S1 is a subset of complement of S2. */ + +static bool attr_alt_subset_of_compl_p (rtx s1, rtx s2) +{ + switch ((XINT (s1, 1) << 1) | XINT (s2, 1)) + { + case (0 << 1) | 0: + return !(XINT (s1, 0) & XINT (s2, 0)); + + case (0 << 1) | 1: + return !(XINT (s1, 0) & ~XINT (s2, 0)); + + case (1 << 1) | 0: + return !(XINT (s2, 0) &~ XINT (s1, 0)); + + case (1 << 1) | 1: + return false; + + default: + abort (); + } +} + +/* Return EQ_ATTR_ALT expression representing intersection of S1 and S2. */ + +static rtx +attr_alt_intersection (rtx s1, rtx s2) +{ + rtx result = rtx_alloc (EQ_ATTR_ALT); + + switch ((XINT (s1, 1) << 1) | XINT (s2, 1)) + { + case (0 << 1) | 0: + XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0); + break; + case (0 << 1) | 1: + XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0); + break; + case (1 << 1) | 0: + XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0); + break; + case (1 << 1) | 1: + XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0); + break; + default: + abort (); + } + XINT (result, 1) = XINT (s1, 1) & XINT (s2, 1); + + return result; +} + +/* Return EQ_ATTR_ALT expression representing union of S1 and S2. */ + +static rtx +attr_alt_union (rtx s1, rtx s2) +{ + rtx result = rtx_alloc (EQ_ATTR_ALT); + + switch ((XINT (s1, 1) << 1) | XINT (s2, 1)) + { + case (0 << 1) | 0: + XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0); + break; + case (0 << 1) | 1: + XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0); + break; + case (1 << 1) | 0: + XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0); + break; + case (1 << 1) | 1: + XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0); + break; + default: + abort (); + } + + XINT (result, 1) = XINT (s1, 1) | XINT (s2, 1); + return result; +} + +/* Return EQ_ATTR_ALT expression representing complement of S. */ + +static rtx +attr_alt_complement (rtx s) +{ + rtx result = rtx_alloc (EQ_ATTR_ALT); + + XINT (result, 0) = XINT (s, 0); + XINT (result, 1) = 1 - XINT (s, 1); + + return result; +} + +/* Tests whether a bit B belongs to the set represented by S. */ + +static bool +attr_alt_bit_p (rtx s, int b) +{ + return XINT (s, 1) ^ ((XINT (s, 0) >> b) & 1); +} + +/* Return EQ_ATTR_ALT expression representing set containing elements set + in E. */ + +static rtx +mk_attr_alt (int e) +{ + rtx result = rtx_alloc (EQ_ATTR_ALT); + + XINT (result, 0) = e; + XINT (result, 1) = 0; + + return result; +} + /* Given an expression, see if it can be simplified for a particular insn code based on the values of other attributes being tested. This can eliminate nested get_attr_... calls. @@ -3105,6 +3310,7 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) struct insn_ent *ie; int i; rtx newexp = exp; + bool left_alt, right_alt; /* Don't re-simplify something we already simplified. */ if (ATTR_IND_SIMPLIFIED_P (exp) || ATTR_CURR_SIMPLIFIED_P (exp)) @@ -3122,6 +3328,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) if (left == false_rtx) return false_rtx; + if (GET_CODE (left) == EQ_ATTR_ALT + && GET_CODE (right) == EQ_ATTR_ALT) + { + exp = attr_alt_intersection (left, right); + return simplify_test_exp (exp, insn_code, insn_index); + } + /* If either side is an IOR and we have (eq_attr "alternative" ..") present on both sides, apply the distributive law since this will yield simplifications. */ @@ -3161,15 +3374,25 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) /* See if all or all but one of the insn's alternatives are specified in this tree. Optimize if so. */ - else if (insn_code >= 0 - && (GET_CODE (left) == AND - || (GET_CODE (left) == NOT - && GET_CODE (XEXP (left, 0)) == EQ_ATTR - && XSTR (XEXP (left, 0), 0) == alternative_name) - || GET_CODE (right) == AND - || (GET_CODE (right) == NOT - && GET_CODE (XEXP (right, 0)) == EQ_ATTR - && XSTR (XEXP (right, 0), 0) == alternative_name))) + if (GET_CODE (left) == NOT) + left_alt = (GET_CODE (XEXP (left, 0)) == EQ_ATTR + && XSTR (XEXP (left, 0), 0) == alternative_name); + else + left_alt = (GET_CODE (left) == EQ_ATTR_ALT + && XINT (left, 1)); + + if (GET_CODE (right) == NOT) + right_alt = (GET_CODE (XEXP (right, 0)) == EQ_ATTR + && XSTR (XEXP (right, 0), 0) == alternative_name); + else + right_alt = (GET_CODE (right) == EQ_ATTR_ALT + && XINT (right, 1)); + + if (insn_code >= 0 + && (GET_CODE (left) == AND + || left_alt + || GET_CODE (right) == AND + || right_alt)) { i = compute_alternative_mask (exp, AND); if (i & ~insn_alternatives[insn_code]) @@ -3211,6 +3434,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) if (right == true_rtx) return true_rtx; + if (GET_CODE (left) == EQ_ATTR_ALT + && GET_CODE (right) == EQ_ATTR_ALT) + { + exp = attr_alt_union (left, right); + return simplify_test_exp (exp, insn_code, insn_index); + } + right = simplify_or_tree (right, &left, insn_code, insn_index); if (left == XEXP (exp, 0) && right == XEXP (exp, 1)) left = simplify_or_tree (left, &right, insn_code, insn_index); @@ -3249,9 +3479,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) else if (insn_code >= 0 && (GET_CODE (left) == IOR + || (GET_CODE (left) == EQ_ATTR_ALT + && !XINT (left, 1)) || (GET_CODE (left) == EQ_ATTR && XSTR (left, 0) == alternative_name) || GET_CODE (right) == IOR + || (GET_CODE (right) == EQ_ATTR_ALT + && !XINT (right, 1)) || (GET_CODE (right) == EQ_ATTR && XSTR (right, 0) == alternative_name))) { @@ -3301,11 +3535,17 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) if (left == false_rtx) return true_rtx; - else if (left == true_rtx) + if (left == true_rtx) return false_rtx; + if (GET_CODE (left) == EQ_ATTR_ALT) + { + exp = attr_alt_complement (left); + return simplify_test_exp (exp, insn_code, insn_index); + } + /* Try to apply De`Morgan's laws. */ - else if (GET_CODE (left) == IOR) + if (GET_CODE (left) == IOR) { newexp = attr_rtx (AND, attr_rtx (NOT, XEXP (left, 0)), @@ -3327,16 +3567,30 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index) } break; + case EQ_ATTR_ALT: + if (current_alternative_string) + return attr_alt_bit_p (exp, atoi (current_alternative_string)) ? true_rtx : false_rtx; + + if (!XINT (exp, 0)) + return XINT (exp, 1) ? true_rtx : false_rtx; + break; + case EQ_ATTR: if (current_alternative_string && XSTR (exp, 0) == alternative_name) return (XSTR (exp, 1) == current_alternative_string ? true_rtx : false_rtx); + if (XSTR (exp, 0) == alternative_name) + { + newexp = mk_attr_alt (1 << atoi (XSTR (exp, 1))); + break; + } + /* Look at the value for this insn code in the specified attribute. We normally can replace this comparison with the condition that would give this insn the values being tested for. */ if (XSTR (exp, 0) != alternative_name - && (attr = find_attr (XSTR (exp, 0), 0)) != NULL) + && (attr = find_attr (&XSTR (exp, 0), 0)) != NULL) for (av = attr->first_value; av; av = av->next) for (ie = av->first_insn; ie; ie = ie->next) if (ie->insn_code == insn_code) @@ -3500,7 +3754,10 @@ simplify_by_exploding (rtx exp) const char *name = XSTR (XEXP (list, 0), 0); rtx *prev; - if ((space[ndim].attr = find_attr (name, 0)) == 0 + space[ndim].attr = find_attr (&name, 0); + XSTR (XEXP (list, 0), 0) = name; + + if (space[ndim].attr == 0 || space[ndim].attr->is_numeric) { unmark_used_attributes (list, space, ndim); @@ -3512,7 +3769,7 @@ simplify_by_exploding (rtx exp) space[ndim].values = 0; prev = &list; for (link = list; link; link = *prev) - if (! strcmp (XSTR (XEXP (link, 0), 0), name)) + if (! strcmp_check (XSTR (XEXP (link, 0), 0), name)) { space[ndim].num_values++; *prev = XEXP (link, 1); @@ -3954,65 +4211,6 @@ clear_struct_flag (rtx x) } } -/* Return the number of RTX objects making up the expression X. - But if we count more than MAX objects, stop counting. */ - -static int -count_sub_rtxs (rtx x, int max) -{ - int i; - int j; - enum rtx_code code; - const char *fmt; - int total = 0; - - code = GET_CODE (x); - - switch (code) - { - case REG: - case QUEUED: - case CONST_INT: - case CONST_DOUBLE: - case CONST_VECTOR: - case SYMBOL_REF: - case CODE_LABEL: - case PC: - case CC0: - case EQ_ATTR: - case ATTR_FLAG: - return 1; - - default: - break; - } - - /* Compare the elements. If any pair of corresponding elements - fail to match, return 0 for the whole things. */ - - fmt = GET_RTX_FORMAT (code); - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (total >= max) - return total; - - switch (fmt[i]) - { - case 'V': - case 'E': - for (j = 0; j < XVECLEN (x, i); j++) - total += count_sub_rtxs (XVECEXP (x, i, j), max); - break; - - case 'e': - total += count_sub_rtxs (XEXP (x, i), max); - break; - } - } - return total; - -} - /* Create table entries for DEFINE_ATTR. */ static void @@ -4025,7 +4223,7 @@ gen_attr (rtx exp, int lineno) /* Make a new attribute structure. Check for duplicate by looking at attr->default_val, since it is initialized by this routine. */ - attr = find_attr (XSTR (exp, 0), 1); + attr = find_attr (&XSTR (exp, 0), 1); if (attr->default_val) { message_with_line (lineno, "duplicate definition for attribute %s", @@ -4067,7 +4265,7 @@ gen_attr (rtx exp, int lineno) XEXP (exp, 2) = XEXP (XEXP (exp, 2), 0); } - if (! strcmp (attr->name, "length") && ! attr->is_numeric) + if (! strcmp_check (attr->name, length_str) && ! attr->is_numeric) { message_with_line (lineno, "`length' attribute must take numeric values"); @@ -4311,6 +4509,8 @@ gen_unit (rtx def, int lineno) unit->first_lineno = lineno; units = unit; } + else + XSTR (def, 0) = unit->name; /* Make a new operation class structure entry and initialize it. */ op = oballoc (sizeof (struct function_unit_op)); @@ -4490,6 +4690,52 @@ write_test_expr (rtx exp, int flags) write_test_expr (XEXP (exp, 0), flags); break; + case EQ_ATTR_ALT: + { + int set = XINT (exp, 0), bit = 0; + + if (flags & 1) + fatal ("EQ_ATTR_ALT not valid inside comparison"); + + if (!set) + fatal ("Empty EQ_ATTR_ALT should be optimized out"); + + if (!(set & (set - 1))) + { + if (!(set & 0xffff)) + { + bit += 16; + set >>= 16; + } + if (!(set & 0xff)) + { + bit += 8; + set >>= 8; + } + if (!(set & 0xf)) + { + bit += 4; + set >>= 4; + } + if (!(set & 0x3)) + { + bit += 2; + set >>= 2; + } + if (!(set & 1)) + bit++; + + printf ("which_alternative %s= %d", + XINT (exp, 1) ? "!" : "=", bit); + } + else + { + printf ("%s((1 << which_alternative) & 0x%x)", + XINT (exp, 1) ? "!" : "", set); + } + } + break; + /* Comparison test of an attribute with a value. Most of these will have been removed by optimization. Handle "alternative" specially and give error if EQ_ATTR present inside a comparison. */ @@ -4503,7 +4749,7 @@ write_test_expr (rtx exp, int flags) break; } - attr = find_attr (XSTR (exp, 0), 0); + attr = find_attr (&XSTR (exp, 0), 0); if (! attr) abort (); @@ -4710,10 +4956,14 @@ walk_attr_value (rtx exp) must_extract = 1; return; + case EQ_ATTR_ALT: + must_extract = must_constrain = 1; + break; + case EQ_ATTR: if (XSTR (exp, 0) == alternative_name) must_extract = must_constrain = 1; - else if (strcmp (XSTR (exp, 0), "length") == 0) + else if (strcmp_check (XSTR (exp, 0), length_str) == 0) length_used = 1; return; @@ -5176,7 +5426,7 @@ write_attr_value (struct attr_desc *attr, rtx value) case ATTR: { - struct attr_desc *attr2 = find_attr (XSTR (value, 0), 0); + struct attr_desc *attr2 = find_attr (&XSTR (value, 0), 0); printf ("get_attr_%s (%s)", attr2->name, (attr2->is_const ? "" : "insn")); } @@ -5250,6 +5500,7 @@ write_eligible_delay (const char *kind) struct delay_desc *delay; int max_slots; char str[50]; + const char *pstr; struct attr_desc *attr; struct attr_value *av, *common_av; int i; @@ -5278,7 +5529,7 @@ write_eligible_delay (const char *kind) if (num_delays > 1) { - attr = find_attr ("*delay_type", 0); + attr = find_attr (&delay_type_str, 0); if (! attr) abort (); common_av = find_most_used (attr); @@ -5307,7 +5558,7 @@ write_eligible_delay (const char *kind) printf (" switch (recog_memoized (insn))\n"); printf (" {\n"); - attr = find_attr ("*delay_1_0", 0); + attr = find_attr (&delay_1_0_str, 0); if (! attr) abort (); common_av = find_most_used (attr); @@ -5337,7 +5588,8 @@ write_eligible_delay (const char *kind) printf ("\t{\n"); sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3); - attr = find_attr (str, 0); + pstr = str; + attr = find_attr (&pstr, 0); if (! attr) abort (); common_av = find_most_used (attr); @@ -5441,6 +5693,7 @@ write_complex_function (struct function_unit *unit, struct attr_value *av, *common_av; rtx value; char str[256]; + const char *pstr; int using_case; int i; @@ -5458,7 +5711,8 @@ write_complex_function (struct function_unit *unit, if (strlen (unit->name) + sizeof "*_cases" > 256) abort (); sprintf (str, "*%s_cases", unit->name); - case_attr = find_attr (str, 0); + pstr = str; + case_attr = find_attr (&pstr, 0); if (! case_attr) abort (); common_av = find_most_used (case_attr); @@ -5492,7 +5746,8 @@ write_complex_function (struct function_unit *unit, printf (" case %d:\n", i); sprintf (str, "*%s_%s_%d", unit->name, connection, i); - attr = find_attr (str, 0); + pstr = str; + attr = find_attr (&pstr, 0); if (! attr) abort (); @@ -5544,13 +5799,15 @@ next_comma_elt (const char **pstr) } /* Return a `struct attr_desc' pointer for a given named attribute. If CREATE - is nonzero, build a new attribute, if one does not exist. */ + is nonzero, build a new attribute, if one does not exist. *NAME_P is + replaced by a pointer to a canonical copy of the string. */ static struct attr_desc * -find_attr (const char *name, int create) +find_attr (const char **name_p, int create) { struct attr_desc *attr; int index; + const char *name = *name_p; /* Before we resort to using `strcmp', see if the string address matches anywhere. In most cases, it should have been canonicalized to do so. */ @@ -5565,19 +5822,24 @@ find_attr (const char *name, int create) /* Otherwise, do it the slow way. */ for (attr = attrs[index]; attr; attr = attr->next) if (name[0] == attr->name[0] && ! strcmp (name, attr->name)) - return attr; + { + *name_p = attr->name; + return attr; + } if (! create) return NULL; attr = oballoc (sizeof (struct attr_desc)); - attr->name = attr_string (name, strlen (name)); + attr->name = DEF_ATTR_STRING (name); attr->first_value = attr->default_val = NULL; attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0; attr->unsigned_p = attr->func_units_p = attr->blockage_p = attr->static_p = 0; attr->next = attrs[index]; attrs[index] = attr; + *name_p = attr->name; + return attr; } @@ -5588,7 +5850,7 @@ make_internal_attr (const char *name, rtx value, int special) { struct attr_desc *attr; - attr = find_attr (name, 1); + attr = find_attr (&name, 1); if (attr->default_val) abort (); @@ -5693,7 +5955,7 @@ copy_rtx_unchanging (rtx orig) static void write_const_num_delay_slots (void) { - struct attr_desc *attr = find_attr ("*num_delay_slots", 0); + struct attr_desc *attr = find_attr (&num_delay_slots_str, 0); struct attr_value *av; struct insn_ent *ie; @@ -5751,7 +6013,11 @@ main (int argc, char **argv) ATTR_IND_SIMPLIFIED_P (true_rtx) = ATTR_IND_SIMPLIFIED_P (false_rtx) = 1; ATTR_PERMANENT_P (true_rtx) = ATTR_PERMANENT_P (false_rtx) = 1; - alternative_name = attr_string ("alternative", strlen ("alternative")); + alternative_name = DEF_ATTR_STRING ("alternative"); + length_str = DEF_ATTR_STRING ("length"); + delay_type_str = DEF_ATTR_STRING ("*delay_type"); + delay_1_0_str = DEF_ATTR_STRING ("*delay_1_0"); + num_delay_slots_str = DEF_ATTR_STRING ("*num_delay_slots"); printf ("/* Generated automatically by the program `genattrtab'\n\ from the machine description file `md'. */\n\n"); @@ -5934,7 +6200,7 @@ from the machine description file `md'. */\n\n"); insn_alts_p = (attr->name [0] == '*' - && strcmp (&attr->name [1], INSN_ALTS_FUNC_NAME) == 0); + && strcmp (&attr->name[1], INSN_ALTS_FUNC_NAME) == 0); if (insn_alts_p) printf ("\n#if AUTOMATON_ALTS\n"); write_attr_get (attr); diff --git a/gcc/genautomata.c b/gcc/genautomata.c index a5783e6f80d..b343d6e65ba 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -6282,7 +6282,7 @@ merge_states (automaton_t automaton, vla_ptr_t *equiv_classes) } } /* Its is important that alt states were sorted before and - after merging to have the same quering results. */ + after merging to have the same querying results. */ new_state->component_states = uniq_sort_alt_states (alt_states); } else diff --git a/gcc/genemit.c b/gcc/genemit.c index 8a821d67bc2..0e695d2729c 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -32,7 +32,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static int max_opno; static int max_dup_opno; static int max_scratch_opno; -static int register_constraints; static int insn_code_number; static int insn_index_number; @@ -83,10 +82,6 @@ max_operand_1 (rtx x) code = GET_CODE (x); - if (code == MATCH_OPERAND && XSTR (x, 2) != 0 && *XSTR (x, 2) != '\0') - register_constraints = 1; - if (code == MATCH_SCRATCH && XSTR (x, 1) != 0 && *XSTR (x, 1) != '\0') - register_constraints = 1; if (code == MATCH_OPERAND || code == MATCH_OPERATOR || code == MATCH_PARALLEL) max_opno = MAX (max_opno, XINT (x, 0)); @@ -376,9 +371,7 @@ gen_insn (rtx insn, int lineno) printf ("/* %s:%d */\n", read_rtx_filename, lineno); - /* Find out how many operands this function has, - and also whether any of them have register constraints. */ - register_constraints = 0; + /* Find out how many operands this function has. */ operands = max_operand_vec (insn, 1); if (max_dup_opno >= operands) fatal ("match_dup operand number has no match_operand"); @@ -396,7 +389,7 @@ gen_insn (rtx insn, int lineno) printf (")\n"); printf ("{\n"); - /* Output code to construct and return the rtl for the instruction body */ + /* Output code to construct and return the rtl for the instruction body. */ if (XVECLEN (insn, 1) == 1) { @@ -431,10 +424,7 @@ gen_expand (rtx expand) if (XVEC (expand, 1) == 0) fatal ("define_expand for %s lacks a pattern", XSTR (expand, 0)); - /* Find out how many operands this function has, - and also whether any of them have register constraints. */ - register_constraints = 0; - + /* Find out how many operands this function has. */ operands = max_operand_vec (expand, 1); /* Output the function name and argument declarations. */ diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 3b82ff5ec78..2f526599685 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -146,7 +146,7 @@ ITYPE {IWORD}({WS}{IWORD})* update_lineno (yytext, yyleng); } -[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?PARAMS { +[^[:alnum:]_]typedef{WS}{ID}{WS}?"*"?{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?PARAMS { char *namestart; size_t namelen; struct type *t; @@ -162,7 +162,7 @@ ITYPE {IWORD}({WS}{IWORD})* update_lineno (yytext, yyleng); } -[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?"(" { +[^[:alnum:]_]typedef{WS}{ID}{WS}?"*"?{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?"(" { char *namestart; size_t namelen; struct type *t; diff --git a/gcc/gengtype.c b/gcc/gengtype.c index c663a8a3add..784d551fb8a 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1087,7 +1087,7 @@ open_base_files (void) "config.h", "system.h", "coretypes.h", "tm.h", "varray.h", "hashtab.h", "splay-tree.h", "bitmap.h", "tree.h", "rtl.h", "function.h", "insn-config.h", "expr.h", "hard-reg-set.h", - "basic-block.h", "cselib.h", "insn-addr.h", "ssa.h", "optabs.h", + "basic-block.h", "cselib.h", "insn-addr.h", "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h", NULL }; @@ -2914,10 +2914,10 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) do_scalar_typedef ("uint8", &pos); do_scalar_typedef ("jword", &pos); do_scalar_typedef ("JCF_u2", &pos); + do_scalar_typedef ("void", &pos); + + do_typedef ("PTR", create_pointer (resolve_typedef ("void", &pos)), &pos); - do_typedef ("PTR", create_pointer (create_scalar_type ("void", - strlen ("void"))), - &pos); do_typedef ("HARD_REG_SET", create_array ( create_scalar_type ("unsigned long", strlen ("unsigned long")), "2"), &pos); diff --git a/gcc/genmodes.c b/gcc/genmodes.c index 13456555be6..a09e4527065 100644 --- a/gcc/genmodes.c +++ b/gcc/genmodes.c @@ -56,7 +56,7 @@ struct mode_data const char *name; /* printable mode name -- SI, not SImode */ enum mode_class class; /* this mode class */ - unsigned int bitsize; /* size in bits, equiv to TYPE_PRECISION */ + unsigned int precision; /* size in bits, equiv to TYPE_PRECISION */ unsigned int bytesize; /* storage size in addressable units */ unsigned int ncomponents; /* number of subunits */ unsigned int alignment; /* mode alignment */ @@ -262,13 +262,13 @@ enum requirement { SET, UNSET, OPTIONAL }; static void validate_mode (struct mode_data *m, - enum requirement r_bitsize, + enum requirement r_precision, enum requirement r_bytesize, enum requirement r_component, enum requirement r_ncomponents, enum requirement r_format) { - validate_field (m, bitsize); + validate_field (m, precision); validate_field (m, bytesize); validate_field (m, component); validate_field (m, ncomponents); @@ -304,7 +304,7 @@ complete_mode (struct mode_data *m) validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET); - m->bitsize = 0; + m->precision = 0; m->bytesize = 0; m->ncomponents = 0; m->component = 0; @@ -316,7 +316,7 @@ complete_mode (struct mode_data *m) validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET); m->bytesize = 4; - m->ncomponents = 0; + m->ncomponents = 1; m->component = 0; break; @@ -328,7 +328,7 @@ complete_mode (struct mode_data *m) validate_mode (m, OPTIONAL, SET, UNSET, UNSET, m->class == MODE_FLOAT ? SET : UNSET); - m->ncomponents = 0; + m->ncomponents = 1; m->component = 0; break; @@ -340,7 +340,7 @@ complete_mode (struct mode_data *m) m->bytesize = m->component->bytesize; - m->ncomponents = 0; + m->ncomponents = 1; m->component = 0; /* ??? preserve this */ break; @@ -349,8 +349,8 @@ complete_mode (struct mode_data *m) /* Complex modes should have a component indicated, but no more. */ validate_mode (m, UNSET, UNSET, SET, UNSET, UNSET); m->ncomponents = 2; - if (m->component->bitsize != (unsigned int)-1) - m->bitsize = 2 * m->component->bitsize; + if (m->component->precision != (unsigned int)-1) + m->precision = 2 * m->component->precision; m->bytesize = 2 * m->component->bytesize; break; @@ -358,8 +358,8 @@ complete_mode (struct mode_data *m) case MODE_VECTOR_FLOAT: /* Vector modes should have a component and a number of components. */ validate_mode (m, UNSET, UNSET, SET, SET, UNSET); - if (m->component->bitsize != (unsigned int)-1) - m->bitsize = m->ncomponents * m->component->bitsize; + if (m->component->precision != (unsigned int)-1) + m->precision = m->ncomponents * m->component->precision; m->bytesize = m->ncomponents * m->component->bytesize; break; @@ -413,7 +413,7 @@ make_complex_modes (enum mode_class class, for (m = modes[class]; m; m = m->next) { /* Skip BImode. FIXME: BImode probably shouldn't be MODE_INT. */ - if (m->bitsize == 1) + if (m->precision == 1) continue; if (strlen (m->name) >= sizeof buf) @@ -479,7 +479,7 @@ make_vector_modes (enum mode_class class, unsigned int width, not be necessary. */ if (class == MODE_FLOAT && m->bytesize == 1) continue; - if (class == MODE_INT && m->bitsize == 1) + if (class == MODE_INT && m->precision == 1) continue; if ((size_t)snprintf (buf, sizeof buf, "V%u%s", ncomponents, m->name) @@ -515,12 +515,12 @@ make_special_mode (enum mode_class class, const char *name, static void make_int_mode (const char *name, - unsigned int bitsize, unsigned int bytesize, + unsigned int precision, unsigned int bytesize, const char *file, unsigned int line) { struct mode_data *m = new_mode (MODE_INT, name, file, line); m->bytesize = bytesize; - m->bitsize = bitsize; + m->precision = precision; } #define FLOAT_MODE(N, Y, F) FRACTIONAL_FLOAT_MODE (N, -1, Y, F) @@ -529,13 +529,13 @@ make_int_mode (const char *name, static void make_float_mode (const char *name, - unsigned int bitsize, unsigned int bytesize, + unsigned int precision, unsigned int bytesize, const char *format, const char *file, unsigned int line) { struct mode_data *m = new_mode (MODE_FLOAT, name, file, line); m->bytesize = bytesize; - m->bitsize = bitsize; + m->precision = precision; m->format = format; } @@ -565,7 +565,7 @@ reset_float_format (const char *name, const char *format, make_partial_integer_mode (#M, "P" #M, -1, __FILE__, __LINE__) static void ATTRIBUTE_UNUSED make_partial_integer_mode (const char *base, const char *name, - unsigned int bitsize, + unsigned int precision, const char *file, unsigned int line) { struct mode_data *m; @@ -582,7 +582,7 @@ make_partial_integer_mode (const char *base, const char *name, } m = new_mode (MODE_PARTIAL_INT, name, file, line); - m->bitsize = bitsize; + m->precision = precision; m->component = component; } @@ -645,18 +645,18 @@ create_modes (void) /* Processing. */ /* Sort a list of modes into the order needed for the WIDER field: - major sort by bitsize, minor sort by component bitsize. + major sort by precision, minor sort by component precision. For instance: QI < HI < SI < DI < TI V4QI < V2HI < V8QI < V4HI < V2SI. - If the bitsize is not set, sort by the bytesize. A mode with - bitsize set gets sorted before a mode without bitsize set, if + If the precision is not set, sort by the bytesize. A mode with + precision set gets sorted before a mode without precision set, if they have the same bytesize; this is the right thing because - the bitsize must always be smaller than the bytesize * BITS_PER_UNIT. + the precision must always be smaller than the bytesize * BITS_PER_UNIT. We don't have to do anything special to get this done -- an unset - bitsize shows up as (unsigned int)-1, i.e. UINT_MAX. */ + precision shows up as (unsigned int)-1, i.e. UINT_MAX. */ static int cmp_modes (const void *a, const void *b) { @@ -668,9 +668,9 @@ cmp_modes (const void *a, const void *b) else if (m->bytesize < n->bytesize) return -1; - if (m->bitsize > n->bitsize) + if (m->precision > n->precision) return 1; - else if (m->bitsize < n->bitsize) + else if (m->precision < n->precision) return -1; if (!m->component && !n->component) @@ -681,9 +681,9 @@ cmp_modes (const void *a, const void *b) else if (m->component->bytesize < n->component->bytesize) return -1; - if (m->component->bitsize > n->component->bitsize) + if (m->component->precision > n->component->precision) return 1; - else if (m->component->bitsize < n->component->bitsize) + else if (m->component->precision < n->component->precision) return -1; return 0; @@ -802,7 +802,7 @@ enum machine_mode\n{"); end will try to use it for bitfields in structures and the like, which we do not want. Only the target md file should generate BImode widgets. */ - if (first && first->bitsize == 1) + if (first && first->precision == 1) first = first->next; if (first && last) @@ -892,16 +892,16 @@ emit_mode_class (void) } static void -emit_mode_bitsize (void) +emit_mode_precision (void) { enum mode_class c; struct mode_data *m; - print_decl ("unsigned short", "mode_bitsize", "NUM_MACHINE_MODES"); + print_decl ("unsigned short", "mode_precision", "NUM_MACHINE_MODES"); for_all_modes (c, m) - if (m->bitsize != (unsigned int)-1) - tagged_printf ("%u", m->bitsize, m->name); + if (m->precision != (unsigned int)-1) + tagged_printf ("%u", m->precision, m->name); else tagged_printf ("%u*BITS_PER_UNIT", m->bytesize, m->name); @@ -968,8 +968,8 @@ emit_mode_mask (void) : ((unsigned HOST_WIDE_INT) 1 << (m)) - 1\n"); for_all_modes (c, m) - if (m->bitsize != (unsigned int)-1) - tagged_printf ("MODE_MASK (%u)", m->bitsize, m->name); + if (m->precision != (unsigned int)-1) + tagged_printf ("MODE_MASK (%u)", m->precision, m->name); else tagged_printf ("MODE_MASK (%u*BITS_PER_UNIT)", m->bytesize, m->name); @@ -1020,7 +1020,7 @@ emit_class_narrowest_mode (void) /* Bleah, all this to get the comment right for MIN_MODE_INT. */ tagged_printf ("MIN_%s", mode_class_names[c], modes[c] - ? (modes[c]->bitsize != 1 + ? (modes[c]->precision != 1 ? modes[c]->name : (modes[c]->next ? modes[c]->next->name @@ -1156,7 +1156,7 @@ emit_insn_modes_c (void) emit_insn_modes_c_header (); emit_mode_name (); emit_mode_class (); - emit_mode_bitsize (); + emit_mode_precision (); emit_mode_size (); emit_mode_nunits (); emit_mode_wider (); diff --git a/gcc/genmultilib b/gcc/genmultilib index b5ffa9d4d52..3cac4e9ad7a 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -323,6 +323,7 @@ for combo in ${combinations}; do osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'` if [ "x${enable_multilib}" != xyes ]; then dirout=".:${osdirout}" + disable_multilib=yes else case "${osdirout}" in !*) @@ -403,6 +404,12 @@ moptions=`echo ${options} | sed -e 's,[ ][ ]*, ,g'` echo "" echo "static const char *multilib_options = \"${moptions}\";" +# Finally output the disable flag if specified +if [ "x${disable_multilib}" = xyes ]; then + echo "" + echo "#define DISABLE_MULTILIB 1" +fi + cd .. rm -r tmpmultilib.$$ diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 76f37496107..208ea8e57f2 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -633,7 +633,7 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code) if (GET_CODE (dest) == STRICT_LOW_PART) dest = XEXP (dest, 0); - /* Find the referant for a DUP. */ + /* Find the referent for a DUP. */ if (GET_CODE (dest) == MATCH_DUP || GET_CODE (dest) == MATCH_OP_DUP @@ -1734,6 +1734,20 @@ write_afterward (struct decision *start, struct decision *afterward, } } +/* Emit a HOST_WIDE_INT as an integer constant expression. We need to take + special care to avoid "decimal constant is so large that it is unsigned" + warnings in the resulting code. */ + +static void +print_host_wide_int (HOST_WIDE_INT val) +{ + HOST_WIDE_INT min = (unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1); + if (val == min) + printf ("(" HOST_WIDE_INT_PRINT_DEC_C "-1)", val + 1); + else + printf (HOST_WIDE_INT_PRINT_DEC_C, val); +} + /* Emit a switch statement, if possible, for an initial sequence of nodes at START. Return the first node yet untested. */ @@ -1907,7 +1921,7 @@ write_switch (struct decision *start, int depth) case DT_elt_one_int: case DT_elt_zero_wide: case DT_elt_zero_wide_safe: - printf (HOST_WIDE_INT_PRINT_DEC_C, p->tests->u.intval); + print_host_wide_int (p->tests->u.intval); break; default: abort (); @@ -1964,7 +1978,7 @@ write_cond (struct decision_test *p, int depth, case DT_elt_zero_wide: case DT_elt_zero_wide_safe: printf ("XWINT (x%d, 0) == ", depth); - printf (HOST_WIDE_INT_PRINT_DEC_C, p->u.intval); + print_host_wide_int (p->u.intval); break; case DT_veclen_ge: diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 23f8e3f32cd..fede14a5130 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -259,7 +259,7 @@ process_include (rtx desc, int lineno) fclose (input_file); } -/* Process a top level rtx in some way, queueing as appropriate. */ +/* Process a top level rtx in some way, queuing as appropriate. */ static void process_rtx (rtx desc, int lineno) @@ -842,7 +842,7 @@ process_define_cond_exec (void) static char * save_string (const char *s, int len) { - register char *result = xmalloc (len + 1); + char *result = xmalloc (len + 1); memcpy (result, s, len); result[len] = 0; diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index eab766e0378..ecd6624487c 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -48,10 +48,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #endif #ifdef ENABLE_VALGRIND_CHECKING -# ifdef HAVE_MEMCHECK_H -# include +# ifdef HAVE_VALGRIND_MEMCHECK_H +# include +# elif defined HAVE_MEMCHECK_H +# include # else -# include +# include # endif #else /* Avoid #ifdef:s when we can help it. */ diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 198b73364bf..bf18e3f00d7 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -31,10 +31,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "timevar.h" #include "params.h" #ifdef ENABLE_VALGRIND_CHECKING -# ifdef HAVE_MEMCHECK_H -# include +# ifdef HAVE_VALGRIND_MEMCHECK_H +# include +# elif defined HAVE_MEMCHECK_H +# include # else -# include +# include # endif #else /* Avoid #ifdef:s when we can help it. */ @@ -185,7 +187,7 @@ static const size_t extra_order_size_table[] = { sizeof (struct tree_list), TREE_EXP_SIZE (2), RTL_SIZE (2), /* MEM, PLUS, etc. */ - RTL_SIZE (9), /* INSN, CALL_INSN, JUMP_INSN */ + RTL_SIZE (9), /* INSN */ }; /* The total number of orders. */ @@ -399,13 +401,12 @@ static struct globals zero otherwise. We allocate them all together, to enable a better runtime data access pattern. */ unsigned long **save_in_use; - #ifdef GATHER_STATISTICS struct { - /* Total memory allocated with ggc_alloc */ + /* Total memory allocated with ggc_alloc. */ unsigned long long total_allocated; - /* Total overhead for memory to be allocated with ggc_alloc */ + /* Total overhead for memory to be allocated with ggc_alloc. */ unsigned long long total_overhead; /* Total allocations and overhead for sizes less than 32, 64 and 128. @@ -421,6 +422,9 @@ static struct globals unsigned long long total_allocated_under128; unsigned long long total_overhead_under128; + /* The allocations for each of the allocation orders. */ + unsigned long long total_allocated_per_order[NUM_ORDERS]; + /* The overhead for each of the allocation orders. */ unsigned long long total_overhead_per_order[NUM_ORDERS]; } stats; @@ -1169,8 +1173,9 @@ ggc_alloc (size_t size) #ifdef GATHER_STATISTICS { G.stats.total_overhead += OBJECT_SIZE (order) - size; - G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size; G.stats.total_allocated += OBJECT_SIZE(order); + G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size; + G.stats.total_allocated_per_order[order] += OBJECT_SIZE (order); if (size <= 32){ G.stats.total_overhead_under32 += OBJECT_SIZE (order) - size; @@ -1399,6 +1404,20 @@ init_ggc (void) G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *)); } +/* Start a new GGC zone. */ + +struct alloc_zone * +new_ggc_zone (const char *name ATTRIBUTE_UNUSED) +{ + return NULL; +} + +/* Destroy a GGC zone. */ +void +destroy_ggc_zone (struct alloc_zone *zone ATTRIBUTE_UNUSED) +{ +} + /* Increment the `GC context'. Objects allocated in an outer context are never freed, eliminating the need to register their roots. */ @@ -1828,6 +1847,8 @@ ggc_print_statistics (void) /* Collect some information about the various sizes of allocation. */ + fprintf (stderr, + "Memory still allocated at the end of the compilation process\n"); fprintf (stderr, "%-5s %10s %10s %10s\n", "Size", "Allocated", "Used", "Overhead"); for (i = 0; i < NUM_ORDERS; ++i) @@ -1869,6 +1890,8 @@ ggc_print_statistics (void) #ifdef GATHER_STATISTICS { + fprintf (stderr, "\nTotal allocations and overheads during the compilation process\n"); + fprintf (stderr, "Total Overhead: %10lld\n", G.stats.total_overhead); fprintf (stderr, "Total Allocated: %10lld\n", @@ -1888,9 +1911,13 @@ ggc_print_statistics (void) G.stats.total_allocated_under128); for (i = 0; i < NUM_ORDERS; i++) - if (G.stats.total_overhead_per_order[i]) - fprintf (stderr, "Total Overhead page size %7d: %10lld\n", - OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]); + if (G.stats.total_allocated_per_order[i]) + { + fprintf (stderr, "Total Overhead page size %7d: %10lld\n", + OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]); + fprintf (stderr, "Total Allocated page size %7d: %10lld\n", + OBJECT_SIZE (i), G.stats.total_allocated_per_order[i]); + } } #endif } @@ -2107,7 +2134,7 @@ ggc_pch_read (FILE *f, void *addr) /* We've just read in a PCH file. So, every object that used to be allocated is now free. */ clear_marks (); -#ifdef GGC_POISON +#ifdef ENABLE_GC_CHECKING poison_pages (); #endif diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c index eee33a568af..2f75021f42d 100644 --- a/gcc/ggc-simple.c +++ b/gcc/ggc-simple.c @@ -344,6 +344,20 @@ init_ggc (void) { } +/* Start a new GGC zone. */ + +struct alloc_zone * +new_ggc_zone (const char *name ATTRIBUTE_UNUSED) +{ + return NULL; +} + +/* Destroy a GGC zone. */ +void +destroy_ggc_zone (struct alloc_zone *zone ATTRIBUTE_UNUSED) +{ +} + /* Start a new GGC context. Memory allocated in previous contexts will not be collected while the new context is active. */ diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c index 897389e0286..a709edf5931 100644 --- a/gcc/ggc-zone.c +++ b/gcc/ggc-zone.c @@ -36,7 +36,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bitmap.h" #ifdef ENABLE_VALGRIND_CHECKING -#include +# ifdef HAVE_VALGRIND_MEMCHECK_H +# include +# elif defined HAVE_MEMCHECK_H +# include +# else +# include +# endif #else /* Avoid #ifdef:s when we can help it. */ #define VALGRIND_DISCARD(x) @@ -83,7 +89,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA If we track inter-zone pointers, we can mark single zones at a time. If we have a zone where we guarantee no inter-zone pointers, we - could mark that zone seperately. + could mark that zone separately. The garbage zone should not be marked, and we should return 1 in ggc_set_mark for any object in the garbage zone, which cuts off marking quickly. */ @@ -238,7 +244,6 @@ struct max_alignment { #define LOOKUP_L2(p) \ (((size_t) (p) >> G.lg_pagesize) & ((1 << PAGE_L2_BITS) - 1)) -struct alloc_zone; /* A page_entry records the status of an allocation page. */ typedef struct page_entry { @@ -262,7 +267,7 @@ typedef struct page_entry #endif /* Number of bytes on the page unallocated. Only used during - collection, and even then large pages merely set this non-zero. */ + collection, and even then large pages merely set this nonzero. */ size_t bytes_free; /* Context depth of this page. */ @@ -271,6 +276,7 @@ typedef struct page_entry /* Does this page contain small objects, or one large object? */ bool large_p; + /* The zone that this page entry belongs to. */ struct alloc_zone *zone; } page_entry; @@ -375,8 +381,11 @@ struct alloc_zone /* Next zone in the linked list of zones. */ struct alloc_zone *next_zone; - /* Return true if this zone was collected during this collection. */ + /* True if this zone was collected during this collection. */ bool was_collected; + + /* True if this zone should be destroyed after the next collection. */ + bool dead; } main_zone; struct alloc_zone *rtl_zone; @@ -995,20 +1004,26 @@ ggc_alloc_zone_1 (size_t size, struct alloc_zone *zone, short type) return result; } -/* Allocate a SIZE of chunk memory of GTE type, into an approriate zone +/* Allocate a SIZE of chunk memory of GTE type, into an appropriate zone for that type. */ void * ggc_alloc_typed (enum gt_types_enum gte, size_t size) { - if (gte == gt_ggc_e_14lang_tree_node) - return ggc_alloc_zone_1 (size, tree_zone, gte); - else if (gte == gt_ggc_e_7rtx_def) - return ggc_alloc_zone_1 (size, rtl_zone, gte); - else if (gte == gt_ggc_e_9rtvec_def) - return ggc_alloc_zone_1 (size, rtl_zone, gte); - else - return ggc_alloc_zone_1 (size, &main_zone, gte); + switch (gte) + { + case gt_ggc_e_14lang_tree_node: + return ggc_alloc_zone_1 (size, tree_zone, gte); + + case gt_ggc_e_7rtx_def: + return ggc_alloc_zone_1 (size, rtl_zone, gte); + + case gt_ggc_e_9rtvec_def: + return ggc_alloc_zone_1 (size, rtl_zone, gte); + + default: + return ggc_alloc_zone_1 (size, &main_zone, gte); + } } /* Normal ggc_alloc simply allocates into the main zone. */ @@ -1127,26 +1142,16 @@ ggc_get_size (const void *p) /* Initialize the ggc-zone-mmap allocator. */ void -init_ggc () +init_ggc (void) { - /* Create the zones. */ + /* Set up the main zone by hand. */ main_zone.name = "Main zone"; G.zones = &main_zone; - rtl_zone = xcalloc (1, sizeof (struct alloc_zone)); - rtl_zone->name = "RTL zone"; - /* The main zone's connected to the ... rtl_zone */ - G.zones->next_zone = rtl_zone; - - garbage_zone = xcalloc (1, sizeof (struct alloc_zone)); - garbage_zone->name = "Garbage zone"; - /* The rtl zone's connected to the ... garbage zone */ - rtl_zone->next_zone = garbage_zone; - - tree_zone = xcalloc (1, sizeof (struct alloc_zone)); - tree_zone->name = "Tree zone"; - /* The garbage zone's connected to ... the tree zone */ - garbage_zone->next_zone = tree_zone; + /* Allocate the default zones. */ + rtl_zone = new_ggc_zone ("RTL zone"); + tree_zone = new_ggc_zone ("Tree zone"); + garbage_zone = new_ggc_zone ("Garbage zone"); G.pagesize = getpagesize(); G.lg_pagesize = exact_log2 (G.pagesize); @@ -1191,11 +1196,42 @@ init_ggc () #endif } +/* Start a new GGC zone. */ + +struct alloc_zone * +new_ggc_zone (const char * name) +{ + struct alloc_zone *new_zone = xcalloc (1, sizeof (struct alloc_zone)); + new_zone->name = name; + new_zone->next_zone = G.zones->next_zone; + G.zones->next_zone = new_zone; + return new_zone; +} + +/* Destroy a GGC zone. */ +void +destroy_ggc_zone (struct alloc_zone * dead_zone) +{ + struct alloc_zone *z; + + for (z = G.zones; z && z->next_zone != dead_zone; z = z->next_zone) + /* Just find that zone. */ ; + +#ifdef ENABLE_CHECKING + /* We should have found the zone in the list. Anything else is fatal. */ + if (!z) + abort (); +#endif + + /* z is dead, baby. z is dead. */ + z->dead= true; +} + /* Increment the `GC context'. Objects allocated in an outer context are never freed, eliminating the need to register their roots. */ void -ggc_push_context () +ggc_push_context (void) { struct alloc_zone *zone; for (zone = G.zones; zone; zone = zone->next_zone) @@ -1228,15 +1264,15 @@ ggc_pop_context_1 (struct alloc_zone *zone) /* Any remaining pages in the popped context are lowered to the new current context; i.e. objects allocated in the popped context and left over are imported into the previous context. */ - for (p = zone->pages; p != NULL; p = p->next) - if (p->context_depth > depth) - p->context_depth = depth; + for (p = zone->pages; p != NULL; p = p->next) + if (p->context_depth > depth) + p->context_depth = depth; } /* Pop all the zone contexts. */ void -ggc_pop_context () +ggc_pop_context (void) { struct alloc_zone *zone; for (zone = G.zones; zone; zone = zone->next_zone) @@ -1282,7 +1318,7 @@ sweep_pages (struct alloc_zone *zone) } /* Large pages are all or none affairs. Either they are - completely empty, or they are completeley full. + completely empty, or they are completely full. Thus, if the above didn't catch it, we need not do anything except remove the mark and reset the bytes_free. @@ -1371,19 +1407,24 @@ sweep_pages (struct alloc_zone *zone) static bool ggc_collect_1 (struct alloc_zone *zone, bool need_marking) { - /* Avoid frequent unnecessary work by skipping collection if the - total allocations haven't expanded much since the last - collection. */ - float allocated_last_gc = - MAX (zone->allocated_last_gc, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024); + if (!zone->dead) + { + /* Avoid frequent unnecessary work by skipping collection if the + total allocations haven't expanded much since the last + collection. */ + float allocated_last_gc = + MAX (zone->allocated_last_gc, + (size_t) PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024); - float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100; + float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100; - if (zone->allocated < allocated_last_gc + min_expand) - return false; + if (zone->allocated < allocated_last_gc + min_expand) + return false; + } if (!quiet_flag) - fprintf (stderr, " {%s GC %luk -> ", zone->name, (unsigned long) zone->allocated / 1024); + fprintf (stderr, " {%s GC %luk -> ", + zone->name, (unsigned long) zone->allocated / 1024); /* Zero the total allocated bytes. This will be recalculated in the sweep phase. */ @@ -1402,7 +1443,6 @@ ggc_collect_1 (struct alloc_zone *zone, bool need_marking) zone->was_collected = true; zone->allocated_last_gc = zone->allocated; - if (!quiet_flag) fprintf (stderr, "%luk}", (unsigned long) zone->allocated / 1024); return true; @@ -1430,10 +1470,12 @@ calculate_average_page_survival (struct alloc_zone *zone) structures. */ static inline void -check_cookies () +check_cookies (void) { #ifdef COOKIE_CHECKING page_entry *p; + struct alloc_zone *zone; + for (zone = G.zones; zone; zone = zone->next_zone) { for (p = zone->pages; p; p = p->next) @@ -1459,7 +1501,7 @@ check_cookies () /* Top level collection routine. */ void -ggc_collect () +ggc_collect (void) { struct alloc_zone *zone; bool marked = false; @@ -1470,6 +1512,7 @@ ggc_collect () /* Start by possibly collecting the main zone. */ main_zone.was_collected = false; marked |= ggc_collect_1 (&main_zone, true); + /* In order to keep the number of collections down, we don't collect other zones unless we are collecting the main zone. This gives us roughly the same number of collections as we used to @@ -1481,36 +1524,30 @@ ggc_collect () if (main_zone.was_collected) { - check_cookies (); - rtl_zone->was_collected = false; - marked |= ggc_collect_1 (rtl_zone, !marked); - check_cookies (); - tree_zone->was_collected = false; - marked |= ggc_collect_1 (tree_zone, !marked); - check_cookies (); - garbage_zone->was_collected = false; - marked |= ggc_collect_1 (garbage_zone, !marked); + struct alloc_zone *zone; + + for (zone = main_zone.next_zone; zone; zone = zone->next_zone) + { + check_cookies (); + zone->was_collected = false; + marked |= ggc_collect_1 (zone, !marked); + } } /* Print page survival stats, if someone wants them. */ if (GGC_DEBUG_LEVEL >= 2) { - if (rtl_zone->was_collected) - { - f = calculate_average_page_survival (rtl_zone); - printf ("Average RTL page survival is %f\n", f); - } - if (main_zone.was_collected) - { - f = calculate_average_page_survival (&main_zone); - printf ("Average main page survival is %f\n", f); - } - if (tree_zone->was_collected) + for (zone = G.zones; zone; zone = zone->next_zone) { - f = calculate_average_page_survival (tree_zone); - printf ("Average tree page survival is %f\n", f); + if (zone->was_collected) + { + f = calculate_average_page_survival (zone); + printf ("Average page survival in zone `%s' is %f\n", + zone->name, f); + } } } + /* Since we don't mark zone at a time right now, marking in any zone means marking in every zone. So we have to clear all the marks in all the zones that weren't collected already. */ @@ -1552,13 +1589,34 @@ ggc_collect () } } } + + /* Free dead zones. */ + for (zone = G.zones; zone && zone->next_zone; zone = zone->next_zone) + { + if (zone->next_zone->dead) + { + struct alloc_zone *dead_zone = zone->next_zone; + + printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name); + + /* The zone must be empty. */ + if (dead_zone->allocated != 0) + abort (); + + /* Unchain the dead zone, release all its pages and free it. */ + zone->next_zone = zone->next_zone->next_zone; + release_pages (dead_zone); + free (dead_zone); + } + } + timevar_pop (TV_GC); } /* Print allocation statistics. */ void -ggc_print_statistics () +ggc_print_statistics (void) { } @@ -1570,7 +1628,6 @@ struct ggc_pch_data } d; size_t base; size_t written; - }; /* Initialize the PCH datastructure. */ @@ -1655,7 +1712,7 @@ ggc_pch_write_object (struct ggc_pch_data *d ATTRIBUTE_UNUSED, if (!is_string) { struct alloc_chunk *chunk = (struct alloc_chunk *) ((char *)x - CHUNK_OVERHEAD); - size = chunk->size; + size = ggc_get_size (x); if (fwrite (chunk, size + CHUNK_OVERHEAD, 1, f) != 1) fatal_error ("can't write PCH file: %m"); d->written += size + CHUNK_OVERHEAD; diff --git a/gcc/ggc.h b/gcc/ggc.h index 4f25f7373c2..8add2da33ba 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -141,9 +141,18 @@ extern void init_stringpool (void); /* A GC implementation must provide these functions. They are internal to the GC system. */ +/* Forward declare the zone structure. Only ggc_zone implements this. */ +struct alloc_zone; + /* Initialize the garbage collector. */ extern void init_ggc (void); +/* Start a new GGC zone. */ +extern struct alloc_zone *new_ggc_zone (const char *); + +/* Free a complete GGC zone, destroying everything in it. */ +extern void destroy_ggc_zone (struct alloc_zone *); + /* Start a new GGC context. Memory allocated in previous contexts will not be collected while the new context is active. */ extern void ggc_push_context (void); @@ -193,8 +202,6 @@ extern void ggc_pch_read (FILE *, void *); /* Allocation. */ -/* Zone structure. */ -struct alloc_zone; /* For single pass garbage. */ extern struct alloc_zone *garbage_zone; /* For regular rtl allocations. */ @@ -206,7 +213,7 @@ extern struct alloc_zone *tree_zone; extern void *ggc_alloc (size_t); /* Allocate an object into the specified allocation zone. */ extern void *ggc_alloc_zone (size_t, struct alloc_zone *); -/* Allocate an object of the specified type and size. */ +/* Allocate an object of the specified type and size. */ extern void *ggc_alloc_typed (enum gt_types_enum, size_t); /* Like ggc_alloc, but allocates cleared memory. */ extern void *ggc_alloc_cleared (size_t); diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index d19d78a3140..1bb3e90bc9b 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -413,21 +413,12 @@ typedef __WINT_TYPE__ wint_t; #ifndef __cplusplus #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #else -/* In C++ a POD type can have a user defined address-of operator, and - that will break offsetof. C++ core defect 273 addresses this and - claims that reinterpret_casts to char & type are sufficient to - overcome this problem. - - (reinterpret_cast - (&reinterpret_cast (static_cast (0)->MEMBER))) - - But, such casts are not permitted in integral constant expressions, - which offsetof is supposed to be. - - It appears that offsetof is unimplementable in C++ without a - compiler extension. */ -#define offsetof(TYPE, MEMBER) (reinterpret_cast \ - (&static_cast (0)->MEMBER)) +/* The cast to "char &" below avoids problems with user-defined + "operator &", which can appear in a POD type. */ +#define offsetof(TYPE, MEMBER) \ + (__offsetof__ (reinterpret_cast \ + (&reinterpret_cast \ + (static_cast (0)->MEMBER)))) #endif /* C++ */ #endif /* _STDDEF_H was defined this time */ diff --git a/gcc/global.c b/gcc/global.c index c808e207406..de765b36731 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -323,9 +323,7 @@ global_alloc (FILE *file) #endif int need_fp = (! flag_omit_frame_pointer -#ifdef EXIT_IGNORE_STACK || (current_function_calls_alloca && EXIT_IGNORE_STACK) -#endif || FRAME_POINTER_REQUIRED); size_t i; @@ -343,22 +341,48 @@ global_alloc (FILE *file) #ifdef ELIMINABLE_REGS for (i = 0; i < ARRAY_SIZE (eliminables); i++) { - SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from); + bool cannot_elim + = (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to) + || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp)); + + if (!regs_asm_clobbered[eliminables[i].from]) + { + SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from); - if (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to) - || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp)) - SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from); + if (cannot_elim) + SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from); + } + else if (cannot_elim) + error ("%s cannot be used in asm here", + reg_names[eliminables[i].from]); + else + regs_ever_live[eliminables[i].from] = 1; } #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM); - if (need_fp) - SET_HARD_REG_BIT (no_global_alloc_regs, HARD_FRAME_POINTER_REGNUM); + if (!regs_asm_clobbered[HARD_FRAME_POINTER_REGNUM]) + { + SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM); + if (need_fp) + SET_HARD_REG_BIT (no_global_alloc_regs, HARD_FRAME_POINTER_REGNUM); + } + else if (need_fp) + error ("%s cannot be used in asm here", + reg_names[HARD_FRAME_POINTER_REGNUM]); + else + regs_ever_live[HARD_FRAME_POINTER_REGNUM] = 1; #endif #else - SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM); - if (need_fp) - SET_HARD_REG_BIT (no_global_alloc_regs, FRAME_POINTER_REGNUM); + if (!regs_asm_clobbered[FRAME_POINTER_REGNUM]) + { + SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM); + if (need_fp) + SET_HARD_REG_BIT (no_global_alloc_regs, FRAME_POINTER_REGNUM); + } + else if (need_fp) + error ("%s cannot be used in asm here", reg_names[FRAME_POINTER_REGNUM]); + else + regs_ever_live[FRAME_POINTER_REGNUM] = 1; #endif /* Track which registers have already been used. Start with registers @@ -732,7 +756,7 @@ global_conflicts (void) } } - insn = b->head; + insn = BB_HEAD (b); /* Scan the code of this basic block, noting which allocnos and hard regs are born or die. When one is born, @@ -832,7 +856,7 @@ global_conflicts (void) } } - if (insn == b->end) + if (insn == BB_END (b)) break; insn = NEXT_INSN (insn); } @@ -1781,7 +1805,7 @@ build_insn_chain (rtx first) { struct insn_chain *c; - if (first == b->head) + if (first == BB_HEAD (b)) { int i; @@ -1843,7 +1867,7 @@ build_insn_chain (rtx first) } } - if (first == b->end) + if (first == BB_END (b)) b = b->next_bb; /* Stop after we pass the end of the last basic block. Verify that diff --git a/gcc/graph.c b/gcc/graph.c index 9ff50c18130..483cc7e35a1 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -25,9 +25,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" +#include "tree.h" #include "flags.h" #include "output.h" #include "function.h" +#include "langhooks.h" #include "hard-reg-set.h" #include "basic-block.h" #include "toplev.h" @@ -55,7 +57,8 @@ start_fct (FILE *fp) case vcg: fprintf (fp, "\ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n", - current_function_name, current_function_name); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + (*lang_hooks.decl_printable_name) (current_function_decl, 2)); break; case no_graph: break; @@ -71,7 +74,8 @@ start_bb (FILE *fp, int bb) fprintf (fp, "\ graph: {\ntitle: \"%s.BB%d\"\nfolding: 1\ncolor: lightblue\n\ label: \"basic block %d", - current_function_name, bb, bb); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + bb, bb); break; case no_graph: break; @@ -113,8 +117,9 @@ node_data (FILE *fp, rtx tmp_rtx) case vcg: fprintf (fp, "\ edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n", - current_function_name, - current_function_name, XINT (tmp_rtx, 0)); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + XINT (tmp_rtx, 0)); break; case no_graph: break; @@ -126,7 +131,8 @@ edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n", case vcg: fprintf (fp, "node: {\n title: \"%s.%d\"\n color: %s\n \ label: \"%s %d\n", - current_function_name, XINT (tmp_rtx, 0), + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + XINT (tmp_rtx, 0), GET_CODE (tmp_rtx) == NOTE ? "lightgrey" : GET_CODE (tmp_rtx) == INSN ? "green" : GET_CODE (tmp_rtx) == JUMP_INSN ? "darkgreen" @@ -178,8 +184,11 @@ draw_edge (FILE *fp, int from, int to, int bb_edge, int class) color = "color: green "; fprintf (fp, "edge: { sourcename: \"%s.%d\" targetname: \"%s.%d\" %s", - current_function_name, from, - current_function_name, to, color); + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + from, + (*lang_hooks.decl_printable_name) (current_function_decl, 2), + to, + color); if (class) fprintf (fp, "class: %d ", class); fputs ("}\n", fp); @@ -209,7 +218,7 @@ end_fct (FILE *fp) { case vcg: fprintf (fp, "node: { title: \"%s.999999\" label: \"END\" }\n}\n", - current_function_name); + (*lang_hooks.decl_printable_name) (current_function_decl, 2)); break; case no_graph: break; @@ -260,14 +269,14 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first) FOR_EACH_BB_REVERSE (bb) { rtx x; - start[INSN_UID (bb->head)] = bb->index; - end[INSN_UID (bb->end)] = bb->index; - for (x = bb->head; x != NULL_RTX; x = NEXT_INSN (x)) + start[INSN_UID (BB_HEAD (bb))] = bb->index; + end[INSN_UID (BB_END (bb))] = bb->index; + for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x)) { in_bb_p[INSN_UID (x)] = (in_bb_p[INSN_UID (x)] == NOT_IN_BB) ? IN_ONE_BB : IN_MULTIPLE_BB; - if (x == bb->end) + if (x == BB_END (bb)) break; } } @@ -321,7 +330,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first) { if (e->dest != EXIT_BLOCK_PTR) { - rtx block_head = e->dest->head; + rtx block_head = BB_HEAD (e->dest); draw_edge (fp, INSN_UID (tmp_rtx), INSN_UID (block_head), diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index f75894ac3be..5e11b39d507 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -123,8 +123,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA This pass must update information that subsequent passes expect to be correct. Namely: reg_n_refs, reg_n_sets, reg_n_deaths, - reg_n_calls_crossed, and reg_live_length. Also, BLOCK_HEAD, - BLOCK_END. + reg_n_calls_crossed, and reg_live_length. Also, BB_HEAD, BB_END. The information in the line number notes is carefully retained by this pass. Notes that refer to the starting and ending of @@ -973,7 +972,7 @@ priority (rtx insn) } /* Macros and functions for keeping the priority queue sorted, and - dealing with queueing and dequeueing of instructions. */ + dealing with queuing and dequeuing of instructions. */ #define SCHED_SORT(READY, N_READY) \ do { if ((N_READY) == 2) \ @@ -1432,8 +1431,8 @@ void get_block_head_tail (int b, rtx *headp, rtx *tailp) { /* HEAD and TAIL delimit the basic block being scheduled. */ - rtx head = BLOCK_HEAD (b); - rtx tail = BLOCK_END (b); + rtx head = BB_HEAD (BASIC_BLOCK (b)); + rtx tail = BB_END (BASIC_BLOCK (b)); /* Don't include any notes or labels at the beginning of the basic block, or notes at the ends of basic blocks. */ @@ -1872,7 +1871,7 @@ ok_for_early_queue_removal (rtx insn) /* Remove insns from the queue, before they become "ready" with respect - to FU latency considerations. */ + to FU latency considerations. */ static int early_queue_to_ready (state_t state, struct ready_list *ready) @@ -2791,7 +2790,7 @@ sched_init (FILE *dump_file) h_i_d[0].luid = 0; luid = 1; FOR_EACH_BB (b) - for (insn = b->head;; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn)) { INSN_LUID (insn) = luid; @@ -2803,7 +2802,7 @@ sched_init (FILE *dump_file) if (GET_CODE (insn) != NOTE) ++luid; - if (insn == b->end) + if (insn == BB_END (b)) break; } @@ -2825,7 +2824,7 @@ sched_init (FILE *dump_file) FOR_EACH_BB (b) { - for (line = b->head; line; line = PREV_INSN (line)) + for (line = BB_HEAD (b); line; line = PREV_INSN (line)) if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0) { line_note_head[b->index] = line; @@ -2833,7 +2832,7 @@ sched_init (FILE *dump_file) } /* Do a forward search as well, since we won't get to see the first notes in a basic block. */ - for (line = b->head; line; line = NEXT_INSN (line)) + for (line = BB_HEAD (b); line; line = NEXT_INSN (line)) { if (INSN_P (line)) break; @@ -2852,16 +2851,16 @@ sched_init (FILE *dump_file) /* ??? Add a NOTE after the last insn of the last basic block. It is not known why this is done. */ - insn = EXIT_BLOCK_PTR->prev_bb->end; + insn = BB_END (EXIT_BLOCK_PTR->prev_bb); if (NEXT_INSN (insn) == 0 || (GET_CODE (insn) != NOTE && GET_CODE (insn) != CODE_LABEL /* Don't emit a NOTE if it would end up before a BARRIER. */ && GET_CODE (NEXT_INSN (insn)) != BARRIER)) { - emit_note_after (NOTE_INSN_DELETED, EXIT_BLOCK_PTR->prev_bb->end); + emit_note_after (NOTE_INSN_DELETED, BB_END (EXIT_BLOCK_PTR->prev_bb)); /* Make insn to appear outside BB. */ - EXIT_BLOCK_PTR->prev_bb->end = PREV_INSN (EXIT_BLOCK_PTR->prev_bb->end); + BB_END (EXIT_BLOCK_PTR->prev_bb) = PREV_INSN (BB_END (EXIT_BLOCK_PTR->prev_bb)); } /* Compute INSN_REG_WEIGHT for all blocks. We must do this before diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index fe3806066b1..2b10e18628e 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -84,9 +84,6 @@ static int cond_exec_changed_p; /* True if life data ok at present. */ static bool life_data_ok; -/* The post-dominator relation on the original block numbers. */ -static dominance_info post_dominators; - /* Forward references. */ static int count_bb_insns (basic_block); static rtx first_active_insn (basic_block); @@ -123,6 +120,7 @@ mark_loop_exit_edges (void) edge e; flow_loops_find (&loops, LOOP_TREE); + free_dominance_info (CDI_DOMINATORS); if (loops.num > 1) { @@ -148,14 +146,14 @@ static int count_bb_insns (basic_block bb) { int count = 0; - rtx insn = bb->head; + rtx insn = BB_HEAD (bb); while (1) { if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == INSN) count++; - if (insn == bb->end) + if (insn == BB_END (bb)) break; insn = NEXT_INSN (insn); } @@ -168,18 +166,18 @@ count_bb_insns (basic_block bb) static rtx first_active_insn (basic_block bb) { - rtx insn = bb->head; + rtx insn = BB_HEAD (bb); if (GET_CODE (insn) == CODE_LABEL) { - if (insn == bb->end) + if (insn == BB_END (bb)) return NULL_RTX; insn = NEXT_INSN (insn); } while (GET_CODE (insn) == NOTE) { - if (insn == bb->end) + if (insn == BB_END (bb)) return NULL_RTX; insn = NEXT_INSN (insn); } @@ -195,8 +193,8 @@ first_active_insn (basic_block bb) static rtx last_active_insn (basic_block bb, int skip_use_p) { - rtx insn = bb->end; - rtx head = bb->head; + rtx insn = BB_END (bb); + rtx head = BB_HEAD (bb); while (GET_CODE (insn) == NOTE || GET_CODE (insn) == JUMP_INSN @@ -407,13 +405,13 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, /* Find the conditional jump to the ELSE or JOIN part, and isolate the test. */ - test_expr = cond_exec_get_condition (test_bb->end); + test_expr = cond_exec_get_condition (BB_END (test_bb)); if (! test_expr) return FALSE; /* If the conditional jump is more than just a conditional jump, then we can not do conditional execution conversion on this block. */ - if (! onlyjump_p (test_bb->end)) + if (! onlyjump_p (BB_END (test_bb))) return FALSE; /* Collect the bounds of where we're to search, skipping any labels, jumps @@ -440,7 +438,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, true_expr = test_expr; - false_code = reversed_comparison_code (true_expr, test_bb->end); + false_code = reversed_comparison_code (true_expr, BB_END (test_bb)); if (false_code != UNKNOWN) false_expr = gen_rtx_fmt_ee (false_code, GET_MODE (true_expr), XEXP (true_expr, 0), XEXP (true_expr, 1)); @@ -452,12 +450,12 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, conditional execution register from a comparison, it can do so here. */ IFCVT_MODIFY_TESTS (ce_info, true_expr, false_expr); - /* See if the conversion failed */ + /* See if the conversion failed. */ if (!true_expr || !false_expr) goto fail; #endif - true_prob_val = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX); + true_prob_val = find_reg_note (BB_END (test_bb), REG_BR_PROB, NULL_RTX); if (true_prob_val) { true_prob_val = XEXP (true_prob_val, 0); @@ -491,11 +489,11 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, /* If the conditional jump is more than just a conditional jump, then we can not do conditional execution conversion on this block. */ - if (! onlyjump_p (bb->end)) + if (! onlyjump_p (BB_END (bb))) goto fail; /* Find the conditional jump and isolate the test. */ - t = cond_exec_get_condition (bb->end); + t = cond_exec_get_condition (BB_END (bb)); if (! t) goto fail; @@ -521,7 +519,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, #ifdef IFCVT_MODIFY_MULTIPLE_TESTS IFCVT_MODIFY_MULTIPLE_TESTS (ce_info, bb, t, f); - /* See if the conversion failed */ + /* See if the conversion failed. */ if (!t || !f) goto fail; #endif @@ -563,7 +561,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, } #ifdef IFCVT_MODIFY_FINAL - /* Do any machine dependent final modifications */ + /* Do any machine dependent final modifications. */ IFCVT_MODIFY_FINAL (ce_info); #endif @@ -602,6 +600,7 @@ struct noce_if_info }; static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int); +static int noce_try_move (struct noce_if_info *); static int noce_try_store_flag (struct noce_if_info *); static int noce_try_addcc (struct noce_if_info *); static int noce_try_store_flag_constants (struct noce_if_info *); @@ -674,7 +673,9 @@ noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep, || code == GEU || code == GTU), normalize); } -/* Emit instruction to move an rtx into STRICT_LOW_PART. */ +/* Emit instruction to move an rtx, possibly into STRICT_LOW_PART. + X is the destination/target and Y is the value to copy. */ + static void noce_emit_move_insn (rtx x, rtx y) { @@ -697,6 +698,60 @@ noce_emit_move_insn (rtx x, rtx y) GET_MODE_BITSIZE (inmode)); } +/* Unshare sequence SEQ produced by if conversion. We care to mark + all arguments that may be shared with outer instruction stream. */ +static void +unshare_ifcvt_sequence (struct noce_if_info *if_info, rtx seq) +{ + set_used_flags (if_info->x); + set_used_flags (if_info->cond); + unshare_all_rtl_in_chain (seq); +} + +/* Convert "if (a != b) x = a; else x = b" into "x = a" and + "if (a == b) x = a; else x = b" into "x = b". */ + +static int +noce_try_move (struct noce_if_info *if_info) +{ + rtx cond = if_info->cond; + enum rtx_code code = GET_CODE (cond); + rtx y, seq; + + if (code != NE && code != EQ) + return FALSE; + + /* This optimization isn't valid if either A or B could be a NaN + or a signed zero. */ + if (HONOR_NANS (GET_MODE (if_info->x)) + || HONOR_SIGNED_ZEROS (GET_MODE (if_info->x))) + return FALSE; + + /* Check whether the operands of the comparison are A and in + either order. */ + if ((rtx_equal_p (if_info->a, XEXP (cond, 0)) + && rtx_equal_p (if_info->b, XEXP (cond, 1))) + || (rtx_equal_p (if_info->a, XEXP (cond, 1)) + && rtx_equal_p (if_info->b, XEXP (cond, 0)))) + { + y = (code == EQ) ? if_info->a : if_info->b; + + /* Avoid generating the move if the source is the destination. */ + if (! rtx_equal_p (if_info->x, y)) + { + start_sequence (); + noce_emit_move_insn (if_info->x, y); + seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); + end_sequence (); + emit_insn_before_setloc (seq, if_info->jump, + INSN_LOCATOR (if_info->insn_a)); + } + return TRUE; + } + return FALSE; +} + /* Convert "if (test) x = 1; else x = 0". Only try 0 and STORE_FLAG_VALUE here. Other combinations will be @@ -731,6 +786,7 @@ noce_try_store_flag (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); emit_insn_before_setloc (seq, if_info->jump, INSN_LOCATOR (if_info->insn_a)); @@ -861,6 +917,7 @@ noce_try_store_flag_constants (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); if (seq_contains_jump (seq)) @@ -898,9 +955,11 @@ noce_try_addcc (struct noce_if_info *if_info) { start_sequence (); target = emit_conditional_add (if_info->x, code, - XEXP (cond, 0), XEXP (cond, 1), + XEXP (cond, 0), + XEXP (cond, 1), VOIDmode, - if_info->b, XEXP (if_info->a, 1), + if_info->b, + XEXP (if_info->a, 1), GET_MODE (if_info->x), (code == LTU || code == GEU || code == LEU || code == GTU)); @@ -910,6 +969,7 @@ noce_try_addcc (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); emit_insn_before_setloc (seq, if_info->jump, INSN_LOCATOR (if_info->insn_a)); @@ -948,6 +1008,7 @@ noce_try_addcc (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); if (seq_contains_jump (seq)) @@ -991,7 +1052,8 @@ noce_try_store_flag_mask (struct noce_if_info *if_info) reversep, -1); if (target) target = expand_simple_binop (GET_MODE (if_info->x), AND, - if_info->x, target, if_info->x, 0, + if_info->x, + target, if_info->x, 0, OPTAB_WIDEN); if (target) @@ -1000,6 +1062,7 @@ noce_try_store_flag_mask (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); if (seq_contains_jump (seq)) @@ -1097,6 +1160,7 @@ noce_try_cmove (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); emit_insn_before_setloc (seq, if_info->jump, INSN_LOCATOR (if_info->insn_a)); @@ -1214,7 +1278,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info) if (is_mem) { tmp = gen_reg_rtx (GET_MODE (b)); - tmp = emit_insn (gen_rtx_SET (VOIDmode, tmp, b)); + tmp = emit_insn (gen_rtx_SET (VOIDmode, + tmp, + b)); } else if (! insn_b) goto end_seq_and_fail; @@ -1259,6 +1325,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info) noce_emit_move_insn (x, target); tmp = get_insns (); + unshare_ifcvt_sequence (if_info, tmp); end_sequence (); emit_insn_before_setloc (tmp, if_info->jump, INSN_LOCATOR (if_info->insn_a)); return TRUE; @@ -1504,6 +1571,7 @@ noce_try_minmax (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); if (seq_contains_jump (seq)) @@ -1559,7 +1627,7 @@ noce_try_abs (struct noce_if_info *if_info) { rtx insn, note = NULL; for (insn = earliest; - insn != if_info->test_bb->head; + insn != BB_HEAD (if_info->test_bb); insn = PREV_INSN (insn)) if (INSN_P (insn) && ((note = find_reg_note (insn, REG_EQUAL, c)) @@ -1606,7 +1674,7 @@ noce_try_abs (struct noce_if_info *if_info) target = expand_abs_nojump (GET_MODE (if_info->x), b, if_info->x, 1); - /* ??? It's a quandry whether cmove would be better here, especially + /* ??? It's a quandary whether cmove would be better here, especially for integers. Perhaps combine will clean things up. */ if (target && negate) target = expand_simple_unop (GET_MODE (target), NEG, target, if_info->x, 0); @@ -1621,6 +1689,7 @@ noce_try_abs (struct noce_if_info *if_info) noce_emit_move_insn (if_info->x, target); seq = get_insns (); + unshare_ifcvt_sequence (if_info, seq); end_sequence (); if (seq_contains_jump (seq)) @@ -1758,7 +1827,7 @@ noce_process_if_block (struct ce_if_block * ce_info) } /* If this is not a standard conditional jump, we can't parse it. */ - jump = test_bb->end; + jump = BB_END (test_bb); cond = noce_get_condition (jump, &if_info.cond_earliest); if (! cond) return FALSE; @@ -1874,8 +1943,8 @@ noce_process_if_block (struct ce_if_block * ce_info) { rtx note; - if (else_bb && insn_b == else_bb->end) - else_bb->end = PREV_INSN (insn_b); + if (else_bb && insn_b == BB_END (else_bb)) + BB_END (else_bb) = PREV_INSN (insn_b); reorder_insns (insn_b, insn_b, PREV_INSN (jump)); /* If there was a REG_EQUAL note, delete it since it may have been @@ -1894,6 +1963,27 @@ noce_process_if_block (struct ce_if_block * ce_info) goto success; } + /* Disallow the "if (...) x = a;" form (with an implicit "else x = x;") + for most optimizations if writing to x may trap, i.e. its a memory + other than a static var or a stack slot. */ + if (! set_b + && GET_CODE (orig_x) == MEM + && ! MEM_NOTRAP_P (orig_x) + && rtx_addr_can_trap_p (XEXP (orig_x, 0))) + { + if (HAVE_conditional_move) + { + if (noce_try_cmove (&if_info)) + goto success; + if (! HAVE_conditional_execution + && noce_try_cmove_arith (&if_info)) + goto success; + } + return FALSE; + } + + if (noce_try_move (&if_info)) + goto success; if (noce_try_store_flag (&if_info)) goto success; if (noce_try_minmax (&if_info)) @@ -1940,11 +2030,13 @@ noce_process_if_block (struct ce_if_block * ce_info) if (orig_x != x) { start_sequence (); - noce_emit_move_insn (copy_rtx (orig_x), x); + noce_emit_move_insn (orig_x, x); insn_b = get_insns (); + set_used_flags (orig_x); + unshare_all_rtl_in_chain (insn_b); end_sequence (); - emit_insn_after_setloc (insn_b, test_bb->end, INSN_LOCATOR (insn_a)); + emit_insn_after_setloc (insn_b, BB_END (test_bb), INSN_LOCATOR (insn_a)); } /* Merge the blocks! */ @@ -2011,8 +2103,8 @@ merge_if_block (struct ce_if_block * ce_info) { bb = fallthru; fallthru = block_fallthru (bb); - if (post_dominators) - delete_from_dominance_info (post_dominators, bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, bb); merge_blocks (combo_bb, bb); num_true_changes++; } @@ -2028,8 +2120,8 @@ merge_if_block (struct ce_if_block * ce_info) if (combo_bb->global_live_at_end) COPY_REG_SET (combo_bb->global_live_at_end, then_bb->global_live_at_end); - if (post_dominators) - delete_from_dominance_info (post_dominators, then_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, then_bb); merge_blocks (combo_bb, then_bb); num_true_changes++; } @@ -2039,8 +2131,8 @@ merge_if_block (struct ce_if_block * ce_info) get their addresses taken. */ if (else_bb) { - if (post_dominators) - delete_from_dominance_info (post_dominators, else_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, else_bb); merge_blocks (combo_bb, else_bb); num_true_changes++; } @@ -2050,7 +2142,7 @@ merge_if_block (struct ce_if_block * ce_info) if (! join_bb) { - rtx last = combo_bb->end; + rtx last = BB_END (combo_bb); /* The outgoing edge for the current COMBO block should already be correct. Verify this. */ @@ -2096,8 +2188,8 @@ merge_if_block (struct ce_if_block * ce_info) COPY_REG_SET (combo_bb->global_live_at_end, join_bb->global_live_at_end); - if (post_dominators) - delete_from_dominance_info (post_dominators, join_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, join_bb); merge_blocks (combo_bb, join_bb); num_true_changes++; } @@ -2177,7 +2269,7 @@ find_if_header (basic_block test_bb, int pass) && find_cond_trap (test_bb, then_edge, else_edge)) goto success; - if (post_dominators + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY && (! HAVE_conditional_execution || reload_completed)) { if (find_if_case_1 (test_bb, then_edge, else_edge)) @@ -2241,8 +2333,8 @@ block_jumps_and_fallthru_p (basic_block cur_bb, basic_block target_bb) together for conditional execution support. ??? we should support conditional execution support across calls for IA-64 some day, but for now it makes the code simpler. */ - end = cur_bb->end; - insn = cur_bb->head; + end = BB_END (cur_bb); + insn = BB_HEAD (cur_bb); while (insn != NULL_RTX) { @@ -2373,7 +2465,7 @@ find_if_block (struct ce_if_block * ce_info) if (then_succ != NULL_EDGE && (then_succ->succ_next != NULL_EDGE || (then_succ->flags & EDGE_COMPLEX) - || (flow2_completed && tablejump_p (then_bb->end, NULL, NULL)))) + || (flow2_completed && tablejump_p (BB_END (then_bb), NULL, NULL)))) return FALSE; /* If the THEN block has no successors, conditional execution can still @@ -2386,11 +2478,11 @@ find_if_block (struct ce_if_block * ce_info) { if (else_bb->pred->pred_next == NULL_EDGE) { - rtx last_insn = then_bb->end; + rtx last_insn = BB_END (then_bb); while (last_insn && GET_CODE (last_insn) == NOTE - && last_insn != then_bb->head) + && last_insn != BB_HEAD (then_bb)) last_insn = PREV_INSN (last_insn); if (last_insn @@ -2421,7 +2513,7 @@ find_if_block (struct ce_if_block * ce_info) && else_bb->pred->pred_next == NULL_EDGE && else_succ->succ_next == NULL_EDGE && ! (else_succ->flags & EDGE_COMPLEX) - && ! (flow2_completed && tablejump_p (else_bb->end, NULL, NULL))) + && ! (flow2_completed && tablejump_p (BB_END (else_bb), NULL, NULL))) join_bb = else_succ->dest; /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ @@ -2435,15 +2527,15 @@ find_if_block (struct ce_if_block * ce_info) fprintf (rtl_dump_file, "\nIF-THEN%s block found, pass %d, start block %d [insn %d], then %d [%d]", (else_bb) ? "-ELSE" : "", ce_info->pass, - test_bb->index, (test_bb->head) ? (int)INSN_UID (test_bb->head) : -1, - then_bb->index, (then_bb->head) ? (int)INSN_UID (then_bb->head) : -1); + test_bb->index, (BB_HEAD (test_bb)) ? (int)INSN_UID (BB_HEAD (test_bb)) : -1, + then_bb->index, (BB_HEAD (then_bb)) ? (int)INSN_UID (BB_HEAD (then_bb)) : -1); if (else_bb) fprintf (rtl_dump_file, ", else %d [%d]", - else_bb->index, (else_bb->head) ? (int)INSN_UID (else_bb->head) : -1); + else_bb->index, (BB_HEAD (else_bb)) ? (int)INSN_UID (BB_HEAD (else_bb)) : -1); fprintf (rtl_dump_file, ", join %d [%d]", - join_bb->index, (join_bb->head) ? (int)INSN_UID (join_bb->head) : -1); + join_bb->index, (BB_HEAD (join_bb)) ? (int)INSN_UID (BB_HEAD (join_bb)) : -1); if (ce_info->num_multiple_test_blocks > 0) fprintf (rtl_dump_file, ", %d %s block%s last test %d [%d]", @@ -2451,8 +2543,8 @@ find_if_block (struct ce_if_block * ce_info) (ce_info->and_and_p) ? "&&" : "||", (ce_info->num_multiple_test_blocks == 1) ? "" : "s", ce_info->last_test_bb->index, - ((ce_info->last_test_bb->head) - ? (int)INSN_UID (ce_info->last_test_bb->head) + ((BB_HEAD (ce_info->last_test_bb)) + ? (int)INSN_UID (BB_HEAD (ce_info->last_test_bb)) : -1)); fputc ('\n', rtl_dump_file); @@ -2513,7 +2605,7 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) } /* If this is not a standard conditional jump, we can't parse it. */ - jump = test_bb->end; + jump = BB_END (test_bb); cond = noce_get_condition (jump, &cond_earliest); if (! cond) return FALSE; @@ -2537,7 +2629,8 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) } /* Attempt to generate the conditional trap. */ - seq = gen_cond_trap (code, XEXP (cond, 0), XEXP (cond, 1), + seq = gen_cond_trap (code, XEXP (cond, 0), + XEXP (cond, 1), TRAP_CODE (PATTERN (trap))); if (seq == NULL) return FALSE; @@ -2551,8 +2644,8 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) remove_edge (trap_bb == then_bb ? then_edge : else_edge); if (trap_bb->pred == NULL) { - if (post_dominators) - delete_from_dominance_info (post_dominators, trap_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, trap_bb); delete_block (trap_bb); } @@ -2603,7 +2696,7 @@ block_has_only_trap (basic_block bb) /* The only instruction in the THEN block must be the trap. */ trap = first_active_insn (bb); - if (! (trap == bb->end + if (! (trap == BB_END (bb) && GET_CODE (PATTERN (trap)) == TRAP_IF && TRAP_CONDITION (PATTERN (trap)) == const_true_rtx)) return NULL_RTX; @@ -2736,8 +2829,8 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb); then_bb_index = then_bb->index; - if (post_dominators) - delete_from_dominance_info (post_dominators, then_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, then_bb); delete_block (then_bb); /* Make rest of code believe that the newly created block is the THEN_BB @@ -2746,8 +2839,8 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) { new_bb->index = then_bb_index; BASIC_BLOCK (then_bb_index) = new_bb; - if (post_dominators) - add_to_dominance_info (post_dominators, new_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + add_to_dominance_info (CDI_POST_DOMINATORS, new_bb); } /* We've possibly created jump to next insn, cleanup_cfg will solve that later. */ @@ -2785,11 +2878,11 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge) return FALSE; /* ELSE is predicted or SUCC(ELSE) postdominates THEN. */ - note = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX); + note = find_reg_note (BB_END (test_bb), REG_BR_PROB, NULL_RTX); if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2) ; else if (else_succ->dest->index < 0 - || dominated_by_p (post_dominators, then_bb, + || dominated_by_p (CDI_POST_DOMINATORS, then_bb, else_succ->dest)) ; else @@ -2816,8 +2909,8 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge) then_bb->global_live_at_start, else_bb->global_live_at_end, BITMAP_IOR); - if (post_dominators) - delete_from_dominance_info (post_dominators, else_bb); + if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY) + delete_from_dominance_info (CDI_POST_DOMINATORS, else_bb); delete_block (else_bb); num_true_changes++; @@ -2852,11 +2945,11 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, { rtx head, end, jump, earliest, old_dest, new_label = NULL_RTX; - jump = test_bb->end; + jump = BB_END (test_bb); /* Find the extent of the real code in the merge block. */ - head = merge_bb->head; - end = merge_bb->end; + head = BB_HEAD (merge_bb); + end = BB_END (merge_bb); if (GET_CODE (head) == CODE_LABEL) head = NEXT_INSN (head); @@ -2886,8 +2979,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, if (HAVE_conditional_execution) { /* In the conditional execution case, we have things easy. We know - the condition is reversible. We don't have to check life info, - becase we're going to conditionally execute the code anyway. + the condition is reversible. We don't have to check life info + because we're going to conditionally execute the code anyway. All that's left is making sure the insns involved can actually be predicated. */ @@ -3076,8 +3169,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, /* Move the insns out of MERGE_BB to before the branch. */ if (head != NULL) { - if (end == merge_bb->end) - merge_bb->end = PREV_INSN (head); + if (end == BB_END (merge_bb)) + BB_END (merge_bb) = PREV_INSN (head); if (squeeze_notes (&head, &end)) return TRUE; @@ -3122,11 +3215,9 @@ if_convert (int x_life_data_ok) free_basic_block_vars (1); /* Compute postdominators if we think we'll use them. */ - post_dominators = NULL; if (HAVE_conditional_execution || life_data_ok) - { - post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS); - } + calculate_dominance_info (CDI_POST_DOMINATORS); + if (life_data_ok) clear_bb_flags (); @@ -3163,8 +3254,7 @@ if_convert (int x_life_data_ok) fprintf (rtl_dump_file, "\n\n========== no more changes\n"); #endif - if (post_dominators) - free_dominance_info (post_dominators); + free_dominance_info (CDI_POST_DOMINATORS); if (rtl_dump_file) fflush (rtl_dump_file); diff --git a/gcc/integrate.c b/gcc/integrate.c index fa5d71efa00..f317627e487 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -172,6 +172,9 @@ function_cannot_inline_p (tree fndecl) if (current_function_calls_alloca) return N_("function using alloca cannot be inline"); + if (current_function_calls_longjmp) + return N_("function using longjmp cannot be inline"); + if (current_function_calls_setjmp) return N_("function using setjmp cannot be inline"); diff --git a/gcc/java/.cvsignore b/gcc/java/.cvsignore deleted file mode 100644 index dab65347a77..00000000000 --- a/gcc/java/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -parse.c -parse-scan.c -gcj.info* -gcj.1 -gcjh.1 -jv-scan.1 -jcf-dump.1 -gij.1 -jv-convert.1 -rmic.1 rmiregistry.1 diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index d3388a95267..2fa7728ebde 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,233 @@ +2003-12-25 Andrew Pinski + + * parse.y (catch_clause_parameter): Fix typo. + + PR java/13404 + * parse.y: (catch_clause_parameter): Return early if $3, aka + formal_parameter, is null. + +2003-12-20 Kazu Hirata + + * class.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * decl.c: Likewise. + * expr.c: Likewise. + * gjavah.c: Likewise. + * jcf-dump.c: Likewise. + * jcf-io.c: Likewise. + * jcf-parse.c: Likewise. + * jcf-write.c: Likewise. + * keyword.h: Likewise. + * parse.y: Likewise. + * typeck.c: Likewise. + * verify.c: Likewise. + +2003-12-06 Kelley Cook + + * Make-lang.in (GCJ_CROSS_NAME): Delete. + (java.install_common, java.install-man): Adjust for above. + (java.uninstall): Likewise. + +2003-12-03 Michael Koch + + * class.c (make_class_data): + Push field value to 'hack_signers' instead of 'signers'. + * decl.c (java_init_decl_processing): + Push field 'hack_signers' instead of 'signers'. + +2003-12-03 Zack Weinberg + + * lex.h: Check both HAVE_ICONV and HAVE_ICONV_H before + including iconv.h. + +2003-12-03 Ralph Loader + + PR java/12374: + * parse.y (qualify_ambiguous_name): Remove lots of broken + field access processing - there's no need to do that here, + because we have resolve_field_access. Remove + RESOLVE_EXPRESSION_NAME_P as it isn't used anywhere else. + * java-tree.h: Remove RESOLVE_EXPRESSION_NAME_P as it isn't + used. + +2003-12-01 Jeff Sturm + + Fix PR java/13237 + * parse.y (java_complete_lhs): Save location prior to patching + CALL_EXPR. + +2003-11-25 Mohan Embar + + PR java/12548 + * resource.c (write_resource_constructor): Append + "_resource" to constructor identifier name. + +2003-11-25 Jeff Sturm + + Fix PR java/13183. + * constants.c (cpool_for_class): New function. + (outgoing_cpool): Remove global variable. + (alloc_name_constant): Use cpool_for_class. + (build_constants_constructor): Likewise. + * decl.c (java_expand_body): Set current_class. + * java-tree.h (outgoing_cpool) Remove declaration. + (init_outgoing_cpool): Likewise. + * jcf-parse.c (init_outgoing_cpool): Remove function. + (parse_class_file): Don't call init_outgoing_cpool. + * parse.y (java_complete_expand_methods): Don't call + init_outgoing_cpool. Don't save outgoing_cpool. + (java_expand_classes): Don't restore outgoing_cpool. + (java_finish_classes): Likewise. + +2003-11-24 Mohan Embar + + * Make-lang.in: (java.install-common) Add + symlink for $(target_noncanonical)-gcjh for + native builds. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (java.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (check-java): Add. + +2003-11-19 Jeff Sturm + + Fix PR java/13024. + * except.c (prepare_eh_table_type): Allocate variable-sized + buffer `buf' with alloca. + +2003-11-17 Jeff Sturm + + Fix PR java/12857. + + decl.c (java_init_decl_processing): Don't initialize + class_not_found_type_node, no_class_def_found_type_node. + + java-tree.h (JTI_CLASS_NOT_FOUND_TYPE_NODE, + JTI_NO_CLASS_DEF_FOUND_TYPE_NODE): Remove from java_tree_index. + (class_not_found_type_node, no_class_def_found_type_node): + Don't define. + + parse.y (build_dot_class_method_invocation): Add this_class + argument. Qualify method invocations to a different class. + (create_new_parser_context): Initialize saved_data_ctx to 0. + (java_parser_context_save_global): Initialize saved_data_ctx to 1. + (build_dot_class_method): Don't load classes. Register + incomplete types. + (build_incomplete_class_ref): Special cases for interfaces + and inner classes. Move build_dot_class_method call to here... + (patch_incomplete_class_ref): ...from here. Pass current_class + to build_dot_class_method_invocation. + (build_assertion): Pass class_type to + build_dot_class_method_invocation. + (encapsulate_with_try_catch): Handle EXPR_WITH_FILE_LOCATION node. + +2003-11-17 Jeff Sturm + + Fix PR java/12739. + * java-tree.h (BLOCK_EMPTY_P): Define. + * parse.y (java_complete_lhs): Check for empty blocks + in TRY_FINALLY_EXPR case. + +2003-11-17 Andrew Haley + + * java-tree.h (LOCAL_VAR_OUT_OF_SCOPE_P): New. + (struct lang_decl_var:freed): New variable. + * decl.c (poplevel): Mark local vars that have gone out of scope. + (push_jvm_slot): Don't use the RTL of a var that has gone out of + scope. + +2003-11-16 Jason Merrill + + * Make-lang.in (java.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-15 Tom Tromey + + * gjavah.c (print_stub_or_jni): Pass `env' to FatalError. + +2003-11-12 Jason Merrill + + PR optimization/12547 + * lang.c (java_tree_inlining_walk_subtrees): Just walk + BLOCK_EXPR_BODY directly. + +2003-11-12 Andrew Haley + + PR java/11045 + * parse.y (fold_constant_for_init): Check that we really do have a + constant. + + PR java/11533 + * lang.c (merge_init_test_initialization): Clear DECL_INITIAL for + init_test_decls being inlined. + + PR java/12890: + * parse.y (do_resolve_class): Check return value from + breakdown_qualified(). + +2003-11-11 Tom Tromey + + PR java/12915: + * parse.y (merge_string_cste): Handle case where we have a + pointer that happens to be zero, not null_pointer_node. + +2003-11-10 Tom Tromey + + * jcf-parse.c (classify_zip_file): Correctly compare + filename_length against length of manifest file's name. + +2003-11-08 Tom Tromey + + PR java/12894: + * jcf-parse.c (classify_zip_file): Only skip MANIFEST.MF file. + +2003-11-06 Andrew Haley + + * expr.c (java_stack_swap): Make sure destination stack slots are + of the correct type. + +2003-11-03 Kelley Cook + + * Make-lang.in (dvi): Move targets to $(docobjdir). + (gcj.dvi): Simplify rule and adjust target. + (gcj.info): Simplify rule. + (gcj.pod): New intermediate rule. + (gcjh.pod): Likewise. + (jv-scan.pod): Likewise. + (jcf-dump.pod): Likewise. + (gij.pod): Likewise. + (jv-convert.pod): Likewise. + (rmic.pod): Likewise. + (rmiregistry.pod): Likewise. + (gcj.1): Delete. + (gcjh.1): Delete. + (jv-scan.1): Delete. + (jcf-dump.1): Delete. + (gij.1): Delete. + (jv-convert.1): Delete. + (rmic.1): Delete. + (rmiregistry.1): Delete. + +2003-11-02 Jeff Sturm + + Fixes PR java/12866. + * parse.y (resolve_qualified_expression_name): Move test + for outer field access methods from here... + (check_thrown_exceptions) ...to here. + +2003-11-01 Kelley Cook + + * .cvsignore: Delete. + +2003-10-28 Frank Ch. Eigler + + * verify.c (verify_jvm_instructions): Don't warn about legal + eh binding regions generated for example by jdk 1.4.1. + 2003-10-24 David S. Miller * jcf-parse.c (jcf_parse): Fix args to fatal_error(). @@ -117,7 +347,7 @@ (atable_syms_decl): New. (enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL, JTI_ATABLE_SYMS_DECL. Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*. - (symbol_*type): Rename method_symbol* to symbol*type. + (symbol_*type): Rename method_symbol* to symbol*type. (emit_offset_symbol_table): Delete. (emit_symbol_table): New. (get_symbol_table_index): New. @@ -134,7 +364,7 @@ (emit_symbol_table): Rename from emit_offset_symbol_table. Parameterize to allow re-use by different types of symbol table. (build_symbol_entry): Renamed from build_method_symbols_entry. - + 2003-09-30 Roger Sayle * jcf-write.c (generate_bytecode_insns): Implement evaluate-once @@ -197,17 +427,17 @@ 2003-09-21 Richard Henderson - * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, + * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Revert. 2003-09-21 Richard Henderson - * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, + * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Update for DECL_SOURCE_LOCATION rename and change to const. 2003-09-20 Richard Henderson - * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics. + * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics. 2003-09-18 Roger Sayle @@ -233,18 +463,18 @@ 2003-09-16 Bryce McKinlay - * class.c (add_miranda_methods): Ensure super-interfaces are laid + * class.c (add_miranda_methods): Ensure super-interfaces are laid out. Fix for PR java/12254. 2003-09-11 Richard Henderson - * parse.y (source_end_java_method): Update for new - cgraph_finalize_function argument. + * parse.y (source_end_java_method): Update for new + cgraph_finalize_function argument. 2003-09-09 Richard Henderson - * parse.y (source_end_java_method): Update call to - cgraph_finalize_function. + * parse.y (source_end_java_method): Update call to + cgraph_finalize_function. 2003-09-03 Jeff Sturm @@ -292,8 +522,8 @@ 2003-08-20 Andrew Haley - * except.c (prepare_eh_table_type): Use new encoding for exception - handlers when using -fno-assume-compiled. + * except.c (prepare_eh_table_type): Use new encoding for exception + handlers when using -fno-assume-compiled. 2003-08-13 Tom Tromey diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index ab732310960..fc6adf9c15f 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -1,4 +1,4 @@ -# Top level makefile fragment for the GNU compiler for the Java(TM) +# Top level -*- makefile -*- fragment for the GNU compiler for the Java(TM) # language. # Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -29,7 +29,7 @@ # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-normal, foo.install-common, foo.install-man, # foo.uninstall, -# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. @@ -43,9 +43,7 @@ # Actual names to use when installing a native compiler. JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'` JAVA_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcj|sed '$(program_transform_name)'` - -# Actual names to use when installing a cross-compiler. -JAVA_CROSS_NAME = `echo gcj|sed '$(program_transform_cross_name)'` +GCJH_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcjh|sed '$(program_transform_name)'` GCJ = gcj @@ -158,15 +156,20 @@ java.rest.encap: java.tags: force - cd $(srcdir)/java; etags *.y *.c *.h --language=none --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' java-tree.def + cd $(srcdir)/java; etags -o TAGS.sub *.y *.c *.h --language=none \ + --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' java-tree.def; \ + etags --include TAGS.sub --include ../TAGS.sub + info:: $(docobjdir)/gcj.info -dvi:: java/gcj.dvi +dvi:: $(docobjdir)/gcj.dvi generated-manpages:: $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 \ $(docobjdir)/jv-scan.1 $(docobjdir)/jcf-dump.1 \ $(docobjdir)/gij.1 $(docobjdir)/jv-convert.1 \ $(docobjdir)/rmic.1 $(docobjdir)/rmiregistry.1 +check-java : + # Install hooks: # jc1, gcj, jvgenmain, and gcjh are installed elsewhere as part # of $(COMPILERS). @@ -174,16 +177,19 @@ generated-manpages:: $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 \ # Nothing to do here. java.install-normal: +# Install gcj as well as the target-independent tools. +# For a native build, we special-case gcjh and also install +# its explicitly-prefixed variant. This allows us to write +# portable makefiles for both cross builds (where gcjh *must* +# be explicitly prefixed) and native builds. java.install-common: installdirs -if [ -f $(GCJ)$(exeext) ]; then \ + rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ + chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ if [ -f $(GCJ)-cross$(exeext) ]; then \ - rm -f $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \ - $(INSTALL_PROGRAM) $(GCJ)-cross$(exeext) $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \ + true; \ else \ - rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ - chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ rm -f $(DESTDIR)$(bindir)/$(JAVA_TARGET_INSTALL_NAME)$(exeext); \ ( cd $(DESTDIR)$(bindir) && \ $(LN) $(JAVA_INSTALL_NAME)$(exeext) $(JAVA_TARGET_INSTALL_NAME)$(exeext) ); \ @@ -195,6 +201,11 @@ java.install-common: installdirs rm -f $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \ $(INSTALL_PROGRAM) $$tool$(exeext) $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \ chmod a+x $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \ + if [ $$tool = gcjh ]; then \ + rm -f $(DESTDIR)$(bindir)/$(GCJH_TARGET_INSTALL_NAME)$(exeext); \ + ( cd $(DESTDIR)$(bindir) && \ + $(LN) $$tool_transformed_name$(exeext) $(GCJH_TARGET_INSTALL_NAME)$(exeext) ); \ + fi; \ fi ; \ done @@ -202,9 +213,7 @@ java.install-man: java.uninstall: -rm -rf $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext) - -rm -rf $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext) -rm -rf $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext) - -rm -rf $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/gcjh$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/jv-scan$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/jcf-dump$(man1ext) @@ -226,7 +235,6 @@ java.clean: java.distclean: -rm -f java/config.status java/Makefile -rm -f java/parse.output -java.extraclean: java.maintainer-clean: -rm -f $(parsedir)/java/parse.c $(parsedir)/java/parse-scan.c java/parse.output java/y.tab.c -rm -f $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 @@ -354,87 +362,44 @@ java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(srcdir)/tree-inline.c -o $@ # Documentation -$(docobjdir)/gcj.info: $(srcdir)/java/gcj.texi $(docdir)/include/fdl.texi \ +$(docobjdir)/gcj.info: java/gcj.texi $(docdir)/include/fdl.texi \ $(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi stmp-docobjdir if test "x$(BUILD_INFO)" = xinfo; then \ - rm -f $(docobjdir)/gcj.info*; \ - $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir)/include \ - -o $(docobjdir)/gcj.info $(srcdir)/java/gcj.texi; \ + rm -f doc/gcj.info*; \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir)/include -o $@ $<; \ else true; fi -java/gcj.dvi: $(srcdir)/java/gcj.texi $(srcdir)/doc/include/fdl.texi \ - $(srcdir)/doc/include/gpl.texi $(srcdir)/doc/include/gcc-common.texi - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - cd java && $(TEXI2DVI) -I $$s/doc/include $$s/java/gcj.texi - -$(docobjdir)/gcj.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D gcj < $(srcdir)/java/gcj.texi > java/gcj.pod - -($(POD2MAN) --section=1 java/gcj.pod > java/gcj.1.T$$$$ && \ - mv -f java/gcj.1.T$$$$ $(docobjdir)/gcj.1) || \ - (rm -f java/gcj.1.T$$$$ && exit 1) - -rm -f java/gcj.pod - -$(docobjdir)/gcjh.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D gcjh < $(srcdir)/java/gcj.texi > java/gcjh.pod - -($(POD2MAN) --section=1 java/gcjh.pod > java/gcjh.1.T$$$$ && \ - mv -f java/gcjh.1.T$$$$ $(docobjdir)/gcjh.1) || \ - (rm -f java/gcjh.1.T$$$$ && exit 1) - -rm -f java/gcjh.pod - -$(docobjdir)/jv-scan.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D jv-scan < $(srcdir)/java/gcj.texi > java/jv-scan.pod - -($(POD2MAN) --section=1 java/jv-scan.pod > java/jv-scan.1.T$$$$ && \ - mv -f java/jv-scan.1.T$$$$ $(docobjdir)/jv-scan.1) || \ - (rm -f java/jv-scan.1.T$$$$ && exit 1) - -rm -f java/jv-scan.pod - -$(docobjdir)/jcf-dump.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D jcf-dump < $(srcdir)/java/gcj.texi > java/jcf-dump.pod - -($(POD2MAN) --section=1 java/jcf-dump.pod > java/jcf-dump.1.T$$$$ && \ - mv -f java/jcf-dump.1.T$$$$ $(docobjdir)/jcf-dump.1) || \ - (rm -f java/jcf-dump.1.T$$$$ && exit 1) - -rm -f java/jcf-dump.pod - -$(docobjdir)/gij.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D gij < $(srcdir)/java/gcj.texi > java/gij.pod - -($(POD2MAN) --section=1 java/gij.pod > java/gij.1.T$$$$ && \ - mv -f java/gij.1.T$$$$ $(docobjdir)/gij.1) || \ - (rm -f java/gij.1.T$$$$ && exit 1) - -rm -f java/gij.pod - -$(docobjdir)/jv-convert.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D jv-convert < $(srcdir)/java/gcj.texi > java/jv-convert.pod - -($(POD2MAN) --section=1 java/jv-convert.pod > java/jv-convert.1.T$$$$ && \ - mv -f java/jv-convert.1.T$$$$ $(docobjdir)/jv-convert.1) || \ - (rm -f java/jv-convert.1.T$$$$ && exit 1) - -rm -f java/jv-convert.pod - -$(docobjdir)/rmic.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D rmic < $(srcdir)/java/gcj.texi > java/rmic.pod - -($(POD2MAN) --section=1 java/rmic.pod > java/rmic.1.T$$$$ && \ - mv -f java/rmic.1.T$$$$ $(docobjdir)/rmic.1) || \ - (rm -f java/rmic.1.T$$$$ && exit 1) - -rm -f java/rmic.pod - -$(docobjdir)/rmiregistry.1: $(srcdir)/java/gcj.texi stmp-docobjdir - -$(TEXI2POD) -D rmiregistry < $(srcdir)/java/gcj.texi > java/rmiregistry.pod - -($(POD2MAN) --section=1 java/rmiregistry.pod > java/rmiregistry.1.T$$$$ && \ - mv -f java/rmiregistry.1.T$$$$ $(docobjdir)/rmiregistry.1) || \ - (rm -f java/rmiregistry.1.T$$$$ && exit 1) - -rm -f java/rmiregistry.pod +$(docobjdir)/gcj.dvi: java/gcj.texi $(docdir)/include/fdl.texi \ + $(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi \ + stmp-docobjdir + $(TEXI2DVI) -I $(docdir)/include -o $@ $< + +.INTERMEDIATE: gcj.pod gcjh.pod jv-scan.pod jcf-dump.pod gij.pod \ + jv-convert.pod rmic.pod rmiregistry.pod + +gcj.pod: java/gcj.texi + -$(TEXI2POD) -D gcj < $< > $@ +gcjh.pod: java/gcj.texi + -$(TEXI2POD) -D gcjh < $< > $@ +jv-scan.pod: java/gcj.texi + -$(TEXI2POD) -D jv-scan < $< > $@ +jcf-dump.pod: java/gcj.texi + -$(TEXI2POD) -D jcf-dump < $< > $@ +gij.pod: java/gcj.texi + -$(TEXI2POD) -D gij < $< > $@ +jv-convert.pod: java/gcj.texi + -$(TEXI2POD) -D jv-convert < $< > $@ +rmic.pod: java/gcj.texi + -$(TEXI2POD) -D rmic < $< > $@ +rmiregistry.pod: java/gcj.texi + -$(TEXI2POD) -D rmiregistry < $< > $@ # Install the man pages. java.install-man: installdirs $(GENERATED_JAVA_MANPAGES) -if [ -f $(GCJ)$(exeext) ]; then \ - if [ -f $(GCJ)-cross$(exeext) ]; then \ - rm -f $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \ - else \ - rm -f $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ - $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ - chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ - fi ; \ + rm -f $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ + $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ + chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \ fi -rm -f $(DESTDIR)$(man1dir)/gcjh$(man1ext) -$(INSTALL_DATA) $(docobjdir)/gcjh.1 $(DESTDIR)$(man1dir)/gcjh$(man1ext) diff --git a/gcc/java/class.c b/gcc/java/class.c index 2aacbd42e04..6c772e0a808 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -723,8 +723,8 @@ strLengthUtf8 (char *str, int len) static int32 hashUtf8String (const char *str, int len) { - register const unsigned char* ptr = (const unsigned char*) str; - register const unsigned char *limit = ptr + len; + const unsigned char* ptr = (const unsigned char*) str; + const unsigned char *limit = ptr + len; int32 hash = 0; for (; ptr < limit;) { @@ -1568,7 +1568,7 @@ make_class_data (tree type) PUSH_FIELD_VALUE (cons, "idt", null_pointer_node); PUSH_FIELD_VALUE (cons, "arrayclass", null_pointer_node); PUSH_FIELD_VALUE (cons, "protectionDomain", null_pointer_node); - PUSH_FIELD_VALUE (cons, "signers", null_pointer_node); + PUSH_FIELD_VALUE (cons, "hack_signers", null_pointer_node); PUSH_FIELD_VALUE (cons, "chain", null_pointer_node); FINISH_RECORD_CONSTRUCTOR (cons); diff --git a/gcc/java/constants.c b/gcc/java/constants.c index 274a8bfd91b..8a1fe1bb4ea 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -37,6 +37,7 @@ static int find_class_or_string_constant (CPool *, int, tree); static int find_name_and_type_constant (CPool *, tree, tree); static tree get_tag_node (int); static tree build_constant_data_ref (void); +static CPool *cpool_for_class (tree); /* Set the INDEX'th constant in CPOOL to have the given TAG and VALUE. */ @@ -315,8 +316,6 @@ write_constant_pool (CPool *cpool, unsigned char *buffer, int length) abort (); } -CPool *outgoing_cpool; - static GTY(()) tree tag_nodes[13]; static tree get_tag_node (int tag) @@ -328,6 +327,21 @@ get_tag_node (int tag) return tag_nodes[tag]; } +/* Given a class, return its constant pool, creating one if necessary. */ + +static CPool * +cpool_for_class (tree class) +{ + CPool *cpool = TYPE_CPOOL (class); + + if (cpool == NULL) + { + cpool = ggc_alloc_cleared (sizeof (struct CPool)); + TYPE_CPOOL (class) = cpool; + } + return cpool; +} + /* Look for a constant pool entry that matches TAG and NAME. Creates a new entry if not found. TAG is one of CONSTANT_Utf8, CONSTANT_String or CONSTANT_Class. @@ -337,6 +351,7 @@ get_tag_node (int tag) int alloc_name_constant (int tag, tree name) { + CPool *outgoing_cpool = cpool_for_class (current_class); return find_tree_constant (outgoing_cpool, tag, name); } @@ -414,6 +429,7 @@ build_ref_from_constant_pool (int index) tree build_constants_constructor (void) { + CPool *outgoing_cpool = cpool_for_class (current_class); tree tags_value, data_value; tree cons; tree tags_list = NULL_TREE; diff --git a/gcc/java/decl.c b/gcc/java/decl.c index e23cb120c3a..46bb2248b6d 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -94,7 +94,7 @@ int current_pc; void indent (void) { - register unsigned i; + unsigned i; for (i = 0; i < binding_depth*2; i++) putc (' ', stderr); @@ -116,7 +116,8 @@ push_jvm_slot (int index, tree decl) tmp = TREE_VEC_ELT (decl_map, index); while (tmp != NULL_TREE) { - if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp))) + if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp)) + && ! LOCAL_VAR_OUT_OF_SCOPE_P (tmp)) rtl = DECL_RTL_IF_SET (tmp); if (rtl != NULL) break; @@ -391,7 +392,7 @@ create_primitive_vtable (const char *name) void java_init_decl_processing (void) { - register tree endlink; + tree endlink; tree field = NULL_TREE; tree t; @@ -552,10 +553,6 @@ java_init_decl_processing (void) lookup_class (get_identifier ("java.lang.RuntimeException")); error_exception_type_node = lookup_class (get_identifier ("java.lang.Error")); - class_not_found_type_node = - lookup_class (get_identifier ("java.lang.ClassNotFoundException")); - no_class_def_found_type_node = - lookup_class (get_identifier ("java.lang.NoClassDefFoundError")); rawdata_ptr_type_node = promote_type (lookup_class (get_identifier ("gnu.gcj.RawData"))); @@ -731,7 +728,7 @@ java_init_decl_processing (void) PUSH_FIELD (class_type_node, field, "idt", ptr_type_node); PUSH_FIELD (class_type_node, field, "arrayclass", ptr_type_node); PUSH_FIELD (class_type_node, field, "protectionDomain", ptr_type_node); - PUSH_FIELD (class_type_node, field, "signers", ptr_type_node); + PUSH_FIELD (class_type_node, field, "hack_signers", ptr_type_node); PUSH_FIELD (class_type_node, field, "chain", ptr_type_node); for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = TREE_CHAIN (t)) FIELD_PRIVATE (t) = 1; @@ -969,7 +966,7 @@ java_init_decl_processing (void) tree lookup_name (tree name) { - register tree val; + tree val; if (current_binding_level != global_binding_level && IDENTIFIER_LOCAL_VALUE (name)) val = IDENTIFIER_LOCAL_VALUE (name); @@ -984,7 +981,7 @@ lookup_name (tree name) static tree lookup_name_current_level (tree name) { - register tree t; + tree t; if (current_binding_level == global_binding_level) return IDENTIFIER_GLOBAL_VALUE (name); @@ -1004,8 +1001,8 @@ lookup_name_current_level (tree name) void push_labeled_block (tree lb) { - register tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb)); - register struct binding_level *b = current_binding_level; + tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb)); + struct binding_level *b = current_binding_level; tree oldlocal = IDENTIFIER_LOCAL_VALUE (name); if (oldlocal != 0) b->shadowed = tree_cons (name, oldlocal, b->shadowed); @@ -1045,9 +1042,9 @@ pop_labeled_block (void) tree pushdecl (tree x) { - register tree t; - register tree name = DECL_NAME (x); - register struct binding_level *b = current_binding_level; + tree t; + tree name = DECL_NAME (x); + struct binding_level *b = current_binding_level; if (TREE_CODE (x) != TYPE_DECL) DECL_CONTEXT (x) = current_function_decl; @@ -1162,8 +1159,8 @@ pushdecl_force_head (tree x) tree pushdecl_top_level (tree x) { - register tree t; - register struct binding_level *b = current_binding_level; + tree t; + struct binding_level *b = current_binding_level; current_binding_level = global_binding_level; t = pushdecl (x); @@ -1202,7 +1199,7 @@ make_binding_level (void) void pushlevel (int unused ATTRIBUTE_UNUSED) { - register struct binding_level *newlevel = NULL_BINDING_LEVEL; + struct binding_level *newlevel = NULL_BINDING_LEVEL; #if 0 /* If this is the top level of a function, @@ -1258,7 +1255,7 @@ pushlevel (int unused ATTRIBUTE_UNUSED) tree poplevel (int keep, int reverse, int functionbody) { - register tree link; + tree link; /* The chain of decls was accumulated in reverse order. Put it into forward order, just for cleanliness. */ tree decls; @@ -1266,6 +1263,7 @@ poplevel (int keep, int reverse, int functionbody) tree block = 0; tree decl; int block_previously_created; + { #if defined(DEBUG_JAVA_BINDING_LEVELS) binding_depth--; @@ -1306,12 +1304,13 @@ poplevel (int keep, int reverse, int functionbody) && DECL_INITIAL (decl) != 0 && TREE_ADDRESSABLE (decl)) { - /* If this decl was copied from a file-scope decl - on account of a block-scope extern decl, - propagate TREE_ADDRESSABLE to the file-scope decl. - - DECL_ABSTRACT_ORIGIN can be set to itself if warn_return_type is - true, since then the decl goes through save_for_inline_copying. */ + /* If this decl was copied from a file-scope decl on account + of a block-scope extern decl, propagate TREE_ADDRESSABLE + to the file-scope decl. + + DECL_ABSTRACT_ORIGIN can be set to itself if + warn_return_type is true, since then the decl goes + through save_for_inline_copying. */ if (DECL_ABSTRACT_ORIGIN (decl) != 0 && DECL_ABSTRACT_ORIGIN (decl) != decl) TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1; @@ -1322,6 +1321,11 @@ poplevel (int keep, int reverse, int functionbody) pop_function_context (); } } + else if (TREE_CODE (decl) == VAR_DECL + && DECL_LANG_SPECIFIC (decl) != NULL + && DECL_LOCAL_SLOT_NUMBER (decl)) + LOCAL_VAR_OUT_OF_SCOPE_P (decl) = 1; + } /* If there were any declarations in that level, or if this level is a function body, @@ -1390,7 +1394,7 @@ poplevel (int keep, int reverse, int functionbody) #if 0 for (link = named_labels; link; link = TREE_CHAIN (link)) { - register tree label = TREE_VALUE (link); + tree label = TREE_VALUE (link); if (DECL_INITIAL (label) == 0) { @@ -1413,7 +1417,7 @@ poplevel (int keep, int reverse, int functionbody) /* Pop the current level, and free the structure for reuse. */ { - register struct binding_level *level = current_binding_level; + struct binding_level *level = current_binding_level; current_binding_level = current_binding_level->level_chain; level->level_chain = free_binding_level; @@ -1856,6 +1860,7 @@ java_expand_body (tree fndecl) current_function_decl = fndecl; input_location = DECL_SOURCE_LOCATION (fndecl); + current_class = DECL_CONTEXT (fndecl); timevar_push (TV_EXPAND); diff --git a/gcc/java/except.c b/gcc/java/except.c index dc97b42fabf..c0fa800c262 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -312,6 +312,10 @@ tree prepare_eh_table_type (tree type) { tree exp; + const char *name; + char *buf; + tree decl; + tree utf8_ref; /* The "type" (match_info) in a (Java) exception table is a pointer to: * a) NULL - meaning match any type in a try-finally. @@ -323,10 +327,9 @@ prepare_eh_table_type (tree type) exp = NULL_TREE; else if (is_compiled_class (type) && !flag_indirect_dispatch) { - char buf[64]; - tree decl; - sprintf (buf, "%s_ref", - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); + name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); + buf = alloca (strlen (name) + 5); + sprintf (buf, "%s_ref", name); decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node); TREE_STATIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; @@ -342,11 +345,10 @@ prepare_eh_table_type (tree type) } else { - tree decl; - tree utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type))); - char buf[64]; - sprintf (buf, "%s_ref", - IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0)))); + utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type))); + name = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0))); + buf = alloca (strlen (name) + 5); + sprintf (buf, "%s_ref", name); decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type); TREE_STATIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; diff --git a/gcc/java/expr.c b/gcc/java/expr.c index e5654e79b6f..533b88c39b3 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -206,7 +206,7 @@ static void flush_quick_stack (void) { int stack_index = stack_pointer; - register tree prev, cur, next; + tree prev, cur, next; /* First reverse the quick_stack, and count the number of slots it has. */ for (cur = quick_stack, prev = NULL_TREE; cur != NULL_TREE; cur = next) @@ -503,8 +503,9 @@ java_stack_swap (void) decl1 = find_stack_slot (stack_pointer - 1, type1); decl2 = find_stack_slot (stack_pointer - 2, type2); temp = copy_to_reg (DECL_RTL (decl1)); - emit_move_insn (DECL_RTL (decl1), DECL_RTL (decl2)); - emit_move_insn (DECL_RTL (decl2), temp); + emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 1, type2)), + DECL_RTL (decl2)); + emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 2, type1)), temp); stack_type_map[stack_pointer - 1] = type2; stack_type_map[stack_pointer - 2] = type1; } diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 10c5ef851fb..b9a34e3bbdb 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -1370,7 +1370,7 @@ print_c_decl (FILE* stream, JCF* jcf, int name_index, int signature_index, { int length = JPOOL_UTF_LENGTH (jcf, signature_index); const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); - register const unsigned char *str = str0; + const unsigned char *str = str0; const unsigned char *limit = str + length; int need_space = 0; int is_method = str[0] == '('; @@ -1430,7 +1430,7 @@ print_full_cxx_name (FILE* stream, JCF* jcf, int name_index, { int length = JPOOL_UTF_LENGTH (jcf, signature_index); const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); - register const unsigned char *str = str0; + const unsigned char *str = str0; const unsigned char *limit = str + length; int need_space = 0; int is_method = str[0] == '('; @@ -1541,7 +1541,7 @@ print_stub_or_jni (FILE* stream, JCF* jcf, int name_index, { int length = JPOOL_UTF_LENGTH (jcf, signature_index); const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); - register const unsigned char *str = str0; + const unsigned char *str = str0; const unsigned char *limit = str + length; int need_space = 0; int is_method = str[0] == '('; @@ -1597,7 +1597,7 @@ print_stub_or_jni (FILE* stream, JCF* jcf, int name_index, if (stubs) { if (flag_jni) - fputs ("\n{\n (*env)->FatalError (\"", stream); + fputs ("\n{\n (*env)->FatalError (env, \"", stream); else fputs ("\n{\n throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 (\"", stream); print_name_for_stub_or_jni (stream, jcf, name_index, diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 7b5a397ecdb..88be2a03441 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -44,7 +44,6 @@ struct JCF; /* Usage of TREE_LANG_FLAG_?: 0: IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (in IDENTIFIER_NODE) - RESOLVE_EXPRESSION_NAME_P (in EXPR_WITH_FILE_LOCATION) FOR_LOOP_P (in LOOP_EXPR) SUPPRESS_UNREACHABLE_ERROR (for other _EXPR nodes) ANONYMOUS_CLASS_P (in RECORD_TYPE) @@ -308,8 +307,6 @@ enum java_tree_index JTI_RUNTIME_EXCEPTION_TYPE_NODE, JTI_ERROR_EXCEPTION_TYPE_NODE, JTI_RAWDATA_PTR_TYPE_NODE, - JTI_CLASS_NOT_FOUND_TYPE_NODE, - JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_BYTE_ARRAY_TYPE_NODE, JTI_SHORT_ARRAY_TYPE_NODE, @@ -492,10 +489,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX]; java_global_trees[JTI_ERROR_EXCEPTION_TYPE_NODE] #define rawdata_ptr_type_node \ java_global_trees[JTI_RAWDATA_PTR_TYPE_NODE] -#define class_not_found_type_node \ - java_global_trees[JTI_CLASS_NOT_FOUND_TYPE_NODE] -#define no_class_def_found_type_node \ - java_global_trees[JTI_NO_CLASS_DEF_FOUND_TYPE_NODE] #define byte_array_type_node \ java_global_trees[JTI_BYTE_ARRAY_TYPE_NODE] @@ -700,9 +693,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX]; #define nativecode_ptr_type_node ptr_type_node -/* They need to be reset before processing each class */ -extern GTY(()) struct CPool *outgoing_cpool; - #define wfl_operator \ java_global_trees[JTI_WFL_OPERATOR] @@ -947,6 +937,9 @@ union lang_tree_node /* True if NODE is a class initialization flag. */ #define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \ (DECL_LANG_SPECIFIC (NODE) && LOCAL_CLASS_INITIALIZATION_FLAG(NODE)) +/* True if NODE is a variable that is out of scope. */ +#define LOCAL_VAR_OUT_OF_SCOPE_P(NODE) \ + (DECL_LANG_SPECIFIC(NODE)->u.v.freed) /* Create a DECL_LANG_SPECIFIC if necessary. */ #define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \ if (DECL_LANG_SPECIFIC (T) == NULL) \ @@ -1031,6 +1024,7 @@ struct lang_decl_var GTY(()) tree wfl; /* Original wfl */ unsigned int final_iud : 1; /* Final initialized upon declaration */ unsigned int cif : 1; /* True: decl is a class initialization flag */ + unsigned int freed; /* Decl is no longer in scope. */ }; /* This is what 'lang_decl' really points to. */ @@ -1221,7 +1215,6 @@ extern int enclosing_context_p (tree, tree); extern void complete_start_java_method (tree); extern tree build_result_decl (tree); extern void emit_handlers (void); -extern void init_outgoing_cpool (void); extern void make_class_data (tree); extern void register_class (void); extern int alloc_name_constant (int, tree); @@ -1556,9 +1549,6 @@ extern tree *type_map; feature a finalizer method. */ #define HAS_FINALIZER_P(EXPR) TREE_LANG_FLAG_3 (EXPR) -/* True if EXPR (a WFL in that case) resolves into an expression name */ -#define RESOLVE_EXPRESSION_NAME_P(WFL) TREE_LANG_FLAG_0 (WFL) - /* True if EXPR (a LOOP_EXPR in that case) is part of a for statement */ #define FOR_LOOP_P(EXPR) TREE_LANG_FLAG_0 (EXPR) @@ -1727,6 +1717,8 @@ while (0) #define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE) /* True for an implicit block surrounding declaration not at start of {...}. */ #define BLOCK_IS_IMPLICIT(NODE) TREE_LANG_FLAG_1 (NODE) +#define BLOCK_EMPTY_P(NODE) \ + (TREE_CODE (NODE) == BLOCK && BLOCK_EXPR_BODY (NODE) == empty_stmt_node) #define BUILD_MONITOR_ENTER(WHERE, ARG) \ { \ diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index a87dd401e0f..a95f122ac19 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -615,7 +615,7 @@ print_constant (FILE *out, JCF *jcf, int index, int verbosity) break; case CONSTANT_Utf8: { - register const unsigned char *str = JPOOL_UTF_DATA (jcf, index); + const unsigned char *str = JPOOL_UTF_DATA (jcf, index); int length = JPOOL_UTF_LENGTH (jcf, index); if (verbosity > 0) { /* Print as 8-bit bytes. */ diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index fb8d00fa9fb..101be8ee1d3 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -619,7 +619,7 @@ jcf_print_char (FILE *stream, int ch) /* Print UTF8 string at STR of length LENGTH bytes to STREAM. */ void -jcf_print_utf8 (FILE *stream, register const unsigned char *str, int length) +jcf_print_utf8 (FILE *stream, const unsigned char *str, int length) { const unsigned char * limit = str + length; while (str < limit) @@ -713,7 +713,7 @@ format_uint (char *buffer, uint64 value, int base) { #define WRITE_BUF_SIZE (4 + sizeof(uint64) * 8) char buf[WRITE_BUF_SIZE]; - register char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */ + char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */ int chars_written; int i; diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index fa77efebb8b..a3fa2124f82 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -693,12 +693,6 @@ load_inner_classes (tree cur_class) } } -void -init_outgoing_cpool (void) -{ - outgoing_cpool = ggc_alloc_cleared (sizeof (struct CPool)); -} - static void parse_class_file (void) { @@ -710,7 +704,6 @@ parse_class_file (void) input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class)); input_line = 0; (*debug_hooks->start_source_file) (input_line, input_filename); - init_outgoing_cpool (); /* Currently we always have to emit calls to _Jv_InitClass when compiling from class files. */ @@ -760,8 +753,8 @@ parse_class_file (void) input_line = 0; if (DECL_LINENUMBERS_OFFSET (method)) { - register int i; - register unsigned char *ptr; + int i; + unsigned char *ptr; JCF_SEEK (jcf, DECL_LINENUMBERS_OFFSET (method)); linenumber_count = i = JCF_readu2 (jcf); linenumber_table = ptr = jcf->read_ptr; @@ -1172,10 +1165,9 @@ classify_zip_file (struct ZipDirectory *zdir) ".class", 6)) return 1; - /* For now we drop the manifest and other information. Maybe it - would make more sense to compile it in? */ - if (zdir->filename_length > 8 - && !strncmp (class_name_in_zip_dir, "META-INF/", 9)) + /* For now we drop the manifest, but not other information. */ + if (zdir->filename_length == 20 + && !strncmp (class_name_in_zip_dir, "META-INF/MANIFEST.MF", 20)) return 0; /* Drop directory entries. */ diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index 578fa4aa826..74ebc1aa886 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -559,9 +559,9 @@ localvar_alloc (tree decl, struct jcf_partial *state) struct jcf_block *start_label = get_jcf_label_here (state); int wide = TYPE_IS_WIDE (TREE_TYPE (decl)); int index; - register struct localvar_info *info; - register struct localvar_info **ptr = localvar_buffer; - register struct localvar_info **limit + struct localvar_info *info; + struct localvar_info **ptr = localvar_buffer; + struct localvar_info **limit = (struct localvar_info**) state->localvars.ptr; for (index = 0; ptr < limit; index++, ptr++) { @@ -602,8 +602,8 @@ maybe_free_localvar (tree decl, struct jcf_partial *state, int really) { struct jcf_block *end_label = get_jcf_label_here (state); int index = DECL_LOCAL_INDEX (decl); - register struct localvar_info **ptr = &localvar_buffer [index]; - register struct localvar_info *info = *ptr; + struct localvar_info **ptr = &localvar_buffer [index]; + struct localvar_info *info = *ptr; int wide = TYPE_IS_WIDE (TREE_TYPE (decl)); info->end_label = end_label; diff --git a/gcc/java/keyword.h b/gcc/java/keyword.h index 0339df18f93..49eda19f451 100644 --- a/gcc/java/keyword.h +++ b/gcc/java/keyword.h @@ -51,7 +51,7 @@ inline #endif #endif static unsigned int -hash (register const char *str, register unsigned int len) +hash (const char *str, unsigned int len) { static const unsigned char asso_values[] = { @@ -82,7 +82,7 @@ hash (register const char *str, register unsigned int len) 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86 }; - register int hval = len; + int hval = len; switch (hval) { @@ -102,7 +102,7 @@ hash (register const char *str, register unsigned int len) __inline #endif const struct java_keyword * -java_keyword (register const char *str, register unsigned int len) +java_keyword (const char *str, unsigned int len) { static const struct java_keyword wordlist[] = { @@ -175,11 +175,11 @@ java_keyword (register const char *str, register unsigned int len) if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int key = hash (str, len); + int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { - register const char *s = wordlist[key].name; + const char *s = wordlist[key].name; if (*str == *s && !strcmp (str + 1, s + 1)) return &wordlist[key]; diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 615d250c018..c2494daacea 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -840,21 +840,14 @@ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED, switch (code) { case BLOCK: - if (BLOCK_EXPR_BODY (t)) - { - tree *prev = &BLOCK_EXPR_BODY (*tp); - while (*prev) - { - WALK_SUBTREE (*prev); - prev = &TREE_CHAIN (*prev); - } - } + WALK_SUBTREE (BLOCK_EXPR_BODY (t)); return NULL_TREE; - break; default: return NULL_TREE; } + + #undef WALK_SUBTREE } /* Called from unsafe_for_reeval. */ @@ -926,6 +919,24 @@ merge_init_test_initialization (void **entry, void *x) if (!*init_test_decl) *init_test_decl = (tree)n->value; + /* This fixes a weird case. + + The front end assumes that once we have called a method that + initializes some class, we can assume the class is initialized. It + does this by setting the DECL_INITIAL of the init_test_decl for that + class, and no initializations are emitted for that class. + + However, what if the method that is suppoed to do the initialization + is itself inlined in the caller? When expanding the called method + we'll assume that the class initalization has already been done, + because the DECL_INITIAL of the init_test_decl is set. + + To fix this we remove the DECL_INITIAL (in the caller scope) of all + the init_test_decls corresponding to classes initialized by the + inlined method. This makes the caller no longer assume that the + method being inlined does any class initializations. */ + DECL_INITIAL (*init_test_decl) = NULL; + return true; } diff --git a/gcc/java/lex.h b/gcc/java/lex.h index 037d044afd5..c339cc13e51 100644 --- a/gcc/java/lex.h +++ b/gcc/java/lex.h @@ -35,7 +35,7 @@ extern FILE *finput; /* A Unicode character, as read from the input file */ typedef unsigned short unicode_t; -#ifdef HAVE_ICONV +#if defined HAVE_ICONV_H && defined HAVE_ICONV #include #endif /* HAVE_ICONV */ diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 3f63300fbc5..c8b4596a587 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -326,7 +326,7 @@ static void patch_anonymous_class (tree, tree, tree); static void add_inner_class_fields (tree, tree); static tree build_dot_class_method (tree); -static tree build_dot_class_method_invocation (tree); +static tree build_dot_class_method_invocation (tree, tree); static void create_new_parser_context (int); static tree maybe_build_class_init_for_field (tree, tree); @@ -1905,15 +1905,24 @@ catch_clause_parameter: formal_parameter (CCBP). The formal parameter is declared initialized by the appropriate function call */ - tree ccpb = enter_block (); - tree init = build_assignment - (ASSIGN_TK, $2.location, TREE_PURPOSE ($3), - build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); - declare_local_variables (0, TREE_VALUE ($3), - build_tree_list (TREE_PURPOSE ($3), - init)); - $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb); - EXPR_WFL_LINECOL ($$) = $1.location; + tree ccpb; + tree init; + if ($3) + { + ccpb = enter_block (); + init = build_assignment + (ASSIGN_TK, $2.location, TREE_PURPOSE ($3), + build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); + declare_local_variables (0, TREE_VALUE ($3), + build_tree_list + (TREE_PURPOSE ($3), init)); + $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb); + EXPR_WFL_LINECOL ($$) = $1.location; + } + else + { + $$ = error_mark_node; + } } | CATCH_TK error {yyerror ("'(' expected"); RECOVER; $$ = NULL_TREE;} @@ -2660,7 +2669,9 @@ create_new_parser_context (int copy_from_previous) if (copy_from_previous) { memcpy (new, ctxp, sizeof (struct parser_ctxt)); - new->saved_data_ctx = 1; + /* This flag, indicating the context saves global values, + should only be set by java_parser_context_save_global. */ + new->saved_data_ctx = 0; } else memset (new, 0, sizeof (struct parser_ctxt)); @@ -2733,7 +2744,10 @@ java_parser_context_save_global (void) /* If this context already stores data, create a new one suitable for data storage. */ else if (ctxp->saved_data) - create_new_parser_context (1); + { + create_new_parser_context (1); + ctxp->saved_data_ctx = 1; + } ctxp->lineno = input_line; ctxp->class_type = current_class; @@ -5109,7 +5123,7 @@ create_jdep_list (struct parser_ctxt *ctxp) static jdeplist * reverse_jdep_list (struct parser_ctxt *ctxp) { - register jdeplist *prev = NULL, *current, *next; + jdeplist *prev = NULL, *current, *next; for (current = ctxp->classd_list; current; current = next) { next = current->next; @@ -5718,14 +5732,16 @@ do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl) class and then treat Id as a member type. If we can't find Q as a class then we fall through. */ tree q, left, left_type, right; - breakdown_qualified (&left, &right, TYPE_NAME (class_type)); - BUILD_PTR_FROM_NAME (left_type, left); - q = do_resolve_class (enclosing, left_type, decl, cl); - if (q) + if (breakdown_qualified (&left, &right, TYPE_NAME (class_type)) == 0) { - enclosing = q; - saved_enclosing_type = TREE_TYPE (q); - BUILD_PTR_FROM_NAME (class_type, right); + BUILD_PTR_FROM_NAME (left_type, left); + q = do_resolve_class (enclosing, left_type, decl, cl); + if (q) + { + enclosing = q; + saved_enclosing_type = TREE_TYPE (q); + BUILD_PTR_FROM_NAME (class_type, right); + } } } @@ -7682,9 +7698,6 @@ java_complete_expand_methods (tree class_decl) current_class = TREE_TYPE (class_decl); - /* Initialize a new constant pool */ - init_outgoing_cpool (); - /* Pre-expand to figure whether we really need it or not. If we do need it, we pre-expand the static fields so they're ready to be used somewhere else. will be fully expanded @@ -7768,9 +7781,6 @@ java_complete_expand_methods (tree class_decl) if (DECL_CONSTRUCTOR_P (decl) && verify_constructor_circularity (decl, decl)) break; - - /* Save the constant pool. We'll need to restore it later. */ - TYPE_CPOOL (current_class) = outgoing_cpool; } /* Attempt to create . Pre-expand static fields so they can be @@ -8722,7 +8732,7 @@ build_dot_class_method (tree class) { #define BWF(S) build_wfl_node (get_identifier ((S))) #define MQN(X,Y) make_qualified_name ((X), (Y), 0) - tree args, tmp, saved_current_function_decl, mdecl; + tree args, tmp, saved_current_function_decl, mdecl, qual_name; tree stmt, throw_stmt; if (!get_message_wfl) @@ -8739,15 +8749,17 @@ build_dot_class_method (tree class) /* Build the qualified name java.lang.Class.forName */ tmp = MQN (MQN (MQN (BWF ("java"), BWF ("lang")), BWF ("Class")), BWF ("forName")); - load_class (class_not_found_type_node, 1); - load_class (no_class_def_found_type_node, 1); /* Create the "class$" function */ mdecl = create_artificial_method (class, ACC_STATIC, build_pointer_type (class_type_node), classdollar_identifier_node, args); - DECL_FUNCTION_THROWS (mdecl) = - build_tree_list (NULL_TREE, no_class_def_found_type_node); + qual_name = MQN (MQN (BWF ("java"), BWF ("lang")), + BWF ("NoClassDefFoundError")); + DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, qual_name); + register_incomplete_type (JDEP_EXCEPTION, qual_name, NULL_TREE, NULL_TREE); + JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) = + &TREE_VALUE (DECL_FUNCTION_THROWS (mdecl)); /* We start by building the try block. We need to build: return (java.lang.Class.forName (type)); */ @@ -8770,8 +8782,9 @@ build_dot_class_method (tree class) throw_stmt = build1 (THROW_EXPR, NULL_TREE, throw_stmt); /* Encapsulate STMT in a try block. The catch clause executes THROW_STMT */ - stmt = encapsulate_with_try_catch (0, class_not_found_type_node, - stmt, throw_stmt); + qual_name = MQN (MQN (BWF ("java"), BWF ("lang")), + BWF ("ClassNotFoundException")); + stmt = encapsulate_with_try_catch (0, qual_name, stmt, throw_stmt); fix_method_argument_names (args, mdecl); layout_class_method (class, NULL_TREE, mdecl, NULL_TREE); @@ -8786,9 +8799,10 @@ build_dot_class_method (tree class) } static tree -build_dot_class_method_invocation (tree type) +build_dot_class_method_invocation (tree this_class, tree type) { - tree sig_id, s; + tree dot_class_method = TYPE_DOT_CLASS (this_class); + tree sig_id, s, t; if (TYPE_ARRAY_P (type)) sig_id = build_java_signature (type); @@ -8801,8 +8815,14 @@ build_dot_class_method_invocation (tree type) s = build_string (IDENTIFIER_LENGTH (sig_id), IDENTIFIER_POINTER (sig_id)); - return build_method_invocation (build_wfl_node (classdollar_identifier_node), - build_tree_list (NULL_TREE, s)); + t = build_method_invocation (build_wfl_node (DECL_NAME (dot_class_method)), + build_tree_list (NULL_TREE, s)); + if (DECL_CONTEXT (dot_class_method) != this_class) + { + tree class_name = DECL_NAME (TYPE_NAME (DECL_CONTEXT (dot_class_method))); + t = make_qualified_primary (build_wfl_node (class_name), t, 0); + } + return t; } /* This section of the code deals with constructor. */ @@ -9140,7 +9160,6 @@ java_expand_classes (void) current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); - outgoing_cpool = TYPE_CPOOL (current_class); if (flag_emit_class_files) write_classfile (current_class); if (flag_emit_xref) @@ -9162,7 +9181,6 @@ java_finish_classes (void) for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (current); - outgoing_cpool = TYPE_CPOOL (current_class); finish_class (); } } @@ -9601,10 +9619,7 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl, instantiation using a primary qualified by a `new' */ RESTORE_THIS_AND_CURRENT_CLASS; - /* EH check. No check on access$ functions */ - if (location - && !OUTER_FIELD_ACCESS_IDENTIFIER_P - (DECL_NAME (current_function_decl))) + if (location) { tree arguments = NULL_TREE; if (TREE_CODE (qual_wfl) == CALL_EXPR @@ -9796,7 +9811,6 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl, list = TREE_CHAIN (q); while (list) { - RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (list)) = 1; RESOLVE_PACKAGE_NAME_P (QUAL_WFL (list)) = 0; list = TREE_CHAIN (list); } @@ -11237,7 +11251,7 @@ static GTY(()) tree m2_arg_cache; static int argument_types_convertible (tree m1, tree m2_or_arglist) { - register tree m1_arg, m2_arg; + tree m1_arg, m2_arg; SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1) @@ -11274,211 +11288,58 @@ argument_types_convertible (tree m1, tree m2_or_arglist) /* Qualification routines */ +/* Given a name x.y.z, look up x locally. If it's found, save the + decl. If it's not found, mark the name as RESOLVE_PACKAGE_NAME_P, + so that we later try and load the appropriate classes. */ static void qualify_ambiguous_name (tree id) { - tree qual, qual_wfl, name = NULL_TREE, decl, ptr_type = NULL_TREE, - saved_current_class; - int again, super_found = 0, this_found = 0, new_array_found = 0; - int code; - - /* We first qualify the first element, then derive qualification of - others based on the first one. If the first element is qualified - by a resolution (field or type), this resolution is stored in the - QUAL_RESOLUTION of the qual element being examined. We need to - save the current_class since the use of SUPER might change the - its value. */ - saved_current_class = current_class; - qual = EXPR_WFL_QUALIFICATION (id); - do { + tree name, decl; - /* Simple qualified expression feature a qual_wfl that is a - WFL. Expression derived from a primary feature more complicated - things like a CALL_EXPR. Expression from primary need to be - worked out to extract the part on which the qualification will - take place. */ - qual_wfl = QUAL_WFL (qual); - switch (TREE_CODE (qual_wfl)) - { - case CALL_EXPR: - qual_wfl = TREE_OPERAND (qual_wfl, 0); - if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION - || (EXPR_WFL_QUALIFICATION (qual_wfl) - && TREE_CODE (EXPR_WFL_QUALIFICATION (qual_wfl)) == TREE_LIST)) - { - qual = EXPR_WFL_QUALIFICATION (qual_wfl); - qual_wfl = QUAL_WFL (qual); - } - break; - case NEW_ARRAY_EXPR: - case NEW_ANONYMOUS_ARRAY_EXPR: - qual = TREE_CHAIN (qual); - again = new_array_found = 1; - continue; - case CONVERT_EXPR: - break; - case NEW_CLASS_EXPR: - qual_wfl = TREE_OPERAND (qual_wfl, 0); - break; - case ARRAY_REF: - while (TREE_CODE (qual_wfl) == ARRAY_REF) - qual_wfl = TREE_OPERAND (qual_wfl, 0); - break; - case STRING_CST: - qual = TREE_CHAIN (qual); - qual_wfl = QUAL_WFL (qual); - break; - case CLASS_LITERAL: - qual = TREE_CHAIN (qual); - qual_wfl = QUAL_WFL (qual); - break; - default: - /* Fix for -Wall. Just break doing nothing */ - break; - } - - ptr_type = current_class; - again = 0; - code = TREE_CODE (qual_wfl); - - /* Pos evaluation: non WFL leading expression nodes */ - if (code == CONVERT_EXPR - && TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION) - name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl)); - - else if (code == INTEGER_CST) - name = qual_wfl; - - else if (code == CONVERT_EXPR && - TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) - name = TREE_OPERAND (qual_wfl, 0); - - else if (code == CONVERT_EXPR - && TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == CALL_EXPR - && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 0)) - == EXPR_WITH_FILE_LOCATION)) - name = TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 0); - - else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) && - TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) - name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); + /* We inspect the first item of the qualification list. As a sanity + check, make sure that it is an identfier node. */ + tree qual = EXPR_WFL_QUALIFICATION (id); + tree qual_wfl = QUAL_WFL (qual); - else if (code == TREE_LIST) - name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl)); + if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION) + return; - else if (code == STRING_CST || code == CONDITIONAL_EXPR - || code == PLUS_EXPR) - { - qual = TREE_CHAIN (qual); - qual_wfl = QUAL_WFL (qual); - again = 1; - } - else - { - name = EXPR_WFL_NODE (qual_wfl); - if (!name) - { - qual = EXPR_WFL_QUALIFICATION (qual_wfl); - again = 1; - } - } + name = EXPR_WFL_NODE (qual_wfl); - /* If we have a THIS (from a primary), we set the context accordingly */ - if (name == this_identifier_node) - { - /* This isn't really elegant. One more added irregularity - before I start using COMPONENT_REF (hopefully very soon.) */ - if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF - && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == - EXPR_WITH_FILE_LOCATION - && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == - this_identifier_node) - { - qual = TREE_OPERAND (TREE_PURPOSE (qual), 0); - qual = EXPR_WFL_QUALIFICATION (qual); - } - qual = TREE_CHAIN (qual); - qual_wfl = QUAL_WFL (qual); - if (TREE_CODE (qual_wfl) == CALL_EXPR) - again = 1; - else if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION) - name = EXPR_WFL_NODE (qual_wfl); - else if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR) - name = TREE_OPERAND (qual_wfl, 0); - this_found = 1; - } - /* If we have a SUPER, we set the context accordingly */ - if (name == super_identifier_node) - { - current_class = CLASSTYPE_SUPER (ptr_type); - /* Check that there is such a thing as a super class. If not, - return. The error will be caught later on, during the - resolution */ - if (!current_class) - { - current_class = saved_current_class; - return; - } - qual = TREE_CHAIN (qual); - /* Do one more iteration to set things up */ - super_found = again = 1; - } - } while (again); + /* If we don't have an identifier, or we have a 'this' or 'super', + then field access processing is all we need : there is nothing + for us to do. */ + if (!name || TREE_CODE (name) != IDENTIFIER_NODE || + name == this_identifier_node || + name == super_identifier_node) + return; /* If name appears within the scope of a local variable declaration - or parameter declaration, then it is an expression name. We don't - carry this test out if we're in the context of the use of SUPER - or THIS */ - if (!this_found && !super_found - && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST - && (decl = IDENTIFIER_LOCAL_VALUE (name))) - { - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; + or parameter declaration, or is a field within an enclosing + class, then it is an expression name. Save the decl and let + resolve_field_access do it's work. */ + if ((decl = IDENTIFIER_LOCAL_VALUE (name)) || + (decl = lookup_field_wrapper (current_class, name))) + { QUAL_RESOLUTION (qual) = decl; + return; } - /* If within the class/interface NAME was found to be used there - exists a (possibly inherited) field named NAME, then this is an - expression name. If we saw a NEW_ARRAY_EXPR before and want to - address length, it is OK. */ - else if ((decl = lookup_field_wrapper (ptr_type, name)) - || name == length_identifier_node) - { - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; - QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl); - } - - /* We reclassify NAME as yielding to a type name resolution if: - - NAME is a class/interface declared within the compilation - unit containing NAME, - - NAME is imported via a single-type-import declaration, - - NAME is declared in an another compilation unit of the package - of the compilation unit containing NAME, - - NAME is declared by exactly on type-import-on-demand declaration - of the compilation unit containing NAME. - - NAME is actually a STRING_CST. - This can't happen if the expression was qualified by `this.' */ - else if (! this_found && - (TREE_CODE (name) == STRING_CST || - TREE_CODE (name) == INTEGER_CST || - (decl = resolve_and_layout (name, NULL_TREE)))) + /* If name is a known class name (either declared or imported), mark + us as a type name. */ + if ((decl = resolve_and_layout (name, NULL_TREE))) { RESOLVE_TYPE_NAME_P (qual_wfl) = 1; QUAL_RESOLUTION (qual) = decl; } - /* Method call, array references and cast are expression name */ - else if (TREE_CODE (QUAL_WFL (qual)) == CALL_EXPR - || TREE_CODE (QUAL_WFL (qual)) == ARRAY_REF - || TREE_CODE (QUAL_WFL (qual)) == CONVERT_EXPR - || TREE_CODE (QUAL_WFL (qual)) == MODIFY_EXPR) - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; - /* Check here that NAME isn't declared by more than one type-import-on-demand declaration of the compilation unit containing NAME. FIXME */ - /* Otherwise, NAME is reclassified as a package name */ + /* We couldn't find a declaration for the name. Assume for now that + we have a qualified class name that needs to be loaded from an + external class file. */ else RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; @@ -11489,21 +11350,14 @@ qualify_ambiguous_name (tree id) { if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1; - else - RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1; } /* Store the global qualification for the ambiguous part of ID back into ID fields */ - if (RESOLVE_EXPRESSION_NAME_P (qual_wfl)) - RESOLVE_EXPRESSION_NAME_P (id) = 1; - else if (RESOLVE_TYPE_NAME_P (qual_wfl)) + if (RESOLVE_TYPE_NAME_P (qual_wfl)) RESOLVE_TYPE_NAME_P (id) = 1; else if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (id) = 1; - - /* Restore the current class */ - current_class = saved_current_class; } static int @@ -11720,9 +11574,13 @@ java_complete_lhs (tree node) case TRY_FINALLY_EXPR: COMPLETE_CHECK_OP_0 (node); COMPLETE_CHECK_OP_1 (node); - if (TREE_OPERAND (node, 0) == empty_stmt_node) + /* Reduce try/finally nodes with an empty try block. */ + if (TREE_OPERAND (node, 0) == empty_stmt_node + || BLOCK_EMPTY_P (TREE_OPERAND (node, 0))) return TREE_OPERAND (node, 1); - if (TREE_OPERAND (node, 1) == empty_stmt_node) + /* Likewise for an empty finally block. */ + if (TREE_OPERAND (node, 1) == empty_stmt_node + || BLOCK_EMPTY_P (TREE_OPERAND (node, 1))) return TREE_OPERAND (node, 0); CAN_COMPLETE_NORMALLY (node) = (CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 0)) @@ -12043,6 +11901,7 @@ java_complete_lhs (tree node) int from_super = (EXPR_WFL_NODE (TREE_OPERAND (node, 0)) == super_identifier_node); tree arguments; + int location = EXPR_WFL_LINECOL (node); node = patch_method_invocation (node, NULL_TREE, NULL_TREE, from_super, 0, &decl); @@ -12054,8 +11913,7 @@ java_complete_lhs (tree node) arguments = TREE_VALUE (TREE_OPERAND (node, 1)); else arguments = NULL_TREE; - check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl, - arguments); + check_thrown_exceptions (location, decl, arguments); /* If we call this(...), register signature and positions */ if (in_this) DECL_CONSTRUCTOR_CALLS (current_function_decl) = @@ -12081,8 +11939,8 @@ java_complete_lhs (tree node) /* When we have a primitype type, or a string and we're not emitting a class file, we actually don't want to generate anything for the assignment. */ - if (value != NULL_TREE && - (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || + if (value != NULL_TREE && + (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || (TREE_TYPE (value) == string_ptr_type_node && ! flag_emit_class_files))) { @@ -13844,7 +13702,9 @@ merge_string_cste (tree op1, tree op2, int after) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; - else if (op2 == null_pointer_node) + else if (op2 == null_pointer_node + || (integer_zerop (op2) + && TREE_CODE (TREE_TYPE (op2)) == POINTER_TYPE)) /* FIXME: null is not a compile-time constant, so it is only safe to merge if the overall expression is non-constant. However, this code always merges without checking the overall expression. */ @@ -14094,6 +13954,44 @@ static tree build_incomplete_class_ref (int location, tree class_name) { tree node = build1 (CLASS_LITERAL, NULL_TREE, class_name); + tree class_decl = GET_CPC (); + tree this_class = TREE_TYPE (class_decl); + + /* Generate the synthetic static method `class$'. (Previously we + deferred this, causing different method tables to be emitted + for native code and bytecode.) */ + if (!TYPE_DOT_CLASS (this_class) + && !JPRIMITIVE_TYPE_P (class_name) + && !(TREE_CODE (class_name) == VOID_TYPE)) + { + tree target_class; + + if (CLASS_INTERFACE (TYPE_NAME (this_class))) + { + /* For interfaces, adding a static 'class$' method directly + is illegal. So create an inner class to contain the new + method. Empirically this matches the behavior of javac. */ + tree t = build_wfl_node (DECL_NAME (TYPE_NAME (object_type_node))); + tree inner = create_anonymous_class (0, t); + target_class = TREE_TYPE (inner); + end_class_declaration (1); + } + else + { + /* For inner classes, add a 'class$' method to their outermost + context, creating it if necessary. */ + while (INNER_CLASS_DECL_P (class_decl)) + class_decl = DECL_CONTEXT (class_decl); + target_class = TREE_TYPE (class_decl); + } + + if (TYPE_DOT_CLASS (target_class) == NULL_TREE) + build_dot_class_method (target_class); + + if (this_class != target_class) + TYPE_DOT_CLASS (this_class) = TYPE_DOT_CLASS (target_class); + } + EXPR_WFL_LINECOL (node) = location; return node; } @@ -14108,12 +14006,6 @@ patch_incomplete_class_ref (tree node) if (!(ref_type = resolve_type_during_patch (type))) return error_mark_node; - /* Generate the synthetic static method `class$'. (Previously we - deferred this, causing different method tables to be emitted - for native code and bytecode.) */ - if (!TYPE_DOT_CLASS (current_class)) - build_dot_class_method (current_class); - /* If we're not emitting class files and we know ref_type is a compiled class, build a direct reference. */ if ((! flag_emit_class_files && is_compiled_class (ref_type)) @@ -14129,7 +14021,7 @@ patch_incomplete_class_ref (tree node) /* If we're emitting class files and we have to deal with non primitive types, we invoke the synthetic static method `class$'. */ - ref_type = build_dot_class_method_invocation (ref_type); + ref_type = build_dot_class_method_invocation (current_class, ref_type); return java_complete_tree (ref_type); } @@ -15393,7 +15285,7 @@ build_assertion (int location, tree condition, tree value) if (!TYPE_DOT_CLASS (class_type)) build_dot_class_method (class_type); - classdollar = build_dot_class_method_invocation (class_type); + classdollar = build_dot_class_method_invocation (class_type, class_type); /* Call CLASS.desiredAssertionStatus(). */ id = build_wfl_node (get_identifier ("desiredAssertionStatus")); @@ -15451,7 +15343,7 @@ build_assertion (int location, tree condition, tree value) catches TYPE and executes CATCH_STMTS. */ static tree -encapsulate_with_try_catch (int location, tree type, tree try_stmts, +encapsulate_with_try_catch (int location, tree type_or_name, tree try_stmts, tree catch_stmts) { tree try_block, catch_clause_param, catch_block, catch; @@ -15460,8 +15352,20 @@ encapsulate_with_try_catch (int location, tree type, tree try_stmts, try_block = build_expr_block (try_stmts, NULL_TREE); /* Build a catch block: we need a catch clause parameter */ - catch_clause_param = build_decl (VAR_DECL, - wpv_id, build_pointer_type (type)); + if (TREE_CODE (type_or_name) == EXPR_WITH_FILE_LOCATION) + { + tree catch_type = obtain_incomplete_type (type_or_name); + jdep *dep; + catch_clause_param = build_decl (VAR_DECL, wpv_id, catch_type); + register_incomplete_type (JDEP_VARIABLE, type_or_name, + catch_clause_param, catch_type); + dep = CLASSD_LAST (ctxp->classd_list); + JDEP_GET_PATCH (dep) = &TREE_TYPE (catch_clause_param); + } + else + catch_clause_param = build_decl (VAR_DECL, wpv_id, + build_pointer_type (type_or_name)); + /* And a block */ catch_block = build_expr_block (NULL_TREE, catch_clause_param); @@ -15783,6 +15687,10 @@ check_thrown_exceptions (int location, tree decl, tree this_expr) tree throws; int is_array_call = 0; + /* Skip check within generated methods, such as access$. */ + if (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl))) + return; + if (this_expr != NULL_TREE && TREE_CODE (TREE_TYPE (this_expr)) == POINTER_TYPE && TYPE_ARRAY_P (TREE_TYPE (TREE_TYPE (this_expr)))) @@ -16084,7 +15992,11 @@ fold_constant_for_init (tree node, tree context) if (val == NULL_TREE || ! TREE_CONSTANT (val)) return NULL_TREE; TREE_OPERAND (node, 0) = val; - return patch_unaryop (node, op0); + val = patch_unaryop (node, op0); + if (! TREE_CONSTANT (val)) + return NULL_TREE; + return val; + break; case COND_EXPR: @@ -16215,8 +16127,8 @@ attach_init_test_initialization_flags (void **entry, void *ptr) return true; } -/* This function is called for each classes that is known definitely - assigned when a given static method was called. This function +/* This function is called for each class that is known definitely + initialized when a given static method was called. This function augments a compound expression (INFO) storing all assignment to initialized static class flags if a flag already existed, otherwise a new one is created. */ diff --git a/gcc/java/resource.c b/gcc/java/resource.c index b71a6709f5e..5d4b72a13ae 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -105,12 +105,16 @@ write_resource_constructor (void) tree init_name, init_type, init_decl; tree iter; location_t saved_loc = input_location; + char *resource_ctor_name; /* Only do work if required. */ if (resources == NULL_TREE) return; - init_name = get_file_function_name ('I'); + resource_ctor_name = concat (IDENTIFIER_POINTER (get_file_function_name ('I')), + "_resource", NULL); + init_name = get_identifier (resource_ctor_name); + free (resource_ctor_name); init_type = build_function_type (void_type_node, end_params_node); init_decl = build_decl (FUNCTION_DECL, init_name, init_type); diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 972cb8b3686..ddee2ba198b 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -112,7 +112,7 @@ convert_ieee_real_to_integer (tree type, tree expr) tree convert (tree type, tree expr) { - register enum tree_code code = TREE_CODE (type); + enum tree_code code = TREE_CODE (type); if (!expr) return error_mark_node; @@ -244,7 +244,7 @@ java_unsigned_type (tree type) bool java_mark_addressable (tree exp) { - register tree x = exp; + tree x = exp; while (1) switch (TREE_CODE (x)) { @@ -480,7 +480,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit) case 'L': { const unsigned char *start = ++(*ptr); - register const unsigned char *str = start; + const unsigned char *str = start; for ( ; ; str++) { if (str >= limit) diff --git a/gcc/java/verify.c b/gcc/java/verify.c index a5375bf1357..abcdac8c4d8 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -423,7 +423,7 @@ verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length) char *pmessage; int i; int index; - register unsigned char *p; + unsigned char *p; struct eh_range *prev_eh_ranges = NULL_EH_RANGE; struct eh_range *eh_ranges; tree return_type = TREE_TYPE (TREE_TYPE (current_function_decl)); @@ -473,9 +473,6 @@ verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length) return 0; } - if (handler_pc >= start_pc && handler_pc < end_pc) - warning ("exception handler inside code that is being protected"); - add_handler (start_pc, end_pc, lookup_label (handler_pc), catch_type == 0 ? NULL_TREE diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index cf241602f44..6a9f68c86f0 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -83,7 +83,7 @@ extern tree lhd_tree_inlining_copy_res_decl_for_inlining (tree, tree, tree, extern int lhd_tree_inlining_anon_aggr_type_p (tree); extern int lhd_tree_inlining_start_inlining (tree); extern void lhd_tree_inlining_end_inlining (tree); -extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree); +extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree, int); extern void lhd_initialize_diagnostics (struct diagnostic_context *); extern tree lhd_callgraph_analyze_expr (tree *, int *, tree); diff --git a/gcc/langhooks.c b/gcc/langhooks.c index a1d60f9ff5e..e31c1fbbd10 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -420,7 +420,8 @@ lhd_tree_inlining_end_inlining (tree fn ATTRIBUTE_UNUSED) tree lhd_tree_inlining_convert_parm_for_inlining (tree parm ATTRIBUTE_UNUSED, tree value, - tree fndecl ATTRIBUTE_UNUSED) + tree fndecl ATTRIBUTE_UNUSED, + int argnum ATTRIBUTE_UNUSED) { return value; } @@ -544,7 +545,6 @@ lhd_print_error_function (diagnostic_context *context, const char *file) (context->printer, "In function `%s':", (*lang_hooks.decl_printable_name) (current_function_decl, 2)); } - pp_newline (context->printer); diagnostic_set_last_function (context); pp_flush (context->printer); diff --git a/gcc/langhooks.h b/gcc/langhooks.h index cb5941ff3eb..ce6b7a6b1c7 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -47,7 +47,7 @@ struct lang_hooks_for_tree_inlining bool (*var_mod_type_p) (tree); int (*start_inlining) (tree); void (*end_inlining) (tree); - tree (*convert_parm_for_inlining) (tree, tree, tree); + tree (*convert_parm_for_inlining) (tree, tree, tree, int); int (*estimate_num_insns) (tree); }; diff --git a/gcc/lcm.c b/gcc/lcm.c index 68b49efb015..c8669049a6a 100644 --- a/gcc/lcm.c +++ b/gcc/lcm.c @@ -1058,8 +1058,8 @@ optimize_mode_switching (FILE *file) REG_SET_TO_HARD_REG_SET (live_now, bb->global_live_at_start); - for (insn = bb->head; - insn != NULL && insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) { if (INSN_P (insn)) @@ -1093,7 +1093,7 @@ optimize_mode_switching (FILE *file) /* Check for blocks without ANY mode requirements. */ if (last_mode == no_mode) { - ptr = new_seginfo (no_mode, bb->end, bb->index, live_now); + ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now); add_seginfo (info + bb->index, ptr); } } @@ -1201,8 +1201,8 @@ optimize_mode_switching (FILE *file) if (eg->flags & EDGE_ABNORMAL) { emited = true; - if (GET_CODE (src_bb->end) == JUMP_INSN) - emit_insn_before (mode_set, src_bb->end); + if (GET_CODE (BB_END (src_bb)) == JUMP_INSN) + emit_insn_before (mode_set, BB_END (src_bb)); /* It doesn't make sense to switch to normal mode after a CALL_INSN, so we're going to abort if we find one. The cases in which a CALL_INSN may @@ -1214,8 +1214,8 @@ optimize_mode_switching (FILE *file) the call (it wouldn't make sense, anyway). In the case of EH edges, EH entry points also start in normal mode, so a similar reasoning applies. */ - else if (GET_CODE (src_bb->end) == INSN) - emit_insn_after (mode_set, src_bb->end); + else if (GET_CODE (BB_END (src_bb)) == INSN) + emit_insn_after (mode_set, BB_END (src_bb)); else abort (); bb_info[j][src_bb->index].computing = mode; diff --git a/gcc/libgcc-darwin.ver b/gcc/libgcc-darwin.ver new file mode 100644 index 00000000000..5aba34efbdc --- /dev/null +++ b/gcc/libgcc-darwin.ver @@ -0,0 +1,213 @@ +GCC_3.0 { + # libgcc1 integer symbols + ___absvsi2 + ___addvsi3 + ___ashlsi3 + ___ashrsi3 + ___divsi3 + ___lshrsi3 + ___modsi3 + ___mulsi3 + ___mulvsi3 + ___negvsi2 + ___subvsi3 + ___udivsi3 + ___umodsi3 + + # libgcc1 floating point symbols + ___addsf3 + ___adddf3 + ___addxf3 + ___addtf3 + ___divsf3 + ___divdf3 + ___divxf3 + ___divtf3 + ___eqsf2 + ___eqdf2 + ___eqxf2 + ___eqtf2 + ___extenddfxf2 + ___extenddftf2 + ___extendsfdf2 + ___extendsfxf2 + ___extendsftf2 + ___fixsfsi + ___fixdfsi + ___fixxfsi + ___fixtfsi + ___floatsisf + ___floatsidf + ___floatsixf + ___floatsitf + ___gesf2 + ___gedf2 + ___gexf2 + ___getf2 + ___gtsf2 + ___gtdf2 + ___gtxf2 + ___gttf2 + ___lesf2 + ___ledf2 + ___lexf2 + ___letf2 + ___ltsf2 + ___ltdf2 + ___ltxf2 + ___lttf2 + ___mulsf3 + ___muldf3 + ___mulxf3 + ___multf3 + ___negsf2 + ___negdf2 + ___negxf2 + ___negtf2 + ___nesf2 + ___nedf2 + ___nexf2 + ___netf2 + ___subsf3 + ___subdf3 + ___subxf3 + ___subtf3 + ___truncdfsf2 + ___truncxfsf2 + ___trunctfsf2 + ___truncxfdf2 + ___trunctfdf2 + + # libgcc2 DImode arithmetic (for 32-bit targets). + ___absvdi2 + ___addvdi3 + ___ashldi3 + ___ashrdi3 + ___cmpdi2 + ___divdi3 + ___ffsdi2 + ___fixdfdi + ___fixsfdi + ___fixtfdi + ___fixxfdi + ___fixunsdfdi + ___fixunsdfsi + ___fixunssfsi + ___fixunssfdi + ___fixunstfdi + ___fixunstfsi + ___fixunsxfdi + ___fixunsxfsi + ___floatdidf + ___floatdisf + ___floatdixf + ___floatditf + ___lshrdi3 + ___moddi3 + ___muldi3 + ___mulvdi3 + ___negdi2 + ___negvdi2 + ___subvdi3 + ___ucmpdi2 + ___udivdi3 + ___udivmoddi4 + ___umoddi3 + + # libgcc2 TImode arithmetic (for 64-bit targets). + ___ashlti3 + ___ashrti3 + ___cmpti2 + ___divti3 + ___ffsti2 + ___fixdfti + ___fixsfti + ___fixtfti + ___fixxfti + ___lshrti3 + ___modti3 + ___multi3 + ___negti2 + ___ucmpti2 + ___udivmodti4 + ___udivti3 + ___umodti3 + ___fixunsdfti + ___fixunssfti + ___fixunstfti + ___fixunsxfti + ___floattidf + ___floattisf + ___floattixf + ___floattitf + + # Used to deal with trampoline initialization on some platforms + ___clear_cache + + # EH symbols + __Unwind_DeleteException + __Unwind_Find_FDE + __Unwind_ForcedUnwind + __Unwind_GetGR + __Unwind_GetIP + __Unwind_GetLanguageSpecificData + __Unwind_GetRegionStart + __Unwind_GetTextRelBase + __Unwind_GetDataRelBase + __Unwind_RaiseException + __Unwind_Resume + __Unwind_SetGR + __Unwind_SetIP + ___deregister_frame + ___deregister_frame_info + ___deregister_frame_info_bases + ___register_frame + ___register_frame_info + ___register_frame_info_bases + ___register_frame_info_table + ___register_frame_info_table_bases + ___register_frame_table + + # SjLj EH symbols + __Unwind_SjLj_Register + __Unwind_SjLj_Unregister + __Unwind_SjLj_RaiseException + __Unwind_SjLj_ForcedUnwind + __Unwind_SjLj_Resume +} + +%inherit GCC_3.3 GCC_3.0 +GCC_3.3 { + __Unwind_FindEnclosingFunction + __Unwind_GetCFA + __Unwind_Backtrace + __Unwind_Resume_or_Rethrow + __Unwind_SjLj_Resume_or_Rethrow +} + +%inherit GCC_3.3.1 GCC_3.3 +GCC_3.3.1 { + __gcc_personality_sj0 + __gcc_personality_v0 +} + +%inherit GCC_3.3.2 GCC_3.3.1 +GCC_3.3.2 { +} + +%inherit GCC_3.4 GCC_3.3 +GCC_3.4 { + # bit scanning and counting built-ins + ___clzsi2 + ___clzdi2 + ___clzti2 + ___ctzsi2 + ___ctzdi2 + ___ctzti2 + ___popcountsi2 + ___popcountdi2 + ___popcountti2 + ___paritysi2 + ___paritydi2 + ___parityti2 +} diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 05cb315cb9d..34171ad9002 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -63,13 +63,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DWtype __negdi2 (DWtype u) { - DWunion w; - DWunion uu; - - uu.ll = u; - - w.s.low = -uu.s.low; - w.s.high = -uu.s.high - ((UWtype) w.s.low > 0); + const DWunion uu = {.ll = u}; + const DWunion w = { {.low = -uu.s.low, + .high = -uu.s.high - ((UWtype) -uu.s.low > 0) } }; return w.ll; } @@ -79,9 +75,7 @@ __negdi2 (DWtype u) Wtype __addvsi3 (Wtype a, Wtype b) { - Wtype w; - - w = a + b; + const Wtype w = a + b; if (b >= 0 ? w < a : w > a) abort (); @@ -94,9 +88,7 @@ __addvsi3 (Wtype a, Wtype b) DWtype __addvdi3 (DWtype a, DWtype b) { - DWtype w; - - w = a + b; + const DWtype w = a + b; if (b >= 0 ? w < a : w > a) abort (); @@ -109,9 +101,7 @@ __addvdi3 (DWtype a, DWtype b) Wtype __subvsi3 (Wtype a, Wtype b) { - DWtype w; - - w = a - b; + const DWtype w = a - b; if (b >= 0 ? w > a : w < a) abort (); @@ -124,9 +114,7 @@ __subvsi3 (Wtype a, Wtype b) DWtype __subvdi3 (DWtype a, DWtype b) { - DWtype w; - - w = a - b; + const DWtype w = a - b; if (b >= 0 ? w > a : w < a) abort (); @@ -140,9 +128,7 @@ __subvdi3 (DWtype a, DWtype b) Wtype __mulvsi3 (Wtype a, Wtype b) { - DWtype w; - - w = (DWtype) a * (DWtype) b; + const DWtype w = (DWtype) a * (DWtype) b; if (((a >= 0) == (b >= 0)) ? (UDWtype) w > (UDWtype) (((DWtype) 1 << (WORD_SIZE - 1)) - 1) @@ -157,9 +143,7 @@ __mulvsi3 (Wtype a, Wtype b) Wtype __negvsi2 (Wtype a) { - Wtype w; - - w = -a; + const Wtype w = -a; if (a >= 0 ? w > 0 : w < 0) abort (); @@ -172,9 +156,7 @@ __negvsi2 (Wtype a) DWtype __negvdi2 (DWtype a) { - DWtype w; - - w = -a; + const DWtype w = -a; if (a >= 0 ? w > 0 : w < 0) abort (); @@ -230,10 +212,8 @@ __mulvdi3 (DWtype u, DWtype v) { /* The unchecked multiplication needs 3 Wtype x Wtype multiplications, but the checked multiplication needs only two. */ - DWunion uu, vv; - - uu.ll = u; - vv.ll = v; + const DWunion uu = {.ll = u}; + const DWunion vv = {.ll = v}; if (__builtin_expect (uu.s.high == uu.s.low >> (WORD_SIZE - 1), 1)) { @@ -247,10 +227,11 @@ __mulvdi3 (DWtype u, DWtype v) else { /* Two multiplications. */ - DWunion w0, w1; + DWunion w0 = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; + DWunion w1 = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.high}; - w0.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.low; - w1.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.high; if (vv.s.high < 0) w1.s.high -= uu.s.low; if (uu.s.low < 0) @@ -269,10 +250,11 @@ __mulvdi3 (DWtype u, DWtype v) { /* v fits into a single Wtype. */ /* Two multiplications. */ - DWunion w0, w1; + DWunion w0 = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; + DWunion w1 = {.ll = (UDWtype) (UWtype) uu.s.high + * (UDWtype) (UWtype) vv.s.low}; - w0.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.low; - w1.ll = (UDWtype) (UWtype) uu.s.high * (UDWtype) (UWtype) vv.s.low; if (uu.s.high < 0) w1.s.high -= vv.s.low; if (vv.s.low < 0) @@ -293,10 +275,8 @@ __mulvdi3 (DWtype u, DWtype v) { if (uu.s.high == 0 && vv.s.high == 0) { - DWtype w; - - w = (UDWtype) (UWtype) uu.s.low - * (UDWtype) (UWtype) vv.s.low; + const DWtype w = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low; if (__builtin_expect (w >= 0, 1)) return w; } @@ -305,10 +285,9 @@ __mulvdi3 (DWtype u, DWtype v) { if (uu.s.high == 0 && vv.s.high == (Wtype) -1) { - DWunion ww; + DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; - ww.ll = (UDWtype) (UWtype) uu.s.low - * (UDWtype) (UWtype) vv.s.low; ww.s.high -= uu.s.low; if (__builtin_expect (ww.s.high < 0, 1)) return ww.ll; @@ -321,10 +300,9 @@ __mulvdi3 (DWtype u, DWtype v) { if (uu.s.high == (Wtype) -1 && vv.s.high == 0) { - DWunion ww; + DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; - ww.ll = (UDWtype) (UWtype) uu.s.low - * (UDWtype) (UWtype) vv.s.low; ww.s.high -= vv.s.low; if (__builtin_expect (ww.s.high < 0, 1)) return ww.ll; @@ -334,10 +312,9 @@ __mulvdi3 (DWtype u, DWtype v) { if (uu.s.high == (Wtype) -1 && vv.s.high == (Wtype) - 1) { - DWunion ww; + DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; - ww.ll = (UDWtype) (UWtype) uu.s.low - * (UDWtype) (UWtype) vv.s.low; ww.s.high -= uu.s.low; ww.s.high -= vv.s.low; if (__builtin_expect (ww.s.high >= 0, 1)) @@ -360,16 +337,13 @@ __mulvdi3 (DWtype u, DWtype v) DWtype __lshrdi3 (DWtype u, word_type b) { - DWunion w; - word_type bm; - DWunion uu; - if (b == 0) return u; - uu.ll = u; + const DWunion uu = {.ll = u}; + const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; + DWunion w; - bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; if (bm <= 0) { w.s.high = 0; @@ -377,7 +351,7 @@ __lshrdi3 (DWtype u, word_type b) } else { - UWtype carries = (UWtype) uu.s.high << bm; + const UWtype carries = (UWtype) uu.s.high << bm; w.s.high = (UWtype) uu.s.high >> b; w.s.low = ((UWtype) uu.s.low >> b) | carries; @@ -391,16 +365,13 @@ __lshrdi3 (DWtype u, word_type b) DWtype __ashldi3 (DWtype u, word_type b) { - DWunion w; - word_type bm; - DWunion uu; - if (b == 0) return u; - uu.ll = u; + const DWunion uu = {.ll = u}; + const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; + DWunion w; - bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; if (bm <= 0) { w.s.low = 0; @@ -408,7 +379,7 @@ __ashldi3 (DWtype u, word_type b) } else { - UWtype carries = (UWtype) uu.s.low >> bm; + const UWtype carries = (UWtype) uu.s.low >> bm; w.s.low = (UWtype) uu.s.low << b; w.s.high = ((UWtype) uu.s.high << b) | carries; @@ -422,16 +393,13 @@ __ashldi3 (DWtype u, word_type b) DWtype __ashrdi3 (DWtype u, word_type b) { - DWunion w; - word_type bm; - DWunion uu; - if (b == 0) return u; - uu.ll = u; + const DWunion uu = {.ll = u}; + const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; + DWunion w; - bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; if (bm <= 0) { /* w.s.high = 1..1 or 0..0 */ @@ -440,7 +408,7 @@ __ashrdi3 (DWtype u, word_type b) } else { - UWtype carries = (UWtype) uu.s.high << bm; + const UWtype carries = (UWtype) uu.s.high << bm; w.s.high = uu.s.high >> b; w.s.low = ((UWtype) uu.s.low >> b) | carries; @@ -472,10 +440,9 @@ extern int __ffsDI2 (DWtype u); int __ffsDI2 (DWtype u) { - DWunion uu; + const DWunion uu = {.ll = u}; UWtype word, count, add; - uu.ll = u; if (uu.s.low != 0) word = uu.s.low, add = 0; else if (uu.s.high != 0) @@ -492,13 +459,10 @@ __ffsDI2 (DWtype u) DWtype __muldi3 (DWtype u, DWtype v) { - DWunion w; - DWunion uu, vv; + const DWunion uu = {.ll = u}; + const DWunion vv = {.ll = v}; + DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)}; - uu.ll = u, - vv.ll = v; - - w.ll = __umulsidi3 (uu.s.low, vv.s.low); w.s.high += ((UWtype) uu.s.low * (UWtype) vv.s.high + (UWtype) uu.s.high * (UWtype) vv.s.low); @@ -667,11 +631,10 @@ extern int __clzDI2 (UDWtype x); int __clzDI2 (UDWtype x) { - DWunion uu; + const DWunion uu = {.ll = x}; UWtype word; Wtype ret, add; - uu.ll = x; if (uu.s.high) word = uu.s.high, add = 0; else @@ -702,11 +665,10 @@ extern int __ctzDI2 (UDWtype x); int __ctzDI2 (UDWtype x) { - DWunion uu; + const DWunion uu = {.ll = x}; UWtype word; Wtype ret, add; - uu.ll = x; if (uu.s.low) word = uu.s.low, add = 0; else @@ -794,11 +756,8 @@ extern int __parityDI2 (UDWtype x); int __parityDI2 (UDWtype x) { - DWunion uu; - UWtype nx; - - uu.ll = x; - nx = uu.s.low ^ uu.s.high; + const DWunion uu = {.ll = x}; + UWtype nx = uu.s.low ^ uu.s.high; #if W_TYPE_SIZE > 64 # error "fill out the table" @@ -825,16 +784,13 @@ static inline __attribute__ ((__always_inline__)) UDWtype __udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp) { - DWunion ww; - DWunion nn, dd; + const DWunion nn = {.ll = n}; + const DWunion dd = {.ll = d}; DWunion rr; UWtype d0, d1, n0, n1, n2; UWtype q0, q1; UWtype b, bm; - nn.ll = n; - dd.ll = d; - d0 = dd.s.low; d1 = dd.s.high; n0 = nn.s.low; @@ -1034,8 +990,7 @@ __udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp) } } - ww.s.low = q0; - ww.s.high = q1; + const DWunion ww = {{.low = q0, .high = q1}}; return ww.ll; } #endif @@ -1045,12 +1000,10 @@ DWtype __divdi3 (DWtype u, DWtype v) { word_type c = 0; - DWunion uu, vv; + DWunion uu = {.ll = u}; + DWunion vv = {.ll = v}; DWtype w; - uu.ll = u; - vv.ll = v; - if (uu.s.high < 0) c = ~c, uu.ll = -uu.ll; @@ -1071,12 +1024,10 @@ DWtype __moddi3 (DWtype u, DWtype v) { word_type c = 0; - DWunion uu, vv; + DWunion uu = {.ll = u}; + DWunion vv = {.ll = v}; DWtype w; - uu.ll = u; - vv.ll = v; - if (uu.s.high < 0) c = ~c, uu.ll = -uu.ll; @@ -1115,9 +1066,8 @@ __udivdi3 (UDWtype n, UDWtype d) word_type __cmpdi2 (DWtype a, DWtype b) { - DWunion au, bu; - - au.ll = a, bu.ll = b; + const DWunion au = {.ll = a}; + const DWunion bu = {.ll = b}; if (au.s.high < bu.s.high) return 0; @@ -1135,9 +1085,8 @@ __cmpdi2 (DWtype a, DWtype b) word_type __ucmpdi2 (DWtype a, DWtype b) { - DWunion au, bu; - - au.ll = a, bu.ll = b; + const DWunion au = {.ll = a}; + const DWunion bu = {.ll = b}; if ((UWtype) au.s.high < (UWtype) bu.s.high) return 0; @@ -1158,17 +1107,14 @@ __ucmpdi2 (DWtype a, DWtype b) DWtype __fixunstfDI (TFtype a) { - TFtype b; - UDWtype v; - if (a < 0) return 0; /* Compute high word of result, as a flonum. */ - b = (a / HIGH_WORD_COEFF); + const TFtype b = (a / HIGH_WORD_COEFF); /* Convert that to fixed (but not to DWtype!), and shift it into the high word. */ - v = (UWtype) b; + UDWtype v = (UWtype) b; v <<= WORD_SIZE; /* Remove high part from the TFtype, leaving the low part as flonum. */ a -= (TFtype)v; @@ -1200,17 +1146,14 @@ __fixtfdi (TFtype a) DWtype __fixunsxfDI (XFtype a) { - XFtype b; - UDWtype v; - if (a < 0) return 0; /* Compute high word of result, as a flonum. */ - b = (a / HIGH_WORD_COEFF); + const XFtype b = (a / HIGH_WORD_COEFF); /* Convert that to fixed (but not to DWtype!), and shift it into the high word. */ - v = (UWtype) b; + UDWtype v = (UWtype) b; v <<= WORD_SIZE; /* Remove high part from the XFtype, leaving the low part as flonum. */ a -= (XFtype)v; @@ -1242,17 +1185,15 @@ __fixxfdi (XFtype a) DWtype __fixunsdfDI (DFtype a) { - UWtype hi, lo; - /* Get high part of result. The division here will just moves the radix point and will not cause any rounding. Then the conversion to integral type chops result as desired. */ - hi = a / HIGH_WORD_COEFF; + const UWtype hi = a / HIGH_WORD_COEFF; /* Get low part of result. Convert `hi' to floating type and scale it back, then subtract this from the number being converted. This leaves the low part. Convert that to integral type. */ - lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF); + const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF); /* Assemble result from the two parts. */ return ((UDWtype) hi << WORD_SIZE) | lo; @@ -1279,18 +1220,17 @@ __fixunssfDI (SFtype original_a) /* Convert the SFtype to a DFtype, because that is surely not going to lose any bits. Some day someone else can write a faster version that avoids converting to DFtype, and verify it really works right. */ - DFtype a = original_a; - UWtype hi, lo; + const DFtype a = original_a; /* Get high part of result. The division here will just moves the radix point and will not cause any rounding. Then the conversion to integral type chops result as desired. */ - hi = a / HIGH_WORD_COEFF; + const UWtype hi = a / HIGH_WORD_COEFF; /* Get low part of result. Convert `hi' to floating type and scale it back, then subtract this from the number being converted. This leaves the low part. Convert that to integral type. */ - lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF); + const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF); /* Assemble result from the two parts. */ return ((UDWtype) hi << WORD_SIZE) | lo; @@ -1315,9 +1255,7 @@ __fixsfdi (SFtype a) XFtype __floatdixf (DWtype u) { - XFtype d; - - d = (Wtype) (u >> WORD_SIZE); + XFtype d = (Wtype) (u >> WORD_SIZE); d *= HIGH_HALFWORD_COEFF; d *= HIGH_HALFWORD_COEFF; d += (UWtype) (u & (HIGH_WORD_COEFF - 1)); @@ -1334,9 +1272,7 @@ __floatdixf (DWtype u) TFtype __floatditf (DWtype u) { - TFtype d; - - d = (Wtype) (u >> WORD_SIZE); + TFtype d = (Wtype) (u >> WORD_SIZE); d *= HIGH_HALFWORD_COEFF; d *= HIGH_HALFWORD_COEFF; d += (UWtype) (u & (HIGH_WORD_COEFF - 1)); @@ -1353,9 +1289,7 @@ __floatditf (DWtype u) DFtype __floatdidf (DWtype u) { - DFtype d; - - d = (Wtype) (u >> WORD_SIZE); + DFtype d = (Wtype) (u >> WORD_SIZE); d *= HIGH_HALFWORD_COEFF; d *= HIGH_HALFWORD_COEFF; d += (UWtype) (u & (HIGH_WORD_COEFF - 1)); @@ -1376,11 +1310,6 @@ __floatdidf (DWtype u) SFtype __floatdisf (DWtype u) { - /* Do the calculation in DFmode - so that we don't lose any of the precision of the high word - while multiplying it. */ - DFtype f; - /* Protect against double-rounding error. Represent any low-order bits, that might be truncated in DFmode, by a bit that won't be lost. The bit can go in anywhere below the @@ -1401,7 +1330,10 @@ __floatdisf (DWtype u) } } } - f = (Wtype) (u >> WORD_SIZE); + /* Do the calculation in DFmode + so that we don't lose any of the precision of the high word + while multiplying it. */ + DFtype f = (Wtype) (u >> WORD_SIZE); f *= HIGH_HALFWORD_COEFF; f *= HIGH_HALFWORD_COEFF; f += (UWtype) (u & (HIGH_WORD_COEFF - 1)); @@ -1510,7 +1442,7 @@ __gcc_bcmp (const unsigned char *s1, const unsigned char *s2, size_t size) { while (size > 0) { - unsigned char c1 = *s1++, c2 = *s2++; + const unsigned char c1 = *s1++, c2 = *s2++; if (c1 != c2) return c1 - c2; size--; @@ -1690,8 +1622,9 @@ __do_global_ctors (void) For systems which support a .init section we use the .init section to run __do_global_ctors, so we need not do anything here. */ +extern void SYMBOL__MAIN (void); void -SYMBOL__MAIN () +SYMBOL__MAIN (void) { /* Support recursive calls to `main': run initializers just once. */ static int initialized; diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h index 7f608d66080..0bd6d2eac6d 100644 --- a/gcc/libgcc2.h +++ b/gcc/libgcc2.h @@ -69,15 +69,15 @@ typedef unsigned int UQItype __attribute__ ((mode (QI))); typedef int HItype __attribute__ ((mode (HI))); typedef unsigned int UHItype __attribute__ ((mode (HI))); #if MIN_UNITS_PER_WORD > 1 -/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1 */ +/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */ typedef int SItype __attribute__ ((mode (SI))); typedef unsigned int USItype __attribute__ ((mode (SI))); #if LONG_LONG_TYPE_SIZE > 32 -/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */ +/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */ typedef int DItype __attribute__ ((mode (DI))); typedef unsigned int UDItype __attribute__ ((mode (DI))); #if MIN_UNITS_PER_WORD > 4 -/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */ +/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */ typedef int TItype __attribute__ ((mode (TI))); typedef unsigned int UTItype __attribute__ ((mode (TI))); #endif diff --git a/gcc/line-map.c b/gcc/line-map.c index f04350d7806..521c4e5c843 100644 --- a/gcc/line-map.c +++ b/gcc/line-map.c @@ -1,5 +1,5 @@ /* Map logical line numbers to (source file, line number) pairs. - Copyright (C) 2001 + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ linemap_free (struct line_maps *set) const struct line_map * linemap_add (struct line_maps *set, enum lc_reason reason, - unsigned int sysp, unsigned int from_line, + unsigned int sysp, source_location from_line, const char *to_file, unsigned int to_line) { struct line_map *map; @@ -166,7 +166,7 @@ linemap_add (struct line_maps *set, enum lc_reason reason, the list is sorted and we can use a binary search. */ const struct line_map * -linemap_lookup (struct line_maps *set, unsigned int line) +linemap_lookup (struct line_maps *set, source_location line) { unsigned int md, mn = 0, mx = set->used; diff --git a/gcc/line-map.h b/gcc/line-map.h index b53f5e06be6..c57f51a6624 100644 --- a/gcc/line-map.h +++ b/gcc/line-map.h @@ -1,5 +1,5 @@ /* Map logical line numbers to (source file, line number) pairs. - Copyright (C) 2001 + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -32,8 +32,9 @@ enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME}; /* A logical line number, i,e, an "index" into a line_map. */ /* Long-term, we want to use this to replace struct location_s (in input.h), - and effectively typedef fileline location_t. */ -typedef unsigned int fileline; + and effectively typedef source_location location_t. */ +typedef unsigned int source_location; +typedef source_location fileline; /* deprecated name */ /* The logical line FROM_LINE maps to physical source file TO_FILE at line TO_LINE, and subsequently one-to-one until the next line_map @@ -47,7 +48,7 @@ struct line_map { const char *to_file; unsigned int to_line; - fileline from_line; + source_location from_line; int included_from; ENUM_BITFIELD (lc_reason) reason : CHAR_BIT; unsigned char sysp; @@ -92,11 +93,12 @@ extern void linemap_free (struct line_maps *); maps, so any stored line_map pointers should not be used. */ extern const struct line_map *linemap_add (struct line_maps *, enum lc_reason, unsigned int sysp, - fileline from_line, const char *to_file, unsigned int to_line); + source_location from_line, const char *to_file, unsigned int to_line); /* Given a logical line, returns the map from which the corresponding (source file, line) pair can be deduced. */ -extern const struct line_map *linemap_lookup (struct line_maps *, fileline); +extern const struct line_map *linemap_lookup + (struct line_maps *, source_location); /* Print the file names and line numbers of the #include commands which led to the map MAP, if any, to stderr. Nothing is output if diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index c5c2506e9ca..f3caba4f6a6 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -108,7 +108,7 @@ struct qty /* Number of words needed to hold the data in given quantity. This depends on its machine mode. It is used for these purposes: - 1. It is used in computing the relative importances of qtys, + 1. It is used in computing the relative importance of qtys, which determines the order in which we look for regs for them. 2. It is used in rules that prevent tying several registers of different sizes in a way that is geometrically impossible @@ -809,7 +809,9 @@ update_equiv_regs (void) { loop_depth = bb->loop_depth; - for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); + insn != NEXT_INSN (BB_END (bb)); + insn = NEXT_INSN (insn)) { rtx note; rtx set; @@ -1023,7 +1025,9 @@ update_equiv_regs (void) FOR_EACH_BB_REVERSE (bb) { loop_depth = bb->loop_depth; - for (insn = bb->end; insn != PREV_INSN (bb->head); insn = PREV_INSN (insn)) + for (insn = BB_END (bb); + insn != PREV_INSN (BB_HEAD (bb)); + insn = PREV_INSN (insn)) { rtx link; @@ -1117,8 +1121,8 @@ update_equiv_regs (void) REG_N_CALLS_CROSSED (regno) = 0; REG_LIVE_LENGTH (regno) = 2; - if (insn == bb->head) - bb->head = PREV_INSN (insn); + if (insn == BB_HEAD (bb)) + BB_HEAD (bb) = PREV_INSN (insn); /* Remember to clear REGNO from all basic block's live info. */ @@ -1204,13 +1208,13 @@ block_alloc (int b) /* Count the instructions in the basic block. */ - insn = BLOCK_END (b); + insn = BB_END (BASIC_BLOCK (b)); while (1) { if (GET_CODE (insn) != NOTE) if (++insn_count > max_uid) abort (); - if (insn == BLOCK_HEAD (b)) + if (insn == BB_HEAD (BASIC_BLOCK (b))) break; insn = PREV_INSN (insn); } @@ -1227,7 +1231,7 @@ block_alloc (int b) and assigns quantities to registers. It computes which registers to tie. */ - insn = BLOCK_HEAD (b); + insn = BB_HEAD (BASIC_BLOCK (b)); while (1) { if (GET_CODE (insn) != NOTE) @@ -1459,7 +1463,7 @@ block_alloc (int b) IOR_HARD_REG_SET (regs_live_at[2 * insn_number], regs_live); IOR_HARD_REG_SET (regs_live_at[2 * insn_number + 1], regs_live); - if (insn == BLOCK_END (b)) + if (insn == BB_END (BASIC_BLOCK (b))) break; insn = NEXT_INSN (insn); @@ -2289,11 +2293,7 @@ post_mark_life (int regno, enum machine_mode mode, int life, int birth, int death) { int j = HARD_REGNO_NREGS (regno, mode); -#ifdef HARD_REG_SET - /* Declare it register if it's a scalar. */ - register -#endif - HARD_REG_SET this_reg; + HARD_REG_SET this_reg; CLEAR_HARD_REG_SET (this_reg); while (--j >= 0) diff --git a/gcc/longlong.h b/gcc/longlong.h index 2fb68e7c373..8a7d3dfc083 100644 --- a/gcc/longlong.h +++ b/gcc/longlong.h @@ -186,7 +186,7 @@ do { \ UDItype __umulsidi3 (USItype, USItype); #endif -#if defined (__arm__) && W_TYPE_SIZE == 32 +#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ __asm__ ("adds %1, %4, %5\n\tadc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 13285a31e61..0b882d9e163 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -53,7 +53,9 @@ loop_optimizer_init (FILE *dumpfile) /* No loops. */ flow_loops_free (loops); + free_dominance_info (CDI_DOMINATORS); free (loops); + /* Make chain. */ FOR_EACH_BB (bb) if (bb->next_bb != EXIT_BLOCK_PTR) @@ -81,7 +83,7 @@ loop_optimizer_init (FILE *dumpfile) flow_loops_dump (loops, dumpfile, NULL, 1); #ifdef ENABLE_CHECKING - verify_dominators (loops->cfg.dom); + verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif @@ -105,6 +107,7 @@ loop_optimizer_finalize (struct loops *loops, FILE *dumpfile) /* Clean up. */ flow_loops_free (loops); + free_dominance_info (CDI_DOMINATORS); free (loops); /* Finalize changes. */ diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index dde3c7439af..6c796af577c 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -68,14 +68,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static void decide_unrolling_and_peeling (struct loops *, int); static void peel_loops_completely (struct loops *, int); -static void decide_peel_simple (struct loops *, struct loop *, int); -static void decide_peel_once_rolling (struct loops *, struct loop *, int); -static void decide_peel_completely (struct loops *, struct loop *, int); -static void decide_unroll_stupid (struct loops *, struct loop *, int); -static void decide_unroll_constant_iterations (struct loops *, - struct loop *, int); -static void decide_unroll_runtime_iterations (struct loops *, struct loop *, - int); +static void decide_peel_simple (struct loop *, int); +static void decide_peel_once_rolling (struct loop *, int); +static void decide_peel_completely (struct loop *, int); +static void decide_unroll_stupid (struct loop *, int); +static void decide_unroll_constant_iterations (struct loop *, int); +static void decide_unroll_runtime_iterations (struct loop *, int); static void peel_loop_simple (struct loops *, struct loop *); static void peel_loop_completely (struct loops *, struct loop *); static void unroll_loop_stupid (struct loops *, struct loop *); @@ -140,7 +138,7 @@ unroll_and_peel_loops (struct loops *loops, int flags) if (check) { #ifdef ENABLE_CHECKING - verify_dominators (loops->cfg.dom); + verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif } @@ -178,15 +176,15 @@ peel_loops_completely (struct loops *loops, int flags) loop->ninsns = num_loop_insns (loop); - decide_peel_once_rolling (loops, loop, flags); + decide_peel_once_rolling (loop, flags); if (loop->lpt_decision.decision == LPT_NONE) - decide_peel_completely (loops, loop, flags); + decide_peel_completely (loop, flags); if (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY) { peel_loop_completely (loops, loop); #ifdef ENABLE_CHECKING - verify_dominators (loops->cfg.dom); + verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif } @@ -254,13 +252,13 @@ decide_unrolling_and_peeling (struct loops *loops, int flags) /* Try transformations one by one in decreasing order of priority. */ - decide_unroll_constant_iterations (loops, loop, flags); + decide_unroll_constant_iterations (loop, flags); if (loop->lpt_decision.decision == LPT_NONE) - decide_unroll_runtime_iterations (loops, loop, flags); + decide_unroll_runtime_iterations (loop, flags); if (loop->lpt_decision.decision == LPT_NONE) - decide_unroll_stupid (loops, loop, flags); + decide_unroll_stupid (loop, flags); if (loop->lpt_decision.decision == LPT_NONE) - decide_peel_simple (loops, loop, flags); + decide_peel_simple (loop, flags); loop = next; } @@ -269,8 +267,7 @@ decide_unrolling_and_peeling (struct loops *loops, int flags) /* Decide whether the LOOP is once rolling and suitable for complete peeling. */ static void -decide_peel_once_rolling (struct loops *loops, struct loop *loop, - int flags ATTRIBUTE_UNUSED) +decide_peel_once_rolling (struct loop *loop, int flags ATTRIBUTE_UNUSED) { if (rtl_dump_file) fprintf (rtl_dump_file, ";; Considering peeling once rolling loop\n"); @@ -284,7 +281,7 @@ decide_peel_once_rolling (struct loops *loops, struct loop *loop, } /* Check for simple loops. */ - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; /* Check number of iterations. */ @@ -303,8 +300,7 @@ decide_peel_once_rolling (struct loops *loops, struct loop *loop, /* Decide whether the LOOP is suitable for complete peeling. */ static void -decide_peel_completely (struct loops *loops, struct loop *loop, - int flags ATTRIBUTE_UNUSED) +decide_peel_completely (struct loop *loop, int flags ATTRIBUTE_UNUSED) { unsigned npeel; @@ -352,7 +348,7 @@ decide_peel_completely (struct loops *loops, struct loop *loop, /* Check for simple loops. */ if (!loop->has_desc) { - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; } @@ -441,8 +437,7 @@ peel_loop_completely (struct loops *loops, struct loop *loop) /* Decide whether to unroll LOOP iterating constant number of times and how much. */ static void -decide_unroll_constant_iterations (struct loops *loops, struct loop *loop, - int flags) +decide_unroll_constant_iterations (struct loop *loop, int flags) { unsigned nunroll, nunroll_by_av, best_copies, best_unroll = -1, n_copies, i; @@ -475,7 +470,7 @@ decide_unroll_constant_iterations (struct loops *loops, struct loop *loop, /* Check for simple loops. */ if (!loop->has_desc) { - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; } @@ -649,8 +644,7 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop) /* Decide whether to unroll LOOP iterating runtime computable number of times and how much. */ static void -decide_unroll_runtime_iterations (struct loops *loops, struct loop *loop, - int flags) +decide_unroll_runtime_iterations (struct loop *loop, int flags) { unsigned nunroll, nunroll_by_av, i; @@ -683,7 +677,7 @@ decide_unroll_runtime_iterations (struct loops *loops, struct loop *loop, /* Check for simple loops. */ if (!loop->has_desc) { - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; } @@ -774,7 +768,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) unsigned nldom; basic_block *ldom; - nldom = get_dominated_by (loops->cfg.dom, body[i], &ldom); + nldom = get_dominated_by (CDI_DOMINATORS, body[i], &ldom); for (j = 0; j < nldom; j++) if (!flow_bb_inside_loop_p (loop, ldom[j])) dom_bbs[n_dom_bbs++] = ldom[j]; @@ -821,7 +815,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) end_sequence (); /* Precondition the loop. */ - loop_split_edge_with (loop_preheader_edge (loop), init_code, loops); + loop_split_edge_with (loop_preheader_edge (loop), init_code); remove_edges = xcalloc (max_unroll + n_peel + 1, sizeof (edge)); n_remove_edges = 0; @@ -844,7 +838,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) /* Record the place where switch will be built for preconditioning. */ swtch = loop_split_edge_with (loop_preheader_edge (loop), - NULL_RTX, loops); + NULL_RTX); for (i = 0; i < n_peel; i++) { @@ -862,8 +856,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) j = n_peel - i - (extra_zero_check ? 0 : 1); p = REG_BR_PROB_BASE / (i + 2); - preheader = loop_split_edge_with (loop_preheader_edge (loop), - NULL_RTX, loops); + preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); label = block_label (preheader); start_sequence (); do_compare_rtx_and_jump (copy_rtx (niter), GEN_INT (j), EQ, 0, @@ -879,8 +872,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) branch_code = get_insns (); end_sequence (); - swtch = loop_split_edge_with (swtch->pred, branch_code, loops); - set_immediate_dominator (loops->cfg.dom, preheader, swtch); + swtch = loop_split_edge_with (swtch->pred, branch_code); + set_immediate_dominator (CDI_DOMINATORS, preheader, swtch); swtch->succ->probability = REG_BR_PROB_BASE - p; e = make_edge (swtch, preheader, swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP); @@ -892,8 +885,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) /* Add branch for zero iterations. */ p = REG_BR_PROB_BASE / (max_unroll + 1); swtch = ezc_swtch; - preheader = loop_split_edge_with (loop_preheader_edge (loop), - NULL_RTX, loops); + preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); label = block_label (preheader); start_sequence (); do_compare_rtx_and_jump (copy_rtx (niter), const0_rtx, EQ, 0, @@ -909,8 +901,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) branch_code = get_insns (); end_sequence (); - swtch = loop_split_edge_with (swtch->succ, branch_code, loops); - set_immediate_dominator (loops->cfg.dom, preheader, swtch); + swtch = loop_split_edge_with (swtch->succ, branch_code); + set_immediate_dominator (CDI_DOMINATORS, preheader, swtch); swtch->succ->probability = REG_BR_PROB_BASE - p; e = make_edge (swtch, preheader, swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP); @@ -918,7 +910,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) } /* Recount dominators for outer blocks. */ - iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); /* And unroll loop. */ @@ -946,7 +938,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) /* Decide whether to simply peel LOOP and how much. */ static void -decide_peel_simple (struct loops *loops, struct loop *loop, int flags) +decide_peel_simple (struct loop *loop, int flags) { unsigned npeel; @@ -975,7 +967,7 @@ decide_peel_simple (struct loops *loops, struct loop *loop, int flags) /* Check for simple loops. */ if (!loop->has_desc) { - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; } @@ -1062,7 +1054,7 @@ peel_loop_simple (struct loops *loops, struct loop *loop) /* Decide whether to unroll LOOP stupidly and how much. */ static void -decide_unroll_stupid (struct loops *loops, struct loop *loop, int flags) +decide_unroll_stupid (struct loop *loop, int flags) { unsigned nunroll, nunroll_by_av, i; @@ -1095,7 +1087,7 @@ decide_unroll_stupid (struct loops *loops, struct loop *loop, int flags) /* Check for simple loops. */ if (!loop->has_desc) { - loop->simple = simple_loop_p (loops, loop, &loop->desc); + loop->simple = simple_loop_p (loop, &loop->desc); loop->has_desc = 1; } diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c index c1971c6f4c0..4cfaa2f6255 100644 --- a/gcc/loop-unswitch.c +++ b/gcc/loop-unswitch.c @@ -81,7 +81,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static struct loop *unswitch_loop (struct loops *, struct loop *, basic_block); static void unswitch_single_loop (struct loops *, struct loop *, rtx, int); -static bool may_unswitch_on_p (struct loops *, basic_block, struct loop *, +static bool may_unswitch_on_p (basic_block, struct loop *, basic_block *); static rtx reversed_condition (rtx); @@ -107,7 +107,7 @@ unswitch_loops (struct loops *loops) unswitch_single_loop (loops, loop, NULL_RTX, 0); #ifdef ENABLE_CHECKING - verify_dominators (loops->cfg.dom); + verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif } @@ -117,8 +117,7 @@ unswitch_loops (struct loops *loops) basic blocks (for what it means see comments below). List of basic blocks inside LOOP is provided in BODY to save time. */ static bool -may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop, - basic_block *body) +may_unswitch_on_p (basic_block bb, struct loop *loop, basic_block *body) { rtx test; unsigned i; @@ -126,7 +125,7 @@ may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop, /* BB must end in a simple conditional jump. */ if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next) return false; - if (!any_condjump_p (bb->end)) + if (!any_condjump_p (BB_END (bb))) return false; /* With branches inside loop. */ @@ -136,17 +135,17 @@ may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop, /* It must be executed just once each iteration (because otherwise we are unable to update dominator/irreducible loop information correctly). */ - if (!just_once_each_iteration_p (loops, loop, bb)) + if (!just_once_each_iteration_p (loop, bb)) return false; /* Condition must be invariant. We use just a stupid test of invariantness of the condition: all used regs must not be modified inside loop body. */ - test = get_condition (bb->end, NULL, true); + test = get_condition (BB_END (bb), NULL, true); if (!test) return false; for (i = 0; i < loop->num_nodes; i++) - if (modified_between_p (test, body[i]->head, NEXT_INSN (body[i]->end))) + if (modified_between_p (test, BB_HEAD (body[i]), NEXT_INSN (BB_END (body[i])))) return false; return true; @@ -239,7 +238,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, /* Find a bb to unswitch on. */ bbs = get_loop_body (loop); for (i = 0; i < loop->num_nodes; i++) - if (may_unswitch_on_p (loops, bbs[i], loop, bbs)) + if (may_unswitch_on_p (bbs[i], loop, bbs)) break; if (i == loop->num_nodes) @@ -248,7 +247,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, return; } - if (!(cond = get_condition (bbs[i]->end, &split_before, true))) + if (!(cond = get_condition (BB_END (bbs[i]), &split_before, true))) abort (); rcond = reversed_condition (cond); @@ -295,7 +294,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, rconds = cond_checked; /* Separate condition in a single basic block. */ - bb = split_loop_bb (loops, bbs[i], PREV_INSN (split_before))->dest; + bb = split_loop_bb (bbs[i], PREV_INSN (split_before))->dest; free (bbs); true_first = !(bb->succ->flags & EDGE_FALLTHRU); if (rtl_dump_file) @@ -335,7 +334,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on) if (!unswitch_on->succ || !unswitch_on->succ->succ_next || unswitch_on->succ->succ_next->succ_next) abort (); - if (!just_once_each_iteration_p (loops, loop, unswitch_on)) + if (!just_once_each_iteration_p (loop, unswitch_on)) abort (); if (loop->inner) abort (); @@ -345,7 +344,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on) abort (); /* Will we be able to perform redirection? */ - if (!any_condjump_p (unswitch_on->end)) + if (!any_condjump_p (BB_END (unswitch_on))) return NULL; if (!cfg_layout_can_duplicate_bb_p (unswitch_on)) return NULL; @@ -382,7 +381,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on) switch_bb->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP; switch_bb->succ->succ_next->flags &= ~EDGE_IRREDUCIBLE_LOOP; } - add_to_dominance_info (loops->cfg.dom, switch_bb); + add_to_dominance_info (CDI_DOMINATORS, switch_bb); unswitch_on->rbi->copy = unswitch_on_alt; /* Loopify from the copy of LOOP body, constructing the new loop. */ @@ -402,5 +401,9 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on) fix_loop_placement (loop); fix_loop_placement (nloop); + /* Preserve the simple loop preheaders. */ + loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); + loop_split_edge_with (loop_preheader_edge (nloop), NULL_RTX); + return nloop; } diff --git a/gcc/loop.c b/gcc/loop.c index 667833d64a5..4ee83447a69 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -255,6 +255,7 @@ static void count_one_set (struct loop_regs *, rtx, rtx, rtx *); static void note_addr_stored (rtx, rtx, void *); static void note_set_pseudo_multiple_uses (rtx, rtx, void *); static int loop_reg_used_before_p (const struct loop *, rtx, rtx); +static rtx find_regs_nested (rtx, rtx); static void scan_loop (struct loop*, int); #if 0 static void replace_call_address (rtx, rtx, rtx); @@ -573,6 +574,32 @@ next_insn_in_loop (const struct loop *loop, rtx insn) return insn; } +/* Find any register references hidden inside X and add them to + the dependency list DEPS. This is used to look inside CLOBBER (MEM + when checking whether a PARALLEL can be pulled out of a loop. */ + +static rtx +find_regs_nested (rtx deps, rtx x) +{ + enum rtx_code code = GET_CODE (x); + if (code == REG) + deps = gen_rtx_EXPR_LIST (VOIDmode, x, deps); + else + { + const char *fmt = GET_RTX_FORMAT (code); + int i, j; + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) + { + if (fmt[i] == 'e') + deps = find_regs_nested (deps, XEXP (x, i)); + else if (fmt[i] == 'E') + for (j = 0; j < XVECLEN (x, i); j++) + deps = find_regs_nested (deps, XVECEXP (x, i, j)); + } + } + return deps; +} + /* Optimize one loop described by LOOP. */ /* ??? Could also move memory writes out of loops if the destination address @@ -776,7 +803,9 @@ scan_loop (struct loop *loop, int flags) } /* For parallels, add any possible uses to the dependencies, as - we can't move the insn without resolving them first. */ + we can't move the insn without resolving them first. + MEMs inside CLOBBERs may also reference registers; these + count as implicit uses. */ if (GET_CODE (PATTERN (p)) == PARALLEL) { for (i = 0; i < XVECLEN (PATTERN (p), 0); i++) @@ -786,6 +815,10 @@ scan_loop (struct loop *loop, int flags) dependencies = gen_rtx_EXPR_LIST (VOIDmode, XEXP (x, 0), dependencies); + else if (GET_CODE (x) == CLOBBER + && GET_CODE (XEXP (x, 0)) == MEM) + dependencies = find_regs_nested (dependencies, + XEXP (XEXP (x, 0), 0)); } } @@ -2113,7 +2146,8 @@ move_movables (struct loop *loop, struct loop_movables *movables, /* The SET_SRC might not be invariant, so we must use the REG_EQUAL note. */ start_sequence (); - emit_move_insn (m->set_dest, m->set_src); + emit_move_insn (m->insert_temp ? newreg : m->set_dest, + m->set_src); seq = get_insns (); end_sequence (); @@ -3298,8 +3332,14 @@ loop_invariant_p (const struct loop *loop, rtx x) return 0; /* Out-of-range regs can occur when we are called from unrolling. - These have always been created by the unroller and are set in - the loop, hence are never invariant. */ + These registers created by the unroller are set in the loop, + hence are never invariant. + Other out-of-range regs can be generated by load_mems; those that + are written to in the loop are not invariant, while those that are + not written to are invariant. It would be easy for load_mems + to set n_times_set correctly for these registers, however, there + is no easy way to distinguish them from registers created by the + unroller. */ if (REGNO (x) >= (unsigned) regs->num) return 0; @@ -5647,7 +5687,7 @@ record_biv (struct loop *loop, struct induction *v, rtx insn, rtx dest_reg, /* Set initial value to the reg itself. */ bl->initial_value = dest_reg; bl->final_value = 0; - /* We haven't seen the initializing insn yet */ + /* We haven't seen the initializing insn yet. */ bl->init_insn = 0; bl->init_set = 0; bl->initial_test = 0; @@ -6095,6 +6135,10 @@ update_giv_derive (const struct loop *loop, rtx p) if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN || biv->insn == p) { + /* Skip if location is the same as a previous one. */ + if (biv->same) + continue; + for (giv = bl->giv; giv; giv = giv->next_iv) { /* If cant_derive is already true, there is no point in @@ -6223,7 +6267,7 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode, /* convert_modes can emit new instructions, e.g. when arg is a loop invariant MEM and dest_reg has a different mode. These instructions would be emitted after the end of the function - and then *inc_val would be an unitialized pseudo. + and then *inc_val would be an uninitialized pseudo. Detect this and bail in this case. Other alternatives to solve this can be introducing a convert_modes variant which is allowed to fail but not allowed to emit new @@ -7196,6 +7240,9 @@ express_from (struct induction *g1, struct induction *g2) && GET_CODE (g2->mult_val) == CONST_INT) { if (g1->mult_val == const0_rtx + || (g1->mult_val == constm1_rtx + && INTVAL (g2->mult_val) + == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)) || INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0) return NULL_RTX; mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val)); @@ -8017,6 +8064,22 @@ check_dbra_loop (struct loop *loop, int insn_count) break; } + /* Try swapping the comparison to identify a suitable biv. */ + if (!bl) + for (bl = ivs->list; bl; bl = bl->next) + if (bl->biv_count == 1 + && ! bl->biv->maybe_multiple + && bl->biv->dest_reg == XEXP (comparison, 1) + && ! reg_used_between_p (regno_reg_rtx[bl->regno], bl->biv->insn, + first_compare)) + { + comparison = gen_rtx_fmt_ee (swap_condition (GET_CODE (comparison)), + VOIDmode, + XEXP (comparison, 1), + XEXP (comparison, 0)); + break; + } + if (! bl) return 0; @@ -10678,18 +10741,18 @@ loop_dump_aux (const struct loop *loop, FILE *file, /* Print diagnostics to compare our concept of a loop with what the loop notes say. */ - if (! PREV_INSN (loop->first->head) - || GET_CODE (PREV_INSN (loop->first->head)) != NOTE - || NOTE_LINE_NUMBER (PREV_INSN (loop->first->head)) + if (! PREV_INSN (BB_HEAD (loop->first)) + || GET_CODE (PREV_INSN (BB_HEAD (loop->first))) != NOTE + || NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (loop->first))) != NOTE_INSN_LOOP_BEG) fprintf (file, ";; No NOTE_INSN_LOOP_BEG at %d\n", - INSN_UID (PREV_INSN (loop->first->head))); - if (! NEXT_INSN (loop->last->end) - || GET_CODE (NEXT_INSN (loop->last->end)) != NOTE - || NOTE_LINE_NUMBER (NEXT_INSN (loop->last->end)) + INSN_UID (PREV_INSN (BB_HEAD (loop->first)))); + if (! NEXT_INSN (BB_END (loop->last)) + || GET_CODE (NEXT_INSN (BB_END (loop->last))) != NOTE + || NOTE_LINE_NUMBER (NEXT_INSN (BB_END (loop->last))) != NOTE_INSN_LOOP_END) fprintf (file, ";; No NOTE_INSN_LOOP_END at %d\n", - INSN_UID (NEXT_INSN (loop->last->end))); + INSN_UID (NEXT_INSN (BB_END (loop->last)))); if (loop->start) { diff --git a/gcc/machmode.def b/gcc/machmode.def index 0b762497d00..0b6c6771dba 100644 --- a/gcc/machmode.def +++ b/gcc/machmode.def @@ -47,7 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA A MODE argument must be the printable name of a machine mode, without quotation marks or trailing "mode". For instance, SI. - A BITSIZE, BYTESIZE, or COUNT argument must be a positive integer + A PRECISION, BYTESIZE, or COUNT argument must be a positive integer constant. A FORMAT argument must be one of the real_mode_format structures @@ -78,18 +78,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA declares MODE to be of class INT and BYTESIZE bytes wide. All of the bits of its representation are significant. - FRACTIONAL_INT_MODE (MODE, BITSIZE, BYTESIZE); + FRACTIONAL_INT_MODE (MODE, PRECISION, BYTESIZE); declares MODE to be of class INT, BYTESIZE bytes wide in - storage, but with only BITSIZE significant bits. + storage, but with only PRECISION significant bits. FLOAT_MODE (MODE, BYTESIZE, FORMAT); declares MODE to be of class FLOAT and BYTESIZE bytes wide, using floating point format FORMAT. All of the bits of its representation are significant. - FRACTIONAL_FLOAT_MODE (MODE, BITSIZE, BYTESIZE, FORMAT); + FRACTIONAL_FLOAT_MODE (MODE, PRECISION, BYTESIZE, FORMAT); declares MODE to be of class FLOAT, BYTESIZE bytes wide in - storage, but with only BITSIZE significant bits, using + storage, but with only PRECISION significant bits, using floating point format FORMAT. RESET_FLOAT_FORMAT (MODE, FORMAT); @@ -101,7 +101,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA declares a mode of class PARTIAL_INT with the same size as MODE (which must be an INT mode). The name of the new mode is made by prefixing a P to the name MODE. This statement - may grow a BITSIZE argument in the future. + may grow a PRECISION argument in the future. VECTOR_MODE (CLASS, MODE, COUNT); Declare a vector mode whose component mode is MODE (of class diff --git a/gcc/machmode.h b/gcc/machmode.h index 16f979818c3..c978c0a9b52 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -76,15 +76,15 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES]; #define SCALAR_FLOAT_MODE_P(MODE) \ (GET_MODE_CLASS (MODE) == MODE_FLOAT) -/* Get the size in bytes of an object of mode MODE. */ +/* Get the size in bytes and bits of an object of mode MODE. */ extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES]; -#define GET_MODE_SIZE(MODE) mode_size[MODE] +#define GET_MODE_SIZE(MODE) ((unsigned short) mode_size[MODE]) +#define GET_MODE_BITSIZE(MODE) ((unsigned short) (GET_MODE_SIZE (MODE) * BITS_PER_UNIT)) -/* Get the size in bits of an object of mode MODE. */ - -extern const unsigned short mode_bitsize[NUM_MACHINE_MODES]; -#define GET_MODE_BITSIZE(MODE) mode_bitsize[MODE] +/* Get the number of value bits of an object of mode MODE. */ +extern const unsigned short mode_precision[NUM_MACHINE_MODES]; +#define GET_MODE_PRECISION(MODE) mode_precision[MODE] /* Get a bitmask containing 1 for all bits in a word that fit within mode MODE. */ diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in index 28ea8532fa7..72c6c226986 100644 --- a/gcc/mklibgcc.in +++ b/gcc/mklibgcc.in @@ -388,6 +388,7 @@ EOF fi shlib_so_name="$shlib_base_name" shlib_dir= + shlib_slibdir_qual= if [ -n "$MULTILIB_OSDIRNAMES" ]; then if [ "$dir" != . ]; then gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory` @@ -397,8 +398,12 @@ EOF os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"` if [ -z "$os_multilib_base" ]; then shlib_so_name=libgcc_s + if [ "$os_multilib_dir" != "." ]; then + shlib_slibdir_qual="/$os_multilib_dir" + fi else shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g` + shlib_slibdir_qual="/$os_multilib_base" fi fi fi @@ -411,7 +416,8 @@ EOF -e "s%@shlib_base_name@%$shlib_base_name%g" \ -e "s%@shlib_map_file@%$mapfile%g" \ -e "s%@shlib_so_name@%$shlib_so_name%g" \ - -e "s%@shlib_dir@%$shlib_dir%g" + -e "s%@shlib_dir@%$shlib_dir%g" \ + -e "s%@shlib_slibdir_qual@%%g" elif [ "$SHLIB_MULTILIB" = "$dir" ]; then shlib_base_name="libgcc_s"; echo "" @@ -423,7 +429,8 @@ EOF -e "s%@shlib_base_name@%$shlib_base_name%g" \ -e "s%@shlib_map_file@%$mapfile%g" \ -e "s%@shlib_so_name@%$shlib_base_name%g" \ - -e "s%@shlib_dir@%%g" + -e "s%@shlib_dir@%%g" \ + -e "s%@shlib_slibdir_qual@%%g" fi fi done diff --git a/gcc/objc/.cvsignore b/gcc/objc/.cvsignore deleted file mode 100644 index 040661a9677..00000000000 --- a/gcc/objc/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -objc-parse.y -objc-parse.c diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in index cdacd4e79a4..fe92a50cf03 100644 --- a/gcc/objc/Make-lang.in +++ b/gcc/objc/Make-lang.in @@ -25,7 +25,7 @@ # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-normal, foo.install-common, foo.install-man, # foo.uninstall, -# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. @@ -104,7 +104,10 @@ objc.start.encap: objc.rest.encap: objc.tags: force - cd $(srcdir)/objc; etags *.y *.c *.h + cd $(srcdir)/objc; etags -o TAGS.sub *.y *.c *.h; \ + etags --include TAGS.sub --include ../TAGS.sub + +lang_checks += check-objc # # Install hooks: @@ -131,7 +134,6 @@ objc.distclean: -rm -f objc/Makefile objc/Make-host objc/Make-target -rm -f objc/config.status objc/config.cache -rm -f objc-parse.output -objc.extraclean: objc.maintainer-clean: -rm -f $(parsedir)/objc/objc-parse.y -rm -f $(parsedir)/objc/objc-parse.c $(parsedir)/objc/objc-parse.output diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index ad2b69a9f56..c552bada9de 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -5654,7 +5654,7 @@ build_message_expr (tree mess) /* Look up method SEL_NAME that would be suitable for receiver of type 'id' (if IS_CLASS is zero) or 'Class' (if IS_CLASS is - non-zero), and report on any duplicates. */ + nonzero), and report on any duplicates. */ static tree lookup_method_in_hash_lists (tree sel_name, int is_class) diff --git a/gcc/optabs.c b/gcc/optabs.c index 1410ed2d209..3a5705f9334 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -5371,7 +5371,7 @@ init_optabs (void) abs_optab->handlers[TYPE_MODE (complex_double_type_node)].libfunc = init_one_libfunc ("cabs"); - /* The ffs function op[1erates on `int'. */ + /* The ffs function operates on `int'. */ ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc = init_one_libfunc ("ffs"); diff --git a/gcc/opts.c b/gcc/opts.c index dafd37104b4..e0583691e13 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -148,6 +148,13 @@ static unsigned int columns = 80; /* What to print when a switch has no documentation. */ static const char undocumented_msg[] = N_("This switch lacks documentation"); +/* Used for bookkeeping on whether user set these flags so + -fprofile-use/-fprofile-generate does not use them. */ +static bool profile_arc_flag_set, flag_profile_values_set; +static bool flag_unroll_loops_set, flag_tracer_set; +static bool flag_value_profile_transformations_set; +static bool flag_peel_loops_set, flag_branch_probabilities_set; + /* Input file names. */ const char **in_fnames; unsigned num_in_fnames; @@ -882,6 +889,7 @@ common_handle_option (size_t scode, const char *arg, break; case OPT_fbranch_probabilities: + flag_branch_probabilities_set = true; flag_branch_probabilities = value; break; @@ -1023,10 +1031,6 @@ common_handle_option (size_t scode, const char *arg, flag_gcse_las = value; break; - case OPT_fgnu_linker: - flag_gnu_linker = value; - break; - case OPT_fguess_branch_probability: flag_guess_branch_prob = value; break; @@ -1057,7 +1061,6 @@ common_handle_option (size_t scode, const char *arg, case OPT_finline_limit_: case OPT_finline_limit_eq: - set_param_value ("max-inline-insns", value); set_param_value ("max-inline-insns-single", value / 2); set_param_value ("max-inline-insns-auto", value / 2); set_param_value ("max-inline-insns-rtl", value); @@ -1140,6 +1143,7 @@ common_handle_option (size_t scode, const char *arg, break; case OPT_fpeel_loops: + flag_peel_loops_set = true; flag_peel_loops = value; break; @@ -1172,14 +1176,41 @@ common_handle_option (size_t scode, const char *arg, break; case OPT_fprofile_arcs: + profile_arc_flag_set = true; profile_arc_flag = value; break; + case OPT_fprofile_use: + if (!flag_branch_probabilities_set) + flag_branch_probabilities = value; + if (!flag_profile_values_set) + flag_profile_values = value; + if (!flag_unroll_loops_set) + flag_unroll_loops = value; + if (!flag_peel_loops_set) + flag_peel_loops = value; + if (!flag_tracer_set) + flag_tracer = value; + if (!flag_value_profile_transformations_set) + flag_value_profile_transformations = value; + break; + + case OPT_fprofile_generate: + if (!profile_arc_flag_set) + profile_arc_flag = value; + if (!flag_profile_values_set) + flag_profile_values = value; + if (!flag_value_profile_transformations_set) + flag_value_profile_transformations = value; + break; + case OPT_fprofile_values: + flag_profile_values_set = true; flag_profile_values = value; break; case OPT_fvpt: + flag_value_profile_transformations_set = value; flag_value_profile_transformations = value; break; @@ -1300,18 +1331,6 @@ common_handle_option (size_t scode, const char *arg, flag_single_precision_constant = value; break; - case OPT_fssa: - flag_ssa = value; - break; - - case OPT_fssa_ccp: - flag_ssa_ccp = value; - break; - - case OPT_fssa_dce: - flag_ssa_dce = value; - break; - case OPT_fstack_check: flag_stack_check = value; break; @@ -1375,6 +1394,7 @@ common_handle_option (size_t scode, const char *arg, break; case OPT_ftracer: + flag_tracer_set = true; flag_tracer = value; break; @@ -1395,6 +1415,7 @@ common_handle_option (size_t scode, const char *arg, break; case OPT_funroll_loops: + flag_unroll_loops_set = true; flag_unroll_loops = value; break; @@ -1438,19 +1459,6 @@ common_handle_option (size_t scode, const char *arg, set_debug_level (SDB_DEBUG, false, arg); break; - case OPT_gdwarf: - if (*arg) - { - error ("use -gdwarf -gN for DWARF v1 level N, " - "and -gdwarf-2 for DWARF v2" ); - break; - } - - /* Fall through. */ - case OPT_gdwarf_: - set_debug_level (DWARF_DEBUG, code == OPT_gdwarf_, arg); - break; - case OPT_gdwarf_2: set_debug_level (DWARF2_DEBUG, false, arg); break; @@ -1846,7 +1854,7 @@ wrap_help (const char *help, const char *item, unsigned int item_width) len = i; else if ((help[i] == '-' || help[i] == '/') && help[i + 1] != ' ' - && ISALPHA (help[i - 1])) + && i > 0 && ISALPHA (help[i - 1])) len = i + 1; } } diff --git a/gcc/params.def b/gcc/params.def index b08603b1f29..d665ad57ba4 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -39,7 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA of a function counted in internal gcc instructions (not in real machine instructions) that is eligible for inlining by the tree inliner. - The default value is 100. + The default value is 500. Only functions marked inline (or methods defined in the class definition for C++) are affected by this, unless you set the -finline-functions (included in -O3) compiler option. @@ -59,31 +59,12 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE, that is applied to functions marked inlined (or defined in the class declaration in C++) given by the "max-inline-insns-single" parameter. - The default value is 100. */ + The default value is 150. */ DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO, "max-inline-insns-auto", "The maximum number of instructions when automatically inlining", 150) -/* The repeated inlining limit. After this number of instructions - (in the internal gcc representation, not real machine instructions) - got inlined by repeated inlining, gcc starts to decrease the maximum - number of inlinable instructions in the tree inliner. - This is done by a linear function, see "max-inline-slope" parameter. - It is necessary in order to limit the compile-time resources, that - could otherwise become very high. - It is recommended to set this value to twice the value of the single - function limit (set by the "max-inline-insns-single" parameter) or - higher. The default value is 200. - Higher values mean that more inlining is done, resulting in - better performance of the code, at the expense of higher - compile-time resource (time, memory) requirements and larger - binaries. */ -DEFPARAM (PARAM_MAX_INLINE_INSNS, - "max-inline-insns", - "The maximum number of instructions by repeated inlining before gcc starts to throttle inlining", - 200) - /* For languages that (still) use the RTL inliner, we can specify limits for the RTL inliner separately. The parameter here defines the maximum number of RTL instructions diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 3989883e4e0..2c5543ee9f6 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,16 @@ +2003-12-19 Joseph S. Myers + + * de.po: Update. + +2003-11-26 Joseph S. Myers + + * de.po: Update. + +2003-11-20 Joseph S. Myers + + * exgettext: Use --copyright-holder and --msgid-bugs-address. + * gcc.pot: Regenerate. + 2003-10-26 Joseph S. Myers * nl.po: Update. diff --git a/gcc/po/de.po b/gcc/po/de.po index a2eea254424..31dd8b570e9 100644 --- a/gcc/po/de.po +++ b/gcc/po/de.po @@ -1,16 +1,15 @@ # German translation of gcc messages. # Copyright © 2002, 2003 Free Software Foundation, Inc. # Karl Eichwalder , 2002, 2003. +# Roland Stigge , 2003. # This file is distributed under the same license as the gcc package. # -# Wer möchte an dieser Ãœbersetzung arbeiten? Bitte bei de@li.org melden! -# msgid "" msgstr "" -"Project-Id-Version: gcc 3.3-b20021230\n" +"Project-Id-Version: gcc 3.3.2\n" "POT-Creation-Date: 2003-10-24 13:20+0200\n" -"PO-Revision-Date: 2003-01-06 20:10+0100\n" -"Last-Translator: Karl Eichwalder \n" +"PO-Revision-Date: 2003-12-15 21:30+0100\n" +"Last-Translator: Roland Stigge \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -29,12 +28,12 @@ msgstr "falsche Anzahl an Argumenten für das Attribut »%s« angegeben" #: attribs.c:210 #, c-format msgid "`%s' attribute does not apply to types" -msgstr "" +msgstr "Attribut »%s« kann nicht auf Typen angewandt werden" #: attribs.c:247 #, c-format msgid "`%s' attribute only applies to function types" -msgstr "" +msgstr "Attribut »%s« kann nur auf Funktionstypen angewandt werden" #: attribs.c:404 c-common.c:5275 c-common.c:5297 c-common.c:5319 #: c-common.c:5350 c-common.c:5372 c-common.c:5397 c-common.c:5423 @@ -51,23 +50,23 @@ msgstr "Attribut »%s« wird ignoriert" #: builtins.c:285 msgid "offset outside bounds of constant string" -msgstr "" +msgstr "Adressabstand ist außerhalb der Grenzen der konstanten Zeichenkette" #: builtins.c:765 msgid "second arg to `__builtin_prefetch' must be a constant" -msgstr "" +msgstr "Zweites Argument für »__builtin_prefetch« muss eine Konstante sein" #: builtins.c:772 msgid "invalid second arg to __builtin_prefetch; using zero" -msgstr "" +msgstr "Ungültiges zweites Argument für »__builtin_prefetch«; benutze Null" #: builtins.c:779 msgid "third arg to `__builtin_prefetch' must be a constant" -msgstr "" +msgstr "Drittes Argument für »__builtin_prefetch« muss eine Konstante sein" #: builtins.c:786 msgid "invalid third arg to __builtin_prefetch; using zero" -msgstr "" +msgstr "Ungültiges drittes Argument für »__builtin_prefetch«; benutze Null" #. ??? We used to try and build up a call to the out of line function, #. guessing about what registers needed saving etc. This became much @@ -78,41 +77,41 @@ msgstr "" #. weird and make the backend absorb the evil. #: builtins.c:2875 msgid "__builtin_saveregs not supported by this target" -msgstr "" +msgstr "__builtin_saveregs wird von diesem Ziel nicht unterstützt" #: builtins.c:2917 msgid "argument of `__builtin_args_info' must be constant" -msgstr "" +msgstr "Argument von »__builtin_args_info« muss konstant sein" #: builtins.c:2923 msgid "argument of `__builtin_args_info' out of range" -msgstr "" +msgstr "Argument von »__builtin_args_info« außerhalb des Wertebereichs" #: builtins.c:2929 msgid "missing argument in `__builtin_args_info'" -msgstr "" +msgstr "Fehlendes Argument in »__builtin_args_info«" #: builtins.c:2960 msgid "`va_start' used in function with fixed args" -msgstr "" +msgstr "»va_start« in Funktion mit fester Parameterzahl verwendet" #: builtins.c:2979 msgid "second parameter of `va_start' not last named argument" -msgstr "" +msgstr "Zweiter Parameter von »va_start« ist nicht letztgenanntes Argument" #. Evidently an out of date version of ; can't validate #. va_start's second argument, but can still work as intended. #: builtins.c:2984 msgid "`__builtin_next_arg' called without an argument" -msgstr "" +msgstr "»__builtin_next_arg« ohne Argument gerufen" #: builtins.c:3070 msgid "too many arguments to function `va_start'" -msgstr "" +msgstr "Zu viele Argumente für »va_start«" #: builtins.c:3172 msgid "first argument to `va_arg' not of type `va_list'" -msgstr "" +msgstr "Erstes Argument für »va_arg« nicht vom Typ »va_list«" #. Unfortunately, this is merely undefined, rather than a constraint #. violation, so we cannot make this an error. If this call is never @@ -120,685 +119,685 @@ msgstr "" #: builtins.c:3204 #, c-format msgid "`%s' is promoted to `%s' when passed through `...'" -msgstr "" +msgstr "»%s« auf »%s« gesetzt beim Durchlaufen von »...«" #: builtins.c:3209 #, c-format msgid "(so you should pass `%s' not `%s' to `va_arg')" -msgstr "" +msgstr "(Sie sollten also »%s« statt »%s« an »va_arg« übergeben)" #: builtins.c:3340 msgid "invalid arg to `__builtin_frame_address'" -msgstr "" +msgstr "Ungültiges Argument für »__builtin_frame_address«" #: builtins.c:3342 msgid "invalid arg to `__builtin_return_address'" -msgstr "" +msgstr "Ungültiges Argument für »__builtin_return_address«" #: builtins.c:3356 msgid "unsupported arg to `__builtin_frame_address'" -msgstr "" +msgstr "Nicht unterstütztes Argument für »__builtin_frame_address«" #: builtins.c:3358 msgid "unsupported arg to `__builtin_return_address'" -msgstr "" +msgstr "Nicht unterstütztes Argument für »__builtin_return_address«" #: builtins.c:3530 msgid "second arg to `__builtin_expect' must be a constant" -msgstr "" +msgstr "Zweites Argument für »__builtin_expect« muss eine Konstante sein" #: builtins.c:4028 msgid "__builtin_longjmp second argument must be 1" -msgstr "" +msgstr "Zweites Argument für __builtin_longjmp muss 1 sein" #. just do library call, if unknown builtin #: builtins.c:4092 c-common.c:4459 #, c-format msgid "built-in function `%s' not currently supported" -msgstr "" +msgstr "Eingebaute Funktion »%s« gegenwärtig nicht unterstützt" #: builtins.c:4165 msgid "target format does not support infinity" -msgstr "" +msgstr "Zielformat unterstützt nicht »unendlich«" #: c-common.c:1168 #, c-format msgid "`%s' is not defined outside of function scope" -msgstr "" +msgstr "»%s« ist außerhalb des Funktionsgültigkeitsbereiches undefiniert" #: c-common.c:1189 #, c-format msgid "string length `%d' is greater than the length `%d' ISO C%d compilers are required to support" -msgstr "" +msgstr "Zeichenkettenlänge »%d« ist größer als die Länge »%d«, die von ISO-C%d-Compilern unterstützt werden muss" #: c-common.c:1247 msgid "concatenation of string literals with __FUNCTION__ is deprecated" -msgstr "" +msgstr "Verkettung von Zeichenkettenliteralen mit __FUNCTION__ ist veraltet" #: c-common.c:1343 msgid "overflow in constant expression" -msgstr "" +msgstr "Ãœberlauf in Konstanten-Ausdruck" #: c-common.c:1364 msgid "integer overflow in expression" -msgstr "" +msgstr "Ganzzahlüberlauf in Ausdruck" #: c-common.c:1373 msgid "floating point overflow in expression" -msgstr "" +msgstr "Fließkommaüberlauf in Ausdruck" #: c-common.c:1379 msgid "vector overflow in expression" -msgstr "" +msgstr "Vektorüberlauf in Ausdruck" #. This detects cases like converting -129 or 256 to unsigned char. #: c-common.c:1402 msgid "large integer implicitly truncated to unsigned type" -msgstr "" +msgstr "Große Ganzzahl implizit auf vorzeichenlosen Typen abgeschnitten" #: c-common.c:1404 msgid "negative integer implicitly converted to unsigned type" -msgstr "" +msgstr "Negative Ganzzahl implizit in vorzeichenlosen Typen konvertiert" #: c-common.c:1452 msgid "overflow in implicit constant conversion" -msgstr "" +msgstr "Ãœberlauf in impliziter Konstantenkonvertierung" #: c-common.c:1600 #, c-format msgid "operation on `%s' may be undefined" -msgstr "" +msgstr "Operation auf »%s« könnte undefiniert sein" #: c-common.c:1891 msgid "expression statement has incomplete type" -msgstr "" +msgstr "Ausdrucksanweisung hat unvollständigen Typ" #: c-common.c:1924 msgid "case label does not reduce to an integer constant" -msgstr "" +msgstr "case-Marke reduziert nicht auf Ganzzahlkonstante" #: c-common.c:2228 msgid "invalid truth-value expression" -msgstr "" +msgstr "Ungültiger Wahrheitswert-Ausdruck" #: c-common.c:2279 #, c-format msgid "invalid operands to binary %s" -msgstr "" +msgstr "Ungültige Operanden für binäres %s" #: c-common.c:2513 msgid "comparison is always false due to limited range of data type" -msgstr "" +msgstr "Vergleich ist durch beschränkten Wertebereich des Datentyps stets »unwahr«" #: c-common.c:2515 msgid "comparison is always true due to limited range of data type" -msgstr "" +msgstr "Vergleich ist durch beschränkten Wertebereich des Datentyps stets »wahr«" #: c-common.c:2585 msgid "comparison of unsigned expression >= 0 is always true" -msgstr "" +msgstr "Vergleich eines vorzeichenlosen Ausdrucks >= 0 ist stets »wahr«" #: c-common.c:2594 msgid "comparison of unsigned expression < 0 is always false" -msgstr "" +msgstr "Vergleich eines vorzeichenlosen Ausdrucks < 0 ist stets »unwahr«" #: c-common.c:2641 msgid "pointer of type `void *' used in arithmetic" -msgstr "" +msgstr "Zeiger auf Typen »void *« in Arithmetik verwendet" #: c-common.c:2647 msgid "pointer to a function used in arithmetic" -msgstr "" +msgstr "Zeiger auf Funktion in Arithmetik verwendet" #: c-common.c:2653 msgid "pointer to member function used in arithmetic" -msgstr "" +msgstr "Zeiger auf member-Funktion in Arithmetik verwendet" #: c-common.c:2659 msgid "pointer to a member used in arithmetic" -msgstr "" +msgstr "Zeiger auf member in Arithmetik verwendet" #: c-common.c:2746 f/com.c:14762 msgid "struct type value used where scalar is required" -msgstr "" +msgstr "Wert eines struct-Typs anstelle des geforderten Skalars verwendet" #: c-common.c:2750 f/com.c:14766 msgid "union type value used where scalar is required" -msgstr "" +msgstr "Wert eines union-Typs anstelle des geforderten Skalars verwendet" #: c-common.c:2754 f/com.c:14770 msgid "array type value used where scalar is required" -msgstr "" +msgstr "Wert eines array-Typs anstelle des geforderten Skalars verwendet" #: c-common.c:2874 f/com.c:14903 msgid "suggest parentheses around assignment used as truth value" -msgstr "" +msgstr "Schlage Klammern um Zuweisung, die als Wahrheitswert verwendet wird, vor" #: c-common.c:2918 c-common.c:2950 msgid "invalid use of `restrict'" -msgstr "" +msgstr "Ungültige Verwendung von »restrict«" #: c-common.c:3064 msgid "invalid application of `sizeof' to a function type" -msgstr "" +msgstr "Ungültige Anwendung von »sizeof« auf einen Funktionstypen" #: c-common.c:3074 #, c-format msgid "invalid application of `%s' to a void type" -msgstr "" +msgstr "Ungültige Anwendung von »%s« auf einen void-Typen" #: c-common.c:3080 #, c-format msgid "invalid application of `%s' to an incomplete type" -msgstr "" +msgstr "Ungültige Anwendung von »%s« auf einen unvollständigen Typen" #: c-common.c:3121 msgid "`__alignof' applied to a bit-field" -msgstr "" +msgstr "»__alignof« auf Bitfeld angewandt" #: c-common.c:3618 #, c-format msgid "cannot disable built-in function `%s'" -msgstr "" +msgstr "Kann eingebaute Funktion »%s« nicht abschalten" #: c-common.c:3787 c-typeck.c:1748 #, c-format msgid "too few arguments to function `%s'" -msgstr "" +msgstr "Zu wenig Argumente für Funktion »%s«" #: c-common.c:3793 c-typeck.c:1601 #, c-format msgid "too many arguments to function `%s'" -msgstr "" +msgstr "Zu viele Argumente für Funktion »%s«" #: c-common.c:3812 #, c-format msgid "non-floating-point argument to function `%s'" -msgstr "" +msgstr "Nicht-Fließkomma-Argument für Funktion »%s«" #: c-common.c:4081 msgid "pointers are not permitted as case values" -msgstr "" +msgstr "Zeiger sind nicht als case-Werte zugelassen" #: c-common.c:4087 msgid "ISO C++ forbids range expressions in switch statements" -msgstr "" +msgstr "ISO-C++ verbietet Wertebereichsausdrücke in switch-Anweisungen" #: c-common.c:4089 msgid "ISO C forbids range expressions in switch statements" -msgstr "" +msgstr "ISO-C verbietet Wertebereichsausdrücke in switch-Anweisungen" #: c-common.c:4119 msgid "empty range specified" -msgstr "" +msgstr "Leerer Wertebereich angegeben" #: c-common.c:4170 msgid "duplicate (or overlapping) case value" -msgstr "" +msgstr "Doppelte (oder sich überschneidende) case-Werte" #: c-common.c:4172 msgid "this is the first entry overlapping that value" -msgstr "" +msgstr "Dies ist der erste Eintrag, der diesen Wert überschneidet" #: c-common.c:4176 msgid "duplicate case value" -msgstr "" +msgstr "Doppelter case-Wert" #: c-common.c:4177 msgid "previously used here" -msgstr "" +msgstr "bereits hier verwendet" #: c-common.c:4181 msgid "multiple default labels in one switch" -msgstr "" +msgstr "Mehrere Standardmarken in einem »switch«" #: c-common.c:4182 msgid "this is the first default label" -msgstr "" +msgstr "Dies ist die erste Standardmarke" #: c-common.c:4210 msgid "ISO C++ forbids taking the address of a label" -msgstr "" +msgstr "ISO-C++ verbietet die Adresse einer Marke" #: c-common.c:4212 msgid "ISO C forbids taking the address of a label" -msgstr "" +msgstr "ISO-C verbietet die Adresse einer Marke" #: c-common.c:5235 #, c-format msgid "declaration of `%s' shadows %s" -msgstr "" +msgstr "Deklaration von »%s« verdeckt %s" #: c-common.c:5654 #, c-format msgid "unknown machine mode `%s'" -msgstr "" +msgstr "Unbekannter Maschinenzustand »%s«" #: c-common.c:5657 #, c-format msgid "no data type for mode `%s'" -msgstr "" +msgstr "Kein Datentyp für Zustand »%s«" #: c-common.c:5666 c-common.c:6316 #, c-format msgid "unable to emulate '%s'" -msgstr "" +msgstr "»%s« kann nicht emuliert werden" #: c-common.c:5702 msgid "section attribute cannot be specified for local variables" -msgstr "" +msgstr "Abschnitts-Attribut kann nicht für lokale Variablen angegeben werden" #: c-common.c:5713 #, c-format msgid "section of `%s' conflicts with previous declaration" -msgstr "" +msgstr "Abschnitt von »%s« in Konflikt mit vorheriger Deklaration" #: c-common.c:5722 #, c-format msgid "section attribute not allowed for `%s'" -msgstr "" +msgstr "Abschnitts-Attribute nicht erlaubt für »%s«" #: c-common.c:5729 msgid "section attributes are not supported for this target" -msgstr "" +msgstr "Abschnitts-Attribute werden für dieses Ziel nicht unterstützt" #: c-common.c:5771 msgid "requested alignment is not a constant" -msgstr "" +msgstr "Verlangte Ausrichtung ist keine Konstante" #: c-common.c:5776 msgid "requested alignment is not a power of 2" -msgstr "" +msgstr "Verlangte Ausrichtung ist keine Zweierpotenz" #: c-common.c:5781 msgid "requested alignment is too large" -msgstr "" +msgstr "Verlangte Ausrichtung ist zu groß" #: c-common.c:5808 #, c-format msgid "alignment may not be specified for `%s'" -msgstr "" +msgstr "Für »%s« darf keine Ausrichtung angegeben werden" #: c-common.c:5853 #, c-format msgid "`%s' defined both normally and as an alias" -msgstr "" +msgstr "»%s« sowohl normal als auch als Alias definiert" #: c-common.c:5863 msgid "alias arg not a string" -msgstr "" +msgstr "Alias-Argument ist keine Zeichenkette" #: c-common.c:5910 msgid "visibility arg not a string" -msgstr "" +msgstr "Sichtbarkeitsargument ist keine Zeichenkette" #: c-common.c:5919 msgid "visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"" -msgstr "" +msgstr "Sichtbarkeitsargument muss »default«, »hidden«, »protected« oder »internal« sein" #: c-common.c:5953 msgid "tls_model arg not a string" -msgstr "" +msgstr "Argument für tls_model ist keine Zeichenkette" #: c-common.c:5962 msgid "tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"" -msgstr "" +msgstr "Argument für tls_model muss »local-exec«, »initial-exec«, »local-dynamic« oder »global-dynamic« sein" #: c-common.c:5987 c-common.c:6043 #, c-format msgid "`%s' attribute applies only to functions" -msgstr "" +msgstr "Attribut »%s« kann nur auf Funktionen angewandt werden" #: c-common.c:5994 c-common.c:6050 #, c-format msgid "can't set `%s' attribute after definition" -msgstr "" +msgstr "Kann Attribut »%s« nicht nach der Definition setzen" #: c-common.c:6114 msgid "cleanup arg not an identifier" -msgstr "" +msgstr "Argument für cleanup ist kein Bezeichner" #: c-common.c:6121 msgid "cleanup arg not a function" -msgstr "" +msgstr "Argument für cleanup ist keine Funktion" #: c-common.c:6183 #, c-format msgid "`%s' attribute ignored for `%s'" -msgstr "" +msgstr "Attribut »%s« ignoriert für »%s«" #: c-common.c:6248 #, c-format msgid "invalid vector type for attribute `%s'" -msgstr "" +msgstr "Ungültiger Vektortyp für Attribut »%s«" #: c-common.c:6272 c-common.c:6304 msgid "no vector mode with the size and type specified could be found" -msgstr "" +msgstr "Vektorzustand mit der angegebenen Größe und dem angegebenen Typ konnte nicht gefunden werden" #: c-common.c:6403 msgid "nonnull attribute without arguments on a non-prototype" -msgstr "" +msgstr "Nicht-Null-Attribut ohne Argumente für einen Nicht-Prototyp" #: c-common.c:6418 #, c-format msgid "nonnull argument has invalid operand number (arg %lu)" -msgstr "" +msgstr "Nicht-Null-Argument hat ungültige Operandenzahl (Argument %lu)" #: c-common.c:6437 #, c-format msgid "nonnull argument with out-of-range operand number (arg %lu, operand %lu)" -msgstr "" +msgstr "Nicht-Null-Argument mit Operandenzahl außerhalb des Wertebereiches (Argument %lu, Operand %lu)" #: c-common.c:6445 #, c-format msgid "nonnull argument references non-pointer operand (arg %lu, operand %lu)" -msgstr "" +msgstr "Nicht-Null-Argument referenziert Nicht-Zeiger-Operanden (Argument %lu, Operand %lu)" #: c-common.c:6531 #, c-format msgid "null argument where non-null required (arg %lu)" -msgstr "" +msgstr "Null-Argument, wo Nicht-Null erwartet (Argument %lu)" #: c-convert.c:80 c-typeck.c:988 c-typeck.c:4059 cp/typeck.c:1615 #: cp/typeck.c:5939 msgid "void value not ignored as it ought to be" -msgstr "" +msgstr "void-Wert nicht ignoriert wie es sein sollte" #: c-convert.c:112 java/typeck.c:150 msgid "conversion to non-scalar type requested" -msgstr "" +msgstr "Konvertierung zu Nicht-Skalar-Typ verlangt" #: c-decl.c:340 #, c-format msgid "array `%s' assumed to have one element" -msgstr "" +msgstr "Feld »%s« als einelementig betrachtet" #: c-decl.c:526 #, c-format msgid "`struct %s' incomplete in scope ending here" -msgstr "" +msgstr "»struct %s« im Gültigkeitsbereich, der hier endet, unvollständig" #: c-decl.c:529 #, c-format msgid "`union %s' incomplete in scope ending here" -msgstr "" +msgstr "»union %s« im Gültigkeitsbereich, der hier endet, unvollständig" #: c-decl.c:532 #, c-format msgid "`enum %s' incomplete in scope ending here" -msgstr "" +msgstr "»enum %s« im Gültigkeitsbereich, der hier endet, unvollständig" #: c-decl.c:646 c-decl.c:771 java/decl.c:1403 #, c-format msgid "label `%s' used but not defined" -msgstr "" +msgstr "Marke »%s« verwendet, aber nicht definiert" #: c-decl.c:652 c-decl.c:778 java/decl.c:1409 #, c-format msgid "label `%s' defined but not used" -msgstr "" +msgstr "Marke »%s« definiert aber nicht verwendet" #: c-decl.c:893 cp/decl.c:3335 #, c-format msgid "function `%s' redeclared as inline" -msgstr "" +msgstr "Funktion »%s« als inline redeklariert" #: c-decl.c:895 cp/decl.c:3337 #, c-format msgid "previous declaration of function `%s' with attribute noinline" -msgstr "" +msgstr "Vorherige Deklaration der Funktion »%s« mit Attribut noinline" #: c-decl.c:902 cp/decl.c:3344 #, c-format msgid "function `%s' redeclared with attribute noinline" -msgstr "" +msgstr "Funktion »%s« redeklariert mit Attribut noinline" #: c-decl.c:904 cp/decl.c:3346 #, c-format msgid "previous declaration of function `%s' was inline" -msgstr "" +msgstr "Vorherige Deklaration der Funktion »%s« war inline" #: c-decl.c:933 c-decl.c:979 #, c-format msgid "shadowing built-in function `%s'" -msgstr "" +msgstr "Eingebaute Funktion »%s« überdeckt" #: c-decl.c:935 #, c-format msgid "shadowing library function `%s'" -msgstr "" +msgstr "Bibliotheksfunktion »%s« überdeckt" #: c-decl.c:941 #, c-format msgid "library function `%s' declared as non-function" -msgstr "" +msgstr "Bibliotheksfunktion »%s« als Nicht-Funktion deklariert" #: c-decl.c:945 c-decl.c:948 #, c-format msgid "built-in function `%s' declared as non-function" -msgstr "" +msgstr "Eingebaute Funktion »%s« als Nicht-Funktion deklariert" #: c-decl.c:952 objc/objc-act.c:2384 objc/objc-act.c:6154 #, c-format msgid "`%s' redeclared as different kind of symbol" -msgstr "" +msgstr "»%s« redeklariert als andere Symbolart" #: c-decl.c:953 c-decl.c:1144 c-decl.c:1158 c-decl.c:1165 c-decl.c:1310 #: objc/objc-act.c:2386 objc/objc-act.c:6156 objc/objc-act.c:6211 #, c-format msgid "previous declaration of `%s'" -msgstr "" +msgstr "Vorherige Deklaration von »%s«" #. If types don't match for a built-in, throw away the built-in. #: c-decl.c:1048 #, c-format msgid "conflicting types for built-in function `%s'" -msgstr "" +msgstr "In Konflikt stehende Typen für eingebaute Funktion »%s«" #: c-decl.c:1091 c-decl.c:1110 #, c-format msgid "conflicting types for `%s'" -msgstr "" +msgstr "In Konflikt stehende Typen für »%s«" #: c-decl.c:1133 msgid "a parameter list with an ellipsis can't match an empty parameter name list declaration" -msgstr "" +msgstr "Eine Parameterliste mit Auslassung passt nicht zu einer leeren Parameternamenslistendeklaration" #: c-decl.c:1139 msgid "an argument type that has a default promotion can't match an empty parameter name list declaration" -msgstr "" +msgstr "Ein Argumenttyp mit Standard-promotion passt nicht zu leerer Parameternamenslistendeklaration" #: c-decl.c:1157 #, c-format msgid "thread-local declaration of `%s' follows non thread-local declaration" -msgstr "" +msgstr "Thread-lokale Deklaration von »%s« folgt nicht-Thread-lokaler Deklaration" #: c-decl.c:1164 #, c-format msgid "non thread-local declaration of `%s' follows thread-local declaration" -msgstr "" +msgstr "Nicht-Thread-lokale Deklaration von »%s« folgt Thread-lokaler Deklaration" #: c-decl.c:1175 c-decl.c:1198 #, c-format msgid "redefinition of `%s'" -msgstr "" +msgstr "Redefinition von »%s«" #: c-decl.c:1178 #, c-format msgid "redeclaration of `%s'" -msgstr "" +msgstr "Redeklaration von »%s«" #: c-decl.c:1181 #, c-format msgid "conflicting declarations of `%s'" -msgstr "" +msgstr "In Konflikt stehende Deklarationen von »%s«" #: c-decl.c:1225 #, c-format msgid "prototype for `%s' follows" -msgstr "" +msgstr "Prototyp für »%s« folgt" #: c-decl.c:1226 c-decl.c:1234 c-decl.c:1245 msgid "non-prototype definition here" -msgstr "" +msgstr "Nicht-Prototyp-Definition hier" #: c-decl.c:1233 #, c-format msgid "prototype for `%s' follows and number of arguments doesn't match" -msgstr "" +msgstr "Prototyp für »%s« folgt und Anzahl der Argumente passt nicht" #: c-decl.c:1243 #, c-format msgid "prototype for `%s' follows and argument %d doesn't match" -msgstr "" +msgstr "Prototyp für »%s« folgt und Argument %d passt nicht" #: c-decl.c:1261 #, c-format msgid "`%s' declared inline after being called" -msgstr "" +msgstr "»%s« als inline deklariert nachdem es aufgerufen wurde" #: c-decl.c:1267 #, c-format msgid "`%s' declared inline after its definition" -msgstr "" +msgstr "»%s« nach der Definition als inline deklariert" #: c-decl.c:1274 #, c-format msgid "static declaration for `%s' follows non-static" -msgstr "" +msgstr "Statische Deklaration für »%s« folgt Nicht-static" #: c-decl.c:1282 #, c-format msgid "non-static declaration for `%s' follows static" -msgstr "" +msgstr "Nicht-static-Deklaration für »%s« folgt static" #: c-decl.c:1289 #, c-format msgid "const declaration for `%s' follows non-const" -msgstr "" +msgstr "const-Deklaration für »%s« folgt Nicht-const" #: c-decl.c:1296 #, c-format msgid "type qualifiers for `%s' conflict with previous decl" -msgstr "" +msgstr "Typ-Kennzeichner für »%s« stehen in Konflikt mit vorheriger Deklaration" #: c-decl.c:1309 #, c-format msgid "redundant redeclaration of `%s' in same scope" -msgstr "" +msgstr "Redundante Redeklaration von »%s« im selben Gültigkeitsbereich" #: c-decl.c:1619 java/decl.c:1102 #, c-format msgid "declaration of `%s' shadows a parameter" -msgstr "" +msgstr "Deklaration von »%s« überdeckt einen Parameter" #: c-decl.c:1622 java/decl.c:1105 #, c-format msgid "declaration of `%s' shadows a symbol from the parameter list" -msgstr "" +msgstr "Deklaration von »%s« überdeckt ein Symbol aus der Parameterliste" #: c-decl.c:1643 cp/decl.c:4479 msgid "a parameter" -msgstr "" +msgstr "Ein Parameter" #: c-decl.c:1645 cp/decl.c:4496 msgid "a previous local" -msgstr "" +msgstr "Ein vorheriges »local«" #. XXX shadow warnings in outer-more namespaces #: c-decl.c:1649 cp/decl.c:4500 msgid "a global declaration" -msgstr "" +msgstr "Eine globale Deklaration" #: c-decl.c:1693 #, c-format msgid "nested extern declaration of `%s'" -msgstr "" +msgstr "Geschachtelte extern-Deklaration von »%s«" #: c-decl.c:1712 java/decl.c:1055 #, c-format msgid "`%s' used prior to declaration" -msgstr "" +msgstr "»%s« bereits vor Deklaration benutzt" #: c-decl.c:1726 c-decl.c:1901 #, c-format msgid "`%s' was declared implicitly `extern' and later `static'" -msgstr "" +msgstr "»%s« wurde implizit als »extern« und später als »static« deklariert" #: c-decl.c:1829 cp/decl.c:4336 msgid "type mismatch with previous external decl" -msgstr "" +msgstr "Typen passen nicht zu vorheriger externer Deklaration" #: c-decl.c:1830 #, c-format msgid "previous external decl of `%s'" -msgstr "" +msgstr "Vorherige externe Deklaration von »%s«" #: c-decl.c:1843 msgid "type mismatch with previous implicit declaration" -msgstr "" +msgstr "Typen passen nicht zu vorheriger impliziter Deklaration" #: c-decl.c:1845 #, c-format msgid "previous implicit declaration of `%s'" -msgstr "" +msgstr "Vorherige implizite Deklaration von »%s«" #: c-decl.c:1880 #, c-format msgid "`%s' was previously implicitly declared to return `int'" -msgstr "" +msgstr "»%s« wurde bereits implizit deklariert, »int« zurückzugeben" #: c-decl.c:1905 #, c-format msgid "`%s' was declared `extern' and later `static'" -msgstr "" +msgstr "»%s« wurde »extern« deklariert und später »static«" #: c-decl.c:1929 #, c-format msgid "extern declaration of `%s' doesn't match global one" -msgstr "" +msgstr "extern-Deklaration von »%s« passt nicht zu globaler Deklaration" #: c-decl.c:1971 #, c-format msgid "`%s' locally external but globally static" -msgstr "" +msgstr "»%s« ist lokal extern, aber global »static«" #: c-decl.c:2095 #, c-format msgid "function `%s' was previously declared within a block" -msgstr "" +msgstr "Funktion »%s« wurde bereits innerhalb eines Blockes deklariert" #: c-decl.c:2115 c-decl.c:2117 #, c-format msgid "implicit declaration of function `%s'" -msgstr "" +msgstr "Implizite Deklaration der Funktion »%s«" #: c-decl.c:2196 #, c-format msgid "label %s referenced outside of any function" -msgstr "" +msgstr "Marke %s außerhalb einer Funktion referenziert" #: c-decl.c:2253 #, c-format msgid "duplicate label declaration `%s'" -msgstr "" +msgstr "Doppelte Markendeklaration »%s«" #: c-decl.c:2256 msgid "this is a previous declaration" -msgstr "" +msgstr "Dies ist eine vorherige Deklaration" #: c-decl.c:2679 msgid "unnamed struct/union that defines no instances" -msgstr "" +msgstr "Unbenannte struct/union, die keine Instanzen definiert" #: c-decl.c:2698 msgid "useless keyword or type name in empty declaration" -msgstr "" +msgstr "Nutzloses Schlüsselwort oder Typenname in leerer Deklaration" #: c-decl.c:2705 msgid "two types specified in one empty declaration" -msgstr "" +msgstr "Zwei Typen in einer leeren Deklaration angegeben" #: c-decl.c:2710 c-parse.y:753 c-parse.y:755 parse.y:766 parse.y:1853 #: objc-parse.y:799 objc-parse.y:801 objc-parse.y:3042 @@ -807,100 +806,99 @@ msgstr "leere Deklaration" #: c-decl.c:2740 msgid "ISO C90 does not support `static' or type qualifiers in parameter array declarators" -msgstr "" +msgstr "ISO-C90 unterstützt kein »static« oder Typkennzeichner in Parameterfelddeklaratoren" #: c-decl.c:2742 -#, fuzzy msgid "ISO C90 does not support `[*]' array declarators" -msgstr "ISO C89 unterstützt nicht »long long«" +msgstr "ISO-C90 unterstützt nicht »[*]«-Felddeklaratoren" #: c-decl.c:2745 msgid "GCC does not yet properly implement `[*]' array declarators" -msgstr "" +msgstr "GCC implementiert nocht keine richtigen »[*]«-Felddeklaratoren" #: c-decl.c:2764 msgid "static or type qualifiers in abstract declarator" -msgstr "" +msgstr "static oder Typkennzeichner in abstraktem Deklarator" #: c-decl.c:2838 #, c-format msgid "`%s' is usually a function" -msgstr "" +msgstr "»%s« ist üblicherweise eine Funktion" #: c-decl.c:2847 #, c-format msgid "typedef `%s' is initialized (use __typeof__ instead)" -msgstr "" +msgstr "typedef »%s« ist initialisiert (benutzen Sie stattdessen __typeof__)" #: c-decl.c:2853 #, c-format msgid "function `%s' is initialized like a variable" -msgstr "" +msgstr "Funktion »%s« ist wie eine Variable initialisiert" #. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE. #: c-decl.c:2860 #, c-format msgid "parameter `%s' is initialized" -msgstr "" +msgstr "Parameter »%s« ist initialisiert" #: c-decl.c:2880 c-typeck.c:4895 msgid "variable-sized object may not be initialized" -msgstr "" +msgstr "Objekt variabler Größe darf nicht initialisiert werden" #: c-decl.c:2886 #, c-format msgid "variable `%s' has initializer but incomplete type" -msgstr "" +msgstr "Variable »%s« hat Initialisierung aber unvollständigen Typ" #: c-decl.c:2892 #, c-format msgid "elements of array `%s' have incomplete type" -msgstr "" +msgstr "Elemente des Feldes »%s« haben unvollständigen Typ" #: c-decl.c:2905 #, c-format msgid "declaration of `%s' has `extern' and is initialized" -msgstr "" +msgstr "Deklaration von »%s« hat »extern« und ist initialisiert" #: c-decl.c:2954 c-decl.c:5828 cp/decl.c:7760 cp/decl.c:14339 #, c-format msgid "inline function `%s' given attribute noinline" -msgstr "" +msgstr "inline-Funktion »%s« wurde das Attribut »noinline« gegeben" #: c-decl.c:3028 #, c-format msgid "initializer fails to determine size of `%s'" -msgstr "" +msgstr "Initialisierung scheitert an Größenbestimmung von »%s«" #: c-decl.c:3033 #, c-format msgid "array size missing in `%s'" -msgstr "" +msgstr "Feldgröße in »%s« fehlt" #: c-decl.c:3049 #, c-format msgid "zero or negative size array `%s'" -msgstr "" +msgstr "Feldgröße von »%s« ist null oder negativ" #: c-decl.c:3077 #, c-format msgid "storage size of `%s' isn't known" -msgstr "" +msgstr "Speichergröße von »%s« unbekannt" #: c-decl.c:3087 #, c-format msgid "storage size of `%s' isn't constant" -msgstr "" +msgstr "Speichergröße von »%s« unbekannt" #: c-decl.c:3147 #, c-format msgid "ignoring asm-specifier for non-static local variable `%s'" -msgstr "" +msgstr "Ignoriere asm-Symbol für lokale Nicht-static Variable »%s«" #: c-decl.c:3247 #, c-format msgid "ISO C forbids parameter `%s' shadowing typedef" -msgstr "" +msgstr "ISO-C verbietet typedef verdeckenden Parameter »%s«" #: c-decl.c:3592 cp/decl.c:10880 msgid "`long long long' is too long for GCC" @@ -908,1100 +906,1099 @@ msgstr "»long long long« ist für GCC zu lang" #: c-decl.c:3597 msgid "ISO C90 does not support `long long'" -msgstr "ISO C90 unterstützt nicht »long long«" +msgstr "ISO-C90 unterstützt nicht »long long«" #: c-decl.c:3606 c-decl.c:3609 cp/decl.c:10885 #, c-format msgid "duplicate `%s'" -msgstr "" +msgstr "Doppeltes »%s«" #: c-decl.c:3619 cp/decl.c:10892 msgid "`__thread' before `extern'" -msgstr "" +msgstr "»__thread« vor »extern«" #: c-decl.c:3621 cp/decl.c:10894 msgid "`__thread' before `static'" -msgstr "" +msgstr "»__thread« vor »static«" #: c-decl.c:3629 cp/decl.c:10921 #, c-format msgid "two or more data types in declaration of `%s'" -msgstr "" +msgstr "Zwei oder mehr Datentypen in Deklaration von »%s«" #: c-decl.c:3649 cp/decl.c:10926 #, c-format msgid "`%s' fails to be a typedef or built in type" -msgstr "" +msgstr "»%s« ist kein typedef oder eingebauter Typ" #: c-decl.c:3688 #, c-format msgid "type defaults to `int' in declaration of `%s'" -msgstr "" +msgstr "»int« ist Standardtyp in Deklaration von »%s«" #: c-decl.c:3717 #, c-format msgid "both long and short specified for `%s'" -msgstr "" +msgstr "Sowohl »long« als auch »short« für »%s« angegeben" #: c-decl.c:3721 cp/decl.c:11041 #, c-format msgid "long or short specified with char for `%s'" -msgstr "" +msgstr "»long« oder »short« mit »char« für »%s« angegeben" #: c-decl.c:3728 cp/decl.c:11045 #, c-format msgid "long or short specified with floating type for `%s'" -msgstr "" +msgstr "»long« oder »short« mit Fließkommatyp für »%s« angegeben" #: c-decl.c:3731 msgid "the only valid combination is `long double'" -msgstr "" +msgstr "Die einzig gültige Kombination ist »long double«" #: c-decl.c:3737 #, c-format msgid "both signed and unsigned specified for `%s'" -msgstr "" +msgstr "Sowohl »signed« als auch »unsigned« für »%s« angegeben" #: c-decl.c:3739 cp/decl.c:11034 #, c-format msgid "long, short, signed or unsigned invalid for `%s'" -msgstr "" +msgstr "long, short, signed oder unsigned ist ungültig für »%s«" #: c-decl.c:3745 cp/decl.c:11054 #, c-format msgid "long, short, signed or unsigned used invalidly for `%s'" -msgstr "" +msgstr "long, short, signed oder unsigned ungültig verwendet für »%s«" #: c-decl.c:3763 cp/decl.c:11075 #, c-format msgid "complex invalid for `%s'" -msgstr "" +msgstr "complex ungültig für »%s«" #: c-decl.c:3805 msgid "ISO C90 does not support complex types" -msgstr "ISO C90 unterstützt nicht komplexe Typen" +msgstr "ISO-C90 unterstützt nicht komplexe Typen" #: c-decl.c:3817 msgid "ISO C does not support plain `complex' meaning `double complex'" -msgstr "" +msgstr "ISO-C unterstützt nicht »double complex« bedeutendes »complex«" #: c-decl.c:3823 c-decl.c:3835 msgid "ISO C does not support complex integer types" -msgstr "" +msgstr "ISO-C unterstützt keine komplexen Ganzzahltypen" #: c-decl.c:3850 c-decl.c:4316 cp/decl.c:11688 msgid "duplicate `const'" -msgstr "" +msgstr "Doppeltes »const«" #: c-decl.c:3852 c-decl.c:4320 cp/decl.c:11692 msgid "duplicate `restrict'" -msgstr "" +msgstr "Doppeltes »restrict«" #: c-decl.c:3854 c-decl.c:4318 cp/decl.c:11690 msgid "duplicate `volatile'" -msgstr "" +msgstr "Doppeltes »volatile«" #: c-decl.c:3882 cp/decl.c:11238 #, c-format msgid "multiple storage classes in declaration of `%s'" -msgstr "" +msgstr "Mehrere Speicherklassen in Deklaration von »%s«" #: c-decl.c:3892 msgid "function definition declared `auto'" -msgstr "" +msgstr "Funktionsdefinition deklarierte »auto«" #: c-decl.c:3894 msgid "function definition declared `register'" -msgstr "" +msgstr "Funktionsdefinition deklarierte »register«" #: c-decl.c:3896 msgid "function definition declared `typedef'" -msgstr "" +msgstr "Funktionsdefinition deklarierte »typedef«" #: c-decl.c:3898 msgid "function definition declared `__thread'" -msgstr "" +msgstr "Funktionsdefinition deklarierte »__thread«" #: c-decl.c:3911 #, c-format msgid "storage class specified for structure field `%s'" -msgstr "" +msgstr "Speicherklasse für Strukturfeld »%s« angegeben" #: c-decl.c:3915 cp/decl.c:11285 #, c-format msgid "storage class specified for parameter `%s'" -msgstr "" +msgstr "Speicherklasse für Parameter »%s« angegeben" #: c-decl.c:3918 cp/decl.c:11287 msgid "storage class specified for typename" -msgstr "" +msgstr "Speicherklasse für Typnamen angegeben" #: c-decl.c:3930 cp/decl.c:11302 #, c-format msgid "`%s' initialized and declared `extern'" -msgstr "" +msgstr "»%s« initialisiert und als »extern« deklariert" #: c-decl.c:3932 cp/decl.c:11305 #, c-format msgid "`%s' has both `extern' and initializer" -msgstr "" +msgstr "»%s« hat sowohl »extern« als auch Initialisierung" #: c-decl.c:3937 cp/decl.c:11313 #, c-format msgid "top-level declaration of `%s' specifies `auto'" -msgstr "" +msgstr "Deklaration höchster Ebene von »%s« spezifiziert »auto«" #: c-decl.c:3942 cp/decl.c:11309 #, c-format msgid "nested function `%s' declared `extern'" -msgstr "" +msgstr "Geschachtelte Funktion »%s« als »extern« deklariert" #: c-decl.c:3948 cp/decl.c:11319 #, c-format msgid "function-scope `%s' implicitly auto and declared `__thread'" -msgstr "" +msgstr "Funktions-Gültigkeitsbereich »%s« ist implizit auto und deklarierte »__thread«" #. Only the innermost declarator (making a parameter be of #. array type which is converted to pointer type) #. may have static or type qualifiers. #: c-decl.c:3987 c-decl.c:4188 msgid "static or type qualifiers in non-parameter array declarator" -msgstr "" +msgstr "»static« oder Typkennzeichner in Nicht-Parameter-Felddeklarator" #: c-decl.c:4031 #, c-format msgid "declaration of `%s' as array of voids" -msgstr "" +msgstr "Deklaration von »%s« als Feld von voids" #: c-decl.c:4037 #, c-format msgid "declaration of `%s' as array of functions" -msgstr "" +msgstr "Deklaration von »%s« als Feld von Funtionen" #: c-decl.c:4042 c-decl.c:5332 msgid "invalid use of structure with flexible array member" -msgstr "" +msgstr "Ungültige Verwendung einer Struktur mit flexiblem Feld" #: c-decl.c:4061 #, c-format msgid "size of array `%s' has non-integer type" -msgstr "" +msgstr "Feldgröße von »%s« hat Nicht-Ganzzahltyp" #: c-decl.c:4066 #, c-format msgid "ISO C forbids zero-size array `%s'" -msgstr "" +msgstr "ISO-C verbietet Feld »%s« der Größe null" #: c-decl.c:4073 #, c-format msgid "size of array `%s' is negative" -msgstr "" +msgstr "Feldgröße von »%s« ist negativ" #: c-decl.c:4086 #, c-format msgid "ISO C90 forbids array `%s' whose size can't be evaluated" -msgstr "" +msgstr "ISO-C90 verbietet Feld »%s«, dessen Größe nicht ausgewertet werden kann" #: c-decl.c:4089 #, c-format msgid "ISO C90 forbids variable-size array `%s'" -msgstr "" +msgstr "ISO-C90 verbietet Feld »%s« variabler Größe" #: c-decl.c:4119 c-decl.c:4342 cp/decl.c:11897 #, c-format msgid "size of array `%s' is too large" -msgstr "" +msgstr "Feldgröße von »%s« ist zu groß" #: c-decl.c:4145 -#, fuzzy msgid "ISO C90 does not support flexible array members" -msgstr "ISO C90 unterstützt nicht komplexe Typen" +msgstr "ISO-C90 unterstützt keine flexiblen Felder als Mitglied" #: c-decl.c:4155 msgid "array type has incomplete element type" -msgstr "" +msgstr "Feldtyp hat unvollständigen Elementtypen" #: c-decl.c:4162 c-decl.c:4392 msgid "ISO C forbids const or volatile function types" -msgstr "" +msgstr "ISO-C verbietet const oder volatile Funktionstypen" #: c-decl.c:4208 cp/decl.c:11445 #, c-format msgid "`%s' declared as function returning a function" -msgstr "" +msgstr "»%s« als Funktion, die eine Funktion zurückgibt, deklariert" #: c-decl.c:4213 cp/decl.c:11450 #, c-format msgid "`%s' declared as function returning an array" -msgstr "" +msgstr "»%s« als Funktion, die ein Feld zurückgibt, deklariert" #: c-decl.c:4241 msgid "ISO C forbids qualified void function return type" -msgstr "" +msgstr "ISO-C verbietet qualifiziertes void als Funktions-Rückgabetypen" #: c-decl.c:4245 msgid "type qualifiers ignored on function return type" -msgstr "" +msgstr "Typkennzeichner ignoriert an Funktions-Rückgabewert" #: c-decl.c:4274 c-decl.c:4357 c-decl.c:4481 c-decl.c:4573 msgid "ISO C forbids qualified function types" -msgstr "" +msgstr "ISO-C verbietet qualifizierte Funktionstypen" #: c-decl.c:4314 cp/decl.c:11684 msgid "invalid type modifier within pointer declarator" -msgstr "" +msgstr "Ungültiger Typmodifizierer innerhalb Zeigerdeklarator" #: c-decl.c:4412 cp/decl.c:12182 #, c-format msgid "variable or field `%s' declared void" -msgstr "" +msgstr "Variable oder Feld »%s« als »void« deklariert" #: c-decl.c:4445 msgid "attributes in parameter array declarator ignored" -msgstr "" +msgstr "Attribute in Parameterfeld ignoriert" #: c-decl.c:4470 msgid "invalid type modifier within array declarator" -msgstr "" +msgstr "Ungültiger Typmodifizierer in Felddeklarator" #: c-decl.c:4515 #, c-format msgid "field `%s' declared as a function" -msgstr "" +msgstr "Feld »%s« als Funktion deklariert" #: c-decl.c:4521 #, c-format msgid "field `%s' has incomplete type" -msgstr "" +msgstr "Feld »%s« hat unvollständigen Typen" #: c-decl.c:4553 c-decl.c:4555 c-decl.c:4557 c-decl.c:4564 #, c-format msgid "invalid storage class for function `%s'" -msgstr "" +msgstr "Ungültige Speicherklasse für Funktion »%s«" #: c-decl.c:4579 msgid "`noreturn' function returns non-void value" -msgstr "" +msgstr "»noreturn«-Funktion gibt nicht-void-Wert zurück" #: c-decl.c:4594 msgid "cannot inline function `main'" -msgstr "" +msgstr "»main« ist nicht als »inline« möglich" #: c-decl.c:4649 #, c-format msgid "variable `%s' declared `inline'" -msgstr "" +msgstr "Variable »%s« als »inline« deklariert" #. A mere warning is sure to result in improper semantics #. at runtime. Don't bother to allow this to compile. #: c-decl.c:4677 cp/decl.c:9951 msgid "thread-local storage not supported for this target" -msgstr "" +msgstr "Thread-lokaler Speicher wird für dieses Ziel nicht unterstützt" #: c-decl.c:4732 c-decl.c:5880 msgid "function declaration isn't a prototype" -msgstr "" +msgstr "Funktionsdeklaration ist kein Prototyp" #: c-decl.c:4738 msgid "parameter names (without types) in function declaration" -msgstr "" +msgstr "Parameternamen (ohne Typen) in Funktionsdeklaration" #: c-decl.c:4770 c-decl.c:6250 #, c-format msgid "parameter `%s' has incomplete type" -msgstr "" +msgstr "Parameter »%s« hat unvollständigen Typen" #: c-decl.c:4773 msgid "parameter has incomplete type" -msgstr "" +msgstr "Parameter hat unvollständigen Typen" #: c-decl.c:4794 #, c-format msgid "parameter `%s' points to incomplete type" -msgstr "" +msgstr "Parameter »%s« zeigt auf unvollständigen Typen" #: c-decl.c:4797 msgid "parameter points to incomplete type" -msgstr "" +msgstr "Parameter zeigt auf unvollständigen Typen" #: c-decl.c:4862 #, c-format msgid "parameter `%s' has just a forward declaration" -msgstr "" +msgstr "Parameter »%s« hat nur eine Vorwärtsdeklaration" #: c-decl.c:4903 msgid "`void' in parameter list must be the entire list" -msgstr "" +msgstr "»void« in Parameterliste muss die gesamte Liste sein" #: c-decl.c:4934 #, c-format msgid "`struct %s' declared inside parameter list" -msgstr "" +msgstr "»struct %s« innerhalb Parameterliste deklariert" #: c-decl.c:4937 #, c-format msgid "`union %s' declared inside parameter list" -msgstr "" +msgstr "»union %s« innerhalb Parameterliste deklariert" #: c-decl.c:4940 #, c-format msgid "`enum %s' declared inside parameter list" -msgstr "" +msgstr "»enum %s« innerhalb Parameterliste deklariert" #: c-decl.c:4947 msgid "anonymous struct declared inside parameter list" -msgstr "" +msgstr "Anonymes »struct« innerhalb Parameterliste deklariert" #: c-decl.c:4949 msgid "anonymous union declared inside parameter list" -msgstr "" +msgstr "Anonymes »union« innerhalb Parameterliste deklariert" #: c-decl.c:4951 msgid "anonymous enum declared inside parameter list" -msgstr "" +msgstr "Anonymes »enum« innerhalb Parameterliste deklariert" #: c-decl.c:4955 msgid "its scope is only this definition or declaration, which is probably not what you want" -msgstr "" +msgstr "Sein Gültigkeitsbereich umfasst nur diese Definition bzw. Deklaration, was Sie wahrscheinlich nicht wollten" #: c-decl.c:5032 #, c-format msgid "redefinition of `union %s'" -msgstr "" +msgstr "Redefinition von »union %s«" #: c-decl.c:5034 #, c-format msgid "redefinition of `struct %s'" -msgstr "" +msgstr "Redefinition von »struct %s«" #: c-decl.c:5105 cp/decl.c:7532 msgid "declaration does not declare anything" -msgstr "" +msgstr "Deklaration deklariert nichts" #: c-decl.c:5169 c-decl.c:5172 #, c-format msgid "%s defined inside parms" -msgstr "" +msgstr "%s innerhalb Parameter definiert" #: c-decl.c:5170 c-decl.c:5173 c-decl.c:5184 msgid "union" -msgstr "" +msgstr "union" #: c-decl.c:5170 c-decl.c:5173 msgid "structure" -msgstr "" +msgstr "Struktur" #: c-decl.c:5183 #, c-format msgid "%s has no %s" -msgstr "" +msgstr "%s hat kein %s" #: c-decl.c:5184 msgid "struct" -msgstr "" +msgstr "struct" #: c-decl.c:5185 msgid "named members" -msgstr "" +msgstr "benannte Member" #: c-decl.c:5185 msgid "members" -msgstr "" +msgstr "Member" #: c-decl.c:5224 #, c-format msgid "nested redefinition of `%s'" -msgstr "" +msgstr "Verschachtelte Redefinition von »%s«" #: c-decl.c:5237 #, c-format msgid "bit-field `%s' width not an integer constant" -msgstr "" +msgstr "Breite des Bitfeldes »%s« ist keine Ganzzahlkonstante" #: c-decl.c:5248 #, c-format msgid "bit-field `%s' has invalid type" -msgstr "" +msgstr "Bitfeld »%s« hat ungültigen Typen" #: c-decl.c:5260 #, c-format msgid "bit-field `%s' type invalid in ISO C" -msgstr "" +msgstr "Typ des Bitfeldes »%s« ist ungültig in ISO-C" #: c-decl.c:5271 #, c-format msgid "negative width in bit-field `%s'" -msgstr "" +msgstr "Negative Breite in Bitfeld »%s«" #: c-decl.c:5273 #, c-format msgid "width of `%s' exceeds its type" -msgstr "" +msgstr "Breite von »%s« überschreitet dessen Typen" #: c-decl.c:5275 #, c-format msgid "zero width for bit-field `%s'" -msgstr "" +msgstr "Breite null für Bitfeld »%s«" #: c-decl.c:5289 #, c-format msgid "`%s' is narrower than values of its type" -msgstr "" +msgstr "»%s« ist schmaler als die Werte seines Typs" #: c-decl.c:5323 msgid "flexible array member in union" -msgstr "" +msgstr "Flexibler Feld-Member in union" #: c-decl.c:5325 msgid "flexible array member not at end of struct" -msgstr "" +msgstr "Flexibler Feld-Member nicht am Ende von struct" #: c-decl.c:5327 msgid "flexible array member in otherwise empty struct" -msgstr "" +msgstr "Flexibler Feld-Member in ansonsten leerem struct" #: c-decl.c:5357 #, c-format msgid "duplicate member `%s'" -msgstr "" +msgstr "Doppelter Member »%s«" #: c-decl.c:5448 msgid "union cannot be made transparent" -msgstr "" +msgstr "union kann nicht transparent gemacht werden" #. This enum is a named one that has been declared already. #: c-decl.c:5558 #, c-format msgid "redeclaration of `enum %s'" -msgstr "" +msgstr "Redeklaration von »enum %s«" #: c-decl.c:5592 msgid "enum defined inside parms" -msgstr "" +msgstr "enum innerhalb von Parametern definiert" #: c-decl.c:5625 msgid "enumeration values exceed range of largest integer" -msgstr "" +msgstr "Aufzählungswerte überschreiten Wertebereich des größten Ganzzahltypen" #: c-decl.c:5734 #, c-format msgid "enumerator value for `%s' not integer constant" -msgstr "" +msgstr "Aufzählungswert für »%s« ist keine Ganzzahlkonstante" #: c-decl.c:5747 msgid "overflow in enumeration values" -msgstr "" +msgstr "Ãœberlauf in Aufzählungswerten" #: c-decl.c:5752 msgid "ISO C restricts enumerator values to range of `int'" -msgstr "" +msgstr "ISO-C beschränkt Aufzählungswerte auf Bereich von »int«" #: c-decl.c:5834 msgid "return type is an incomplete type" -msgstr "" +msgstr "Rückgabetyp ist unvollständig" #: c-decl.c:5842 msgid "return type defaults to `int'" -msgstr "" +msgstr "Rückgabetyp ist auf »int« voreingestellt" #: c-decl.c:5889 #, c-format msgid "no previous prototype for `%s'" -msgstr "" +msgstr "Kein vorheriger Prototyp für »%s«" #: c-decl.c:5896 #, c-format msgid "`%s' was used with no prototype before its definition" -msgstr "" +msgstr "»%s« wurde vor seiner Definition ohne Prototyp verwendet" #: c-decl.c:5902 #, c-format msgid "no previous declaration for `%s'" -msgstr "" +msgstr "Keine vorherige Deklaration für »%s«" #: c-decl.c:5909 #, c-format msgid "`%s' was used with no declaration before its definition" -msgstr "" +msgstr "»%s« wurde vor seiner Definition ohne Deklaration verwendet" #: c-decl.c:5933 c-decl.c:6486 #, c-format msgid "return type of `%s' is not `int'" -msgstr "" +msgstr "Rückgabetyp von »%s« ist nicht »int«" #: c-decl.c:5949 #, c-format msgid "first argument of `%s' should be `int'" -msgstr "" +msgstr "Erstes Argument von »%s« sollte »int« sein" #: c-decl.c:5958 #, c-format msgid "second argument of `%s' should be `char **'" -msgstr "" +msgstr "Zweites Argument von »%s« sollte »char **« sein" #: c-decl.c:5967 #, c-format msgid "third argument of `%s' should probably be `char **'" -msgstr "" +msgstr "Drittes Argument von »%s« sollte wahrscheinlich »char **« sein" #: c-decl.c:5976 #, c-format msgid "`%s' takes only zero or two arguments" -msgstr "" +msgstr "»%s« benötigt entweder null oder zwei Argumente" #: c-decl.c:5979 #, c-format msgid "`%s' is normally a non-static function" -msgstr "" +msgstr "»%s« ist normalerweise eine Nicht-static-Funktion" #: c-decl.c:6077 msgid "parm types given both in parmlist and separately" -msgstr "" +msgstr "Parametertypen sowohl in Parameterliste als auch separat angegeben" #: c-decl.c:6098 msgid "parameter name omitted" -msgstr "" +msgstr "Parametername ausgelassen" #: c-decl.c:6102 c-decl.c:6204 #, c-format msgid "parameter `%s' declared void" -msgstr "" +msgstr "Parameter »%s« als void deklariert" #: c-decl.c:6178 msgid "parameter name missing from parameter list" -msgstr "" +msgstr "Parametername fehlt in Parameterliste" #: c-decl.c:6197 #, c-format msgid "multiple parameters named `%s'" -msgstr "" +msgstr "Mehrere Parameter wurden »%s« genannt" #: c-decl.c:6219 c-decl.c:6221 #, c-format msgid "type of `%s' defaults to `int'" -msgstr "" +msgstr "Typ von »%s« auf »int« voreingestellt" #: c-decl.c:6257 #, c-format msgid "declaration for parameter `%s' but no such parameter" -msgstr "" +msgstr "Nicht vorhandener Parameter »%s« deklariert" #: c-decl.c:6305 msgid "number of arguments doesn't match prototype" -msgstr "" +msgstr "Anzahl der Argumente passt nicht zum Prototypen" #: c-decl.c:6335 #, c-format msgid "promoted argument `%s' doesn't match prototype" -msgstr "" +msgstr "Weitergegebenes Argument »%s« passt nicht zum Prototypen" #: c-decl.c:6345 #, c-format msgid "argument `%s' doesn't match prototype" -msgstr "" +msgstr "Argument »%s« passt nicht zum Prototypen" #: c-decl.c:6518 cp/decl.c:15049 msgid "no return statement in function returning non-void" -msgstr "" +msgstr "Keine return-Anweisung in nicht void zurückgebender Funktion" #: c-decl.c:6525 msgid "this function may return with or without a value" -msgstr "" +msgstr "Diese Funktion kann mit oder ohne Wert zurückkehren" #: c-decl.c:6729 #, c-format msgid "size of return value of `%s' is %u bytes" -msgstr "" +msgstr "Größe des Rückgabewertes von »%s« ist %u Bytes" #: c-decl.c:6733 #, c-format msgid "size of return value of `%s' is larger than %d bytes" -msgstr "" +msgstr "Größe des Rückgabewertes von »%s« ist größer als %d Bytes" #. If we get here, declarations have been used in a for loop without #. the C99 for loop scope. This doesn't make much sense, so don't #. allow it. #: c-decl.c:6791 msgid "`for' loop initial declaration used outside C99 mode" -msgstr "" +msgstr "Anfangsdeklaration in »for«-Schleife außerhalb C99-Modus verwendet" #: c-decl.c:6815 #, c-format msgid "`struct %s' declared in `for' loop initial declaration" -msgstr "" +msgstr "»struct %s« in Anfangsdeklaration einer »for«-Schleife deklariert" #: c-decl.c:6818 #, c-format msgid "`union %s' declared in `for' loop initial declaration" -msgstr "" +msgstr "»union %s« in Anfangsdeklaration einer »for«-Schleife deklariert" #: c-decl.c:6821 #, c-format msgid "`enum %s' declared in `for' loop initial declaration" -msgstr "" +msgstr "»enum %s« in Anfangsdeklaration einer »for«-Schleife deklariert" #: c-decl.c:6829 #, c-format msgid "declaration of non-variable `%s' in `for' loop initial declaration" -msgstr "" +msgstr "Deklaration der Nicht-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife" #: c-decl.c:6831 #, c-format msgid "declaration of static variable `%s' in `for' loop initial declaration" -msgstr "" +msgstr "Deklaration der »static«-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife" #: c-decl.c:6833 #, c-format msgid "declaration of `extern' variable `%s' in `for' loop initial declaration" -msgstr "" +msgstr "Deklaration der »extern«-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife" #: c-format.c:109 c-format.c:191 msgid "format string arg not a string type" -msgstr "" +msgstr "Format-Zeichenkettenargument ist kein Zeichenkettentyp" #: c-format.c:124 msgid "args to be formatted is not '...'" -msgstr "" +msgstr "Zu formatierendes Argument ist nicht »...«" #: c-format.c:133 msgid "strftime formats cannot format arguments" -msgstr "" +msgstr "strftime-Formate können keine Argumente formatieren" #: c-format.c:168 c-format.c:270 msgid "format string has invalid operand number" -msgstr "" +msgstr "Formatzeichenkette hat ungültige Operandenzahl" #: c-format.c:202 msgid "function does not return string type" -msgstr "" +msgstr "Funktion gibt keinen Zeichenkettentypen zurück" #: c-format.c:233 msgid "unrecognized format specifier" -msgstr "" +msgstr "Unerkannte Formatangabe" #: c-format.c:246 #, c-format msgid "`%s' is an unrecognized format function type" -msgstr "" +msgstr "»%s« ist ein nicht erkannter Formatfunktionstyp" #: c-format.c:280 msgid "format string arg follows the args to be formatted" -msgstr "" +msgstr "Format-Zeichenkettenargument folgt den zu formatierenden Argumenten" #: c-format.c:601 msgid "` ' flag" -msgstr "" +msgstr "» «-Kennzeichen" #: c-format.c:601 msgid "the ` ' printf flag" -msgstr "" +msgstr "Das » «-printf-Kennzeichen" #: c-format.c:602 c-format.c:673 msgid "`+' flag" -msgstr "" +msgstr "»+«-Kennzeichen" #: c-format.c:602 msgid "the `+' printf flag" -msgstr "" +msgstr "Das »+«-printf-Kennzeichen" #: c-format.c:603 c-format.c:649 msgid "`#' flag" -msgstr "" +msgstr "»#«-Kennzeichen" #: c-format.c:603 msgid "the `#' printf flag" -msgstr "" +msgstr "Das »#«-printf-Kennzeichen" #: c-format.c:604 c-format.c:647 msgid "`0' flag" -msgstr "" +msgstr "»0«-Kennzeichen" #: c-format.c:604 msgid "the `0' printf flag" -msgstr "" +msgstr "Das »0«-printf-Kennzeichen" #: c-format.c:605 c-format.c:646 c-format.c:676 msgid "`-' flag" -msgstr "" +msgstr "»-«-Kennzeichen" #: c-format.c:605 msgid "the `-' printf flag" -msgstr "" +msgstr "Das »-«-printf-Kennzeichen" #: c-format.c:606 c-format.c:630 msgid "`'' flag" -msgstr "" +msgstr "»'«-Kennzeichen" #: c-format.c:606 msgid "the `'' printf flag" -msgstr "" +msgstr "Das »'«-printf-Kennzeichen" #: c-format.c:607 c-format.c:631 msgid "`I' flag" -msgstr "" +msgstr "»I«-Kennzeichen" #: c-format.c:607 msgid "the `I' printf flag" -msgstr "" +msgstr "Das »I«-printf-Kennzeichen" #: c-format.c:608 c-format.c:628 c-format.c:650 c-format.c:677 c-format.c:1702 msgid "field width" -msgstr "" +msgstr "Feldbreite" #: c-format.c:608 msgid "field width in printf format" -msgstr "" +msgstr "Feldbreite im printf-Format" #: c-format.c:609 msgid "precision" -msgstr "" +msgstr "Präzision" #: c-format.c:609 msgid "precision in printf format" -msgstr "" +msgstr "Präzision im printf-Format" #: c-format.c:610 c-format.c:629 c-format.c:680 msgid "length modifier" -msgstr "" +msgstr "Längenmodifizierer" #: c-format.c:610 msgid "length modifier in printf format" -msgstr "" +msgstr "Längenmodifizierer im printf-Format" #: c-format.c:626 msgid "assignment suppression" -msgstr "" +msgstr "Zuweisungsunterdrückung" #: c-format.c:626 msgid "the assignment suppression scanf feature" -msgstr "" +msgstr "Das scanf-Merkmal der Zuweisungsunterdrückung" #: c-format.c:627 msgid "`a' flag" -msgstr "" +msgstr "»a«-Kennzeichen" #: c-format.c:627 msgid "the `a' scanf flag" -msgstr "" +msgstr "Das »a«-scanf-Kennzeichen" #: c-format.c:628 msgid "field width in scanf format" -msgstr "" +msgstr "Feldbreite im scanf-Format" #: c-format.c:629 msgid "length modifier in scanf format" -msgstr "" +msgstr "Längenmodifizierer im scanf-Format" #: c-format.c:630 msgid "the `'' scanf flag" -msgstr "" +msgstr "Das »'«-scanf-Kennzeichen" #: c-format.c:631 msgid "the `I' scanf flag" -msgstr "" +msgstr "Das »I«-scanf-Kennzeichen" #: c-format.c:645 msgid "`_' flag" -msgstr "" +msgstr "»_«-Kennzeichen" #: c-format.c:645 msgid "the `_' strftime flag" -msgstr "" +msgstr "Das »_«-strftime-Kennzeichen" #: c-format.c:646 msgid "the `-' strftime flag" -msgstr "" +msgstr "Das »-«-strftime-Kennzeichen" #: c-format.c:647 msgid "the `0' strftime flag" -msgstr "" +msgstr "Das »0«-strftime-Kennzeichen" #: c-format.c:648 c-format.c:672 msgid "`^' flag" -msgstr "" +msgstr "»^«-Kennzeichen" #: c-format.c:648 msgid "the `^' strftime flag" -msgstr "" +msgstr "Das »^«-strftime-Kennzeichen" #: c-format.c:649 msgid "the `#' strftime flag" -msgstr "" +msgstr "Das »#«-strftime-Kennzeichen" #: c-format.c:650 msgid "field width in strftime format" -msgstr "" +msgstr "Feldbreite im strftime-Format" #: c-format.c:651 msgid "`E' modifier" -msgstr "" +msgstr "»E«-Modifizierer" #: c-format.c:651 msgid "the `E' strftime modifier" -msgstr "" +msgstr "Der »E«-strftime-Modifizierer" #: c-format.c:652 msgid "`O' modifier" -msgstr "" +msgstr "»O«-Modifizierer" #: c-format.c:652 msgid "the `O' strftime modifier" -msgstr "" +msgstr "Der »O«-strftime-Modifizierer" #: c-format.c:653 msgid "the `O' modifier" -msgstr "" +msgstr "Der »O«-Modifizierer" #: c-format.c:671 msgid "fill character" -msgstr "" +msgstr "Füllzeichen" #: c-format.c:671 msgid "fill character in strfmon format" -msgstr "" +msgstr "Füllzeichen im strfmon-Format" #: c-format.c:672 msgid "the `^' strfmon flag" -msgstr "" +msgstr "Das »^«-strfmon-Kennzeichen" #: c-format.c:673 msgid "the `+' strfmon flag" -msgstr "" +msgstr "Das »+«-strfmon-Kennzeichen" #: c-format.c:674 msgid "`(' flag" -msgstr "" +msgstr "»(«-Kennzeichen" #: c-format.c:674 msgid "the `(' strfmon flag" -msgstr "" +msgstr "Das »(«-strfmon-Kennzeichen" #: c-format.c:675 msgid "`!' flag" -msgstr "" +msgstr "»!«-Kennzeichen" #: c-format.c:675 msgid "the `!' strfmon flag" -msgstr "" +msgstr "Das »!«-strfmon-Kennzeichen" #: c-format.c:676 msgid "the `-' strfmon flag" -msgstr "" +msgstr "Das »-«-strfmon-Kennzeichen" #: c-format.c:677 msgid "field width in strfmon format" -msgstr "" +msgstr "Feldbreite im strfmon-Format" #: c-format.c:678 msgid "left precision" -msgstr "" +msgstr "Linke Präzision" #: c-format.c:678 msgid "left precision in strfmon format" -msgstr "" +msgstr "Linke Präzision im strfmon-Format" #: c-format.c:679 msgid "right precision" -msgstr "" +msgstr "Rechte Präzision" #: c-format.c:679 msgid "right precision in strfmon format" -msgstr "" +msgstr "Rechte Präzision im strfmon-Format" #: c-format.c:680 msgid "length modifier in strfmon format" -msgstr "" +msgstr "Längenmodifizierer im strfmon-Format" #: c-format.c:983 #, c-format msgid "function might be possible candidate for `%s' format attribute" -msgstr "" +msgstr "Funktion könnte möglicher Kandidat für Formatattribut »%s« sein" #: c-format.c:1107 c-format.c:1128 c-format.c:2112 msgid "missing $ operand number in format" -msgstr "" +msgstr "Fehlende $-Operandennummer im Format" #: c-format.c:1138 #, c-format msgid "%s does not support %%n$ operand number formats" -msgstr "" +msgstr "%s unterstützt nicht %%n$-Operandennummerformate" #: c-format.c:1145 msgid "operand number out of range in format" -msgstr "" +msgstr "Operandennummer außerhalb des Wertebereiches im Format" #: c-format.c:1168 #, c-format msgid "format argument %d used more than once in %s format" -msgstr "" +msgstr "Formatargument %d mehr als einmal im %s-Format verwendet" #: c-format.c:1218 #, c-format msgid "format argument %d unused before used argument %d in $-style format" -msgstr "" +msgstr "Formatargument %d nicht verwendet vor benutztem Argument %d im $-Stil-Format" #: c-format.c:1322 msgid "format not a string literal, format string not checked" -msgstr "" +msgstr "Format ist kein Zeichenkettenliteral, Formatzeichenkette ungeprüft" #: c-format.c:1336 msgid "format not a string literal and no format arguments" -msgstr "" +msgstr "Format ist kein Zeichenkettenliteral, und keine Formatargumente" #: c-format.c:1338 msgid "format not a string literal, argument types not checked" -msgstr "" +msgstr "Format ist kein Zeichenkettenliteral, Argumenttypen ungeprüft" #: c-format.c:1351 msgid "too many arguments for format" -msgstr "" +msgstr "Zu viele Argumente für Format" #: c-format.c:1354 msgid "unused arguments in $-style format" -msgstr "" +msgstr "Unbenutzte Argumente in $-Stil-Format" #: c-format.c:1357 #, c-format msgid "zero-length %s format string" -msgstr "" +msgstr "Format-Zeichenkette %s der Länge null" #: c-format.c:1361 msgid "format is a wide character string" -msgstr "" +msgstr "Format ist »wide character«-Zeichenkette" #: c-format.c:1364 msgid "unterminated format string" -msgstr "" +msgstr "Unbeendete Formatzeichenkette" #: c-format.c:1581 msgid "embedded `\\0' in format" -msgstr "" +msgstr "Eingebettetes »\\0« im Format" #: c-format.c:1596 #, c-format msgid "spurious trailing `%%' in format" -msgstr "" +msgstr "Störendes letztes »%%« im Format" #: c-format.c:1635 c-format.c:1872 #, c-format msgid "repeated %s in format" -msgstr "" +msgstr "Wiederholtes %s im Format" #: c-format.c:1648 msgid "missing fill character at end of strfmon format" -msgstr "" +msgstr "Fehlendes Füllzeichen am Ende des strfmon-Formates" #: c-format.c:1687 c-format.c:1786 c-format.c:2066 c-format.c:2119 msgid "too few arguments for format" -msgstr "" +msgstr "Zu wenig Argumente für Format" #: c-format.c:1728 #, c-format msgid "zero width in %s format" -msgstr "" +msgstr "Breite null im Format %s" #: c-format.c:1747 #, c-format msgid "empty left precision in %s format" -msgstr "" +msgstr "Leere linke Präzision im Format %s" #: c-format.c:1801 msgid "field precision" -msgstr "" +msgstr "Feldpräzision" #: c-format.c:1816 #, c-format msgid "empty precision in %s format" -msgstr "" +msgstr "Fehlende Präzision im Format %s" #: c-format.c:1856 #, c-format msgid "%s does not support the `%s' %s length modifier" -msgstr "" +msgstr "%s unterstützt nicht den Längenmodifizierer »%s« %s" #: c-format.c:1906 msgid "conversion lacks type at end of format" -msgstr "" +msgstr "Konvertierung fehlt der Typ am Ende des Formates" #: c-format.c:1917 #, c-format msgid "unknown conversion type character `%c' in format" -msgstr "" +msgstr "Unbekanntes Konvertierungstyp-Zeichen »%c« im Format" #: c-format.c:1920 #, c-format msgid "unknown conversion type character 0x%x in format" -msgstr "" +msgstr "Unbekanntes Konvertierungstyp-Zeichen 0x%x im Format" #: c-format.c:1927 #, c-format msgid "%s does not support the `%%%c' %s format" -msgstr "" +msgstr "%s unterstützt nicht das Format »%%%c« %s" #: c-format.c:1943 #, c-format msgid "%s used with `%%%c' %s format" -msgstr "" +msgstr "%s verwendet mit Format »%%%c« %s" #: c-format.c:1952 #, c-format msgid "%s does not support %s" -msgstr "" +msgstr "%s unterstützt nicht %s" #: c-format.c:1961 #, c-format msgid "%s does not support %s with the `%%%c' %s format" -msgstr "" +msgstr "%s unterstützt nicht %s mit dem Format »%%%c« %s" #: c-format.c:1994 #, c-format msgid "%s ignored with %s and `%%%c' %s format" -msgstr "" +msgstr "%s ignoriert mit %s und Format »%%%c« %s" #: c-format.c:1998 #, c-format msgid "%s ignored with %s in %s format" -msgstr "" +msgstr "%s ignoriert mit %s im Format %s" #: c-format.c:2004 #, c-format msgid "use of %s and %s together with `%%%c' %s format" -msgstr "" +msgstr "Verwendung von %s und %s zusammen mit »%%%c« %s Format" #: c-format.c:2008 #, c-format msgid "use of %s and %s together in %s format" -msgstr "" +msgstr "Verwendung von %s und %s zusammen im Format %s" #: c-format.c:2027 #, c-format msgid "`%%%c' yields only last 2 digits of year in some locales" -msgstr "" +msgstr "»%%%c« liefert in manchen Locales nur die letzten 2 Ziffern des Jahres" #: c-format.c:2030 #, c-format msgid "`%%%c' yields only last 2 digits of year" -msgstr "" +msgstr "»%%%c« liefert nur die letzten 2 Ziffern des Jahres" #. The end of the format string was reached. #: c-format.c:2046 #, c-format msgid "no closing `]' for `%%[' format" -msgstr "" +msgstr "Kein schließendes »]« für »%%[«-Format" #: c-format.c:2059 #, c-format msgid "use of `%s' length modifier with `%c' type character" -msgstr "" +msgstr "Verwendung des »%s«-Längenmodifizierers mit »%c«-Typ-Zeichen" #: c-format.c:2080 #, c-format msgid "%s does not support the `%%%s%c' %s format" -msgstr "" +msgstr "%s unterstützt nicht das Format »%%%s%c« %s" #: c-format.c:2095 msgid "operand number specified with suppressed assignment" -msgstr "" +msgstr "Operandennummer mit unterdrückter Zuweisung angegeben" #: c-format.c:2097 msgid "operand number specified for format taking no argument" @@ -4907,7 +4904,7 @@ msgid "" "See %s for instructions.\n" msgstr "" "Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;\n" -"bearbeiten Sie die Quellen zunächst mit eine Präprozessor, wenn es\n" +"bearbeiten Sie die Quellen zunächst mit einem Präprozessor, wenn es\n" "dienlich ist.\n" "Fehler in der deutschen Ãœbersetzung sind an de@li.org zu melden.\n" "\n" diff --git a/gcc/po/exgettext b/gcc/po/exgettext index 93f65c34370..c2be7d4cd59 100644 --- a/gcc/po/exgettext +++ b/gcc/po/exgettext @@ -162,4 +162,6 @@ END { echo "running xgettext..." >&2 $xgettext --default-domain=$package --directory=$srcdir \ --add-comments `cat $kopt` --files-from=$posr \ + --copyright-holder="Free Software Foundation, Inc." \ + --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \ --language=c -o po/$package.pot diff --git a/gcc/po/gcc.pot b/gcc/po/gcc.pot index f6e9e95d072..da74e005f71 100644 --- a/gcc/po/gcc.pot +++ b/gcc/po/gcc.pot @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2003-10-25 21:33+0000\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" +"POT-Creation-Date: 2003-11-20 10:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,12 +39,12 @@ msgstr "" #: attribs.c:416 c-common.c:4353 c-common.c:4372 c-common.c:4390 #: c-common.c:4417 c-common.c:4436 c-common.c:4459 c-common.c:4482 #: c-common.c:4508 c-common.c:4542 c-common.c:4586 c-common.c:4614 -#: c-common.c:4642 c-common.c:4661 c-common.c:4916 c-common.c:4935 -#: c-common.c:4974 c-common.c:5041 c-common.c:5087 c-common.c:5145 -#: c-common.c:5176 c-common.c:5522 c-common.c:5545 c-common.c:5584 -#: config/arm/arm.c:2236 config/arm/arm.c:2263 config/avr/avr.c:4561 -#: config/h8300/h8300.c:4279 config/h8300/h8300.c:4302 config/i386/i386.c:1589 -#: config/i386/i386.c:15177 config/i386/winnt.c:86 config/ia64/ia64.c:1057 +#: c-common.c:4642 c-common.c:4661 c-common.c:4916 c-common.c:4938 +#: c-common.c:4973 c-common.c:5040 c-common.c:5086 c-common.c:5144 +#: c-common.c:5175 c-common.c:5521 c-common.c:5544 c-common.c:5583 +#: config/arm/arm.c:2233 config/arm/arm.c:2260 config/avr/avr.c:4561 +#: config/h8300/h8300.c:4279 config/h8300/h8300.c:4302 config/i386/i386.c:1593 +#: config/i386/i386.c:15269 config/i386/winnt.c:86 config/ia64/ia64.c:1057 #: config/ip2k/ip2k.c:3214 #, c-format msgid "`%s' attribute ignored" @@ -70,83 +70,83 @@ msgstr "" msgid "invalid third arg to __builtin_prefetch; using zero" msgstr "" -#: builtins.c:3806 +#: builtins.c:3810 msgid "argument of `__builtin_args_info' must be constant" msgstr "" -#: builtins.c:3812 +#: builtins.c:3816 msgid "argument of `__builtin_args_info' out of range" msgstr "" -#: builtins.c:3818 +#: builtins.c:3822 msgid "missing argument in `__builtin_args_info'" msgstr "" -#: builtins.c:3834 +#: builtins.c:3838 msgid "`va_start' used in function with fixed args" msgstr "" -#: builtins.c:3853 +#: builtins.c:3857 msgid "second parameter of `va_start' not last named argument" msgstr "" #. Evidently an out of date version of ; can't validate #. va_start's second argument, but can still work as intended. -#: builtins.c:3858 +#: builtins.c:3862 msgid "`__builtin_next_arg' called without an argument" msgstr "" -#: builtins.c:3939 +#: builtins.c:3951 msgid "too many arguments to function `va_start'" msgstr "" -#: builtins.c:4039 +#: builtins.c:4051 msgid "first argument to `va_arg' not of type `va_list'" msgstr "" #. Unfortunately, this is merely undefined, rather than a constraint #. violation, so we cannot make this an error. If this call is never #. executed, the program is still strictly conforming. -#: builtins.c:4071 +#: builtins.c:4083 #, c-format msgid "`%s' is promoted to `%s' when passed through `...'" msgstr "" -#: builtins.c:4076 +#: builtins.c:4088 #, c-format msgid "(so you should pass `%s' not `%s' to `va_arg')" msgstr "" -#: builtins.c:4193 +#: builtins.c:4205 msgid "invalid arg to `__builtin_frame_address'" msgstr "" -#: builtins.c:4195 +#: builtins.c:4207 msgid "invalid arg to `__builtin_return_address'" msgstr "" -#: builtins.c:4209 +#: builtins.c:4221 msgid "unsupported arg to `__builtin_frame_address'" msgstr "" -#: builtins.c:4211 +#: builtins.c:4223 msgid "unsupported arg to `__builtin_return_address'" msgstr "" -#: builtins.c:4371 +#: builtins.c:4383 msgid "second arg to `__builtin_expect' must be a constant" msgstr "" -#: builtins.c:5316 +#: builtins.c:5328 msgid "__builtin_longjmp second argument must be 1" msgstr "" -#: builtins.c:5411 +#: builtins.c:5423 #, c-format msgid "built-in function `%s' not currently supported" msgstr "" -#: builtins.c:5551 +#: builtins.c:5563 msgid "target format does not support infinity" msgstr "" @@ -248,15 +248,15 @@ msgstr "" msgid "pointer to a member used in arithmetic" msgstr "" -#: c-common.c:2626 f/com.c:14730 +#: c-common.c:2626 f/com.c:14732 msgid "struct type value used where scalar is required" msgstr "" -#: c-common.c:2630 f/com.c:14734 +#: c-common.c:2630 f/com.c:14736 msgid "union type value used where scalar is required" msgstr "" -#: c-common.c:2634 f/com.c:14738 +#: c-common.c:2634 f/com.c:14740 msgid "array type value used where scalar is required" msgstr "" @@ -266,7 +266,7 @@ msgstr "" msgid "the address of `%D', will always evaluate as `true'" msgstr "" -#: c-common.c:2765 f/com.c:14870 +#: c-common.c:2765 f/com.c:14872 msgid "suggest parentheses around assignment used as truth value" msgstr "" @@ -400,7 +400,7 @@ msgstr "" msgid "invalid pointer mode `%s'" msgstr "" -#: c-common.c:4709 c-common.c:5273 +#: c-common.c:4709 c-common.c:5272 #, c-format msgid "unable to emulate '%s'" msgstr "" @@ -445,82 +445,82 @@ msgstr "" msgid "alias arg not a string" msgstr "" -#: c-common.c:4945 +#: c-common.c:4944 msgid "visibility arg not a string" msgstr "" -#: c-common.c:4954 +#: c-common.c:4957 msgid "" "visibility arg must be one of \"default\", \"hidden\", \"protected\" or " "\"internal\"" msgstr "" -#: c-common.c:4984 +#: c-common.c:4983 msgid "tls_model arg not a string" msgstr "" -#: c-common.c:4993 +#: c-common.c:4992 msgid "" "tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-" "dynamic\" or \"global-dynamic\"" msgstr "" -#: c-common.c:5015 c-common.c:5061 +#: c-common.c:5014 c-common.c:5060 msgid "%J'%E' attribute applies only to functions" msgstr "" -#: c-common.c:5020 c-common.c:5066 +#: c-common.c:5019 c-common.c:5065 msgid "%Jcan't set '%E' attribute after definition" msgstr "" -#: c-common.c:5142 +#: c-common.c:5141 #, c-format msgid "`%s' attribute ignored for `%s'" msgstr "" -#: c-common.c:5205 +#: c-common.c:5204 #, c-format msgid "invalid vector type for attribute `%s'" msgstr "" -#: c-common.c:5229 c-common.c:5261 +#: c-common.c:5228 c-common.c:5260 msgid "no vector mode with the size and type specified could be found" msgstr "" -#: c-common.c:5363 +#: c-common.c:5362 msgid "nonnull attribute without arguments on a non-prototype" msgstr "" -#: c-common.c:5378 +#: c-common.c:5377 #, c-format msgid "nonnull argument has invalid operand number (arg %lu)" msgstr "" -#: c-common.c:5397 +#: c-common.c:5396 #, c-format msgid "" "nonnull argument with out-of-range operand number (arg %lu, operand %lu)" msgstr "" -#: c-common.c:5405 +#: c-common.c:5404 #, c-format msgid "nonnull argument references non-pointer operand (arg %lu, operand %lu)" msgstr "" -#: c-common.c:5485 +#: c-common.c:5484 #, c-format msgid "null argument where non-null required (arg %lu)" msgstr "" -#: c-common.c:5556 +#: c-common.c:5555 msgid "cleanup arg not an identifier" msgstr "" -#: c-common.c:5563 +#: c-common.c:5562 msgid "cleanup arg not a function" msgstr "" -#: c-convert.c:82 c-typeck.c:1192 c-typeck.c:3355 cp/typeck.c:1307 +#: c-convert.c:82 c-typeck.c:1192 c-typeck.c:3348 cp/typeck.c:1307 #: cp/typeck.c:5605 treelang/tree-convert.c:79 msgid "void value not ignored as it ought to be" msgstr "" @@ -797,7 +797,7 @@ msgstr "" msgid "parameter `%s' is initialized" msgstr "" -#: c-decl.c:2621 c-typeck.c:4162 +#: c-decl.c:2621 c-typeck.c:4157 msgid "variable-sized object may not be initialized" msgstr "" @@ -811,7 +811,7 @@ msgstr "" msgid "elements of array `%s' have incomplete type" msgstr "" -#: c-decl.c:2702 c-decl.c:5460 cp/decl.c:3727 cp/decl.c:10099 +#: c-decl.c:2702 c-decl.c:5460 cp/decl.c:3725 cp/decl.c:10097 msgid "%Jinline function '%D' given attribute noinline" msgstr "" @@ -843,7 +843,7 @@ msgstr "" msgid "ISO C forbids forward parameter declarations" msgstr "" -#: c-decl.c:3351 cp/decl.c:6737 +#: c-decl.c:3351 cp/decl.c:6735 msgid "`long long long' is too long for GCC" msgstr "" @@ -851,25 +851,25 @@ msgstr "" msgid "ISO C90 does not support `long long'" msgstr "" -#: c-decl.c:3365 c-decl.c:3368 cp/decl.c:6742 +#: c-decl.c:3365 c-decl.c:3368 cp/decl.c:6740 #, c-format msgid "duplicate `%s'" msgstr "" -#: c-decl.c:3378 cp/decl.c:6748 +#: c-decl.c:3378 cp/decl.c:6746 msgid "`__thread' before `extern'" msgstr "" -#: c-decl.c:3380 cp/decl.c:6750 +#: c-decl.c:3380 cp/decl.c:6748 msgid "`__thread' before `static'" msgstr "" -#: c-decl.c:3388 cp/decl.c:6777 +#: c-decl.c:3388 cp/decl.c:6775 #, c-format msgid "two or more data types in declaration of `%s'" msgstr "" -#: c-decl.c:3408 cp/decl.c:6782 +#: c-decl.c:3408 cp/decl.c:6780 #, c-format msgid "`%s' fails to be a typedef or built in type" msgstr "" @@ -884,12 +884,12 @@ msgstr "" msgid "both long and short specified for `%s'" msgstr "" -#: c-decl.c:3480 cp/decl.c:6882 +#: c-decl.c:3480 cp/decl.c:6880 #, c-format msgid "long or short specified with char for `%s'" msgstr "" -#: c-decl.c:3487 cp/decl.c:6886 +#: c-decl.c:3487 cp/decl.c:6884 #, c-format msgid "long or short specified with floating type for `%s'" msgstr "" @@ -903,17 +903,17 @@ msgstr "" msgid "both signed and unsigned specified for `%s'" msgstr "" -#: c-decl.c:3498 cp/decl.c:6875 +#: c-decl.c:3498 cp/decl.c:6873 #, c-format msgid "long, short, signed or unsigned invalid for `%s'" msgstr "" -#: c-decl.c:3504 cp/decl.c:6895 +#: c-decl.c:3504 cp/decl.c:6893 #, c-format msgid "long, short, signed or unsigned used invalidly for `%s'" msgstr "" -#: c-decl.c:3522 cp/decl.c:6916 +#: c-decl.c:3522 cp/decl.c:6914 #, c-format msgid "complex invalid for `%s'" msgstr "" @@ -930,19 +930,19 @@ msgstr "" msgid "ISO C does not support complex integer types" msgstr "" -#: c-decl.c:3609 c-decl.c:4067 cp/decl.c:7508 +#: c-decl.c:3609 c-decl.c:4067 cp/decl.c:7506 msgid "duplicate `const'" msgstr "" -#: c-decl.c:3611 c-decl.c:4071 cp/decl.c:7512 +#: c-decl.c:3611 c-decl.c:4071 cp/decl.c:7510 msgid "duplicate `restrict'" msgstr "" -#: c-decl.c:3613 c-decl.c:4069 cp/decl.c:7510 +#: c-decl.c:3613 c-decl.c:4069 cp/decl.c:7508 msgid "duplicate `volatile'" msgstr "" -#: c-decl.c:3641 cp/decl.c:7079 +#: c-decl.c:3641 cp/decl.c:7077 #, c-format msgid "multiple storage classes in declaration of `%s'" msgstr "" @@ -968,21 +968,21 @@ msgstr "" msgid "storage class specified for structure field `%s'" msgstr "" -#: c-decl.c:3674 cp/decl.c:7124 +#: c-decl.c:3674 cp/decl.c:7122 #, c-format msgid "storage class specified for parameter `%s'" msgstr "" -#: c-decl.c:3677 cp/decl.c:7126 +#: c-decl.c:3677 cp/decl.c:7124 msgid "storage class specified for typename" msgstr "" -#: c-decl.c:3689 cp/decl.c:7141 +#: c-decl.c:3689 cp/decl.c:7139 #, c-format msgid "`%s' initialized and declared `extern'" msgstr "" -#: c-decl.c:3691 cp/decl.c:7144 +#: c-decl.c:3691 cp/decl.c:7142 #, c-format msgid "`%s' has both `extern' and initializer" msgstr "" @@ -992,12 +992,12 @@ msgstr "" msgid "file-scope declaration of `%s' specifies `auto'" msgstr "" -#: c-decl.c:3701 cp/decl.c:7148 +#: c-decl.c:3701 cp/decl.c:7146 #, c-format msgid "nested function `%s' declared `extern'" msgstr "" -#: c-decl.c:3707 cp/decl.c:7158 +#: c-decl.c:3707 cp/decl.c:7156 #, c-format msgid "function-scope `%s' implicitly auto and declared `__thread'" msgstr "" @@ -1048,7 +1048,7 @@ msgstr "" msgid "ISO C90 forbids variable-size array `%s'" msgstr "" -#: c-decl.c:3878 c-decl.c:4093 cp/decl.c:7682 +#: c-decl.c:3878 c-decl.c:4093 cp/decl.c:7680 #, c-format msgid "size of array `%s' is too large" msgstr "" @@ -1061,12 +1061,12 @@ msgstr "" msgid "array type has incomplete element type" msgstr "" -#: c-decl.c:3959 cp/decl.c:7279 +#: c-decl.c:3959 cp/decl.c:7277 #, c-format msgid "`%s' declared as function returning a function" msgstr "" -#: c-decl.c:3964 cp/decl.c:7284 +#: c-decl.c:3964 cp/decl.c:7282 #, c-format msgid "`%s' declared as function returning an array" msgstr "" @@ -1083,7 +1083,7 @@ msgstr "" msgid "ISO C forbids qualified function types" msgstr "" -#: c-decl.c:4065 cp/decl.c:7504 +#: c-decl.c:4065 cp/decl.c:7502 msgid "invalid type modifier within pointer declarator" msgstr "" @@ -1091,7 +1091,7 @@ msgstr "" msgid "ISO C forbids const or volatile function types" msgstr "" -#: c-decl.c:4163 cp/decl.c:7964 +#: c-decl.c:4163 cp/decl.c:7962 #, c-format msgid "variable or field `%s' declared void" msgstr "" @@ -1137,7 +1137,7 @@ msgstr "" #. A mere warning is sure to result in improper semantics #. at runtime. Don't bother to allow this to compile. -#: c-decl.c:4429 cp/decl.c:5820 +#: c-decl.c:4429 cp/decl.c:5818 msgid "thread-local storage not supported for this target" msgstr "" @@ -1198,7 +1198,7 @@ msgstr "" msgid "redefinition of `struct %s'" msgstr "" -#: c-decl.c:4805 cp/decl.c:3500 +#: c-decl.c:4805 cp/decl.c:3498 msgid "declaration does not declare anything" msgstr "" @@ -1416,7 +1416,7 @@ msgstr "" msgid "argument \"%D\" doesn't match prototype" msgstr "" -#: c-decl.c:6101 cp/decl.c:10807 +#: c-decl.c:6101 cp/decl.c:10817 msgid "no return statement in function returning non-void" msgstr "" @@ -2169,34 +2169,34 @@ msgstr "" msgid "YYDEBUG not defined" msgstr "" -#: c-opts.c:1251 +#: c-opts.c:1252 #, c-format msgid "opening dependency file %s: %m" msgstr "" -#: c-opts.c:1261 +#: c-opts.c:1262 #, c-format msgid "closing dependency file %s: %m" msgstr "" -#: c-opts.c:1264 +#: c-opts.c:1265 #, c-format msgid "when writing output to %s: %m" msgstr "" -#: c-opts.c:1334 +#: c-opts.c:1335 msgid "to generate dependencies you must specify either -M or -MM" msgstr "" -#: c-opts.c:1398 +#: c-opts.c:1403 msgid "" msgstr "" -#: c-opts.c:1413 +#: c-opts.c:1418 msgid "" msgstr "" -#: c-pch.c:111 graph.c:402 toplev.c:1516 toplev.c:4468 f/com.c:14198 +#: c-pch.c:111 graph.c:402 toplev.c:1516 toplev.c:4480 f/com.c:14200 #: java/jcf-parse.c:890 java/jcf-parse.c:1037 java/lex.c:1828 #: objc/objc-act.c:503 #, c-format @@ -2370,11 +2370,11 @@ msgstr "" msgid "asm declaration conflicts with previous rename" msgstr "" -#: c-semantics.c:595 +#: c-semantics.c:595 cp/parser.c:5769 msgid "break statement not within loop or switch" msgstr "" -#: c-semantics.c:613 +#: c-semantics.c:613 cp/parser.c:5780 msgid "continue statement not within a loop" msgstr "" @@ -2392,7 +2392,7 @@ msgid "" "own scope.)" msgstr "" -#: c-semantics.c:741 c-typeck.c:6179 cp/semantics.c:1055 +#: c-semantics.c:741 c-typeck.c:6174 cp/semantics.c:1055 #, c-format msgid "%s qualifier ignored on asm" msgstr "" @@ -2671,543 +2671,543 @@ msgstr "" #. Use `%s' to print the string in case there are any escape #. characters in the message. -#: c-typeck.c:2535 c-typeck.c:3915 c-typeck.c:3930 c-typeck.c:3945 +#: c-typeck.c:2535 c-typeck.c:3910 c-typeck.c:3925 c-typeck.c:3940 #: final.c:2779 final.c:2781 gcc.c:4561 rtl-error.c:109 toplev.c:1371 -#: config/cris/cris.c:544 cp/parser.c:1768 cp/typeck.c:4072 java/expr.c:356 -#: java/verify.c:1459 java/verify.c:1460 java/verify.c:1475 +#: config/cris/cris.c:544 cp/parser.c:1778 cp/typeck.c:4072 java/expr.c:356 +#: java/verify.c:1456 java/verify.c:1457 java/verify.c:1472 #, c-format msgid "%s" msgstr "" -#: c-typeck.c:2592 -msgid "ISO C forbids use of conditional expressions as lvalues" +#: c-typeck.c:2591 +msgid "use of conditional expressions as lvalues is deprecated" msgstr "" -#: c-typeck.c:2596 -msgid "ISO C forbids use of compound expressions as lvalues" +#: c-typeck.c:2594 +msgid "use of compound expressions as lvalues is deprecated" msgstr "" -#: c-typeck.c:2599 +#: c-typeck.c:2597 msgid "use of cast expressions as lvalues is deprecated" msgstr "" -#: c-typeck.c:2614 +#: c-typeck.c:2612 #, c-format msgid "%s of read-only member `%s'" msgstr "" -#: c-typeck.c:2618 +#: c-typeck.c:2616 #, c-format msgid "%s of read-only variable `%s'" msgstr "" -#: c-typeck.c:2621 +#: c-typeck.c:2619 #, c-format msgid "%s of read-only location" msgstr "" -#: c-typeck.c:2639 +#: c-typeck.c:2637 #, c-format msgid "cannot take address of bit-field `%s'" msgstr "" -#: c-typeck.c:2667 treelang/treetree.c:946 +#: c-typeck.c:2665 treelang/treetree.c:946 #, c-format msgid "global register variable `%s' used in nested function" msgstr "" -#: c-typeck.c:2671 treelang/treetree.c:950 +#: c-typeck.c:2669 treelang/treetree.c:950 #, c-format msgid "register variable `%s' used in nested function" msgstr "" -#: c-typeck.c:2678 treelang/treetree.c:957 +#: c-typeck.c:2676 treelang/treetree.c:957 #, c-format msgid "address of global register variable `%s' requested" msgstr "" -#: c-typeck.c:2690 +#: c-typeck.c:2688 msgid "cannot put object with volatile field into register" msgstr "" -#: c-typeck.c:2694 treelang/treetree.c:962 +#: c-typeck.c:2692 treelang/treetree.c:962 #, c-format msgid "address of register variable `%s' requested" msgstr "" -#: c-typeck.c:2779 +#: c-typeck.c:2777 msgid "signed and unsigned type in conditional expression" msgstr "" -#: c-typeck.c:2786 +#: c-typeck.c:2784 msgid "ISO C forbids conditional expr with only one void side" msgstr "" -#: c-typeck.c:2802 c-typeck.c:2809 +#: c-typeck.c:2800 c-typeck.c:2807 msgid "ISO C forbids conditional expr between `void *' and function pointer" msgstr "" -#: c-typeck.c:2815 +#: c-typeck.c:2813 msgid "pointer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:2822 c-typeck.c:2832 +#: c-typeck.c:2820 c-typeck.c:2830 msgid "pointer/integer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:2846 +#: c-typeck.c:2844 msgid "type mismatch in conditional expression" msgstr "" -#: c-typeck.c:2906 +#: c-typeck.c:2904 msgid "left-hand operand of comma expression has no effect" msgstr "" -#: c-typeck.c:2942 +#: c-typeck.c:2935 msgid "cast specifies array type" msgstr "" -#: c-typeck.c:2948 +#: c-typeck.c:2941 msgid "cast specifies function type" msgstr "" -#: c-typeck.c:2958 +#: c-typeck.c:2951 msgid "ISO C forbids casting nonscalar to the same type" msgstr "" -#: c-typeck.c:2976 +#: c-typeck.c:2969 msgid "ISO C forbids casts to union type" msgstr "" -#: c-typeck.c:2984 +#: c-typeck.c:2977 msgid "cast to union type from type not present in union" msgstr "" -#: c-typeck.c:3035 +#: c-typeck.c:3028 msgid "cast adds new qualifiers to function type" msgstr "" #. There are qualifiers present in IN_OTYPE that are not #. present in IN_TYPE. -#: c-typeck.c:3040 +#: c-typeck.c:3033 msgid "cast discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3055 +#: c-typeck.c:3048 msgid "cast increases required alignment of target type" msgstr "" -#: c-typeck.c:3061 cp/typeck.c:4850 +#: c-typeck.c:3054 cp/typeck.c:4850 msgid "cast from pointer to integer of different size" msgstr "" -#: c-typeck.c:3066 +#: c-typeck.c:3059 msgid "cast does not match function type" msgstr "" -#: c-typeck.c:3073 cp/typeck.c:4857 +#: c-typeck.c:3066 cp/typeck.c:4857 msgid "cast to pointer from integer of different size" msgstr "" -#: c-typeck.c:3085 +#: c-typeck.c:3078 msgid "type-punning to incomplete type might break strict-aliasing rules" msgstr "" -#: c-typeck.c:3089 +#: c-typeck.c:3082 msgid "dereferencing type-punned pointer will break strict-aliasing rules" msgstr "" #. Now we have handled acceptable kinds of LHS that are not truly lvalues. #. Reject anything strange now. -#: c-typeck.c:3248 +#: c-typeck.c:3241 msgid "invalid lvalue in assignment" msgstr "" #. Convert new value to destination type. -#: c-typeck.c:3257 c-typeck.c:3282 c-typeck.c:3299 cp/typeck.c:4969 +#: c-typeck.c:3250 c-typeck.c:3275 c-typeck.c:3292 cp/typeck.c:4969 #: cp/typeck.c:5113 msgid "assignment" msgstr "" -#: c-typeck.c:3366 +#: c-typeck.c:3359 msgid "cannot pass rvalue to reference parameter" msgstr "" -#: c-typeck.c:3475 c-typeck.c:3551 +#: c-typeck.c:3468 c-typeck.c:3544 #, c-format msgid "%s makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:3479 c-typeck.c:3531 +#: c-typeck.c:3472 c-typeck.c:3524 #, c-format msgid "%s discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3485 +#: c-typeck.c:3478 msgid "ISO C prohibits argument conversion to union type" msgstr "" -#: c-typeck.c:3523 +#: c-typeck.c:3516 #, c-format msgid "ISO C forbids %s between function pointer and `void *'" msgstr "" -#: c-typeck.c:3540 +#: c-typeck.c:3533 #, c-format msgid "pointer targets in %s differ in signedness" msgstr "" -#: c-typeck.c:3556 +#: c-typeck.c:3549 #, c-format msgid "%s from incompatible pointer type" msgstr "" -#: c-typeck.c:3562 c-typeck.c:4066 cp/typeck.c:1336 +#: c-typeck.c:3555 c-typeck.c:4061 cp/typeck.c:1336 msgid "invalid use of non-lvalue array" msgstr "" -#: c-typeck.c:3577 +#: c-typeck.c:3570 #, c-format msgid "%s makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:3585 +#: c-typeck.c:3578 #, c-format msgid "%s makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:3599 c-typeck.c:3602 +#: c-typeck.c:3592 c-typeck.c:3595 #, c-format msgid "incompatible type for argument %d of `%s'" msgstr "" -#: c-typeck.c:3606 +#: c-typeck.c:3599 #, c-format msgid "incompatible type for argument %d of indirect function call" msgstr "" -#: c-typeck.c:3610 +#: c-typeck.c:3603 #, c-format msgid "incompatible types in %s" msgstr "" #. Function name is known; supply it. -#: c-typeck.c:3664 +#: c-typeck.c:3659 #, c-format msgid "passing arg of `%s'" msgstr "" #. Function name unknown (call through ptr). -#: c-typeck.c:3673 +#: c-typeck.c:3668 msgid "passing arg of pointer to function" msgstr "" #. Function name is known; supply it. -#: c-typeck.c:3681 +#: c-typeck.c:3676 #, c-format msgid "passing arg %d of `%s'" msgstr "" #. Function name unknown (call through ptr); just give arg number. -#: c-typeck.c:3690 +#: c-typeck.c:3685 #, c-format msgid "passing arg %d of pointer to function" msgstr "" -#: c-typeck.c:3747 +#: c-typeck.c:3742 msgid "traditional C rejects automatic aggregate initialization" msgstr "" -#: c-typeck.c:3918 c-typeck.c:3933 c-typeck.c:3948 +#: c-typeck.c:3913 c-typeck.c:3928 c-typeck.c:3943 #, c-format msgid "(near initialization for `%s')" msgstr "" -#: c-typeck.c:3997 cp/typeck2.c:458 +#: c-typeck.c:3992 cp/typeck2.c:458 msgid "char-array initialized from wide string" msgstr "" -#: c-typeck.c:4004 cp/typeck2.c:465 +#: c-typeck.c:3999 cp/typeck2.c:465 msgid "int-array initialized from non-wide string" msgstr "" -#: c-typeck.c:4022 cp/typeck2.c:481 +#: c-typeck.c:4017 cp/typeck2.c:481 msgid "initializer-string for array of chars is too long" msgstr "" -#: c-typeck.c:4089 +#: c-typeck.c:4084 msgid "array initialized from non-constant array expression" msgstr "" -#: c-typeck.c:4106 c-typeck.c:4108 c-typeck.c:4124 c-typeck.c:4145 -#: c-typeck.c:5525 +#: c-typeck.c:4101 c-typeck.c:4103 c-typeck.c:4119 c-typeck.c:4140 +#: c-typeck.c:5520 msgid "initializer element is not constant" msgstr "" -#: c-typeck.c:4140 +#: c-typeck.c:4135 msgid "initialization" msgstr "" -#: c-typeck.c:4151 c-typeck.c:5530 +#: c-typeck.c:4146 c-typeck.c:5525 msgid "initializer element is not computable at load time" msgstr "" -#: c-typeck.c:4166 cp/typeck2.c:558 +#: c-typeck.c:4161 cp/typeck2.c:558 msgid "invalid initializer" msgstr "" -#: c-typeck.c:4449 cp/decl.c:4424 +#: c-typeck.c:4444 cp/decl.c:4422 msgid "opaque vector types cannot be initialized" msgstr "" -#: c-typeck.c:4643 +#: c-typeck.c:4638 msgid "extra brace group at end of initializer" msgstr "" -#: c-typeck.c:4663 +#: c-typeck.c:4658 msgid "missing braces around initializer" msgstr "" -#: c-typeck.c:4723 +#: c-typeck.c:4718 msgid "braces around scalar initializer" msgstr "" -#: c-typeck.c:4770 +#: c-typeck.c:4765 msgid "initialization of flexible array member in a nested context" msgstr "" -#: c-typeck.c:4772 +#: c-typeck.c:4767 msgid "initialization of a flexible array member" msgstr "" -#: c-typeck.c:4803 +#: c-typeck.c:4798 msgid "missing initializer" msgstr "" -#: c-typeck.c:4829 +#: c-typeck.c:4824 msgid "empty scalar initializer" msgstr "" -#: c-typeck.c:4834 +#: c-typeck.c:4829 msgid "extra elements in scalar initializer" msgstr "" -#: c-typeck.c:4919 +#: c-typeck.c:4914 msgid "initialization designators may not nest" msgstr "" -#: c-typeck.c:4940 c-typeck.c:5008 +#: c-typeck.c:4935 c-typeck.c:5003 msgid "array index in non-array initializer" msgstr "" -#: c-typeck.c:4945 c-typeck.c:5061 +#: c-typeck.c:4940 c-typeck.c:5056 msgid "field name not in record or union initializer" msgstr "" -#: c-typeck.c:5004 c-typeck.c:5006 +#: c-typeck.c:4999 c-typeck.c:5001 msgid "nonconstant array index in initializer" msgstr "" -#: c-typeck.c:5010 c-typeck.c:5013 +#: c-typeck.c:5005 c-typeck.c:5008 msgid "array index in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:5024 +#: c-typeck.c:5019 msgid "empty index range in initializer" msgstr "" -#: c-typeck.c:5033 +#: c-typeck.c:5028 msgid "array index range in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:5073 +#: c-typeck.c:5068 #, c-format msgid "unknown field `%s' specified in initializer" msgstr "" -#: c-typeck.c:5109 c-typeck.c:5130 c-typeck.c:5592 +#: c-typeck.c:5104 c-typeck.c:5125 c-typeck.c:5587 msgid "initialized field with side-effects overwritten" msgstr "" -#: c-typeck.c:5800 +#: c-typeck.c:5795 msgid "excess elements in char array initializer" msgstr "" -#: c-typeck.c:5807 c-typeck.c:5853 +#: c-typeck.c:5802 c-typeck.c:5848 msgid "excess elements in struct initializer" msgstr "" -#: c-typeck.c:5868 +#: c-typeck.c:5863 msgid "non-static initialization of a flexible array member" msgstr "" -#: c-typeck.c:5935 +#: c-typeck.c:5930 msgid "excess elements in union initializer" msgstr "" -#: c-typeck.c:5956 +#: c-typeck.c:5951 msgid "traditional C rejects initialization of unions" msgstr "" -#: c-typeck.c:6019 +#: c-typeck.c:6014 msgid "excess elements in array initializer" msgstr "" -#: c-typeck.c:6048 +#: c-typeck.c:6043 msgid "excess elements in vector initializer" msgstr "" -#: c-typeck.c:6070 +#: c-typeck.c:6065 msgid "excess elements in scalar initializer" msgstr "" -#: c-typeck.c:6157 +#: c-typeck.c:6152 msgid "argument of `asm' is not a constant string" msgstr "" -#: c-typeck.c:6172 +#: c-typeck.c:6167 msgid "asm template is not a string constant" msgstr "" -#: c-typeck.c:6204 +#: c-typeck.c:6199 msgid "invalid lvalue in asm statement" msgstr "" -#: c-typeck.c:6276 +#: c-typeck.c:6271 msgid "modification by `asm'" msgstr "" -#: c-typeck.c:6294 cp/typeck.c:5883 +#: c-typeck.c:6289 cp/typeck.c:5883 msgid "function declared `noreturn' has a `return' statement" msgstr "" -#: c-typeck.c:6301 +#: c-typeck.c:6296 msgid "`return' with no value, in function returning non-void" msgstr "" -#: c-typeck.c:6307 +#: c-typeck.c:6302 msgid "`return' with a value, in function returning void" msgstr "" -#: c-typeck.c:6311 +#: c-typeck.c:6306 msgid "return" msgstr "" -#: c-typeck.c:6363 +#: c-typeck.c:6358 msgid "function returns address of local variable" msgstr "" -#: c-typeck.c:6418 cp/semantics.c:734 +#: c-typeck.c:6413 cp/semantics.c:734 msgid "switch quantity not an integer" msgstr "" -#: c-typeck.c:6428 +#: c-typeck.c:6423 msgid "`long' switch expression not converted to `int' in ISO C" msgstr "" -#: c-typeck.c:6469 cp/decl.c:2430 +#: c-typeck.c:6464 cp/parser.c:5281 msgid "case label not within a switch statement" msgstr "" -#: c-typeck.c:6471 cp/decl.c:2435 +#: c-typeck.c:6466 msgid "`default' label not within a switch statement" msgstr "" -#: c-typeck.c:6623 c-typeck.c:6657 +#: c-typeck.c:6618 c-typeck.c:6652 msgid "division by zero" msgstr "" -#: c-typeck.c:6702 cp/typeck.c:2888 +#: c-typeck.c:6697 cp/typeck.c:2888 msgid "right shift count is negative" msgstr "" -#: c-typeck.c:6709 cp/typeck.c:2894 +#: c-typeck.c:6704 cp/typeck.c:2894 msgid "right shift count >= width of type" msgstr "" -#: c-typeck.c:6730 cp/typeck.c:2913 +#: c-typeck.c:6725 cp/typeck.c:2913 msgid "left shift count is negative" msgstr "" -#: c-typeck.c:6733 cp/typeck.c:2915 +#: c-typeck.c:6728 cp/typeck.c:2915 msgid "left shift count >= width of type" msgstr "" -#: c-typeck.c:6754 +#: c-typeck.c:6749 msgid "shift count is negative" msgstr "" -#: c-typeck.c:6756 +#: c-typeck.c:6751 msgid "shift count >= width of type" msgstr "" -#: c-typeck.c:6773 cp/typeck.c:2950 +#: c-typeck.c:6768 cp/typeck.c:2950 msgid "comparing floating point with == or != is unsafe" msgstr "" -#: c-typeck.c:6799 c-typeck.c:6805 +#: c-typeck.c:6794 c-typeck.c:6800 msgid "ISO C forbids comparison of `void *' with function pointer" msgstr "" -#: c-typeck.c:6808 c-typeck.c:6848 c-typeck.c:6876 +#: c-typeck.c:6803 c-typeck.c:6843 c-typeck.c:6871 msgid "comparison of distinct pointer types lacks a cast" msgstr "" -#: c-typeck.c:6822 c-typeck.c:6827 c-typeck.c:6896 c-typeck.c:6901 +#: c-typeck.c:6817 c-typeck.c:6822 c-typeck.c:6891 c-typeck.c:6896 msgid "comparison between pointer and integer" msgstr "" -#: c-typeck.c:6843 c-typeck.c:6871 +#: c-typeck.c:6838 c-typeck.c:6866 msgid "ISO C forbids ordered comparisons of pointers to functions" msgstr "" -#: c-typeck.c:6868 +#: c-typeck.c:6863 msgid "comparison of complete and incomplete pointers" msgstr "" -#: c-typeck.c:6884 c-typeck.c:6891 +#: c-typeck.c:6879 c-typeck.c:6886 msgid "ordered comparison of pointer with integer zero" msgstr "" -#: c-typeck.c:6915 cp/typeck.c:3086 +#: c-typeck.c:6910 cp/typeck.c:3086 msgid "unordered comparison on non-floating point argument" msgstr "" -#: c-typeck.c:7125 +#: c-typeck.c:7120 msgid "comparison between signed and unsigned" msgstr "" -#: c-typeck.c:7171 cp/typeck.c:3333 +#: c-typeck.c:7166 cp/typeck.c:3333 msgid "comparison of promoted ~unsigned with constant" msgstr "" -#: c-typeck.c:7179 cp/typeck.c:3341 +#: c-typeck.c:7174 cp/typeck.c:3341 msgid "comparison of promoted ~unsigned with unsigned" msgstr "" -#: calls.c:1814 tree-inline.c:1328 +#: calls.c:1837 tree-inline.c:1335 msgid "%Jinlining failed in call to '%F'" msgstr "" -#: calls.c:1815 calls.c:2155 tree-inline.c:1329 +#: calls.c:1838 calls.c:2206 tree-inline.c:1336 msgid "called from here" msgstr "" -#: calls.c:2154 +#: calls.c:2205 msgid "%Jcan't inline call to '%F'" msgstr "" -#: calls.c:2163 +#: calls.c:2214 msgid "" "ignoring return value of `%D', declared with attribute warn_unused_result" msgstr "" -#: calls.c:2176 +#: calls.c:2227 msgid "" "ignoring return value of function declared with attribute warn_unused_result" msgstr "" -#: calls.c:2186 +#: calls.c:2237 msgid "function call has aggregate value" msgstr "" @@ -3251,7 +3251,7 @@ msgstr "" msgid "verify_flow_info: Basic block %d succ edge is corrupted" msgstr "" -#: cfg.c:907 cfgrtl.c:1943 +#: cfg.c:907 cfgrtl.c:1973 #, c-format msgid "Wrong amount of branch edges after unconditional jump %i" msgstr "" @@ -3330,120 +3330,124 @@ msgstr "" msgid "Edge from %d to %d should not be marked irreducible." msgstr "" -#: cfgrtl.c:1849 +#: cfgrtl.c:1879 #, c-format msgid "end insn %d for block %d not found in the insn stream" msgstr "" -#: cfgrtl.c:1863 +#: cfgrtl.c:1893 #, c-format msgid "insn %d is in multiple basic blocks (%d and %d)" msgstr "" -#: cfgrtl.c:1875 +#: cfgrtl.c:1905 #, c-format msgid "head insn %d for block %d not found in the insn stream" msgstr "" -#: cfgrtl.c:1897 +#: cfgrtl.c:1927 msgid "verify_flow_info: REG_BR_PROB does not match cfg %wi %i" msgstr "" -#: cfgrtl.c:1925 +#: cfgrtl.c:1955 #, c-format msgid "Missing REG_EH_REGION note in the end of bb %i" msgstr "" -#: cfgrtl.c:1933 +#: cfgrtl.c:1963 #, c-format msgid "Too many outgoing branch edges from bb %i" msgstr "" -#: cfgrtl.c:1938 +#: cfgrtl.c:1968 #, c-format msgid "Fallthru edge after unconditional jump %i" msgstr "" -#: cfgrtl.c:1949 +#: cfgrtl.c:1979 #, c-format msgid "Wrong amount of branch edges after conditional jump %i" msgstr "" -#: cfgrtl.c:1954 +#: cfgrtl.c:1984 #, c-format msgid "Call edges for non-call insn in bb %i" msgstr "" -#: cfgrtl.c:1963 +#: cfgrtl.c:1993 #, c-format msgid "Abnormal edges for no purpose in bb %i" msgstr "" -#: cfgrtl.c:1973 +#: cfgrtl.c:2003 #, c-format msgid "insn %d inside basic block %d but block_for_insn is NULL" msgstr "" -#: cfgrtl.c:1977 +#: cfgrtl.c:2007 #, c-format msgid "insn %d inside basic block %d but block_for_insn is %i" msgstr "" -#: cfgrtl.c:1991 cfgrtl.c:2001 +#: cfgrtl.c:2021 cfgrtl.c:2031 #, c-format msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d" msgstr "" -#: cfgrtl.c:2014 +#: cfgrtl.c:2044 #, c-format msgid "NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d" msgstr "" -#: cfgrtl.c:2024 +#: cfgrtl.c:2054 #, c-format msgid "in basic block %d:" msgstr "" -#: cfgrtl.c:2025 +#: cfgrtl.c:2055 msgid "flow control insn inside a basic block" msgstr "" -#: cfgrtl.c:2071 +#: cfgrtl.c:2101 #, c-format msgid "missing barrier after block %i" msgstr "" -#: cfgrtl.c:2084 +#: cfgrtl.c:2114 #, c-format msgid "verify_flow_info: Incorrect blocks for fallthru %i->%i" msgstr "" -#: cfgrtl.c:2099 +#: cfgrtl.c:2129 #, c-format msgid "verify_flow_info: Incorrect fallthru %i->%i" msgstr "" -#: cfgrtl.c:2101 +#: cfgrtl.c:2131 msgid "wrong insn in the fallthru edge" msgstr "" -#: cfgrtl.c:2118 +#: cfgrtl.c:2148 msgid "basic blocks not laid down consecutively" msgstr "" -#: cfgrtl.c:2143 +#: cfgrtl.c:2173 msgid "insn outside basic block" msgstr "" -#: cfgrtl.c:2151 +#: cfgrtl.c:2181 msgid "return not followed by barrier" msgstr "" -#: cfgrtl.c:2158 +#: cfgrtl.c:2188 #, c-format msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)" msgstr "" +#: cgraph.c:463 +msgid "%D renamed after being referenced in assembly" +msgstr "" + #: collect2.c:406 msgid "internal error" msgstr "" @@ -3624,7 +3628,7 @@ msgstr "" msgid "library lib%s not found" msgstr "" -#: combine.c:13052 +#: combine.c:13014 #, c-format msgid "" ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new " @@ -3633,7 +3637,7 @@ msgid "" "\n" msgstr "" -#: combine.c:13061 +#: combine.c:13023 #, c-format msgid "" "\n" @@ -3757,87 +3761,86 @@ msgstr "" msgid "the meaning of '\\%c' is different in traditional C" msgstr "" -#. We'll error when we try it out as the start of an identifier. -#: cppcharset.c:836 +#: cppcharset.c:837 #, c-format msgid "incomplete universal character name %.*s" msgstr "" -#: cppcharset.c:847 +#: cppcharset.c:849 #, c-format msgid "%.*s is not a valid universal character" msgstr "" -#: cppcharset.c:857 +#: cppcharset.c:859 #, c-format msgid "universal character %.*s is not valid in an identifier" msgstr "" -#: cppcharset.c:861 +#: cppcharset.c:863 #, c-format msgid "universal character %.*s is not valid at the start of an identifier" msgstr "" -#: cppcharset.c:895 +#: cppcharset.c:898 msgid "converting UCN to source character set" msgstr "" -#: cppcharset.c:898 +#: cppcharset.c:902 msgid "converting UCN to execution character set" msgstr "" -#: cppcharset.c:963 +#: cppcharset.c:967 msgid "the meaning of '\\x' is different in traditional C" msgstr "" -#: cppcharset.c:980 f/lex.c:580 +#: cppcharset.c:984 f/lex.c:580 msgid "\\x used with no following hex digits" msgstr "" -#: cppcharset.c:987 +#: cppcharset.c:991 msgid "hex escape sequence out of range" msgstr "" -#: cppcharset.c:1026 +#: cppcharset.c:1030 msgid "octal escape sequence out of range" msgstr "" -#: cppcharset.c:1094 +#: cppcharset.c:1098 msgid "the meaning of '\\a' is different in traditional C" msgstr "" -#: cppcharset.c:1101 +#: cppcharset.c:1105 #, c-format msgid "non-ISO-standard escape sequence, '\\%c'" msgstr "" -#: cppcharset.c:1109 +#: cppcharset.c:1113 #, c-format msgid "unknown escape sequence '\\%c'" msgstr "" -#: cppcharset.c:1112 +#: cppcharset.c:1116 #, c-format msgid "unknown escape sequence: '\\%03o'" msgstr "" -#: cppcharset.c:1118 +#: cppcharset.c:1122 msgid "converting escape sequence to execution character set" msgstr "" -#: cppcharset.c:1177 +#: cppcharset.c:1181 msgid "converting to execution character set" msgstr "" -#: cppcharset.c:1239 cppcharset.c:1301 +#: cppcharset.c:1244 cppcharset.c:1307 msgid "character constant too long for its type" msgstr "" -#: cppcharset.c:1242 +#: cppcharset.c:1247 msgid "multi-character character constant" msgstr "" -#: cppcharset.c:1333 +#: cppcharset.c:1339 msgid "empty character constant" msgstr "" @@ -3853,187 +3856,195 @@ msgstr "" msgid "stdout" msgstr "" -#: cppexp.c:191 +#: cppexp.c:192 msgid "too many decimal points in number" msgstr "" -#: cppexp.c:211 +#: cppexp.c:212 #, c-format msgid "invalid digit \"%c\" in octal constant" msgstr "" -#: cppexp.c:217 +#: cppexp.c:218 msgid "use of C99 hexadecimal floating constant" msgstr "" -#: cppexp.c:226 +#: cppexp.c:227 msgid "exponent has no digits" msgstr "" -#: cppexp.c:233 +#: cppexp.c:234 msgid "hexadecimal floating constants require an exponent" msgstr "" -#: cppexp.c:239 +#: cppexp.c:240 #, c-format msgid "invalid suffix \"%.*s\" on floating constant" msgstr "" -#: cppexp.c:249 cppexp.c:274 +#: cppexp.c:250 cppexp.c:275 #, c-format msgid "traditional C rejects the \"%.*s\" suffix" msgstr "" -#: cppexp.c:260 +#: cppexp.c:261 #, c-format msgid "invalid suffix \"%.*s\" on integer constant" msgstr "" -#: cppexp.c:281 +#: cppexp.c:283 msgid "use of C99 long long integer constant" msgstr "" -#: cppexp.c:287 +#: cppexp.c:290 msgid "imaginary constants are a GCC extension" msgstr "" -#: cppexp.c:373 +#: cppexp.c:376 msgid "integer constant is too large for its type" msgstr "" -#: cppexp.c:385 +#: cppexp.c:388 msgid "integer constant is so large that it is unsigned" msgstr "" -#: cppexp.c:467 +#: cppexp.c:470 msgid "missing ')' after \"defined\"" msgstr "" -#: cppexp.c:474 +#: cppexp.c:477 msgid "operator \"defined\" requires an identifier" msgstr "" -#: cppexp.c:482 +#: cppexp.c:485 #, c-format msgid "(\"%s\" is an alternative token for \"%s\" in C++)" msgstr "" -#: cppexp.c:492 +#: cppexp.c:495 msgid "this use of \"defined\" may not be portable" msgstr "" -#: cppexp.c:528 +#: cppexp.c:531 msgid "floating constant in preprocessor expression" msgstr "" -#: cppexp.c:534 +#: cppexp.c:537 msgid "imaginary number in preprocessor expression" msgstr "" -#: cppexp.c:579 +#: cppexp.c:582 #, c-format msgid "\"%s\" is not defined" msgstr "" -#: cppexp.c:711 cppexp.c:740 +#: cppexp.c:714 cppexp.c:743 #, c-format msgid "missing binary operator before token \"%s\"" msgstr "" -#: cppexp.c:731 +#: cppexp.c:734 #, c-format msgid "token \"%s\" is not valid in preprocessor expressions" msgstr "" -#: cppexp.c:750 +#: cppexp.c:753 msgid "void expression between '(' and ')'" msgstr "" -#: cppexp.c:753 +#: cppexp.c:756 msgid "#if with no expression" msgstr "" -#: cppexp.c:755 +#: cppexp.c:758 #, c-format msgid "operator '%s' has no right operand" msgstr "" -#: cppexp.c:781 +#: cppexp.c:784 msgid " ':' without preceding '?'" msgstr "" -#: cppexp.c:808 +#: cppexp.c:811 msgid "unbalanced stack in #if" msgstr "" -#: cppexp.c:827 +#: cppexp.c:830 #, c-format msgid "impossible operator '%u'" msgstr "" -#: cppexp.c:919 +#: cppexp.c:922 msgid "missing ')' in expression" msgstr "" -#: cppexp.c:940 +#: cppexp.c:943 msgid "'?' without following ':'" msgstr "" -#: cppexp.c:950 +#: cppexp.c:953 msgid "integer overflow in preprocessor expression" msgstr "" -#: cppexp.c:955 +#: cppexp.c:958 msgid "missing '(' in expression" msgstr "" -#: cppexp.c:987 +#: cppexp.c:990 #, c-format msgid "the left operand of \"%s\" changes sign when promoted" msgstr "" -#: cppexp.c:992 +#: cppexp.c:995 #, c-format msgid "the right operand of \"%s\" changes sign when promoted" msgstr "" -#: cppexp.c:1250 +#: cppexp.c:1253 msgid "traditional C rejects the unary plus operator" msgstr "" -#: cppexp.c:1349 +#: cppexp.c:1352 msgid "comma operator in operand of #if" msgstr "" -#: cppexp.c:1480 +#: cppexp.c:1483 msgid "division by zero in #if" msgstr "" -#: cppfiles.c:357 +#: cppfiles.c:367 msgid "NULL directory in find_file" msgstr "" -#: cppfiles.c:435 +#: cppfiles.c:392 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:395 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:453 #, c-format msgid "%s is a block device" msgstr "" -#: cppfiles.c:452 +#: cppfiles.c:470 #, c-format msgid "%s is too large" msgstr "" -#: cppfiles.c:486 +#: cppfiles.c:505 #, c-format msgid "%s is shorter than expected" msgstr "" -#: cppfiles.c:679 +#: cppfiles.c:698 #, c-format msgid "no include path in which to search for %s" msgstr "" -#: cppfiles.c:921 +#: cppfiles.c:940 msgid "Multiple include guards may be useful for:\n" msgstr "" @@ -4064,11 +4075,11 @@ msgstr "" msgid "target int is narrower than target char" msgstr "" -#: cppinit.c:412 +#: cppinit.c:413 msgid "CPP half-integer narrower than CPP character" msgstr "" -#: cppinit.c:416 +#: cppinit.c:417 #, c-format msgid "" "CPP on this host cannot handle wide character constants over %lu bits, but " @@ -4092,27 +4103,27 @@ msgstr "" msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" msgstr "" -#: cpplex.c:595 +#: cpplex.c:596 msgid "null character(s) preserved in literal" msgstr "" -#: cpplex.c:915 +#: cpplex.c:916 msgid "unterminated comment" msgstr "" -#: cpplex.c:926 +#: cpplex.c:927 msgid "C++ style comments are not allowed in ISO C90" msgstr "" -#: cpplex.c:928 +#: cpplex.c:929 msgid "(this will be reported only once per input file)" msgstr "" -#: cpplex.c:933 +#: cpplex.c:934 msgid "multi-line comment" msgstr "" -#: cpplex.c:1196 +#: cpplex.c:1198 #, c-format msgid "unspellable token %s" msgstr "" @@ -4172,143 +4183,143 @@ msgstr "" msgid "macro names must be identifiers" msgstr "" -#: cpplib.c:531 +#: cpplib.c:532 #, c-format msgid "undefining \"%s\"" msgstr "" -#: cpplib.c:601 +#: cpplib.c:602 msgid "missing terminating > character" msgstr "" -#: cpplib.c:654 +#: cpplib.c:655 #, c-format msgid "#%s expects \"FILENAME\" or " msgstr "" -#: cpplib.c:677 +#: cpplib.c:678 msgid "#include nested too deeply" msgstr "" -#: cpplib.c:715 +#: cpplib.c:716 msgid "#include_next in primary source file" msgstr "" -#: cpplib.c:741 +#: cpplib.c:742 #, c-format msgid "invalid flag \"%s\" in line directive" msgstr "" -#: cpplib.c:786 +#: cpplib.c:787 #, c-format msgid "\"%s\" after #line is not a positive integer" msgstr "" -#: cpplib.c:792 +#: cpplib.c:793 msgid "line number out of range" msgstr "" -#: cpplib.c:804 cpplib.c:876 +#: cpplib.c:805 cpplib.c:878 #, c-format msgid "\"%s\" is not a valid filename" msgstr "" -#: cpplib.c:838 +#: cpplib.c:840 #, c-format msgid "\"%s\" after # is not a positive integer" msgstr "" -#: cpplib.c:938 +#: cpplib.c:940 msgid "invalid #ident directive" msgstr "" -#: cpplib.c:1018 +#: cpplib.c:1020 #, c-format msgid "registering \"%s\" as both a pragma and a pragma namespace" msgstr "" -#: cpplib.c:1021 +#: cpplib.c:1023 #, c-format msgid "#pragma %s %s is already registered" msgstr "" -#: cpplib.c:1024 +#: cpplib.c:1026 #, c-format msgid "#pragma %s is already registered" msgstr "" -#: cpplib.c:1169 +#: cpplib.c:1171 msgid "#pragma once in main file" msgstr "" -#: cpplib.c:1191 +#: cpplib.c:1194 msgid "invalid #pragma GCC poison directive" msgstr "" -#: cpplib.c:1200 +#: cpplib.c:1203 #, c-format msgid "poisoning existing macro \"%s\"" msgstr "" -#: cpplib.c:1221 +#: cpplib.c:1224 msgid "#pragma system_header ignored outside include file" msgstr "" -#: cpplib.c:1245 +#: cpplib.c:1248 #, c-format msgid "cannot find source file %s" msgstr "" -#: cpplib.c:1248 +#: cpplib.c:1252 #, c-format msgid "current file is older than %s" msgstr "" -#: cpplib.c:1362 +#: cpplib.c:1366 msgid "_Pragma takes a parenthesized string literal" msgstr "" -#: cpplib.c:1440 +#: cpplib.c:1444 msgid "#else without #if" msgstr "" -#: cpplib.c:1445 +#: cpplib.c:1449 msgid "#else after #else" msgstr "" -#: cpplib.c:1473 +#: cpplib.c:1477 msgid "#elif without #if" msgstr "" -#: cpplib.c:1478 +#: cpplib.c:1482 msgid "#elif after #else" msgstr "" -#: cpplib.c:1508 +#: cpplib.c:1512 msgid "#endif without #if" msgstr "" -#: cpplib.c:1585 +#: cpplib.c:1589 msgid "missing '(' after predicate" msgstr "" -#: cpplib.c:1600 +#: cpplib.c:1604 msgid "missing ')' to complete answer" msgstr "" -#: cpplib.c:1620 +#: cpplib.c:1624 msgid "predicate's answer is empty" msgstr "" -#: cpplib.c:1647 +#: cpplib.c:1651 msgid "assertion without predicate" msgstr "" -#: cpplib.c:1649 +#: cpplib.c:1653 msgid "predicate must be an identifier" msgstr "" -#: cpplib.c:1733 +#: cpplib.c:1737 #, c-format msgid "\"%s\" re-asserted" msgstr "" @@ -4407,26 +4418,26 @@ msgstr "" msgid "invalid hash type %d in cpp_macro_definition" msgstr "" -#: cpppch.c:83 cpppch.c:331 cpppch.c:355 cpppch.c:364 +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 msgid "while writing precompiled header" msgstr "" -#: cpppch.c:462 +#: cpppch.c:463 #, c-format msgid "%s: not used because `%.*s' not defined" msgstr "" -#: cpppch.c:474 +#: cpppch.c:475 #, c-format msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" msgstr "" -#: cpppch.c:515 +#: cpppch.c:516 #, c-format msgid "%s: not used because `%s' is defined" msgstr "" -#: cpppch.c:528 cpppch.c:714 +#: cpppch.c:529 cpppch.c:715 msgid "while reading precompiled header" msgstr "" @@ -4439,7 +4450,7 @@ msgstr "" msgid "too many input files" msgstr "" -#: cpptrad.c:740 +#: cpptrad.c:744 #, c-format msgid "detected recursion whilst expanding macro \"%s\"" msgstr "" @@ -4498,7 +4509,7 @@ msgstr "" msgid "can't access imaginary part of complex value in hard register" msgstr "" -#: emit-rtl.c:3468 +#: emit-rtl.c:3456 msgid "ICE: emit_insn used where emit_jump_insn needed:\n" msgstr "" @@ -4511,11 +4522,11 @@ msgstr "" msgid "exception handling disabled, use -fexceptions to enable" msgstr "" -#: except.c:2919 +#: except.c:2923 msgid "argument of `__builtin_eh_return_regno' must be constant" msgstr "" -#: except.c:3050 +#: except.c:3054 msgid "__builtin_eh_return not supported on this target" msgstr "" @@ -4523,24 +4534,24 @@ msgstr "" msgid "stack limits not supported on this target" msgstr "" -#: expr.c:2981 +#: expr.c:2989 msgid "function using short complex types cannot be inline" msgstr "" -#: expr.c:5948 expr.c:5957 expr.c:5966 expr.c:5971 expr.c:6300 expr.c:6316 +#: expr.c:5960 expr.c:5969 expr.c:5978 expr.c:5983 expr.c:6312 expr.c:6328 msgid "unsupported wide integer operation" msgstr "" -#: expr.c:6359 +#: expr.c:6371 msgid "%Jprior parameter's size depends on '%D'" msgstr "" -#: expr.c:6722 +#: expr.c:6734 msgid "returned value in block_exit_expr" msgstr "" #. We can't make a bitwise copy of this object, so fail. -#: expr.c:8866 +#: expr.c:8869 msgid "cannot take the address of an unaligned member" msgstr "" @@ -4585,12 +4596,12 @@ msgstr "" #. We can't handle floating point constants; #. PRINT_OPERAND must handle them. -#: final.c:3223 vmsdbgout.c:467 config/i386/i386.c:6651 +#: final.c:3223 vmsdbgout.c:467 config/i386/i386.c:6712 #: config/pdp11/pdp11.c:1645 msgid "floating constant misused" msgstr "" -#: final.c:3279 vmsdbgout.c:524 config/i386/i386.c:6729 +#: final.c:3279 vmsdbgout.c:524 config/i386/i386.c:6790 #: config/pdp11/pdp11.c:1692 msgid "invalid expression as operand" msgstr "" @@ -4629,7 +4640,7 @@ msgstr "" msgid "`and' of mutually exclusive equal-tests is always 0" msgstr "" -#: fold-const.c:8324 +#: fold-const.c:8328 msgid "fold check: original tree changed by fold" msgstr "" @@ -4637,27 +4648,27 @@ msgstr "" msgid "%Jsize of variable '%D' is too large" msgstr "" -#: function.c:3706 +#: function.c:3710 msgid "impossible constraint in `asm'" msgstr "" -#: function.c:5626 +#: function.c:5630 msgid "%J'%D' might be used uninitialized in this function" msgstr "" -#: function.c:5633 +#: function.c:5637 msgid "%Jvariable '%D' might be clobbered by `longjmp' or `vfork'" msgstr "" -#: function.c:5652 +#: function.c:5656 msgid "%Jargument '%D' might be clobbered by `longjmp' or `vfork'" msgstr "" -#: function.c:6428 +#: function.c:6432 msgid "function returns an aggregate" msgstr "" -#: function.c:6911 +#: function.c:6915 msgid "%Junused parameter '%D'" msgstr "" @@ -5800,38 +5811,39 @@ msgstr "" msgid "usage: %s [-h|-m] > file" msgstr "" -#: ggc-common.c:396 ggc-common.c:404 ggc-common.c:485 ggc-common.c:505 -#: ggc-page.c:1984 ggc-page.c:2016 ggc-page.c:2023 +#: ggc-common.c:398 ggc-common.c:406 ggc-common.c:487 ggc-common.c:507 +#: ggc-page.c:2005 ggc-page.c:2037 ggc-page.c:2044 ggc-zone.c:1668 +#: ggc-zone.c:1674 ggc-zone.c:1679 ggc-zone.c:1686 #, c-format msgid "can't write PCH file: %m" msgstr "" -#: ggc-common.c:498 +#: ggc-common.c:500 #, c-format msgid "can't get position in PCH file: %m" msgstr "" -#: ggc-common.c:508 +#: ggc-common.c:510 #, c-format msgid "can't write padding to PCH file: %m" msgstr "" -#: ggc-common.c:561 ggc-common.c:569 ggc-common.c:576 ggc-common.c:579 -#: ggc-common.c:652 ggc-common.c:655 ggc-page.c:2111 +#: ggc-common.c:563 ggc-common.c:571 ggc-common.c:578 ggc-common.c:581 +#: ggc-common.c:654 ggc-common.c:657 ggc-page.c:2132 ggc-zone.c:1698 #, c-format msgid "can't read PCH file: %m" msgstr "" -#: ggc-common.c:679 +#: ggc-common.c:681 msgid "had to relocate PCH" msgstr "" -#: ggc-page.c:1301 +#: ggc-page.c:1322 #, c-format msgid "open /dev/zero: %m" msgstr "" -#: ggc-page.c:2001 ggc-page.c:2007 +#: ggc-page.c:2022 ggc-page.c:2028 msgid "can't write PCH file" msgstr "" @@ -5966,61 +5978,61 @@ msgstr "" msgid "-Wuninitialized is not supported without -O" msgstr "" -#: opts.c:1330 +#: opts.c:1329 #, c-format msgid "unrecognized register name \"%s\"" msgstr "" -#: opts.c:1374 +#: opts.c:1373 #, c-format msgid "unknown tls-model \"%s\"" msgstr "" -#: opts.c:1444 +#: opts.c:1443 msgid "use -gdwarf -gN for DWARF v1 level N, and -gdwarf-2 for DWARF v2" msgstr "" -#: opts.c:1522 +#: opts.c:1521 #, c-format msgid "%s: --param arguments should be of the form NAME=VALUE" msgstr "" -#: opts.c:1527 +#: opts.c:1526 #, c-format msgid "invalid --param value `%s'" msgstr "" -#: opts.c:1623 +#: opts.c:1622 msgid "target system does not support debug output" msgstr "" -#: opts.c:1630 +#: opts.c:1629 #, c-format msgid "debug format \"%s\" conflicts with prior selection" msgstr "" -#: opts.c:1646 +#: opts.c:1645 #, c-format msgid "unrecognised debug output level \"%s\"" msgstr "" -#: opts.c:1648 +#: opts.c:1647 #, c-format msgid "debug output level %s is too high" msgstr "" -#: opts.c:1667 +#: opts.c:1666 msgid "The following options are language-independent:\n" msgstr "" -#: opts.c:1674 +#: opts.c:1673 #, c-format msgid "" "The %s front end recognizes the following options:\n" "\n" msgstr "" -#: opts.c:1688 +#: opts.c:1687 msgid "The --param option recognizes the following as parameters:\n" msgstr "" @@ -6396,7 +6408,7 @@ msgstr "" msgid "can't use '%s' as a %s register" msgstr "" -#: regclass.c:764 config/ia64/ia64.c:4417 config/ia64/ia64.c:4424 +#: regclass.c:764 config/ia64/ia64.c:4473 config/ia64/ia64.c:4480 #, c-format msgid "unknown register name: %s" msgstr "" @@ -6433,23 +6445,23 @@ msgstr "" msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)" msgstr "" -#: reload.c:1250 +#: reload.c:1251 msgid "cannot reload integer constant operand in `asm'" msgstr "" -#: reload.c:1272 +#: reload.c:1273 msgid "impossible register constraint in `asm'" msgstr "" -#: reload.c:3479 +#: reload.c:3501 msgid "`&' constraint used with no register class" msgstr "" -#: reload.c:3647 +#: reload.c:3669 msgid "unable to generate reloads for:" msgstr "" -#: reload.c:3648 reload.c:3862 +#: reload.c:3670 reload.c:3884 msgid "inconsistent operand constraints in an `asm'" msgstr "" @@ -6543,148 +6555,148 @@ msgstr "" msgid "RTL flag check: %s used with unexpected rtx code `%s' in %s, at %s:%d" msgstr "" -#: stmt.c:740 +#: stmt.c:748 #, c-format msgid "jump to `%s' invalidly jumps into binding contour" msgstr "" -#: stmt.c:967 stmt.c:3691 +#: stmt.c:975 stmt.c:3739 msgid "%Jlabel '%D' used before containing binding contour" msgstr "" -#: stmt.c:1146 +#: stmt.c:1154 msgid "output operand constraint lacks `='" msgstr "" -#: stmt.c:1161 +#: stmt.c:1169 #, c-format msgid "output constraint `%c' for operand %d is not at the beginning" msgstr "" -#: stmt.c:1183 +#: stmt.c:1191 msgid "operand constraint contains incorrectly positioned '+' or '='" msgstr "" -#: stmt.c:1189 stmt.c:1287 +#: stmt.c:1197 stmt.c:1295 #, c-format msgid "`%%' constraint used with last operand" msgstr "" -#: stmt.c:1208 +#: stmt.c:1216 msgid "matching constraint not valid in output operand" msgstr "" -#: stmt.c:1278 +#: stmt.c:1286 #, c-format msgid "input operand constraint contains `%c'" msgstr "" -#: stmt.c:1318 +#: stmt.c:1326 msgid "matching constraint references invalid operand number" msgstr "" -#: stmt.c:1356 +#: stmt.c:1364 #, c-format msgid "invalid punctuation `%c' in constraint" msgstr "" -#: stmt.c:1405 +#: stmt.c:1413 #, c-format msgid "asm-specifier for variable `%s' conflicts with asm clobber list" msgstr "" -#: stmt.c:1495 +#: stmt.c:1503 #, c-format msgid "unknown register name `%s' in `asm'" msgstr "" -#: stmt.c:1503 +#: stmt.c:1511 #, c-format msgid "PIC register `%s' clobbered in `asm'" msgstr "" -#: stmt.c:1552 +#: stmt.c:1560 #, c-format msgid "more than %d operands in `asm'" msgstr "" -#: stmt.c:1614 +#: stmt.c:1622 #, c-format msgid "output number %d not directly addressable" msgstr "" -#: stmt.c:1692 +#: stmt.c:1700 #, c-format msgid "asm operand %d probably doesn't match constraints" msgstr "" -#: stmt.c:1702 +#: stmt.c:1710 #, c-format msgid "use of memory input without lvalue in asm operand %d is deprecated" msgstr "" -#: stmt.c:1853 +#: stmt.c:1861 msgid "asm clobber conflict with output operand" msgstr "" -#: stmt.c:1858 +#: stmt.c:1866 msgid "asm clobber conflict with input operand" msgstr "" -#: stmt.c:1892 +#: stmt.c:1900 msgid "too many alternatives in `asm'" msgstr "" -#: stmt.c:1904 +#: stmt.c:1912 msgid "operand constraints for `asm' differ in number of alternatives" msgstr "" -#: stmt.c:1956 +#: stmt.c:1964 #, c-format msgid "duplicate asm operand name '%s'" msgstr "" -#: stmt.c:2054 +#: stmt.c:2062 msgid "missing close brace for named operand" msgstr "" -#: stmt.c:2082 +#: stmt.c:2090 #, c-format msgid "undefined named operand '%s'" msgstr "" -#: stmt.c:2138 +#: stmt.c:2146 msgid "%Hstatement with no effect" msgstr "" -#: stmt.c:2293 +#: stmt.c:2301 msgid "%Hvalue computed is not used" msgstr "" -#: stmt.c:3631 +#: stmt.c:3679 msgid "%Junused variable '%D'" msgstr "" -#: stmt.c:4404 +#: stmt.c:4452 msgid "%Hunreachable code at beginning of %s" msgstr "" -#: stmt.c:5032 +#: stmt.c:5080 #, c-format msgid "enumeration value `%s' not handled in switch" msgstr "" -#: stmt.c:5057 stmt.c:5077 +#: stmt.c:5105 stmt.c:5125 #, c-format msgid "case value `%ld' not in enumerated type" msgstr "" -#: stmt.c:5060 stmt.c:5080 +#: stmt.c:5108 stmt.c:5128 #, c-format msgid "case value `%ld' not in enumerated type `%s'" msgstr "" -#: stmt.c:5297 +#: stmt.c:5345 msgid "switch missing default case" msgstr "" @@ -6738,7 +6750,7 @@ msgstr "" msgid "packed attribute is unnecessary" msgstr "" -#: targhooks.c:158 +#: targhooks.c:161 msgid "__builtin_saveregs not supported by this target" msgstr "" @@ -6820,71 +6832,71 @@ msgstr "" msgid "%J'%F' declared `static' but never defined" msgstr "" -#: toplev.c:1736 +#: toplev.c:1740 msgid "%J'%D' defined but not used" msgstr "" -#: toplev.c:1757 toplev.c:1774 +#: toplev.c:1761 toplev.c:1778 #, c-format msgid "`%s' is deprecated (declared at %s:%d)" msgstr "" -#: toplev.c:1777 +#: toplev.c:1781 #, c-format msgid "`%s' is deprecated" msgstr "" -#: toplev.c:1780 +#: toplev.c:1784 #, c-format msgid "type is deprecated (declared at %s:%d)" msgstr "" -#: toplev.c:1783 +#: toplev.c:1787 msgid "type is deprecated" msgstr "" -#: toplev.c:1980 +#: toplev.c:1984 #, c-format msgid "invalid register name `%s' for register variable" msgstr "" -#: toplev.c:3586 +#: toplev.c:3590 msgid "" "branch target register load optimization is not intended to be run twice" msgstr "" -#: toplev.c:3753 +#: toplev.c:3757 msgid "" "\n" "Target specific options:\n" msgstr "" -#: toplev.c:3767 toplev.c:3786 +#: toplev.c:3771 toplev.c:3790 #, c-format msgid " -m%-23s [undocumented]\n" msgstr "" -#: toplev.c:3795 +#: toplev.c:3799 msgid "" "\n" "There are undocumented target specific options as well.\n" msgstr "" -#: toplev.c:3797 +#: toplev.c:3801 msgid " They exist, but they are not documented.\n" msgstr "" -#: toplev.c:3852 +#: toplev.c:3856 #, c-format msgid "unrecognized gcc debugging option: %c" msgstr "" -#: toplev.c:3914 config/rs6000/rs6000.c:881 +#: toplev.c:3918 config/rs6000/rs6000.c:943 #, c-format msgid "invalid option `%s'" msgstr "" -#: toplev.c:3929 +#: toplev.c:3933 #, c-format msgid "" "%s%s%s version %s (%s)\n" @@ -6892,95 +6904,95 @@ msgid "" "%s%s%s version %s (%s) compiled by CC.\n" msgstr "" -#: toplev.c:3936 +#: toplev.c:3940 #, c-format msgid "" "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" msgstr "" -#: toplev.c:3988 +#: toplev.c:3992 msgid "options passed: " msgstr "" -#: toplev.c:4017 +#: toplev.c:4021 msgid "options enabled: " msgstr "" -#: toplev.c:4075 java/jcf-write.c:3422 +#: toplev.c:4079 java/jcf-write.c:3422 #, c-format msgid "can't open %s for writing: %m" msgstr "" -#: toplev.c:4152 +#: toplev.c:4162 config/sh/sh.c:6869 msgid "created and used with different settings of -fpic" msgstr "" -#: toplev.c:4154 +#: toplev.c:4164 config/sh/sh.c:6871 msgid "created and used with different settings of -fpie" msgstr "" -#: toplev.c:4203 +#: toplev.c:4215 config/sh/sh.c:6921 #, c-format msgid "created and used with differing settings of `-m%s'" msgstr "" -#: toplev.c:4206 +#: toplev.c:4218 config/sh/sh.c:6924 msgid "out of memory" msgstr "" -#: toplev.c:4387 +#: toplev.c:4399 msgid "instruction scheduling not supported on this target machine" msgstr "" -#: toplev.c:4391 +#: toplev.c:4403 msgid "this target machine does not have delayed branches" msgstr "" -#: toplev.c:4405 +#: toplev.c:4417 #, c-format msgid "-f%sleading-underscore not supported on this target machine" msgstr "" -#: toplev.c:4458 +#: toplev.c:4470 #, c-format msgid "target system does not support the \"%s\" debug format" msgstr "" -#: toplev.c:4475 +#: toplev.c:4487 msgid "-ffunction-sections not supported for this target" msgstr "" -#: toplev.c:4480 +#: toplev.c:4492 msgid "-fdata-sections not supported for this target" msgstr "" -#: toplev.c:4487 +#: toplev.c:4499 msgid "-ffunction-sections disabled; it makes profiling impossible" msgstr "" -#: toplev.c:4494 +#: toplev.c:4506 msgid "-fprefetch-loop-arrays not supported for this target" msgstr "" -#: toplev.c:4500 +#: toplev.c:4512 msgid "" "-fprefetch-loop-arrays not supported for this target (try -march switches)" msgstr "" -#: toplev.c:4509 +#: toplev.c:4521 msgid "-fprefetch-loop-arrays is not supported with -Os" msgstr "" -#: toplev.c:4515 +#: toplev.c:4527 msgid "-ffunction-sections may affect debugging on some targets" msgstr "" -#: toplev.c:4617 +#: toplev.c:4629 #, c-format msgid "error writing to %s: %m" msgstr "" -#: toplev.c:4619 java/jcf-parse.c:909 java/jcf-write.c:3429 +#: toplev.c:4631 java/jcf-parse.c:909 java/jcf-write.c:3429 #, c-format msgid "error closing %s: %m" msgstr "" @@ -6995,43 +7007,43 @@ msgstr "" msgid "ignoring unknown option `%.*s' in `-fdump-%s'" msgstr "" -#: tree-inline.c:1011 +#: tree-inline.c:1016 msgid "" "%Jfunction '%F' can never be inlined because it uses alloca (override using " "the always_inline attribute)" msgstr "" -#: tree-inline.c:1024 +#: tree-inline.c:1029 msgid "%Jfunction '%F' can never be inlined because it uses setjmp" msgstr "" -#: tree-inline.c:1038 +#: tree-inline.c:1044 msgid "" "%Jfunction '%F' can never be inlined because it uses variable argument lists" msgstr "" -#: tree-inline.c:1053 +#: tree-inline.c:1060 msgid "" "%Jfunction '%F' can never be inlined because it uses setjmp-longjmp " "exception handling" msgstr "" -#: tree-inline.c:1071 +#: tree-inline.c:1078 msgid "" "%Jfunction '%F' can never be inlined because it contains a nested function" msgstr "" -#: tree-inline.c:1088 +#: tree-inline.c:1095 msgid "" "%Jfunction '%F' can never be inlined because it contains a computed goto" msgstr "" -#: tree-inline.c:1098 +#: tree-inline.c:1105 msgid "" "%Jfunction '%F' can never be inlined because it contains a nonlocal goto" msgstr "" -#: tree-inline.c:1121 +#: tree-inline.c:1128 msgid "" "%Jfunction '%F' can never be inlined because it uses variable sized variables" msgstr "" @@ -7044,34 +7056,34 @@ msgstr "" msgid "%Jsize of return value of '%D' is larger than %wd bytes" msgstr "" -#: tree.c:3785 +#: tree.c:3793 msgid "arrays of functions are not meaningful" msgstr "" -#: tree.c:3840 +#: tree.c:3848 msgid "function return type cannot be function" msgstr "" -#: tree.c:4669 +#: tree.c:4677 msgid "invalid initializer for bit string" msgstr "" -#: tree.c:4721 +#: tree.c:4729 #, c-format msgid "tree check: expected %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:4734 +#: tree.c:4742 #, c-format msgid "tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d" msgstr "" -#: tree.c:4747 +#: tree.c:4755 #, c-format msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d" msgstr "" -#: tree.c:4759 +#: tree.c:4767 #, c-format msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d" msgstr "" @@ -7192,154 +7204,148 @@ msgstr "" msgid "The maximum number of instructions when automatically inlining" msgstr "" -#: params.def:84 -msgid "" -"The maximum number of instructions by repeated inlining before gcc starts to " -"throttle inlining" -msgstr "" - -#: params.def:94 +#: params.def:75 msgid "The maximum number of instructions for the RTL inliner" msgstr "" -#: params.def:105 +#: params.def:86 msgid "The maximum number of instructions to consider to fill a delay slot" msgstr "" -#: params.def:116 +#: params.def:97 msgid "" "The maximum number of instructions to consider to find accurate live " "register information" msgstr "" -#: params.def:126 +#: params.def:107 msgid "The maximum length of scheduling's pending operations list" msgstr "" -#: params.def:131 +#: params.def:112 msgid "The size of function body to be considered large" msgstr "" -#: params.def:135 +#: params.def:116 msgid "Maximal growth due to inlining of large function (in percent)" msgstr "" -#: params.def:139 +#: params.def:120 msgid "" "how much can given compilation unit grow because of the inlining (in percent)" msgstr "" -#: params.def:146 +#: params.def:127 msgid "The maximum amount of memory to be allocated by GCSE" msgstr "" -#: params.def:151 +#: params.def:132 msgid "The maximum number of passes to make when doing GCSE" msgstr "" -#: params.def:158 +#: params.def:139 msgid "The maximum number of instructions to consider to unroll in a loop" msgstr "" -#: params.def:164 +#: params.def:145 msgid "" "The maximum number of instructions to consider to unroll in a loop on average" msgstr "" -#: params.def:169 +#: params.def:150 msgid "The maximum number of unrollings of a single loop" msgstr "" -#: params.def:174 +#: params.def:155 msgid "The maximum number of insns of a peeled loop" msgstr "" -#: params.def:179 +#: params.def:160 msgid "The maximum number of peelings of a single loop" msgstr "" -#: params.def:184 +#: params.def:165 msgid "The maximum number of insns of a completely peeled loop" msgstr "" -#: params.def:189 +#: params.def:170 msgid "" "The maximum number of peelings of a single loop that is peeled completely" msgstr "" -#: params.def:194 +#: params.def:175 msgid "The maximum number of insns of a peeled loop that rolls only once" msgstr "" -#: params.def:200 +#: params.def:181 msgid "The maximum number of insns of an unswitched loop" msgstr "" -#: params.def:205 +#: params.def:186 msgid "The maximum number of unswitchings in a single loop" msgstr "" -#: params.def:210 +#: params.def:191 msgid "" "Select fraction of the maximal count of repetitions of basic block in " "program given basic block needs to have to be considered hot" msgstr "" -#: params.def:215 +#: params.def:196 msgid "" "Select fraction of the maximal frequency of executions of basic block in " "function given basic block needs to have to be considered hot" msgstr "" -#: params.def:220 +#: params.def:201 msgid "" "The percentage of function, weighted by execution frequency, that must be " "covered by trace formation. Used when profile feedback is available" msgstr "" -#: params.def:225 +#: params.def:206 msgid "" "The percentage of function, weighted by execution frequency, that must be " "covered by trace formation. Used when profile feedback is not available" msgstr "" -#: params.def:230 +#: params.def:211 msgid "Maximal code growth caused by tail duplication (in percent)" msgstr "" -#: params.def:234 +#: params.def:215 msgid "" "Stop reverse growth if the reverse probability of best edge is less than " "this threshold (in percent)" msgstr "" -#: params.def:239 +#: params.def:220 msgid "" "Stop forward growth if the probability of best edge is less than this " "threshold (in percent). Used when profile feedback is available" msgstr "" -#: params.def:244 +#: params.def:225 msgid "" "Stop forward growth if the probability of best edge is less than this " "threshold (in percent). Used when profile feedback is not available" msgstr "" -#: params.def:251 +#: params.def:232 msgid "The maximum number of incoming edges to consider for crossjumping" msgstr "" -#: params.def:257 +#: params.def:238 msgid "The maximum length of path considered in cse" msgstr "" -#: params.def:270 +#: params.def:251 msgid "" "Minimum heap expansion to trigger garbage collection, as a percentage of the " "total size of the heap" msgstr "" -#: params.def:276 +#: params.def:257 msgid "Minimum heap size before we start collecting garbage, in kilobytes" msgstr "" @@ -7372,6 +7378,12 @@ msgstr "" msgid "junk at end of '#pragma unused'" msgstr "" +#: config/darwin.c:1347 +msgid "" +"internal and protected visibility attributes not supportedin this " +"configuration; ignored" +msgstr "" + #: config/lynx-ng.h:97 config/lynx.h:116 config/rs6000/lynx.h:73 msgid "-msystem-v and -p are incompatible" msgstr "" @@ -7412,7 +7424,7 @@ msgstr "" msgid "bad value `%s' for -mfp-trap-mode switch" msgstr "" -#: config/alpha/alpha.c:324 config/rs6000/rs6000.c:1035 +#: config/alpha/alpha.c:324 config/rs6000/rs6000.c:1097 #, c-format msgid "bad value `%s' for -mtls-size switch" msgstr "" @@ -7448,90 +7460,90 @@ msgstr "" msgid "bad value `%s' for -mmemory-latency" msgstr "" -#: config/alpha/alpha.c:5402 +#: config/alpha/alpha.c:5386 #, c-format msgid "invalid %%H value" msgstr "" -#: config/alpha/alpha.c:5423 +#: config/alpha/alpha.c:5407 #, c-format msgid "invalid %%J value" msgstr "" -#: config/alpha/alpha.c:5439 config/ia64/ia64.c:4013 +#: config/alpha/alpha.c:5423 config/ia64/ia64.c:4069 #, c-format msgid "invalid %%r value" msgstr "" -#: config/alpha/alpha.c:5449 config/rs6000/rs6000.c:8720 -#: config/xtensa/xtensa.c:1971 +#: config/alpha/alpha.c:5433 config/rs6000/rs6000.c:8880 +#: config/xtensa/xtensa.c:1975 #, c-format msgid "invalid %%R value" msgstr "" -#: config/alpha/alpha.c:5455 config/rs6000/rs6000.c:8639 -#: config/xtensa/xtensa.c:1938 +#: config/alpha/alpha.c:5439 config/rs6000/rs6000.c:8799 +#: config/xtensa/xtensa.c:1942 #, c-format msgid "invalid %%N value" msgstr "" -#: config/alpha/alpha.c:5463 config/rs6000/rs6000.c:8667 +#: config/alpha/alpha.c:5447 config/rs6000/rs6000.c:8827 #, c-format msgid "invalid %%P value" msgstr "" -#: config/alpha/alpha.c:5471 +#: config/alpha/alpha.c:5455 #, c-format msgid "invalid %%h value" msgstr "" -#: config/alpha/alpha.c:5479 config/xtensa/xtensa.c:1964 +#: config/alpha/alpha.c:5463 config/xtensa/xtensa.c:1968 #, c-format msgid "invalid %%L value" msgstr "" -#: config/alpha/alpha.c:5518 config/rs6000/rs6000.c:8621 +#: config/alpha/alpha.c:5502 config/rs6000/rs6000.c:8781 #, c-format msgid "invalid %%m value" msgstr "" -#: config/alpha/alpha.c:5526 config/rs6000/rs6000.c:8629 +#: config/alpha/alpha.c:5510 config/rs6000/rs6000.c:8789 #, c-format msgid "invalid %%M value" msgstr "" -#: config/alpha/alpha.c:5570 +#: config/alpha/alpha.c:5554 #, c-format msgid "invalid %%U value" msgstr "" -#: config/alpha/alpha.c:5582 config/alpha/alpha.c:5596 -#: config/rs6000/rs6000.c:8728 +#: config/alpha/alpha.c:5566 config/alpha/alpha.c:5580 +#: config/rs6000/rs6000.c:8888 #, c-format msgid "invalid %%s value" msgstr "" -#: config/alpha/alpha.c:5619 +#: config/alpha/alpha.c:5603 #, c-format msgid "invalid %%C value" msgstr "" -#: config/alpha/alpha.c:5656 config/rs6000/rs6000.c:8478 +#: config/alpha/alpha.c:5640 config/rs6000/rs6000.c:8638 #, c-format msgid "invalid %%E value" msgstr "" -#: config/alpha/alpha.c:5681 config/alpha/alpha.c:5729 +#: config/alpha/alpha.c:5665 config/alpha/alpha.c:5713 msgid "unknown relocation unspec" msgstr "" -#: config/alpha/alpha.c:5690 config/rs6000/rs6000.c:9041 +#: config/alpha/alpha.c:5674 config/rs6000/rs6000.c:9201 #, c-format msgid "invalid %%xn code" msgstr "" -#: config/alpha/alpha.c:6618 config/alpha/alpha.c:6621 config/s390/s390.c:6470 -#: config/s390/s390.c:6473 +#: config/alpha/alpha.c:6602 config/alpha/alpha.c:6605 config/s390/s390.c:6619 +#: config/s390/s390.c:6622 msgid "bad builtin fcode" msgstr "" @@ -7541,13 +7553,13 @@ msgstr "" #. where VALUE is the bits to set or minus the bits to clear. #. An empty string NAME is used to identify the default VALUE. #: config/alpha/alpha.h:286 config/i386/i386.h:327 config/i386/i386.h:329 -#: config/i386/i386.h:331 config/ns32k/ns32k.h:140 config/rs6000/rs6000.h:293 +#: config/i386/i386.h:331 config/ns32k/ns32k.h:140 config/rs6000/rs6000.h:297 #: config/s390/s390.h:123 config/sparc/sparc.h:537 config/sparc/sparc.h:542 msgid "Use hardware fp" msgstr "" #: config/alpha/alpha.h:287 config/i386/i386.h:328 config/i386/i386.h:330 -#: config/rs6000/rs6000.h:295 config/sparc/sparc.h:539 +#: config/rs6000/rs6000.h:299 config/sparc/sparc.h:539 #: config/sparc/sparc.h:544 msgid "Do not use hardware fp" msgstr "" @@ -7659,7 +7671,7 @@ msgstr "" msgid "Tune expected memory latency" msgstr "" -#: config/alpha/alpha.h:365 config/ia64/ia64.h:243 config/rs6000/sysv4.h:90 +#: config/alpha/alpha.h:365 config/ia64/ia64.h:258 config/rs6000/sysv4.h:90 msgid "Specify bit size of immediate TLS offsets" msgstr "" @@ -7668,38 +7680,38 @@ msgstr "" msgid "bad value (%s) for -mcpu switch" msgstr "" -#: config/arc/arc.c:371 +#: config/arc/arc.c:369 #, c-format msgid "argument of `%s' attribute is not a string constant" msgstr "" -#: config/arc/arc.c:378 +#: config/arc/arc.c:376 #, c-format msgid "argument of `%s' attribute is not \"ilink1\" or \"ilink2\"" msgstr "" -#: config/arc/arc.c:1772 config/m32r/m32r.c:2281 +#: config/arc/arc.c:1713 config/m32r/m32r.c:2281 #, c-format msgid "invalid operand to %%R code" msgstr "" -#: config/arc/arc.c:1804 config/m32r/m32r.c:2304 +#: config/arc/arc.c:1745 config/m32r/m32r.c:2304 #, c-format msgid "invalid operand to %%H/%%L code" msgstr "" -#: config/arc/arc.c:1827 config/m32r/m32r.c:2375 +#: config/arc/arc.c:1768 config/m32r/m32r.c:2375 #, c-format msgid "invalid operand to %%U code" msgstr "" -#: config/arc/arc.c:1838 +#: config/arc/arc.c:1779 #, c-format msgid "invalid operand to %%V code" msgstr "" #. Unknown flag. -#: config/arc/arc.c:1845 config/m32r/m32r.c:2408 config/sparc/sparc.c:6857 +#: config/arc/arc.c:1786 config/m32r/m32r.c:2408 config/sparc/sparc.c:6858 msgid "invalid operand output code" msgstr "" @@ -7708,7 +7720,7 @@ msgstr "" msgid "switch -mcpu=%s conflicts with -march= switch" msgstr "" -#: config/arm/arm.c:529 config/rs6000/rs6000.c:731 config/sparc/sparc.c:419 +#: config/arm/arm.c:529 config/rs6000/rs6000.c:793 config/sparc/sparc.c:419 #, c-format msgid "bad value (%s) for %s switch" msgstr "" @@ -7792,36 +7804,36 @@ msgstr "" msgid "unable to use '%s' for PIC register" msgstr "" -#: config/arm/arm.c:2204 config/arm/arm.c:2222 config/avr/avr.c:4580 -#: config/c4x/c4x.c:4445 config/h8300/h8300.c:4255 config/i386/i386.c:1561 -#: config/i386/i386.c:1607 config/ip2k/ip2k.c:3234 -#: config/m68hc11/m68hc11.c:1291 config/m68k/m68k.c:319 +#: config/arm/arm.c:2201 config/arm/arm.c:2219 config/avr/avr.c:4580 +#: config/c4x/c4x.c:4445 config/h8300/h8300.c:4255 config/i386/i386.c:1565 +#: config/i386/i386.c:1611 config/ip2k/ip2k.c:3234 +#: config/m68hc11/m68hc11.c:1227 config/m68k/m68k.c:344 #: config/mcore/mcore.c:3374 config/ns32k/ns32k.c:1091 -#: config/rs6000/rs6000.c:14300 config/sh/sh.c:6715 config/sh/sh.c:6736 -#: config/sh/sh.c:6771 config/stormy16/stormy16.c:2073 config/v850/v850.c:2173 +#: config/rs6000/rs6000.c:14496 config/sh/sh.c:6723 config/sh/sh.c:6744 +#: config/sh/sh.c:6779 config/stormy16/stormy16.c:2073 config/v850/v850.c:2173 #, c-format msgid "`%s' attribute only applies to functions" msgstr "" -#: config/arm/arm.c:10450 +#: config/arm/arm.c:10455 msgid "unable to compute real location of stacked parameter" msgstr "" #. @@@ better error message -#: config/arm/arm.c:11078 config/arm/arm.c:11115 +#: config/arm/arm.c:11083 config/arm/arm.c:11120 msgid "selector must be an immediate" msgstr "" #. @@@ better error message -#: config/arm/arm.c:11158 config/i386/i386.c:14096 config/i386/i386.c:14130 +#: config/arm/arm.c:11163 config/i386/i386.c:14189 config/i386/i386.c:14223 msgid "mask must be an immediate" msgstr "" -#: config/arm/arm.c:11821 +#: config/arm/arm.c:11826 msgid "no low registers available for popping high registers" msgstr "" -#: config/arm/arm.c:12066 +#: config/arm/arm.c:12071 msgid "interrupt Service Routines cannot be coded in Thumb mode" msgstr "" @@ -8643,61 +8655,61 @@ msgstr "" msgid "Together with -fpic and -fPIC, do not use GOTPLT references" msgstr "" -#: config/d30v/d30v.c:215 +#: config/d30v/d30v.c:219 #, c-format msgid "bad modes_tieable_p for register %s, mode1 %s, mode2 %s" msgstr "" -#: config/d30v/d30v.c:2675 +#: config/d30v/d30v.c:2679 msgid "bad insn to d30v_print_operand_address:" msgstr "" -#: config/d30v/d30v.c:2692 config/d30v/d30v.c:2753 config/d30v/d30v.c:2774 -#: config/d30v/d30v.c:2792 +#: config/d30v/d30v.c:2696 config/d30v/d30v.c:2757 config/d30v/d30v.c:2778 +#: config/d30v/d30v.c:2796 msgid "bad insn to d30v_print_operand_memory_reference:" msgstr "" -#: config/d30v/d30v.c:2860 +#: config/d30v/d30v.c:2864 msgid "bad insn to d30v_print_operand, 'f' modifier:" msgstr "" -#: config/d30v/d30v.c:2869 +#: config/d30v/d30v.c:2873 msgid "bad insn to d30v_print_operand, 'A' modifier:" msgstr "" -#: config/d30v/d30v.c:2876 +#: config/d30v/d30v.c:2880 msgid "bad insn to d30v_print_operand, 'M' modifier:" msgstr "" -#: config/d30v/d30v.c:2930 +#: config/d30v/d30v.c:2934 msgid "bad insn to print_operand, 'F' or 'T' modifier:" msgstr "" -#: config/d30v/d30v.c:2941 +#: config/d30v/d30v.c:2945 msgid "bad insn to print_operand, 'B' modifier:" msgstr "" -#: config/d30v/d30v.c:2948 +#: config/d30v/d30v.c:2952 msgid "bad insn to print_operand, 'E' modifier:" msgstr "" -#: config/d30v/d30v.c:2966 +#: config/d30v/d30v.c:2970 msgid "bad insn to print_operand, 'R' modifier:" msgstr "" -#: config/d30v/d30v.c:2975 config/d30v/d30v.c:2983 +#: config/d30v/d30v.c:2979 config/d30v/d30v.c:2987 msgid "bad insn to print_operand, 's' modifier:" msgstr "" -#: config/d30v/d30v.c:3012 +#: config/d30v/d30v.c:3016 msgid "bad insn in d30v_print_operand, 0 case" msgstr "" -#: config/d30v/d30v.c:3310 +#: config/d30v/d30v.c:3314 msgid "d30v_emit_comparison" msgstr "" -#: config/d30v/d30v.c:3354 +#: config/d30v/d30v.c:3358 msgid "bad call to d30v_move_2words" msgstr "" @@ -8880,46 +8892,46 @@ msgstr "" msgid "trampolines not yet implemented" msgstr "" -#: config/fr30/fr30.c:455 +#: config/fr30/fr30.c:456 msgid "fr30_print_operand_address: unhandled address" msgstr "" -#: config/fr30/fr30.c:482 +#: config/fr30/fr30.c:483 #, c-format msgid "fr30_print_operand: unrecognized %%p code" msgstr "" -#: config/fr30/fr30.c:502 +#: config/fr30/fr30.c:503 #, c-format msgid "fr30_print_operand: unrecognized %%b code" msgstr "" -#: config/fr30/fr30.c:523 +#: config/fr30/fr30.c:524 #, c-format msgid "fr30_print_operand: unrecognized %%B code" msgstr "" -#: config/fr30/fr30.c:531 +#: config/fr30/fr30.c:532 #, c-format msgid "fr30_print_operand: invalid operand to %%A code" msgstr "" -#: config/fr30/fr30.c:548 +#: config/fr30/fr30.c:549 #, c-format msgid "fr30_print_operand: invalid %%x code" msgstr "" -#: config/fr30/fr30.c:555 +#: config/fr30/fr30.c:556 #, c-format msgid "fr30_print_operand: invalid %%F code" msgstr "" -#: config/fr30/fr30.c:572 +#: config/fr30/fr30.c:573 msgid "fr30_print_operand: unknown code" msgstr "" -#: config/fr30/fr30.c:601 config/fr30/fr30.c:610 config/fr30/fr30.c:621 -#: config/fr30/fr30.c:634 +#: config/fr30/fr30.c:602 config/fr30/fr30.c:611 config/fr30/fr30.c:622 +#: config/fr30/fr30.c:635 msgid "fr30_print_operand: unhandled MEM" msgstr "" @@ -8927,136 +8939,136 @@ msgstr "" msgid "Assume small address space" msgstr "" -#: config/frv/frv.c:415 config/frv/frv.c:433 +#: config/frv/frv.c:391 config/frv/frv.c:409 #, c-format msgid "Unknown cpu: -mcpu=%s" msgstr "" -#: config/frv/frv.c:456 +#: config/frv/frv.c:432 msgid "-fpic and -gdwarf are incompatible (-fpic and -g/-gdwarf-2 are fine)" msgstr "" -#: config/frv/frv.c:2465 +#: config/frv/frv.c:2395 msgid "Bad insn to frv_print_operand_address:" msgstr "" -#: config/frv/frv.c:2478 +#: config/frv/frv.c:2406 msgid "Bad register to frv_print_operand_memory_reference_reg:" msgstr "" -#: config/frv/frv.c:2519 config/frv/frv.c:2529 config/frv/frv.c:2538 -#: config/frv/frv.c:2566 config/frv/frv.c:2579 config/frv/frv.c:2583 +#: config/frv/frv.c:2444 config/frv/frv.c:2454 config/frv/frv.c:2463 +#: config/frv/frv.c:2491 config/frv/frv.c:2504 config/frv/frv.c:2508 msgid "Bad insn to frv_print_operand_memory_reference:" msgstr "" -#: config/frv/frv.c:2725 +#: config/frv/frv.c:2646 msgid "Bad insn in frv_print_operand, bad const_double" msgstr "" -#: config/frv/frv.c:2770 +#: config/frv/frv.c:2691 msgid "Bad insn to frv_print_operand, 'C' modifier:" msgstr "" -#: config/frv/frv.c:2793 +#: config/frv/frv.c:2714 msgid "Bad insn to frv_print_operand, 'c' modifier:" msgstr "" -#: config/frv/frv.c:2818 +#: config/frv/frv.c:2739 msgid "Bad insn to frv_print_operand, 'e' modifier:" msgstr "" -#: config/frv/frv.c:2826 +#: config/frv/frv.c:2747 msgid "Bad insn to frv_print_operand, 'F' modifier:" msgstr "" -#: config/frv/frv.c:2842 +#: config/frv/frv.c:2763 msgid "Bad insn to frv_print_operand, 'f' modifier:" msgstr "" -#: config/frv/frv.c:2895 +#: config/frv/frv.c:2816 msgid "Bad insn to frv_print_operand, 'L' modifier:" msgstr "" -#: config/frv/frv.c:2908 +#: config/frv/frv.c:2829 msgid "Bad insn to frv_print_operand, 'M/N' modifier:" msgstr "" -#: config/frv/frv.c:2929 +#: config/frv/frv.c:2850 msgid "Bad insn to frv_print_operand, 'O' modifier:" msgstr "" -#: config/frv/frv.c:2947 +#: config/frv/frv.c:2868 msgid "Bad insn to frv_print_operand, P modifier:" msgstr "" -#: config/frv/frv.c:2967 +#: config/frv/frv.c:2888 msgid "Bad insn in frv_print_operand, z case" msgstr "" -#: config/frv/frv.c:2995 +#: config/frv/frv.c:2916 msgid "Bad insn in frv_print_operand, 0 case" msgstr "" -#: config/frv/frv.c:3000 +#: config/frv/frv.c:2921 msgid "frv_print_operand: unknown code" msgstr "" -#: config/frv/frv.c:5683 +#: config/frv/frv.c:5471 msgid "Bad output_move_single operand" msgstr "" -#: config/frv/frv.c:5812 +#: config/frv/frv.c:5598 msgid "Bad output_move_double operand" msgstr "" -#: config/frv/frv.c:5956 +#: config/frv/frv.c:5740 msgid "Bad output_condmove_single operand" msgstr "" -#: config/frv/frv.c:8300 +#: config/frv/frv.c:8019 msgid "frv_registers_update" msgstr "" -#: config/frv/frv.c:8460 +#: config/frv/frv.c:8176 msgid "frv_registers_used_p" msgstr "" -#: config/frv/frv.c:8589 +#: config/frv/frv.c:8302 msgid "frv_registers_set_p" msgstr "" -#: config/frv/frv.c:9188 +#: config/frv/frv.c:8898 msgid "accumulator is not a constant integer" msgstr "" -#: config/frv/frv.c:9193 +#: config/frv/frv.c:8903 msgid "accumulator number is out of bounds" msgstr "" -#: config/frv/frv.c:9204 +#: config/frv/frv.c:8914 #, c-format msgid "inappropriate accumulator for `%s'" msgstr "" -#: config/frv/frv.c:9270 +#: config/frv/frv.c:8974 #, c-format msgid "`%s' expects a constant argument" msgstr "" -#: config/frv/frv.c:9275 +#: config/frv/frv.c:8979 #, c-format msgid "constant argument out of range for `%s'" msgstr "" -#: config/frv/frv.c:9655 +#: config/frv/frv.c:9326 msgid "media functions are not available unless -mmedia is used" msgstr "" -#: config/frv/frv.c:9667 +#: config/frv/frv.c:9338 msgid "this media function is only available on the fr500" msgstr "" -#: config/frv/frv.c:9695 +#: config/frv/frv.c:9366 msgid "this media function is only available on the fr400" msgstr "" @@ -9170,169 +9182,169 @@ msgstr "" msgid "Do not generate char instructions" msgstr "" -#: config/i386/i386.c:1151 +#: config/i386/i386.c:1155 #, c-format msgid "code model %s not supported in PIC mode" msgstr "" -#: config/i386/i386.c:1161 config/sparc/sparc.c:382 +#: config/i386/i386.c:1165 config/sparc/sparc.c:382 #, c-format msgid "bad value (%s) for -mcmodel= switch" msgstr "" -#: config/i386/i386.c:1176 +#: config/i386/i386.c:1180 #, c-format msgid "bad value (%s) for -masm= switch" msgstr "" -#: config/i386/i386.c:1179 +#: config/i386/i386.c:1183 #, c-format msgid "code model `%s' not supported in the %s bit mode" msgstr "" -#: config/i386/i386.c:1182 +#: config/i386/i386.c:1186 msgid "code model `large' not supported yet" msgstr "" -#: config/i386/i386.c:1184 +#: config/i386/i386.c:1188 #, c-format msgid "%i-bit mode not compiled in" msgstr "" -#: config/i386/i386.c:1211 config/i386/i386.c:1223 +#: config/i386/i386.c:1215 config/i386/i386.c:1227 msgid "CPU you selected does not support x86-64 instruction set" msgstr "" -#: config/i386/i386.c:1216 config/iq2000/iq2000.c:1806 +#: config/i386/i386.c:1220 config/iq2000/iq2000.c:1806 #, c-format msgid "bad value (%s) for -march= switch" msgstr "" -#: config/i386/i386.c:1229 +#: config/i386/i386.c:1233 #, c-format msgid "bad value (%s) for -mtune= switch" msgstr "" -#: config/i386/i386.c:1246 +#: config/i386/i386.c:1250 #, c-format msgid "-mregparm=%d is not between 0 and %d" msgstr "" -#: config/i386/i386.c:1259 +#: config/i386/i386.c:1263 msgid "-malign-loops is obsolete, use -falign-loops" msgstr "" -#: config/i386/i386.c:1264 config/i386/i386.c:1277 config/i386/i386.c:1290 +#: config/i386/i386.c:1268 config/i386/i386.c:1281 config/i386/i386.c:1294 #, c-format msgid "-malign-loops=%d is not between 0 and %d" msgstr "" -#: config/i386/i386.c:1272 +#: config/i386/i386.c:1276 msgid "-malign-jumps is obsolete, use -falign-jumps" msgstr "" -#: config/i386/i386.c:1285 +#: config/i386/i386.c:1289 msgid "-malign-functions is obsolete, use -falign-functions" msgstr "" -#: config/i386/i386.c:1323 +#: config/i386/i386.c:1327 #, c-format msgid "-mpreferred-stack-boundary=%d is not between %d and 12" msgstr "" -#: config/i386/i386.c:1335 +#: config/i386/i386.c:1339 #, c-format msgid "-mbranch-cost=%d is not between 0 and 5" msgstr "" -#: config/i386/i386.c:1347 +#: config/i386/i386.c:1351 #, c-format msgid "bad value (%s) for -mtls-dialect= switch" msgstr "" -#: config/i386/i386.c:1376 +#: config/i386/i386.c:1380 msgid "-malign-double makes no sense in the 64bit mode" msgstr "" -#: config/i386/i386.c:1378 +#: config/i386/i386.c:1382 msgid "-mrtd calling convention not supported in the 64bit mode" msgstr "" -#: config/i386/i386.c:1400 config/i386/i386.c:1411 +#: config/i386/i386.c:1404 config/i386/i386.c:1415 msgid "SSE instruction set disabled, using 387 arithmetics" msgstr "" -#: config/i386/i386.c:1416 +#: config/i386/i386.c:1420 msgid "387 instruction set disabled, using SSE arithmetics" msgstr "" -#: config/i386/i386.c:1423 +#: config/i386/i386.c:1427 #, c-format msgid "bad value (%s) for -mfpmath= switch" msgstr "" -#: config/i386/i386.c:1571 config/i386/i386.c:1582 +#: config/i386/i386.c:1575 config/i386/i386.c:1586 msgid "fastcall and stdcall attributes are not compatible" msgstr "" -#: config/i386/i386.c:1575 config/i386/i386.c:1631 +#: config/i386/i386.c:1579 config/i386/i386.c:1635 msgid "fastcall and regparm attributes are not compatible" msgstr "" -#: config/i386/i386.c:1618 +#: config/i386/i386.c:1622 #, c-format msgid "`%s' attribute requires an integer constant argument" msgstr "" -#: config/i386/i386.c:1624 +#: config/i386/i386.c:1628 #, c-format msgid "argument to `%s' attribute larger than %d" msgstr "" -#: config/i386/i386.c:2771 +#: config/i386/i386.c:2780 msgid "SSE vector return without SSE enabled changes the ABI" msgstr "" -#: config/i386/i386.c:6723 +#: config/i386/i386.c:6784 msgid "invalid UNSPEC as operand" msgstr "" -#: config/i386/i386.c:6974 +#: config/i386/i386.c:7038 msgid "extended registers have no high halves" msgstr "" -#: config/i386/i386.c:6989 +#: config/i386/i386.c:7053 msgid "unsupported operand size for extended register" msgstr "" -#: config/i386/i386.c:7299 +#: config/i386/i386.c:7368 msgid "" "operand is neither a constant nor a condition code, invalid operand code 'c'" msgstr "" -#: config/i386/i386.c:7345 +#: config/i386/i386.c:7414 #, c-format msgid "invalid operand code `%c'" msgstr "" -#: config/i386/i386.c:7390 +#: config/i386/i386.c:7459 msgid "invalid constraints for operand" msgstr "" -#: config/i386/i386.c:11787 +#: config/i386/i386.c:11859 msgid "unknown insn mode" msgstr "" -#: config/i386/i386.c:13898 config/i386/i386.c:13934 +#: config/i386/i386.c:13991 config/i386/i386.c:14027 #, c-format msgid "selector must be an integer constant in the range 0..%i" msgstr "" -#: config/i386/i386.c:14162 +#: config/i386/i386.c:14255 msgid "shift must be an immediate" msgstr "" -#: config/i386/i386.c:15186 +#: config/i386/i386.c:15278 #, c-format msgid "`%s' incompatible attribute ignored" msgstr "" @@ -9626,7 +9638,7 @@ msgstr "" #. variable, type `char *', is set to the variable part of the given #. option if the fixed part matches. The actual option name is made #. by appending `-m' to the specified name. -#: config/i386/i386.h:459 config/ia64/ia64.h:245 config/rs6000/rs6000.h:412 +#: config/i386/i386.h:459 config/ia64/ia64.h:260 config/rs6000/rs6000.h:416 #: config/s390/s390.h:145 config/sparc/sparc.h:650 msgid "Schedule code for given CPU" msgstr "" @@ -9732,19 +9744,19 @@ msgstr "" msgid "sorry, not implemented: #pragma noalign NAME" msgstr "" -#: config/i960/i960.c:130 config/i960/i960.c:140 +#: config/i960/i960.c:134 config/i960/i960.c:144 msgid "conflicting architectures defined - using C series" msgstr "" -#: config/i960/i960.c:135 +#: config/i960/i960.c:139 msgid "conflicting architectures defined - using K series" msgstr "" -#: config/i960/i960.c:150 +#: config/i960/i960.c:154 msgid "iC2.0 and iC3.0 are incompatible - using iC3.0" msgstr "" -#: config/i960/i960.c:1452 config/m68k/m68k.c:652 config/rs6000/rs6000.c:11039 +#: config/i960/i960.c:1456 config/m68k/m68k.c:599 config/rs6000/rs6000.c:11237 msgid "stack limit expression is not supported" msgstr "" @@ -9901,33 +9913,41 @@ msgstr "" msgid "%Jaddress area attribute cannot be specified for functions" msgstr "" -#: config/ia64/ia64.c:4058 +#: config/ia64/ia64.c:4114 msgid "ia64_print_operand: unknown code" msgstr "" -#: config/ia64/ia64.c:4405 +#: config/ia64/ia64.c:4461 msgid "value of -mfixed-range must have form REG1-REG2" msgstr "" -#: config/ia64/ia64.c:4432 +#: config/ia64/ia64.c:4488 #, c-format msgid "%s-%s is an empty range" msgstr "" -#: config/ia64/ia64.c:4480 +#: config/ia64/ia64.c:4536 msgid "cannot optimize floating point division for both latency and throughput" msgstr "" -#: config/ia64/ia64.c:4486 +#: config/ia64/ia64.c:4542 msgid "cannot optimize integer division for both latency and throughput" msgstr "" -#: config/ia64/ia64.c:4498 +#: config/ia64/ia64.c:4548 +msgid "cannot optimize square root for both latency and throughput" +msgstr "" + +#: config/ia64/ia64.c:4554 +msgid "not yet implemented: latency-optimized inline square root" +msgstr "" + +#: config/ia64/ia64.c:4566 #, c-format msgid "bad value (%s) for -mtls-size= switch" msgstr "" -#: config/ia64/ia64.c:4514 +#: config/ia64/ia64.c:4582 #, c-format msgid "bad value (%s) for -tune= switch" msgstr "" @@ -9935,99 +9955,107 @@ msgstr "" #. This macro defines names of command options to set and clear bits in #. `target_flags'. Its definition is an initializer with a subgrouping for #. each command option. -#: config/ia64/ia64.h:152 +#: config/ia64/ia64.h:163 msgid "Generate big endian code" msgstr "" -#: config/ia64/ia64.h:154 config/mcore/mcore.h:154 +#: config/ia64/ia64.h:165 config/mcore/mcore.h:154 msgid "Generate little endian code" msgstr "" -#: config/ia64/ia64.h:156 +#: config/ia64/ia64.h:167 msgid "Generate code for GNU as" msgstr "" -#: config/ia64/ia64.h:158 +#: config/ia64/ia64.h:169 msgid "Generate code for Intel as" msgstr "" -#: config/ia64/ia64.h:160 +#: config/ia64/ia64.h:171 msgid "Generate code for GNU ld" msgstr "" -#: config/ia64/ia64.h:162 +#: config/ia64/ia64.h:173 msgid "Generate code for Intel ld" msgstr "" -#: config/ia64/ia64.h:164 +#: config/ia64/ia64.h:175 msgid "Generate code without GP reg" msgstr "" -#: config/ia64/ia64.h:166 +#: config/ia64/ia64.h:177 msgid "Emit stop bits before and after volatile extended asms" msgstr "" -#: config/ia64/ia64.h:168 +#: config/ia64/ia64.h:179 msgid "Don't emit stop bits before and after volatile extended asms" msgstr "" -#: config/ia64/ia64.h:170 +#: config/ia64/ia64.h:181 msgid "Emit code for Itanium (TM) processor B step" msgstr "" -#: config/ia64/ia64.h:172 +#: config/ia64/ia64.h:183 msgid "Use in/loc/out register names" msgstr "" -#: config/ia64/ia64.h:174 +#: config/ia64/ia64.h:185 msgid "Disable use of sdata/scommon/sbss" msgstr "" -#: config/ia64/ia64.h:176 +#: config/ia64/ia64.h:187 msgid "Enable use of sdata/scommon/sbss" msgstr "" -#: config/ia64/ia64.h:178 +#: config/ia64/ia64.h:189 msgid "gp is constant (but save/restore gp on indirect calls)" msgstr "" -#: config/ia64/ia64.h:180 +#: config/ia64/ia64.h:191 msgid "Generate self-relocatable code" msgstr "" -#: config/ia64/ia64.h:182 +#: config/ia64/ia64.h:193 msgid "Generate inline floating point division, optimize for latency" msgstr "" -#: config/ia64/ia64.h:184 +#: config/ia64/ia64.h:195 msgid "Generate inline floating point division, optimize for throughput" msgstr "" -#: config/ia64/ia64.h:186 +#: config/ia64/ia64.h:197 msgid "Generate inline integer division, optimize for latency" msgstr "" -#: config/ia64/ia64.h:188 +#: config/ia64/ia64.h:199 msgid "Generate inline integer division, optimize for throughput" msgstr "" -#: config/ia64/ia64.h:190 +#: config/ia64/ia64.h:201 +msgid "Generate inline square root, optimize for latency" +msgstr "" + +#: config/ia64/ia64.h:203 +msgid "Generate inline square root, optimize for throughput" +msgstr "" + +#: config/ia64/ia64.h:205 msgid "Enable Dwarf 2 line debug info via GNU as" msgstr "" -#: config/ia64/ia64.h:192 +#: config/ia64/ia64.h:207 msgid "Disable Dwarf 2 line debug info via GNU as" msgstr "" -#: config/ia64/ia64.h:194 +#: config/ia64/ia64.h:209 msgid "Enable earlier placing stop bits for better scheduling" msgstr "" -#: config/ia64/ia64.h:196 +#: config/ia64/ia64.h:211 msgid "Disable earlier placing stop bits" msgstr "" -#: config/ia64/ia64.h:241 +#: config/ia64/ia64.h:256 msgid "Specify range of registers to make fixed" msgstr "" @@ -10055,7 +10083,7 @@ msgstr "" msgid "argument `%d' is not a constant" msgstr "" -#: config/iq2000/iq2000.c:3313 config/xtensa/xtensa.c:2053 +#: config/iq2000/iq2000.c:3313 config/xtensa/xtensa.c:2057 msgid "PRINT_OPERAND_ADDRESS, null pointer" msgstr "" @@ -10064,8 +10092,8 @@ msgstr "" msgid "PRINT_OPERAND: Unknown punctuation '%c'" msgstr "" -#: config/iq2000/iq2000.c:3478 config/mips/mips.c:5347 -#: config/xtensa/xtensa.c:1907 +#: config/iq2000/iq2000.c:3478 config/mips/mips.c:5324 +#: config/xtensa/xtensa.c:1911 msgid "PRINT_OPERAND null pointer" msgstr "" @@ -10074,12 +10102,12 @@ msgstr "" msgid "invalid %%P operand" msgstr "" -#: config/iq2000/iq2000.c:3555 config/rs6000/rs6000.c:8657 +#: config/iq2000/iq2000.c:3555 config/rs6000/rs6000.c:8817 #, c-format msgid "invalid %%p value" msgstr "" -#: config/iq2000/iq2000.c:3619 config/mips/mips.c:5475 +#: config/iq2000/iq2000.c:3619 config/mips/mips.c:5454 #, c-format msgid "invalid use of %%d, %%x, or %%X" msgstr "" @@ -10167,7 +10195,7 @@ msgid "post-increment address is not a register" msgstr "" #: config/m32r/m32r.c:2514 config/m32r/m32r.c:2530 -#: config/rs6000/rs6000.c:14497 +#: config/rs6000/rs6000.c:14693 msgid "bad address" msgstr "" @@ -10200,54 +10228,54 @@ msgstr "" msgid "Small data area: none, sdata, use" msgstr "" -#: config/m68hc11/m68hc11.c:266 +#: config/m68hc11/m68hc11.c:269 #, c-format msgid "-f%s ignored for 68HC11/68HC12 (not supported)" msgstr "" -#: config/m68hc11/m68hc11.c:1327 +#: config/m68hc11/m68hc11.c:1260 msgid "`trap' and `far' attributes are not compatible, ignoring `far'" msgstr "" -#: config/m68hc11/m68hc11.c:1333 +#: config/m68hc11/m68hc11.c:1266 msgid "`trap' attribute is already used" msgstr "" #. !!!! SCz wrong here. -#: config/m68hc11/m68hc11.c:3331 config/m68hc11/m68hc11.c:3717 +#: config/m68hc11/m68hc11.c:3222 config/m68hc11/m68hc11.c:3606 msgid "move insn not handled" msgstr "" -#: config/m68hc11/m68hc11.c:3563 config/m68hc11/m68hc11.c:3647 -#: config/m68hc11/m68hc11.c:3920 +#: config/m68hc11/m68hc11.c:3454 config/m68hc11/m68hc11.c:3538 +#: config/m68hc11/m68hc11.c:3809 msgid "invalid register in the move instruction" msgstr "" -#: config/m68hc11/m68hc11.c:3597 +#: config/m68hc11/m68hc11.c:3488 msgid "invalid operand in the instruction" msgstr "" -#: config/m68hc11/m68hc11.c:3894 +#: config/m68hc11/m68hc11.c:3783 msgid "invalid register in the instruction" msgstr "" -#: config/m68hc11/m68hc11.c:3927 +#: config/m68hc11/m68hc11.c:3816 msgid "operand 1 must be a hard register" msgstr "" -#: config/m68hc11/m68hc11.c:3944 +#: config/m68hc11/m68hc11.c:3830 msgid "invalid rotate insn" msgstr "" -#: config/m68hc11/m68hc11.c:4365 +#: config/m68hc11/m68hc11.c:4246 msgid "registers IX, IY and Z used in the same INSN" msgstr "" -#: config/m68hc11/m68hc11.c:4702 config/m68hc11/m68hc11.c:5005 +#: config/m68hc11/m68hc11.c:4583 config/m68hc11/m68hc11.c:4883 msgid "cannot do z-register replacement" msgstr "" -#: config/m68hc11/m68hc11.c:5068 +#: config/m68hc11/m68hc11.c:4946 msgid "invalid Z register replacement for insn" msgstr "" @@ -10324,35 +10352,35 @@ msgstr "" msgid "Indicate the number of soft registers available" msgstr "" -#: config/m68k/m68k.c:213 +#: config/m68k/m68k.c:238 #, c-format msgid "-malign-loops=%d is not between 1 and %d" msgstr "" -#: config/m68k/m68k.c:224 +#: config/m68k/m68k.c:249 msgid "-mshared-library-id= specified without -mid-shared-library" msgstr "" -#: config/m68k/m68k.c:227 +#: config/m68k/m68k.c:252 #, c-format msgid "-mshared-library-id=%d is not between 0 and %d" msgstr "" -#: config/m68k/m68k.c:241 +#: config/m68k/m68k.c:266 msgid "cannot specify both -msep-data and -mid-shared-library" msgstr "" -#: config/m68k/m68k.c:256 +#: config/m68k/m68k.c:281 #, c-format msgid "-malign-jumps=%d is not between 1 and %d" msgstr "" -#: config/m68k/m68k.c:267 +#: config/m68k/m68k.c:292 #, c-format msgid "-malign-functions=%d is not between 1 and %d" msgstr "" -#: config/m68k/m68k.c:276 +#: config/m68k/m68k.c:301 msgid "-fPIC is not currently supported on the 68000 or 68010\n" msgstr "" @@ -10550,159 +10578,163 @@ msgstr "" msgid "Maximum amount for a single stack increment operation" msgstr "" -#: config/mips/mips.c:3118 config/xtensa/xtensa.c:988 -#: config/xtensa/xtensa.c:1020 config/xtensa/xtensa.c:1029 +#: config/mips/mips.c:3036 config/xtensa/xtensa.c:992 +#: config/xtensa/xtensa.c:1024 config/xtensa/xtensa.c:1033 msgid "bad test" msgstr "" -#: config/mips/mips.c:4564 +#: config/mips/mips.c:4480 #, c-format msgid "bad value (%s) for -mabi= switch" msgstr "" -#: config/mips/mips.c:4587 +#: config/mips/mips.c:4503 #, c-format msgid "" "-mips%s conflicts with the other architecture options, which specify a MIPS%" "d processor" msgstr "" -#: config/mips/mips.c:4606 +#: config/mips/mips.c:4522 #, c-format msgid "-march=%s is not compatible with the selected ABI" msgstr "" -#: config/mips/mips.c:4621 +#: config/mips/mips.c:4537 msgid "-mgp64 used with a 32-bit processor" msgstr "" -#: config/mips/mips.c:4623 +#: config/mips/mips.c:4539 msgid "-mgp32 used with a 64-bit ABI" msgstr "" -#: config/mips/mips.c:4625 +#: config/mips/mips.c:4541 msgid "-mgp64 used with a 32-bit ABI" msgstr "" -#: config/mips/mips.c:4643 config/mips/mips.c:4645 config/mips/mips.c:4647 -#: config/mips/mips.c:4776 +#: config/mips/mips.c:4559 config/mips/mips.c:4561 config/mips/mips.c:4563 +#: config/mips/mips.c:4693 #, c-format msgid "unsupported combination: %s" msgstr "" -#: config/mips/mips.c:4740 +#: config/mips/mips.c:4657 msgid "-g is only supported using GNU as," msgstr "" -#: config/mips/mips.c:4742 +#: config/mips/mips.c:4659 msgid "-g is only supported using GNU as with -mabi=32," msgstr "" -#: config/mips/mips.c:4743 config/pa/pa.c:352 +#: config/mips/mips.c:4660 config/pa/pa.c:353 msgid "-g option disabled" msgstr "" -#: config/mips/mips.c:4771 +#: config/mips/mips.c:4688 msgid "" "generation of Branch Likely instructions enabled, but not supported by " "architecture" msgstr "" -#: config/mips/mips.c:4788 +#: config/mips/mips.c:4705 msgid "-G is incompatible with PIC code which is the default" msgstr "" -#: config/mips/mips.c:4816 +#: config/mips/mips.c:4733 msgid "-membedded-pic and -mabicalls are incompatible" msgstr "" -#: config/mips/mips.c:4819 +#: config/mips/mips.c:4736 msgid "-G and -membedded-pic are incompatible" msgstr "" -#: config/mips/mips.c:4851 +#: config/mips/mips.c:4768 msgid "non-PIC n64 with explicit relocations" msgstr "" -#: config/mips/mips.c:5155 +#: config/mips/mips.c:5134 msgid "mips_debugger_offset called with non stack/frame/arg pointer" msgstr "" -#: config/mips/mips.c:5284 +#: config/mips/mips.c:5261 #, c-format msgid "internal error: %%) found without a %%( in assembler pattern" msgstr "" -#: config/mips/mips.c:5298 +#: config/mips/mips.c:5275 #, c-format msgid "internal error: %%] found without a %%[ in assembler pattern" msgstr "" -#: config/mips/mips.c:5311 +#: config/mips/mips.c:5288 #, c-format msgid "internal error: %%> found without a %%< in assembler pattern" msgstr "" -#: config/mips/mips.c:5324 +#: config/mips/mips.c:5301 #, c-format msgid "internal error: %%} found without a %%{ in assembler pattern" msgstr "" -#: config/mips/mips.c:5338 +#: config/mips/mips.c:5315 #, c-format msgid "PRINT_OPERAND: unknown punctuation '%c'" msgstr "" -#: config/mips/mips.c:5376 +#: config/mips/mips.c:5344 #, c-format msgid "PRINT_OPERAND, invalid insn for %%C" msgstr "" -#: config/mips/mips.c:5393 +#: config/mips/mips.c:5361 #, c-format msgid "PRINT_OPERAND, invalid insn for %%N" msgstr "" -#: config/mips/mips.c:5402 +#: config/mips/mips.c:5370 #, c-format msgid "PRINT_OPERAND, invalid insn for %%F" msgstr "" -#: config/mips/mips.c:5411 +#: config/mips/mips.c:5379 #, c-format msgid "PRINT_OPERAND, invalid insn for %%W" msgstr "" -#: config/mips/mips.c:7902 +#: config/mips/mips.c:5485 +msgid "PRINT_OPERAND, invalid operand for relocation" +msgstr "" + +#: config/mips/mips.c:7951 #, c-format msgid "can not handle inconsistent calls to `%s'" msgstr "" -#: config/mips/mips.c:9129 +#: config/mips/mips.c:9178 msgid "the cpu name must be lower case" msgstr "" -#: config/mips/mips.c:9151 +#: config/mips/mips.c:9200 #, c-format msgid "bad value (%s) for %s" msgstr "" -#: config/mips/mips.c:9420 +#: config/mips/mips.c:9469 #, c-format msgid "can't rewind temp file: %m" msgstr "" -#: config/mips/mips.c:9424 +#: config/mips/mips.c:9473 #, c-format msgid "can't write to output file: %m" msgstr "" -#: config/mips/mips.c:9427 +#: config/mips/mips.c:9476 #, c-format msgid "can't read from temp file: %m" msgstr "" -#: config/mips/mips.c:9430 +#: config/mips/mips.c:9479 #, c-format msgid "can't close temp file: %m" msgstr "" @@ -10863,11 +10895,11 @@ msgstr "" msgid "Don't use multiply accumulate" msgstr "" -#: config/mips/mips.h:583 config/rs6000/rs6000.h:311 +#: config/mips/mips.h:583 config/rs6000/rs6000.h:315 msgid "Don't generate fused multiply/add instructions" msgstr "" -#: config/mips/mips.h:585 config/rs6000/rs6000.h:309 +#: config/mips/mips.h:585 config/rs6000/rs6000.h:313 msgid "Generate fused multiply/add instructions" msgstr "" @@ -10945,7 +10977,7 @@ msgstr "" #. Output assembler code to FILE to increment profiler label # LABELNO #. for profiling a function entry. -#: config/mips/mips.h:2433 +#: config/mips/mips.h:2425 msgid "mips16 function profiling" msgstr "" @@ -11216,29 +11248,29 @@ msgstr "" msgid "No \"Small register classes\" kludge" msgstr "" -#: config/pa/pa.c:303 +#: config/pa/pa.c:304 #, c-format msgid "" "unknown -mschedule= option (%s).\n" "Valid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n" msgstr "" -#: config/pa/pa.c:328 +#: config/pa/pa.c:329 #, c-format msgid "" "unknown -march= option (%s).\n" "Valid options are 1.0, 1.1, and 2.0\n" msgstr "" -#: config/pa/pa.c:341 +#: config/pa/pa.c:342 msgid "PIC code generation is not supported in the portable runtime model\n" msgstr "" -#: config/pa/pa.c:346 +#: config/pa/pa.c:347 msgid "PIC code generation is not compatible with fast indirect calls\n" msgstr "" -#: config/pa/pa.c:351 +#: config/pa/pa.c:352 msgid "-g is only supported when using GAS on this processor," msgstr "" @@ -11503,152 +11535,152 @@ msgstr "" msgid "junk at end of #pragma longcall" msgstr "" -#: config/rs6000/rs6000.c:765 +#: config/rs6000/rs6000.c:827 msgid "-mmultiple is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:772 +#: config/rs6000/rs6000.c:834 msgid "-mstring is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:786 +#: config/rs6000/rs6000.c:848 #, c-format msgid "unknown -mdebug-%s switch" msgstr "" -#: config/rs6000/rs6000.c:798 +#: config/rs6000/rs6000.c:860 #, c-format msgid "unknown -mtraceback arg `%s'; expecting `full', `partial' or `none'" msgstr "" -#: config/rs6000/rs6000.c:809 +#: config/rs6000/rs6000.c:871 #, c-format msgid "Unknown switch -mlong-double-%s" msgstr "" -#: config/rs6000/rs6000.c:980 +#: config/rs6000/rs6000.c:1042 #, c-format msgid "unknown -m%s= option specified: '%s'" msgstr "" -#: config/rs6000/rs6000.c:997 +#: config/rs6000/rs6000.c:1059 #, c-format msgid "not configured for ABI: '%s'" msgstr "" -#: config/rs6000/rs6000.c:1003 +#: config/rs6000/rs6000.c:1065 #, c-format msgid "unknown ABI specified: '%s'" msgstr "" -#: config/rs6000/rs6000.c:1017 +#: config/rs6000/rs6000.c:1079 #, c-format msgid "unknown -malign-XXXXX option specified: '%s'" msgstr "" -#: config/rs6000/rs6000.c:5134 +#: config/rs6000/rs6000.c:5297 msgid "argument 1 must be a 5-bit signed literal" msgstr "" -#: config/rs6000/rs6000.c:5236 config/rs6000/rs6000.c:5862 +#: config/rs6000/rs6000.c:5399 config/rs6000/rs6000.c:6022 msgid "argument 2 must be a 5-bit unsigned literal" msgstr "" -#: config/rs6000/rs6000.c:5276 +#: config/rs6000/rs6000.c:5439 msgid "argument 1 of __builtin_altivec_predicate must be a constant" msgstr "" -#: config/rs6000/rs6000.c:5330 +#: config/rs6000/rs6000.c:5493 msgid "argument 1 of __builtin_altivec_predicate is out of range" msgstr "" -#: config/rs6000/rs6000.c:5461 +#: config/rs6000/rs6000.c:5621 msgid "argument 3 must be a 4-bit unsigned literal" msgstr "" -#: config/rs6000/rs6000.c:5631 +#: config/rs6000/rs6000.c:5791 #, c-format msgid "argument to `%s' must be a 2-bit unsigned literal" msgstr "" -#: config/rs6000/rs6000.c:5744 +#: config/rs6000/rs6000.c:5904 msgid "argument to dss must be a 2-bit unsigned literal" msgstr "" -#: config/rs6000/rs6000.c:5982 +#: config/rs6000/rs6000.c:6142 msgid "argument 1 of __builtin_spe_predicate must be a constant" msgstr "" -#: config/rs6000/rs6000.c:6055 +#: config/rs6000/rs6000.c:6215 msgid "argument 1 of __builtin_spe_predicate is out of range" msgstr "" -#: config/rs6000/rs6000.c:8487 +#: config/rs6000/rs6000.c:8647 #, c-format msgid "invalid %%f value" msgstr "" -#: config/rs6000/rs6000.c:8496 +#: config/rs6000/rs6000.c:8656 #, c-format msgid "invalid %%F value" msgstr "" -#: config/rs6000/rs6000.c:8505 +#: config/rs6000/rs6000.c:8665 #, c-format msgid "invalid %%G value" msgstr "" -#: config/rs6000/rs6000.c:8540 +#: config/rs6000/rs6000.c:8700 #, c-format msgid "invalid %%j code" msgstr "" -#: config/rs6000/rs6000.c:8550 +#: config/rs6000/rs6000.c:8710 #, c-format msgid "invalid %%J code" msgstr "" -#: config/rs6000/rs6000.c:8560 +#: config/rs6000/rs6000.c:8720 #, c-format msgid "invalid %%k value" msgstr "" -#: config/rs6000/rs6000.c:8580 config/xtensa/xtensa.c:1957 +#: config/rs6000/rs6000.c:8740 config/xtensa/xtensa.c:1961 #, c-format msgid "invalid %%K value" msgstr "" -#: config/rs6000/rs6000.c:8647 +#: config/rs6000/rs6000.c:8807 #, c-format msgid "invalid %%O value" msgstr "" -#: config/rs6000/rs6000.c:8694 +#: config/rs6000/rs6000.c:8854 #, c-format msgid "invalid %%q value" msgstr "" -#: config/rs6000/rs6000.c:8738 +#: config/rs6000/rs6000.c:8898 #, c-format msgid "invalid %%S value" msgstr "" -#: config/rs6000/rs6000.c:8780 +#: config/rs6000/rs6000.c:8940 #, c-format msgid "invalid %%T value" msgstr "" -#: config/rs6000/rs6000.c:8790 +#: config/rs6000/rs6000.c:8950 #, c-format msgid "invalid %%u value" msgstr "" -#: config/rs6000/rs6000.c:8799 config/xtensa/xtensa.c:1927 +#: config/rs6000/rs6000.c:8959 config/xtensa/xtensa.c:1931 #, c-format msgid "invalid %%v value" msgstr "" -#: config/rs6000/rs6000.c:13255 +#: config/rs6000/rs6000.c:13453 msgid "no profiling of 64-bit code for this ABI" msgstr "" @@ -11692,12 +11724,12 @@ msgstr "" #. The Darwin ABI always includes AltiVec, can't be (validly) turned #. off. -#: config/rs6000/darwin.h:79 +#: config/rs6000/darwin.h:80 msgid "-mdynamic-no-pic overrides -fpic or -fPIC" msgstr "" #. Darwin doesn't support -fpic. -#: config/rs6000/darwin.h:85 +#: config/rs6000/darwin.h:86 msgid "-fpic is not supported; -fPIC assumed" msgstr "" @@ -11716,183 +11748,183 @@ msgstr "" #. each pair being { "NAME", VALUE } #. where VALUE is the bits to set or minus the bits to clear. #. An empty string NAME is used to identify the default VALUE. -#: config/rs6000/rs6000.h:241 +#: config/rs6000/rs6000.h:245 msgid "Use POWER instruction set" msgstr "" -#: config/rs6000/rs6000.h:244 +#: config/rs6000/rs6000.h:248 msgid "Use POWER2 instruction set" msgstr "" -#: config/rs6000/rs6000.h:246 +#: config/rs6000/rs6000.h:250 msgid "Do not use POWER2 instruction set" msgstr "" -#: config/rs6000/rs6000.h:249 +#: config/rs6000/rs6000.h:253 msgid "Do not use POWER instruction set" msgstr "" -#: config/rs6000/rs6000.h:251 +#: config/rs6000/rs6000.h:255 msgid "Use PowerPC instruction set" msgstr "" -#: config/rs6000/rs6000.h:254 +#: config/rs6000/rs6000.h:258 msgid "Do not use PowerPC instruction set" msgstr "" -#: config/rs6000/rs6000.h:256 +#: config/rs6000/rs6000.h:260 msgid "Use PowerPC General Purpose group optional instructions" msgstr "" -#: config/rs6000/rs6000.h:258 +#: config/rs6000/rs6000.h:262 msgid "Don't use PowerPC General Purpose group optional instructions" msgstr "" -#: config/rs6000/rs6000.h:260 +#: config/rs6000/rs6000.h:264 msgid "Use PowerPC Graphics group optional instructions" msgstr "" -#: config/rs6000/rs6000.h:262 +#: config/rs6000/rs6000.h:266 msgid "Don't use PowerPC Graphics group optional instructions" msgstr "" -#: config/rs6000/rs6000.h:264 +#: config/rs6000/rs6000.h:268 msgid "Use PowerPC-64 instruction set" msgstr "" -#: config/rs6000/rs6000.h:266 +#: config/rs6000/rs6000.h:270 msgid "Don't use PowerPC-64 instruction set" msgstr "" -#: config/rs6000/rs6000.h:268 +#: config/rs6000/rs6000.h:272 msgid "Use AltiVec instructions" msgstr "" -#: config/rs6000/rs6000.h:270 +#: config/rs6000/rs6000.h:274 msgid "Don't use AltiVec instructions" msgstr "" -#: config/rs6000/rs6000.h:272 +#: config/rs6000/rs6000.h:276 msgid "Use new mnemonics for PowerPC architecture" msgstr "" -#: config/rs6000/rs6000.h:274 +#: config/rs6000/rs6000.h:278 msgid "Use old mnemonics for PowerPC architecture" msgstr "" -#: config/rs6000/rs6000.h:277 +#: config/rs6000/rs6000.h:281 msgid "Put everything in the regular TOC" msgstr "" -#: config/rs6000/rs6000.h:279 +#: config/rs6000/rs6000.h:283 msgid "Place floating point constants in TOC" msgstr "" -#: config/rs6000/rs6000.h:281 +#: config/rs6000/rs6000.h:285 msgid "Don't place floating point constants in TOC" msgstr "" -#: config/rs6000/rs6000.h:283 +#: config/rs6000/rs6000.h:287 msgid "Place symbol+offset constants in TOC" msgstr "" -#: config/rs6000/rs6000.h:285 +#: config/rs6000/rs6000.h:289 msgid "Don't place symbol+offset constants in TOC" msgstr "" -#: config/rs6000/rs6000.h:291 +#: config/rs6000/rs6000.h:295 msgid "Place variable addresses in the regular TOC" msgstr "" -#: config/rs6000/rs6000.h:297 +#: config/rs6000/rs6000.h:301 msgid "Generate load/store multiple instructions" msgstr "" -#: config/rs6000/rs6000.h:299 +#: config/rs6000/rs6000.h:303 msgid "Do not generate load/store multiple instructions" msgstr "" -#: config/rs6000/rs6000.h:301 +#: config/rs6000/rs6000.h:305 msgid "Generate string instructions for block moves" msgstr "" -#: config/rs6000/rs6000.h:303 +#: config/rs6000/rs6000.h:307 msgid "Do not generate string instructions for block moves" msgstr "" -#: config/rs6000/rs6000.h:305 +#: config/rs6000/rs6000.h:309 msgid "Generate load/store with update instructions" msgstr "" -#: config/rs6000/rs6000.h:307 +#: config/rs6000/rs6000.h:311 msgid "Do not generate load/store with update instructions" msgstr "" -#: config/rs6000/rs6000.h:315 +#: config/rs6000/rs6000.h:319 msgid "Don't schedule the start and end of the procedure" msgstr "" -#: config/rs6000/rs6000.h:321 +#: config/rs6000/rs6000.h:325 msgid "Return all structures in memory (AIX default)" msgstr "" -#: config/rs6000/rs6000.h:323 +#: config/rs6000/rs6000.h:327 msgid "Return small structures in registers (SVR4 default)" msgstr "" -#: config/rs6000/rs6000.h:410 config/sparc/sparc.h:648 +#: config/rs6000/rs6000.h:414 config/sparc/sparc.h:648 msgid "Use features of and schedule code for given CPU" msgstr "" -#: config/rs6000/rs6000.h:413 +#: config/rs6000/rs6000.h:417 msgid "Enable debug output" msgstr "" -#: config/rs6000/rs6000.h:415 +#: config/rs6000/rs6000.h:419 msgid "Select full, part, or no traceback table" msgstr "" -#: config/rs6000/rs6000.h:416 +#: config/rs6000/rs6000.h:420 msgid "Specify ABI to use" msgstr "" -#: config/rs6000/rs6000.h:418 +#: config/rs6000/rs6000.h:422 msgid "Specify size of long double (64 or 128 bits)" msgstr "" -#: config/rs6000/rs6000.h:420 +#: config/rs6000/rs6000.h:424 msgid "Specify yes/no if isel instructions should be generated" msgstr "" -#: config/rs6000/rs6000.h:422 +#: config/rs6000/rs6000.h:426 msgid "Specify yes/no if SPE SIMD instructions should be generated" msgstr "" -#: config/rs6000/rs6000.h:424 +#: config/rs6000/rs6000.h:428 msgid "Specify yes/no if using floating point in the GPRs" msgstr "" -#: config/rs6000/rs6000.h:426 +#: config/rs6000/rs6000.h:430 msgid "Specify yes/no if VRSAVE instructions should be generated for AltiVec" msgstr "" -#: config/rs6000/rs6000.h:428 +#: config/rs6000/rs6000.h:432 msgid "Avoid all range limits on call instructions" msgstr "" -#: config/rs6000/rs6000.h:431 +#: config/rs6000/rs6000.h:435 msgid "Determine which dependences between insns are considered costly" msgstr "" -#: config/rs6000/rs6000.h:433 +#: config/rs6000/rs6000.h:437 msgid "Specify which post scheduling nop insertion scheme to apply" msgstr "" -#: config/rs6000/rs6000.h:435 +#: config/rs6000/rs6000.h:439 msgid "Specify alignment of structure fields default/natural" msgstr "" -#: config/rs6000/rs6000.h:437 +#: config/rs6000/rs6000.h:441 msgid "Specify scheduling priority for dispatch slot restricted insns" msgstr "" @@ -11908,7 +11940,7 @@ msgstr "" #. Number of bytes into the frame return addresses can be found. See #. rs6000_stack_info in rs6000.c for more information on how the different #. abi's store the return address. -#: config/rs6000/rs6000.h:1950 +#: config/rs6000/rs6000.h:1895 msgid "RETURN_ADDRESS_OFFSET not supported" msgstr "" @@ -12020,94 +12052,94 @@ msgstr "" #. #. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to #. get control. -#: config/rs6000/sysv4.h:212 +#: config/rs6000/sysv4.h:214 #, c-format msgid "bad value for -mcall-%s" msgstr "" -#: config/rs6000/sysv4.h:228 +#: config/rs6000/sysv4.h:230 #, c-format msgid "bad value for -msdata=%s" msgstr "" -#: config/rs6000/sysv4.h:245 +#: config/rs6000/sysv4.h:247 #, c-format msgid "-mrelocatable and -msdata=%s are incompatible" msgstr "" -#: config/rs6000/sysv4.h:254 +#: config/rs6000/sysv4.h:256 #, c-format msgid "-f%s and -msdata=%s are incompatible" msgstr "" -#: config/rs6000/sysv4.h:263 +#: config/rs6000/sysv4.h:265 #, c-format msgid "-msdata=%s and -mcall-%s are incompatible" msgstr "" -#: config/rs6000/sysv4.h:272 +#: config/rs6000/sysv4.h:274 msgid "-mrelocatable and -mno-minimal-toc are incompatible" msgstr "" -#: config/rs6000/sysv4.h:278 +#: config/rs6000/sysv4.h:280 #, c-format msgid "-mrelocatable and -mcall-%s are incompatible" msgstr "" -#: config/rs6000/sysv4.h:285 +#: config/rs6000/sysv4.h:287 #, c-format msgid "-fPIC and -mcall-%s are incompatible" msgstr "" -#: config/rs6000/sysv4.h:292 +#: config/rs6000/sysv4.h:294 msgid "-mcall-aixdesc must be big endian" msgstr "" -#: config/rs6000/sysv4.h:307 +#: config/rs6000/sysv4.h:309 #, c-format msgid "-m%s not supported in this configuration" msgstr "" -#: config/s390/s390.c:1048 +#: config/s390/s390.c:1057 #, c-format msgid "Unknown cpu used in -march=%s." msgstr "" -#: config/s390/s390.c:1067 +#: config/s390/s390.c:1076 #, c-format msgid "Unknown cpu used in -mtune=%s." msgstr "" -#: config/s390/s390.c:1072 +#: config/s390/s390.c:1081 #, c-format msgid "z/Architecture mode not supported on %s." msgstr "" -#: config/s390/s390.c:1074 +#: config/s390/s390.c:1083 msgid "64-bit ABI not supported in ESA/390 mode." msgstr "" -#: config/s390/s390.c:3388 +#: config/s390/s390.c:3397 msgid "invalid UNSPEC as operand (1)" msgstr "" -#: config/s390/s390.c:3436 +#: config/s390/s390.c:3445 msgid "invalid UNSPEC as operand (2)" msgstr "" -#: config/s390/s390.c:3442 +#: config/s390/s390.c:3451 msgid "UNKNOWN in s390_output_symbolic_const !?" msgstr "" -#: config/s390/s390.c:3458 +#: config/s390/s390.c:3467 msgid "Cannot decompose address." msgstr "" -#: config/s390/s390.c:3621 +#: config/s390/s390.c:3630 msgid "UNKNOWN in print_operand !?" msgstr "" -#: config/s390/s390.c:5313 +#: config/s390/s390.c:5348 msgid "Total size of local variables exceeds architecture limit." msgstr "" @@ -12175,28 +12207,28 @@ msgstr "" msgid "enable fused multiply/add instructions" msgstr "" -#: config/sh/sh.c:5819 +#: config/sh/sh.c:5827 msgid "__builtin_saveregs not supported by this subtarget" msgstr "" -#: config/sh/sh.c:6721 +#: config/sh/sh.c:6729 msgid "attribute interrupt_handler is not compatible with -m5-compact" msgstr "" #. The sp_switch attribute only has meaning for interrupt functions. -#: config/sh/sh.c:6743 config/sh/sh.c:6778 +#: config/sh/sh.c:6751 config/sh/sh.c:6786 #, c-format msgid "`%s' attribute only applies to interrupt functions" msgstr "" #. The argument must be a constant string. -#: config/sh/sh.c:6750 +#: config/sh/sh.c:6758 #, c-format msgid "`%s' attribute argument not a string constant" msgstr "" #. The argument must be a constant integer. -#: config/sh/sh.c:6785 +#: config/sh/sh.c:6793 #, c-format msgid "`%s' attribute argument not an integer constant" msgstr "" @@ -12221,56 +12253,56 @@ msgstr "" msgid "-mcmodel= is not supported on 32 bit systems" msgstr "" -#: config/sparc/sparc.c:6665 config/sparc/sparc.c:6671 +#: config/sparc/sparc.c:6666 config/sparc/sparc.c:6672 #, c-format msgid "invalid %%Y operand" msgstr "" -#: config/sparc/sparc.c:6741 +#: config/sparc/sparc.c:6742 #, c-format msgid "invalid %%A operand" msgstr "" -#: config/sparc/sparc.c:6751 +#: config/sparc/sparc.c:6752 #, c-format msgid "invalid %%B operand" msgstr "" -#: config/sparc/sparc.c:6790 +#: config/sparc/sparc.c:6791 #, c-format msgid "invalid %%c operand" msgstr "" -#: config/sparc/sparc.c:6791 +#: config/sparc/sparc.c:6792 #, c-format msgid "invalid %%C operand" msgstr "" -#: config/sparc/sparc.c:6812 +#: config/sparc/sparc.c:6813 #, c-format msgid "invalid %%d operand" msgstr "" -#: config/sparc/sparc.c:6813 +#: config/sparc/sparc.c:6814 #, c-format msgid "invalid %%D operand" msgstr "" -#: config/sparc/sparc.c:6829 +#: config/sparc/sparc.c:6830 #, c-format msgid "invalid %%f operand" msgstr "" -#: config/sparc/sparc.c:6843 +#: config/sparc/sparc.c:6844 #, c-format msgid "invalid %%s operand" msgstr "" -#: config/sparc/sparc.c:6897 +#: config/sparc/sparc.c:6898 msgid "long long constant not a valid immediate operand" msgstr "" -#: config/sparc/sparc.c:6900 +#: config/sparc/sparc.c:6901 msgid "floating point constant not a valid immediate operand" msgstr "" @@ -12651,56 +12683,56 @@ msgstr "" msgid "Set the max size of data eligible for the ZDA area" msgstr "" -#: config/xtensa/xtensa.c:1786 +#: config/xtensa/xtensa.c:1790 msgid "boolean registers required for the floating-point option" msgstr "" -#: config/xtensa/xtensa.c:1840 +#: config/xtensa/xtensa.c:1844 #, c-format msgid "-f%s is not supported with CONST16 instructions" msgstr "" -#: config/xtensa/xtensa.c:1845 +#: config/xtensa/xtensa.c:1849 msgid "PIC is required but not supported with CONST16 instructions" msgstr "" -#: config/xtensa/xtensa.c:1915 +#: config/xtensa/xtensa.c:1919 #, c-format msgid "invalid %%D value" msgstr "" -#: config/xtensa/xtensa.c:1952 +#: config/xtensa/xtensa.c:1956 msgid "invalid mask" msgstr "" -#: config/xtensa/xtensa.c:1978 +#: config/xtensa/xtensa.c:1982 #, c-format msgid "invalid %%x value" msgstr "" -#: config/xtensa/xtensa.c:1985 +#: config/xtensa/xtensa.c:1989 #, c-format msgid "invalid %%d value" msgstr "" -#: config/xtensa/xtensa.c:2006 config/xtensa/xtensa.c:2016 +#: config/xtensa/xtensa.c:2010 config/xtensa/xtensa.c:2020 #, c-format msgid "invalid %%t/%%b value" msgstr "" -#: config/xtensa/xtensa.c:2058 +#: config/xtensa/xtensa.c:2062 msgid "invalid address" msgstr "" -#: config/xtensa/xtensa.c:2083 +#: config/xtensa/xtensa.c:2087 msgid "no register in address" msgstr "" -#: config/xtensa/xtensa.c:2091 +#: config/xtensa/xtensa.c:2095 msgid "address offset not a constant" msgstr "" -#: config/xtensa/xtensa.c:2755 +#: config/xtensa/xtensa.c:2759 msgid "only uninitialized variables can be placed in a .bss section" msgstr "" @@ -12744,12 +12776,12 @@ msgstr "" msgid "Use direct CALLn instructions for fast calls" msgstr "" -#: ada/misc.c:238 +#: ada/misc.c:239 #, c-format msgid "missing argument to \"-%s\"" msgstr "" -#: ada/misc.c:274 +#: ada/misc.c:280 msgid "`-gnat' misspelled as `-gant'" msgstr "" @@ -12765,7 +12797,7 @@ msgstr "" msgid "destructor name `~%T' does not match type `%T' of expression" msgstr "" -#: cp/call.c:397 cp/call.c:4951 +#: cp/call.c:397 cp/call.c:4987 msgid "request for member `%D' in `%E', which is of non-aggregate type `%T'" msgstr "" @@ -12897,146 +12929,146 @@ msgstr "" msgid "comparison between `%#T' and `%#T'" msgstr "" -#: cp/call.c:3921 +#: cp/call.c:3925 msgid "no suitable `operator %s' for `%T'" msgstr "" -#: cp/call.c:3938 +#: cp/call.c:3942 msgid "`%+#D' is private" msgstr "" -#: cp/call.c:3940 +#: cp/call.c:3944 msgid "`%+#D' is protected" msgstr "" -#: cp/call.c:3942 +#: cp/call.c:3946 msgid "`%+#D' is inaccessible" msgstr "" -#: cp/call.c:3943 +#: cp/call.c:3947 msgid "within this context" msgstr "" -#: cp/call.c:3986 +#: cp/call.c:3990 msgid "invalid conversion from `%T' to `%T'" msgstr "" -#: cp/call.c:3988 cp/call.c:4126 cp/call.c:4128 +#: cp/call.c:3992 cp/call.c:4130 cp/call.c:4132 msgid " initializing argument %P of `%D'" msgstr "" -#: cp/call.c:4050 cp/call.c:4054 +#: cp/call.c:4054 cp/call.c:4058 msgid " initializing argument %P of `%D' from result of `%D'" msgstr "" -#: cp/call.c:4060 cp/call.c:4063 +#: cp/call.c:4064 cp/call.c:4067 msgid " initializing temporary from result of `%D'" msgstr "" -#: cp/call.c:4148 +#: cp/call.c:4152 msgid "cannot bind bitfield `%E' to `%T'" msgstr "" -#: cp/call.c:4151 +#: cp/call.c:4155 msgid "cannot bind packed field `%E' to `%T'" msgstr "" -#: cp/call.c:4154 +#: cp/call.c:4158 msgid "cannot bind rvalue `%E' to `%T'" msgstr "" #. Undefined behavior [expr.call] 5.2.2/7. We used to just warn #. here and do a bitwise copy, but now cp_expr_size will abort if we #. try to do that. -#: cp/call.c:4235 +#: cp/call.c:4239 msgid "" "cannot pass objects of non-POD type `%#T' through `...'; call will abort at " "runtime" msgstr "" #. Undefined behavior [expr.call] 5.2.2/7. -#: cp/call.c:4260 +#: cp/call.c:4264 msgid "cannot receive objects of non-POD type `%#T' through `...'" msgstr "" -#: cp/call.c:4298 +#: cp/call.c:4302 msgid "the default argument for parameter %d of `%D' has not yet been parsed" msgstr "" -#: cp/call.c:4423 +#: cp/call.c:4459 msgid "passing `%T' as `this' argument of `%#D' discards qualifiers" msgstr "" -#: cp/call.c:4442 +#: cp/call.c:4478 msgid "`%T' is not an accessible base of `%T'" msgstr "" -#: cp/call.c:4685 +#: cp/call.c:4721 msgid "could not find class$ field in java interface type `%T'" msgstr "" -#: cp/call.c:4925 +#: cp/call.c:4961 msgid "call to non-function `%D'" msgstr "" -#: cp/call.c:5029 +#: cp/call.c:5065 msgid "no matching function for call to `%T::%s(%A)%#V'" msgstr "" -#: cp/call.c:5046 +#: cp/call.c:5082 #, c-format msgid "call of overloaded `%s(%A)' is ambiguous" msgstr "" -#: cp/call.c:5067 +#: cp/call.c:5103 msgid "cannot call member function `%D' without object" msgstr "" -#: cp/call.c:5653 +#: cp/call.c:5689 msgid "passing `%T' chooses `%T' over `%T'" msgstr "" -#: cp/call.c:5655 cp/name-lookup.c:4004 +#: cp/call.c:5691 cp/name-lookup.c:4039 msgid " in call to `%D'" msgstr "" -#: cp/call.c:5712 +#: cp/call.c:5748 msgid "choosing `%D' over `%D'" msgstr "" -#: cp/call.c:5713 +#: cp/call.c:5749 msgid " for conversion from `%T' to `%T'" msgstr "" -#: cp/call.c:5715 +#: cp/call.c:5751 msgid " because conversion sequence for the argument is better" msgstr "" -#: cp/call.c:5835 +#: cp/call.c:5871 msgid "" "ISO C++ says that these are ambiguous, even though the worst conversion for " "the first is better than the worst conversion for the second:" msgstr "" -#: cp/call.c:5839 +#: cp/call.c:5875 msgid "candidate 1:" msgstr "" -#: cp/call.c:5840 +#: cp/call.c:5876 msgid "candidate 2:" msgstr "" -#: cp/call.c:5949 +#: cp/call.c:5985 msgid "could not convert `%E' to `%T'" msgstr "" -#: cp/call.c:6054 +#: cp/call.c:6090 msgid "" "invalid initialization of non-const reference of type '%T' from a temporary " "of type '%T'" msgstr "" -#: cp/call.c:6058 +#: cp/call.c:6094 msgid "" "invalid initialization of reference of type '%T' from expression of type '%T'" msgstr "" @@ -13079,204 +13111,204 @@ msgstr "" msgid "conflicting access specifications for field `%s', ignored" msgstr "" -#: cp/class.c:1118 +#: cp/class.c:1122 msgid "`%D' names constructor" msgstr "" -#: cp/class.c:1123 +#: cp/class.c:1127 msgid "`%D' invalid in `%T'" msgstr "" -#: cp/class.c:1131 +#: cp/class.c:1135 msgid "no members matching `%D' in `%#T'" msgstr "" -#: cp/class.c:1163 cp/class.c:1171 +#: cp/class.c:1167 cp/class.c:1175 msgid "`%D' invalid in `%#T'" msgstr "" -#: cp/class.c:1164 +#: cp/class.c:1168 msgid " because of local method `%#D' with same name" msgstr "" -#: cp/class.c:1172 +#: cp/class.c:1176 msgid " because of local member `%#D' with same name" msgstr "" -#: cp/class.c:1242 +#: cp/class.c:1246 msgid "base class `%#T' has a non-virtual destructor" msgstr "" -#: cp/class.c:1262 +#: cp/class.c:1266 msgid "" "base `%T' with only non-default constructor in class without a constructor" msgstr "" -#: cp/class.c:1646 +#: cp/class.c:1650 msgid "all member functions in class `%T' are private" msgstr "" -#: cp/class.c:1657 +#: cp/class.c:1661 msgid "`%#T' only defines a private destructor and has no friends" msgstr "" -#: cp/class.c:1699 +#: cp/class.c:1703 msgid "`%#T' only defines private constructors and has no friends" msgstr "" -#: cp/class.c:2080 +#: cp/class.c:2084 msgid "no unique final overrider for `%D' in `%T'" msgstr "" #. Here we know it is a hider, and no overrider exists. -#: cp/class.c:2515 +#: cp/class.c:2519 msgid "`%D' was hidden" msgstr "" -#: cp/class.c:2516 +#: cp/class.c:2520 msgid " by `%D'" msgstr "" -#: cp/class.c:2557 +#: cp/class.c:2561 msgid "ISO C++ forbids member `%D' with same name as enclosing class" msgstr "" -#: cp/class.c:2562 cp/decl2.c:1186 +#: cp/class.c:2566 cp/decl2.c:1186 msgid "`%#D' invalid; an anonymous union can only have non-static data members" msgstr "" -#: cp/class.c:2568 cp/decl2.c:1193 +#: cp/class.c:2572 cp/decl2.c:1193 msgid "private member `%#D' in anonymous union" msgstr "" -#: cp/class.c:2571 cp/decl2.c:1195 +#: cp/class.c:2575 cp/decl2.c:1195 msgid "protected member `%#D' in anonymous union" msgstr "" -#: cp/class.c:2690 +#: cp/class.c:2694 msgid "" "vtable layout for class `%T' may not be ABI-compliant and may change in a " "future version of GCC due to implicit virtual destructor" msgstr "" -#: cp/class.c:2750 +#: cp/class.c:2754 msgid "bit-field `%#D' with non-integral type" msgstr "" -#: cp/class.c:2770 +#: cp/class.c:2774 msgid "bit-field `%D' width not an integer constant" msgstr "" -#: cp/class.c:2776 +#: cp/class.c:2780 msgid "negative width in bit-field `%D'" msgstr "" -#: cp/class.c:2781 +#: cp/class.c:2785 msgid "zero width for bit-field `%D'" msgstr "" -#: cp/class.c:2787 +#: cp/class.c:2791 msgid "width of `%D' exceeds its type" msgstr "" -#: cp/class.c:2796 +#: cp/class.c:2800 msgid "`%D' is too small to hold all values of `%#T'" msgstr "" -#: cp/class.c:2858 +#: cp/class.c:2862 msgid "member `%#D' with constructor not allowed in union" msgstr "" -#: cp/class.c:2861 +#: cp/class.c:2865 msgid "member `%#D' with destructor not allowed in union" msgstr "" -#: cp/class.c:2864 +#: cp/class.c:2868 msgid "member `%#D' with copy assignment operator not allowed in union" msgstr "" -#: cp/class.c:2891 +#: cp/class.c:2895 msgid "multiple fields in union `%T' initialized" msgstr "" -#: cp/class.c:2960 +#: cp/class.c:2964 msgid "ignoring packed attribute on unpacked non-POD field `%#D'" msgstr "" -#: cp/class.c:3012 +#: cp/class.c:3016 msgid "field `%D' in local class cannot be static" msgstr "" -#: cp/class.c:3018 +#: cp/class.c:3022 msgid "field `%D' invalidly declared function type" msgstr "" -#: cp/class.c:3025 +#: cp/class.c:3029 msgid "field `%D' invalidly declared method type" msgstr "" #. Unions cannot have static members. -#: cp/class.c:3043 +#: cp/class.c:3047 msgid "field `%D' declared static in union" msgstr "" -#: cp/class.c:3070 +#: cp/class.c:3074 msgid "non-static reference `%#D' in class without a constructor" msgstr "" -#: cp/class.c:3105 +#: cp/class.c:3109 msgid "non-static const member `%#D' in class without a constructor" msgstr "" -#: cp/class.c:3120 +#: cp/class.c:3124 msgid "field `%#D' with same name as class" msgstr "" -#: cp/class.c:3138 +#: cp/class.c:3142 msgid "`%#T' has pointer data members" msgstr "" -#: cp/class.c:3142 +#: cp/class.c:3146 msgid " but does not override `%T(const %T&)'" msgstr "" -#: cp/class.c:3144 +#: cp/class.c:3148 msgid " or `operator=(const %T&)'" msgstr "" -#: cp/class.c:3147 +#: cp/class.c:3151 msgid " but does not override `operator=(const %T&)'" msgstr "" -#: cp/class.c:3574 +#: cp/class.c:3578 msgid "" "offset of empty base `%T' may not be ABI-compliant and maychange in a future " "version of GCC" msgstr "" -#: cp/class.c:3683 +#: cp/class.c:3687 msgid "class `%T' will be considered nearly empty in a future version of GCC" msgstr "" -#: cp/class.c:3770 +#: cp/class.c:3774 msgid "initializer specified for non-virtual method `%D'" msgstr "" -#: cp/class.c:4455 +#: cp/class.c:4459 msgid "" "offset of virtual base `%T' is not ABI-compliant and may change in a future " "version of GCC" msgstr "" -#: cp/class.c:4545 +#: cp/class.c:4549 msgid "direct base `%T' inaccessible in `%T' due to ambiguity" msgstr "" -#: cp/class.c:4558 +#: cp/class.c:4562 msgid "virtual base `%T' inaccessible in `%T' due to ambiguity" msgstr "" -#: cp/class.c:4732 +#: cp/class.c:4736 msgid "" "size assigned to `%T' may not be ABI-compliant and may change in a future " "version of GCC" @@ -13284,77 +13316,77 @@ msgstr "" #. Versions of G++ before G++ 3.4 did not reset the #. DECL_MODE. -#: cp/class.c:4771 +#: cp/class.c:4775 msgid "" "the offset of `%D' may not be ABI-compliant and may change in a future " "version of GCC" msgstr "" -#: cp/class.c:4794 +#: cp/class.c:4798 msgid "" "offset of `%D' is not ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:4803 +#: cp/class.c:4807 msgid "" "`%D' contains empty classes which may cause base classes to be placed at " "different locations in a future version of GCC" msgstr "" -#: cp/class.c:4862 +#: cp/class.c:4866 msgid "" "layout of classes derived from empty class `%T' may change in a future " "version of GCC" msgstr "" -#: cp/class.c:4990 cp/semantics.c:2027 +#: cp/class.c:4994 cp/semantics.c:2036 msgid "redefinition of `%#T'" msgstr "" -#: cp/class.c:5156 +#: cp/class.c:5160 msgid "`%#T' has virtual functions but non-virtual destructor" msgstr "" -#: cp/class.c:5235 +#: cp/class.c:5239 msgid "trying to finish struct, but kicked out due to previous parse errors" msgstr "" -#: cp/class.c:5674 +#: cp/class.c:5681 #, c-format msgid "language string `\"%s\"' not recognized" msgstr "" -#: cp/class.c:5762 +#: cp/class.c:5769 msgid "" "cannot resolve overloaded function `%D' based on conversion to type `%T'" msgstr "" -#: cp/class.c:5887 +#: cp/class.c:5894 msgid "no matches converting function `%D' to type `%#T'" msgstr "" -#: cp/class.c:5910 +#: cp/class.c:5917 msgid "converting overloaded function `%D' to type `%#T' is ambiguous" msgstr "" -#: cp/class.c:5936 +#: cp/class.c:5943 msgid "assuming pointer to member `%D'" msgstr "" -#: cp/class.c:5939 +#: cp/class.c:5946 #, c-format msgid "(a pointer to member can only be formed with `&%E')" msgstr "" -#: cp/class.c:5984 cp/class.c:6166 cp/class.c:6173 +#: cp/class.c:5991 cp/class.c:6173 cp/class.c:6180 msgid "not enough type information" msgstr "" -#: cp/class.c:6001 +#: cp/class.c:6008 msgid "argument of type `%T' does not match `%T'" msgstr "" -#: cp/class.c:6150 +#: cp/class.c:6157 msgid "invalid operation on uninstantiated type" msgstr "" @@ -13363,11 +13395,11 @@ msgstr "" #. A name N used in a class S shall refer to the same declaration #. in its context and when re-evaluated in the completed scope of #. S. -#: cp/class.c:6410 cp/decl.c:1229 cp/name-lookup.c:488 cp/pt.c:1957 +#: cp/class.c:6417 cp/decl.c:1229 cp/name-lookup.c:491 cp/pt.c:1959 msgid "declaration of `%#D'" msgstr "" -#: cp/class.c:6411 +#: cp/class.c:6418 msgid "changes meaning of `%D' from `%+#D'" msgstr "" @@ -13447,25 +13479,25 @@ msgid "%s cannot resolve address of overloaded function" msgstr "" #. Only warn when there is no &. -#: cp/cvt.c:889 +#: cp/cvt.c:890 #, c-format msgid "%s is a reference, not call, to function `%E'" msgstr "" -#: cp/cvt.c:896 +#: cp/cvt.c:897 #, c-format msgid "%s has no effect" msgstr "" -#: cp/cvt.c:1007 +#: cp/cvt.c:1008 msgid "converting NULL to non-pointer type" msgstr "" -#: cp/cvt.c:1079 +#: cp/cvt.c:1080 msgid "ambiguous default type conversion from `%T'" msgstr "" -#: cp/cvt.c:1081 +#: cp/cvt.c:1082 msgid " candidate conversions include `%D' and `%D'" msgstr "" @@ -13484,7 +13516,7 @@ msgstr "" msgid "label `%D' defined but not used" msgstr "" -#: cp/decl.c:1137 cp/decl.c:1548 +#: cp/decl.c:1137 cp/decl.c:1556 msgid "previous declaration of `%D'" msgstr "" @@ -13528,7 +13560,7 @@ msgstr "" msgid "declaration of template `%#D'" msgstr "" -#: cp/decl.c:1340 cp/name-lookup.c:489 +#: cp/decl.c:1340 cp/name-lookup.c:492 msgid "conflicts with previous declaration `%#D'" msgstr "" @@ -13552,57 +13584,57 @@ msgstr "" msgid "'%D' has a previous declaration as `%#D'" msgstr "" -#: cp/decl.c:1427 +#: cp/decl.c:1435 msgid "`%#D' previously defined here" msgstr "" -#: cp/decl.c:1428 +#: cp/decl.c:1436 msgid "`%#D' previously declared here" msgstr "" #. Prototype decl follows defn w/o prototype. -#: cp/decl.c:1437 +#: cp/decl.c:1445 msgid "prototype for `%#D'" msgstr "" -#: cp/decl.c:1438 +#: cp/decl.c:1446 msgid "%Jfollows non-prototype definition here" msgstr "" -#: cp/decl.c:1450 +#: cp/decl.c:1458 msgid "previous declaration of `%#D' with %L linkage" msgstr "" -#: cp/decl.c:1452 +#: cp/decl.c:1460 msgid "conflicts with new declaration with %L linkage" msgstr "" -#: cp/decl.c:1475 cp/decl.c:1482 +#: cp/decl.c:1483 cp/decl.c:1490 msgid "default argument given for parameter %d of `%#D'" msgstr "" -#: cp/decl.c:1477 cp/decl.c:1484 +#: cp/decl.c:1485 cp/decl.c:1492 msgid "after previous specification in `%#D'" msgstr "" -#: cp/decl.c:1493 +#: cp/decl.c:1501 msgid "`%#D' was used before it was declared inline" msgstr "" -#: cp/decl.c:1494 +#: cp/decl.c:1502 msgid "%Jprevious non-inline declaration here" msgstr "" -#: cp/decl.c:1547 +#: cp/decl.c:1555 msgid "redundant redeclaration of `%D' in same scope" msgstr "" -#: cp/decl.c:1630 +#: cp/decl.c:1638 #, c-format msgid "declaration of `%F' throws different exceptions" msgstr "" -#: cp/decl.c:1632 +#: cp/decl.c:1640 #, c-format msgid "than previous declaration `%F'" msgstr "" @@ -13615,500 +13647,495 @@ msgstr "" #. that specialization that would cause an implicit #. instantiation to take place, in every translation unit in #. which such a use occurs. -#: cp/decl.c:1779 +#: cp/decl.c:1787 msgid "explicit specialization of %D after first use" msgstr "" -#: cp/decl.c:1944 +#: cp/decl.c:1953 msgid "implicit declaration of function `%#D'" msgstr "" -#: cp/decl.c:2092 +#: cp/decl.c:2101 #, c-format msgid "label `%s' referenced outside of any function" msgstr "" -#: cp/decl.c:2189 cp/decl.c:2213 cp/decl.c:2301 +#: cp/decl.c:2198 cp/decl.c:2222 cp/decl.c:2310 msgid "jump to label `%D'" msgstr "" -#: cp/decl.c:2191 cp/decl.c:2215 +#: cp/decl.c:2200 cp/decl.c:2224 msgid "jump to case label" msgstr "" -#: cp/decl.c:2194 cp/decl.c:2218 +#: cp/decl.c:2203 cp/decl.c:2227 msgid "%H from here" msgstr "" -#: cp/decl.c:2199 +#: cp/decl.c:2208 msgid " crosses initialization of `%#D'" msgstr "" -#: cp/decl.c:2202 cp/decl.c:2317 +#: cp/decl.c:2211 cp/decl.c:2326 msgid " enters scope of non-POD `%#D'" msgstr "" -#: cp/decl.c:2222 cp/decl.c:2321 +#: cp/decl.c:2231 cp/decl.c:2330 msgid " enters try block" msgstr "" -#: cp/decl.c:2224 cp/decl.c:2323 +#: cp/decl.c:2233 cp/decl.c:2332 msgid " enters catch block" msgstr "" -#: cp/decl.c:2302 +#: cp/decl.c:2311 msgid " from here" msgstr "" #. Can't skip init of __exception_info. -#: cp/decl.c:2313 +#: cp/decl.c:2322 msgid "%J enters catch block" msgstr "" -#: cp/decl.c:2315 +#: cp/decl.c:2324 msgid " skips initialization of `%#D'" msgstr "" -#: cp/decl.c:2349 +#: cp/decl.c:2358 msgid "label named wchar_t" msgstr "" -#: cp/decl.c:2352 +#: cp/decl.c:2361 msgid "duplicate label `%D'" msgstr "" -#: cp/decl.c:2432 -#, c-format -msgid "case label `%E' not within a switch statement" -msgstr "" - -#: cp/decl.c:2592 cp/parser.c:2992 +#: cp/decl.c:2589 cp/parser.c:3008 msgid "`%D' used without template parameters" msgstr "" -#: cp/decl.c:2602 cp/decl.c:2618 cp/decl.c:2706 +#: cp/decl.c:2599 cp/decl.c:2615 cp/decl.c:2703 msgid "no class template named `%#T' in `%#T'" msgstr "" -#: cp/decl.c:2639 cp/decl.c:2649 cp/decl.c:2669 +#: cp/decl.c:2636 cp/decl.c:2646 cp/decl.c:2666 msgid "no type named `%#T' in `%#T'" msgstr "" -#: cp/decl.c:3395 +#: cp/decl.c:3393 msgid "%Jan anonymous union cannot have function members" msgstr "" -#: cp/decl.c:3413 +#: cp/decl.c:3411 msgid "member %#D' with constructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3416 +#: cp/decl.c:3414 msgid "member %#D' with destructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3419 +#: cp/decl.c:3417 msgid "" "member %#D' with copy assignment operator not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3459 +#: cp/decl.c:3457 msgid "redeclaration of C++ built-in type `%T'" msgstr "" -#: cp/decl.c:3497 +#: cp/decl.c:3495 msgid "multiple types in one declaration" msgstr "" -#: cp/decl.c:3523 +#: cp/decl.c:3521 msgid "missing type-name in typedef-declaration" msgstr "" -#: cp/decl.c:3531 +#: cp/decl.c:3529 msgid "ISO C++ prohibits anonymous structs" msgstr "" -#: cp/decl.c:3538 +#: cp/decl.c:3536 msgid "`%D' can only be specified for functions" msgstr "" -#: cp/decl.c:3540 +#: cp/decl.c:3538 msgid "`%D' can only be specified inside a class" msgstr "" -#: cp/decl.c:3542 +#: cp/decl.c:3540 msgid "`%D' can only be specified for constructors" msgstr "" -#: cp/decl.c:3545 +#: cp/decl.c:3543 msgid "`%D' can only be specified for objects and functions" msgstr "" -#: cp/decl.c:3687 cp/decl2.c:883 +#: cp/decl.c:3685 cp/decl2.c:883 msgid "typedef `%D' is initialized (use __typeof__ instead)" msgstr "" -#: cp/decl.c:3692 +#: cp/decl.c:3690 msgid "function `%#D' is initialized like a variable" msgstr "" -#: cp/decl.c:3704 +#: cp/decl.c:3702 msgid "declaration of `%#D' has `extern' and is initialized" msgstr "" -#: cp/decl.c:3737 +#: cp/decl.c:3735 msgid "`%#D' is not a static member of `%#T'" msgstr "" -#: cp/decl.c:3743 +#: cp/decl.c:3741 msgid "ISO C++ does not permit `%T::%D' to be defined as `%T::%D'" msgstr "" -#: cp/decl.c:3754 +#: cp/decl.c:3752 msgid "duplicate initialization of %D" msgstr "" -#: cp/decl.c:3783 +#: cp/decl.c:3781 msgid "declaration of `%#D' outside of class is not definition" msgstr "" -#: cp/decl.c:3834 +#: cp/decl.c:3832 msgid "variable `%#D' has initializer but incomplete type" msgstr "" -#: cp/decl.c:3842 cp/decl.c:4385 +#: cp/decl.c:3840 cp/decl.c:4383 msgid "elements of array `%#D' have incomplete type" msgstr "" -#: cp/decl.c:3858 +#: cp/decl.c:3856 msgid "aggregate `%#D' has incomplete type and cannot be defined" msgstr "" -#: cp/decl.c:3900 +#: cp/decl.c:3898 msgid "`%D' declared as reference but not initialized" msgstr "" -#: cp/decl.c:3906 +#: cp/decl.c:3904 msgid "ISO C++ forbids use of initializer list to initialize reference `%D'" msgstr "" -#: cp/decl.c:3934 +#: cp/decl.c:3932 msgid "cannot initialize `%T' from `%T'" msgstr "" -#: cp/decl.c:3966 +#: cp/decl.c:3964 msgid "initializer fails to determine size of `%D'" msgstr "" -#: cp/decl.c:3971 +#: cp/decl.c:3969 msgid "array size missing in `%D'" msgstr "" -#: cp/decl.c:3983 +#: cp/decl.c:3981 msgid "zero-size array `%D'" msgstr "" #. An automatic variable with an incomplete type: that is an error. #. Don't talk about array types here, since we took care of that #. message in grokdeclarator. -#: cp/decl.c:4020 +#: cp/decl.c:4018 msgid "storage size of `%D' isn't known" msgstr "" -#: cp/decl.c:4042 +#: cp/decl.c:4040 msgid "storage size of `%D' isn't constant" msgstr "" -#: cp/decl.c:4097 +#: cp/decl.c:4095 msgid "" "sorry: semantics of inline function static data `%#D' are wrong (you'll wind " "up with multiple copies)" msgstr "" -#: cp/decl.c:4098 +#: cp/decl.c:4096 msgid "%J you can work around this by removing the initializer" msgstr "" -#: cp/decl.c:4124 +#: cp/decl.c:4122 msgid "uninitialized const `%D'" msgstr "" -#: cp/decl.c:4203 +#: cp/decl.c:4201 msgid "brace-enclosed initializer used to initialize `%T'" msgstr "" -#: cp/decl.c:4266 +#: cp/decl.c:4264 msgid "initializer for `%T' must be brace-enclosed" msgstr "" -#: cp/decl.c:4281 +#: cp/decl.c:4279 msgid "ISO C++ does not allow designated initializers" msgstr "" -#: cp/decl.c:4285 +#: cp/decl.c:4283 msgid "`%T' has no non-static data member named `%D'" msgstr "" -#: cp/decl.c:4342 +#: cp/decl.c:4340 msgid "too many initializers for `%T'" msgstr "" -#: cp/decl.c:4379 +#: cp/decl.c:4377 msgid "variable-sized object `%D' may not be initialized" msgstr "" -#: cp/decl.c:4390 +#: cp/decl.c:4388 msgid "`%D' has incomplete type" msgstr "" -#: cp/decl.c:4445 +#: cp/decl.c:4443 msgid "`%D' must be initialized by constructor, not by `{...}'" msgstr "" -#: cp/decl.c:4486 +#: cp/decl.c:4484 msgid "structure `%D' with uninitialized const members" msgstr "" -#: cp/decl.c:4488 +#: cp/decl.c:4486 msgid "structure `%D' with uninitialized reference members" msgstr "" -#: cp/decl.c:4669 +#: cp/decl.c:4667 msgid "assignment (not initialization) in declaration" msgstr "" -#: cp/decl.c:4686 +#: cp/decl.c:4684 msgid "cannot initialize `%D' to namespace `%D'" msgstr "" -#: cp/decl.c:4736 +#: cp/decl.c:4734 msgid "shadowing previous type declaration of `%#D'" msgstr "" -#: cp/decl.c:4772 +#: cp/decl.c:4770 msgid "`%D' cannot be thread-local because it has non-POD type `%T'" msgstr "" -#: cp/decl.c:4787 +#: cp/decl.c:4785 msgid "`%D' is thread-local and so cannot be dynamically initialized" msgstr "" -#: cp/decl.c:5258 +#: cp/decl.c:5256 msgid "invalid catch parameter" msgstr "" -#: cp/decl.c:5372 +#: cp/decl.c:5370 msgid "destructor for alien class `%T' cannot be a member" msgstr "" -#: cp/decl.c:5375 +#: cp/decl.c:5373 msgid "constructor for alien class `%T' cannot be a member" msgstr "" -#: cp/decl.c:5397 +#: cp/decl.c:5395 msgid "`%D' declared as a `virtual' %s" msgstr "" -#: cp/decl.c:5399 +#: cp/decl.c:5397 msgid "`%D' declared as an `inline' %s" msgstr "" -#: cp/decl.c:5401 +#: cp/decl.c:5399 msgid "" "`const' and `volatile' function specifiers on `%D' invalid in %s declaration" msgstr "" -#: cp/decl.c:5404 +#: cp/decl.c:5402 msgid "`%D' declared as a friend" msgstr "" -#: cp/decl.c:5410 +#: cp/decl.c:5408 msgid "`%D' declared with an exception specification" msgstr "" -#: cp/decl.c:5489 +#: cp/decl.c:5487 msgid "cannot declare `::main' to be a template" msgstr "" -#: cp/decl.c:5491 +#: cp/decl.c:5489 msgid "cannot declare `::main' to be inline" msgstr "" -#: cp/decl.c:5493 +#: cp/decl.c:5491 msgid "cannot declare `::main' to be static" msgstr "" -#: cp/decl.c:5496 +#: cp/decl.c:5494 msgid "`main' must return `int'" msgstr "" -#: cp/decl.c:5524 +#: cp/decl.c:5522 msgid "non-local function `%#D' uses anonymous type" msgstr "" -#: cp/decl.c:5527 +#: cp/decl.c:5525 msgid "" "`%#D' does not refer to the unqualified type, so it is not used for linkage" msgstr "" -#: cp/decl.c:5533 +#: cp/decl.c:5531 msgid "non-local function `%#D' uses local type `%T'" msgstr "" -#: cp/decl.c:5557 +#: cp/decl.c:5555 msgid "%smember function `%D' cannot have `%T' method qualifier" msgstr "" -#: cp/decl.c:5581 +#: cp/decl.c:5579 msgid "defining explicit specialization `%D' in friend declaration" msgstr "" #. Something like `template friend void f()'. -#: cp/decl.c:5591 +#: cp/decl.c:5589 msgid "invalid use of template-id `%D' in declaration of primary template" msgstr "" -#: cp/decl.c:5618 +#: cp/decl.c:5616 msgid "" "default arguments are not allowed in declaration of friend template " "specialization `%D'" msgstr "" -#: cp/decl.c:5625 +#: cp/decl.c:5623 msgid "" "`inline' is not allowed in declaration of friend template specialization `%D'" msgstr "" -#: cp/decl.c:5684 +#: cp/decl.c:5682 msgid "definition of implicitly-declared `%D'" msgstr "" -#: cp/decl.c:5702 cp/decl2.c:764 +#: cp/decl.c:5700 cp/decl2.c:764 msgid "no `%#D' member function declared in class `%T'" msgstr "" -#: cp/decl.c:5836 +#: cp/decl.c:5834 msgid "non-local variable `%#D' uses local type `%T'" msgstr "" -#: cp/decl.c:5951 +#: cp/decl.c:5949 msgid "" "invalid in-class initialization of static data member of non-integral type `%" "T'" msgstr "" -#: cp/decl.c:5960 +#: cp/decl.c:5958 msgid "ISO C++ forbids in-class initialization of non-const static member `%D'" msgstr "" -#: cp/decl.c:5963 +#: cp/decl.c:5961 msgid "" "ISO C++ forbids initialization of member constant `%D' of non-integral type `" "%T'" msgstr "" -#: cp/decl.c:6011 +#: cp/decl.c:6009 msgid "size of array `%D' has non-integer type" msgstr "" -#: cp/decl.c:6013 +#: cp/decl.c:6011 msgid "size of array has non-integer type" msgstr "" -#: cp/decl.c:6033 +#: cp/decl.c:6031 msgid "size of array `%D' is negative" msgstr "" -#: cp/decl.c:6035 +#: cp/decl.c:6033 msgid "size of array is negative" msgstr "" -#: cp/decl.c:6044 +#: cp/decl.c:6042 msgid "ISO C++ forbids zero-size array `%D'" msgstr "" -#: cp/decl.c:6046 +#: cp/decl.c:6044 msgid "ISO C++ forbids zero-size array" msgstr "" -#: cp/decl.c:6053 +#: cp/decl.c:6051 msgid "size of array `%D' is not an integral constant-expression" msgstr "" -#: cp/decl.c:6056 +#: cp/decl.c:6054 msgid "size of array is not an integral constant-expression" msgstr "" -#: cp/decl.c:6074 +#: cp/decl.c:6072 msgid "ISO C++ forbids variable-size array `%D'" msgstr "" -#: cp/decl.c:6077 +#: cp/decl.c:6075 msgid "ISO C++ forbids variable-size array" msgstr "" -#: cp/decl.c:6088 +#: cp/decl.c:6086 msgid "overflow in array dimension" msgstr "" -#: cp/decl.c:6181 +#: cp/decl.c:6179 msgid "declaration of `%D' as %s" msgstr "" -#: cp/decl.c:6183 +#: cp/decl.c:6181 #, c-format msgid "creating %s" msgstr "" -#: cp/decl.c:6195 +#: cp/decl.c:6193 msgid "" "declaration of `%D' as multidimensional array must have bounds for all " "dimensions except the first" msgstr "" -#: cp/decl.c:6198 +#: cp/decl.c:6196 msgid "" "multidimensional array must have bounds for all dimensions except the first" msgstr "" -#: cp/decl.c:6226 +#: cp/decl.c:6224 msgid "return type specification for constructor invalid" msgstr "" -#: cp/decl.c:6233 +#: cp/decl.c:6231 msgid "return type specification for destructor invalid" msgstr "" -#: cp/decl.c:6239 +#: cp/decl.c:6237 msgid "operator `%T' declared to return `%T'" msgstr "" -#: cp/decl.c:6241 +#: cp/decl.c:6239 msgid "return type specified for `operator %T'" msgstr "" -#: cp/decl.c:6384 +#: cp/decl.c:6382 msgid "destructors must be member functions" msgstr "" -#: cp/decl.c:6403 +#: cp/decl.c:6401 msgid "destructor `%T' must match class name `%T'" msgstr "" -#: cp/decl.c:6466 +#: cp/decl.c:6464 msgid "declarator-id missing; using reserved word `%D'" msgstr "" -#: cp/decl.c:6520 +#: cp/decl.c:6518 msgid "type `%T' is not derived from type `%T'" msgstr "" #. Parse error puts this typespec where #. a declarator should go. -#: cp/decl.c:6583 +#: cp/decl.c:6581 msgid "`%T' specified as declarator-id" msgstr "" -#: cp/decl.c:6585 +#: cp/decl.c:6583 msgid " perhaps you want `%T' for a constructor" msgstr "" @@ -14116,300 +14143,300 @@ msgstr "" #. decl-specifier like in #. std::allocator alloc; #. Handle that gracefully. -#: cp/decl.c:6607 +#: cp/decl.c:6605 #, c-format msgid "invalid use of template-name '%E' in a declarator" msgstr "" -#: cp/decl.c:6627 +#: cp/decl.c:6625 msgid "declaration of `%D' as non-function" msgstr "" -#: cp/decl.c:6704 +#: cp/decl.c:6702 msgid "`bool' is now a keyword" msgstr "" -#: cp/decl.c:6706 +#: cp/decl.c:6704 msgid "extraneous `%T' ignored" msgstr "" -#: cp/decl.c:6722 cp/decl.c:6766 +#: cp/decl.c:6720 cp/decl.c:6764 msgid "multiple declarations `%T' and `%T'" msgstr "" -#: cp/decl.c:6735 +#: cp/decl.c:6733 msgid "ISO C++ does not support `long long'" msgstr "" -#: cp/decl.c:6839 cp/decl.c:6842 +#: cp/decl.c:6837 cp/decl.c:6840 #, c-format msgid "ISO C++ forbids declaration of `%s' with no type" msgstr "" -#: cp/decl.c:6873 +#: cp/decl.c:6871 #, c-format msgid "short, signed or unsigned invalid for `%s'" msgstr "" -#: cp/decl.c:6878 +#: cp/decl.c:6876 #, c-format msgid "long and short specified together for `%s'" msgstr "" -#: cp/decl.c:6889 +#: cp/decl.c:6887 #, c-format msgid "signed and unsigned given together for `%s'" msgstr "" -#: cp/decl.c:6998 +#: cp/decl.c:6996 msgid "qualifiers are not allowed on declaration of `operator %T'" msgstr "" -#: cp/decl.c:7020 +#: cp/decl.c:7018 msgid "member `%D' cannot be declared both virtual and static" msgstr "" -#: cp/decl.c:7029 +#: cp/decl.c:7027 msgid "`%T::%D' is not a valid declarator" msgstr "" -#: cp/decl.c:7041 +#: cp/decl.c:7039 msgid "storage class specifiers invalid in parameter declarations" msgstr "" -#: cp/decl.c:7045 +#: cp/decl.c:7043 msgid "typedef declaration invalid in parameter declaration" msgstr "" -#: cp/decl.c:7058 +#: cp/decl.c:7056 msgid "virtual outside class declaration" msgstr "" -#: cp/decl.c:7117 +#: cp/decl.c:7115 #, c-format msgid "storage class specified for %s `%s'" msgstr "" -#: cp/decl.c:7152 +#: cp/decl.c:7150 #, c-format msgid "top-level declaration of `%s' specifies `auto'" msgstr "" -#: cp/decl.c:7164 +#: cp/decl.c:7162 msgid "storage class specifiers invalid in friend function declarations" msgstr "" -#: cp/decl.c:7329 +#: cp/decl.c:7327 msgid "destructor cannot be static member function" msgstr "" -#: cp/decl.c:7332 +#: cp/decl.c:7330 #, c-format msgid "destructors may not be `%s'" msgstr "" -#: cp/decl.c:7353 +#: cp/decl.c:7351 msgid "constructor cannot be static member function" msgstr "" -#: cp/decl.c:7356 +#: cp/decl.c:7354 msgid "constructors cannot be declared virtual" msgstr "" -#: cp/decl.c:7361 +#: cp/decl.c:7359 #, c-format msgid "constructors may not be `%s'" msgstr "" -#: cp/decl.c:7371 +#: cp/decl.c:7369 msgid "return value type specifier for constructor ignored" msgstr "" -#: cp/decl.c:7390 +#: cp/decl.c:7388 #, c-format msgid "can't initialize friend function `%s'" msgstr "" #. Cannot be both friend and virtual. -#: cp/decl.c:7394 +#: cp/decl.c:7392 msgid "virtual functions cannot be friends" msgstr "" -#: cp/decl.c:7399 +#: cp/decl.c:7397 msgid "friend declaration not in class definition" msgstr "" -#: cp/decl.c:7401 +#: cp/decl.c:7399 #, c-format msgid "can't define friend function `%s' in a local class definition" msgstr "" -#: cp/decl.c:7422 +#: cp/decl.c:7420 msgid "destructors may not have parameters" msgstr "" -#: cp/decl.c:7442 cp/decl.c:7449 +#: cp/decl.c:7440 cp/decl.c:7447 msgid "cannot declare reference to `%#T'" msgstr "" -#: cp/decl.c:7443 +#: cp/decl.c:7441 msgid "cannot declare pointer to `%#T'" msgstr "" -#: cp/decl.c:7448 +#: cp/decl.c:7446 msgid "cannot declare pointer to `%#T' member" msgstr "" -#: cp/decl.c:7586 +#: cp/decl.c:7584 msgid "extra qualification `%T::' on member `%s' ignored" msgstr "" -#: cp/decl.c:7598 +#: cp/decl.c:7596 msgid "cannot declare member function `%T::%s' within `%T'" msgstr "" -#: cp/decl.c:7613 +#: cp/decl.c:7611 msgid "cannot declare member `%T::%s' within `%T'" msgstr "" -#: cp/decl.c:7693 +#: cp/decl.c:7691 msgid "data member may not have variably modified type `%T'" msgstr "" -#: cp/decl.c:7695 +#: cp/decl.c:7693 msgid "parameter may not have variably modified type `%T'" msgstr "" #. [dcl.fct.spec] The explicit specifier shall only be used in #. declarations of constructors within a class definition. -#: cp/decl.c:7703 +#: cp/decl.c:7701 msgid "only declarations of constructors can be `explicit'" msgstr "" -#: cp/decl.c:7711 +#: cp/decl.c:7709 #, c-format msgid "non-member `%s' cannot be declared `mutable'" msgstr "" -#: cp/decl.c:7716 +#: cp/decl.c:7714 #, c-format msgid "non-object member `%s' cannot be declared `mutable'" msgstr "" -#: cp/decl.c:7722 +#: cp/decl.c:7720 #, c-format msgid "function `%s' cannot be declared `mutable'" msgstr "" -#: cp/decl.c:7727 +#: cp/decl.c:7725 #, c-format msgid "static `%s' cannot be declared `mutable'" msgstr "" -#: cp/decl.c:7732 +#: cp/decl.c:7730 #, c-format msgid "const `%s' cannot be declared `mutable'" msgstr "" -#: cp/decl.c:7745 +#: cp/decl.c:7743 msgid "template-id `%D' used as a declarator" msgstr "" -#: cp/decl.c:7766 +#: cp/decl.c:7764 msgid "ISO C++ forbids nested type `%D' with same name as enclosing class" msgstr "" -#: cp/decl.c:7774 +#: cp/decl.c:7772 msgid "%Jtypedef name may not be a nested-name-specifier" msgstr "" -#: cp/decl.c:7820 +#: cp/decl.c:7818 msgid "%Jinvalid type qualifier for non-member function type" msgstr "" -#: cp/decl.c:7884 +#: cp/decl.c:7882 msgid "type qualifiers specified for friend class declaration" msgstr "" -#: cp/decl.c:7889 +#: cp/decl.c:7887 msgid "`inline' specified for friend class declaration" msgstr "" -#: cp/decl.c:7897 +#: cp/decl.c:7895 msgid "template parameters cannot be friends" msgstr "" -#: cp/decl.c:7899 +#: cp/decl.c:7897 msgid "friend declaration requires class-key, i.e. `friend class %T::%D'" msgstr "" -#: cp/decl.c:7903 +#: cp/decl.c:7901 msgid "friend declaration requires class-key, i.e. `friend %#T'" msgstr "" -#: cp/decl.c:7916 +#: cp/decl.c:7914 msgid "trying to make class `%T' a friend of global scope" msgstr "" -#: cp/decl.c:7927 +#: cp/decl.c:7925 msgid "invalid qualifiers on non-member function type" msgstr "" -#: cp/decl.c:7946 +#: cp/decl.c:7944 msgid "abstract declarator `%T' used as declaration" msgstr "" -#: cp/decl.c:7958 +#: cp/decl.c:7956 msgid "unnamed variable or field declared void" msgstr "" -#: cp/decl.c:7967 +#: cp/decl.c:7965 msgid "variable or field declared void" msgstr "" -#: cp/decl.c:7977 +#: cp/decl.c:7975 msgid "cannot use `::' in parameter declaration" msgstr "" #. Something like struct S { int N::j; }; -#: cp/decl.c:8022 +#: cp/decl.c:8020 msgid "invalid use of `::'" msgstr "" -#: cp/decl.c:8034 +#: cp/decl.c:8032 msgid "function `%D' cannot be declared friend" msgstr "" -#: cp/decl.c:8046 +#: cp/decl.c:8044 msgid "can't make `%D' into a method -- not in a class" msgstr "" -#: cp/decl.c:8055 +#: cp/decl.c:8053 msgid "function `%D' declared virtual inside a union" msgstr "" -#: cp/decl.c:8067 +#: cp/decl.c:8065 msgid "`%D' cannot be declared virtual, since it is always static" msgstr "" -#: cp/decl.c:8144 +#: cp/decl.c:8142 msgid "field `%D' has incomplete type" msgstr "" -#: cp/decl.c:8146 +#: cp/decl.c:8144 msgid "name `%T' has incomplete type" msgstr "" -#: cp/decl.c:8155 +#: cp/decl.c:8153 msgid " in instantiation of template `%T'" msgstr "" -#: cp/decl.c:8165 +#: cp/decl.c:8163 #, c-format msgid "`%s' is neither function nor member function; cannot be declared friend" msgstr "" -#: cp/decl.c:8176 +#: cp/decl.c:8174 msgid "member functions are implicitly friends of their class" msgstr "" @@ -14425,102 +14452,102 @@ msgstr "" #. the rest of the compiler does not correctly #. handle the initialization unless the member is #. static so we make it static below. -#: cp/decl.c:8217 +#: cp/decl.c:8215 msgid "ISO C++ forbids initialization of member `%D'" msgstr "" -#: cp/decl.c:8219 +#: cp/decl.c:8217 msgid "making `%D' static" msgstr "" -#: cp/decl.c:8242 +#: cp/decl.c:8240 msgid "" "ISO C++ forbids static data member `%D' with same name as enclosing class" msgstr "" -#: cp/decl.c:8282 +#: cp/decl.c:8280 #, c-format msgid "storage class `auto' invalid for function `%s'" msgstr "" -#: cp/decl.c:8284 +#: cp/decl.c:8282 #, c-format msgid "storage class `register' invalid for function `%s'" msgstr "" -#: cp/decl.c:8286 +#: cp/decl.c:8284 #, c-format msgid "storage class `__thread' invalid for function `%s'" msgstr "" -#: cp/decl.c:8297 +#: cp/decl.c:8295 #, c-format msgid "" "storage class `static' invalid for function `%s' declared out of global scope" msgstr "" -#: cp/decl.c:8299 +#: cp/decl.c:8297 #, c-format msgid "" "storage class `inline' invalid for function `%s' declared out of global scope" msgstr "" -#: cp/decl.c:8306 +#: cp/decl.c:8304 #, c-format msgid "virtual non-class function `%s'" msgstr "" -#: cp/decl.c:8336 +#: cp/decl.c:8334 msgid "cannot declare member function `%D' to have static linkage" msgstr "" #. FIXME need arm citation -#: cp/decl.c:8342 +#: cp/decl.c:8340 msgid "cannot declare static function inside another function" msgstr "" -#: cp/decl.c:8370 +#: cp/decl.c:8368 msgid "" "`static' may not be used when defining (as opposed to declaring) a static " "data member" msgstr "" -#: cp/decl.c:8376 +#: cp/decl.c:8374 msgid "static member `%D' declared `register'" msgstr "" -#: cp/decl.c:8381 +#: cp/decl.c:8379 msgid "cannot explicitly declare member `%#D' to have extern linkage" msgstr "" -#: cp/decl.c:8523 +#: cp/decl.c:8521 msgid "default argument for `%#D' has type `%T'" msgstr "" -#: cp/decl.c:8526 +#: cp/decl.c:8524 msgid "default argument for parameter of type `%T' has type `%T'" msgstr "" -#: cp/decl.c:8543 +#: cp/decl.c:8541 msgid "default argument `%E' uses local variable `%D'" msgstr "" -#: cp/decl.c:8587 +#: cp/decl.c:8585 #, c-format msgid "invalid string constant `%E'" msgstr "" -#: cp/decl.c:8589 +#: cp/decl.c:8587 msgid "" "invalid integer constant in parameter list, did you forget to give parameter " "name?" msgstr "" -#: cp/decl.c:8627 +#: cp/decl.c:8625 msgid "parameter `%D' invalidly declared method type" msgstr "" -#: cp/decl.c:8651 +#: cp/decl.c:8649 msgid "parameter `%D' includes %s to array of unknown bound `%T'" msgstr "" @@ -14539,94 +14566,94 @@ msgstr "" #. or implicitly defined), there's no need to worry about their #. existence. Theoretically, they should never even be #. instantiated, but that's hard to forestall. -#: cp/decl.c:8810 +#: cp/decl.c:8808 msgid "invalid constructor; you probably meant `%T (const %T&)'" msgstr "" -#: cp/decl.c:8950 +#: cp/decl.c:8948 msgid "`%D' must be a nonstatic member function" msgstr "" -#: cp/decl.c:8956 +#: cp/decl.c:8954 msgid "" "`%D' must be either a non-static member function or a non-member function" msgstr "" -#: cp/decl.c:8973 +#: cp/decl.c:8971 msgid "`%D' must have an argument of class or enumerated type" msgstr "" -#: cp/decl.c:9008 +#: cp/decl.c:9006 #, c-format msgid "conversion to %s%s will never use a type conversion operator" msgstr "" #. 13.4.0.3 -#: cp/decl.c:9015 +#: cp/decl.c:9013 msgid "ISO C++ prohibits overloading operator ?:" msgstr "" -#: cp/decl.c:9065 +#: cp/decl.c:9063 msgid "postfix `%D' must take `int' as its argument" msgstr "" -#: cp/decl.c:9069 +#: cp/decl.c:9067 msgid "postfix `%D' must take `int' as its second argument" msgstr "" -#: cp/decl.c:9076 +#: cp/decl.c:9074 msgid "`%D' must take either zero or one argument" msgstr "" -#: cp/decl.c:9078 +#: cp/decl.c:9076 msgid "`%D' must take either one or two arguments" msgstr "" -#: cp/decl.c:9099 +#: cp/decl.c:9097 msgid "prefix `%D' should return `%T'" msgstr "" -#: cp/decl.c:9105 +#: cp/decl.c:9103 msgid "postfix `%D' should return `%T'" msgstr "" -#: cp/decl.c:9114 +#: cp/decl.c:9112 msgid "`%D' must take `void'" msgstr "" -#: cp/decl.c:9116 cp/decl.c:9124 +#: cp/decl.c:9114 cp/decl.c:9122 msgid "`%D' must take exactly one argument" msgstr "" -#: cp/decl.c:9126 +#: cp/decl.c:9124 msgid "`%D' must take exactly two arguments" msgstr "" -#: cp/decl.c:9134 +#: cp/decl.c:9132 msgid "user-defined `%D' always evaluates both arguments" msgstr "" -#: cp/decl.c:9148 +#: cp/decl.c:9146 msgid "`%D' should return by value" msgstr "" -#: cp/decl.c:9160 cp/decl.c:9163 +#: cp/decl.c:9158 cp/decl.c:9161 msgid "`%D' cannot have default arguments" msgstr "" -#: cp/decl.c:9223 +#: cp/decl.c:9221 msgid "using typedef-name `%D' after `%s'" msgstr "" -#: cp/decl.c:9229 +#: cp/decl.c:9227 msgid "using template type parameter `%T' after `%s'" msgstr "" -#: cp/decl.c:9237 +#: cp/decl.c:9235 msgid "`%T' referred to as `%s'" msgstr "" -#: cp/decl.c:9243 +#: cp/decl.c:9241 msgid "`%T' referred to as enum" msgstr "" @@ -14637,35 +14664,35 @@ msgstr "" #. void f(class C); // No template header here #. #. then the required template argument is missing. -#: cp/decl.c:9258 +#: cp/decl.c:9256 msgid "template argument required for `%s %T'" msgstr "" -#: cp/decl.c:9404 +#: cp/decl.c:9402 msgid "use of enum `%#D' without previous declaration" msgstr "" -#: cp/decl.c:9481 +#: cp/decl.c:9479 msgid "derived union `%T' invalid" msgstr "" -#: cp/decl.c:9534 +#: cp/decl.c:9532 msgid "base type `%T' fails to be a struct or class type" msgstr "" -#: cp/decl.c:9542 +#: cp/decl.c:9540 msgid "recursive type `%T' undefined" msgstr "" -#: cp/decl.c:9544 +#: cp/decl.c:9542 msgid "duplicate base type `%T' invalid" msgstr "" -#: cp/decl.c:9656 +#: cp/decl.c:9654 msgid "multiple definition of `%#T'" msgstr "" -#: cp/decl.c:9657 +#: cp/decl.c:9655 msgid "%Jprevious definition here" msgstr "" @@ -14673,47 +14700,47 @@ msgstr "" #. #. IF no integral type can represent all the enumerator values, the #. enumeration is ill-formed. -#: cp/decl.c:9792 +#: cp/decl.c:9790 msgid "no integral type can represent all of the enumerator values for `%T'" msgstr "" -#: cp/decl.c:9882 +#: cp/decl.c:9880 msgid "enumerator value for `%D' not integer constant" msgstr "" -#: cp/decl.c:9902 +#: cp/decl.c:9900 msgid "overflow in enumeration values at `%D'" msgstr "" -#: cp/decl.c:9971 +#: cp/decl.c:9969 msgid "return type `%#T' is incomplete" msgstr "" -#: cp/decl.c:10091 +#: cp/decl.c:10089 msgid "return type for `main' changed to `int'" msgstr "" -#: cp/decl.c:10121 +#: cp/decl.c:10119 msgid "`%D' implicitly declared before its definition" msgstr "" -#: cp/decl.c:10143 cp/typeck.c:5968 +#: cp/decl.c:10141 cp/typeck.c:5968 msgid "`operator=' should return a reference to `*this'" msgstr "" -#: cp/decl.c:10404 +#: cp/decl.c:10414 msgid "parameter `%D' declared void" msgstr "" -#: cp/decl.c:10869 +#: cp/decl.c:10879 msgid "invalid member function declaration" msgstr "" -#: cp/decl.c:10886 +#: cp/decl.c:10896 msgid "`%D' is already defined in class `%T'" msgstr "" -#: cp/decl.c:11099 +#: cp/decl.c:11109 msgid "static member function `%#D' declared with type qualifiers" msgstr "" @@ -14775,7 +14802,7 @@ msgstr "" msgid "invalid use of `virtual' in template declaration of `%#D'" msgstr "" -#: cp/decl2.c:579 cp/pt.c:2694 +#: cp/decl2.c:579 cp/pt.c:2696 msgid "template declaration of `%#D'" msgstr "" @@ -14929,61 +14956,57 @@ msgstr "" msgid "`...' handler must be the last handler for its try block" msgstr "" -#: cp/friend.c:162 +#: cp/friend.c:161 msgid "`%D' is already a friend of class `%T'" msgstr "" -#: cp/friend.c:164 -msgid "previous friend declaration of `%D'" -msgstr "" - -#: cp/friend.c:216 +#: cp/friend.c:212 msgid "invalid type `%T' declared `friend'" msgstr "" #. [temp.friend] #. Friend declarations shall not declare partial #. specializations. -#: cp/friend.c:232 +#: cp/friend.c:228 msgid "partial specialization `%T' declared `friend'" msgstr "" -#: cp/friend.c:242 +#: cp/friend.c:238 msgid "class `%T' is implicitly friends with itself" msgstr "" #. template friend typename S::X; -#: cp/friend.c:260 +#: cp/friend.c:256 msgid "typename type `%#T' declared `friend'" msgstr "" #. template friend class T; -#: cp/friend.c:266 +#: cp/friend.c:262 msgid "template parameter type `%T' declared `friend'" msgstr "" #. template friend class A; where A is not a template -#: cp/friend.c:272 +#: cp/friend.c:268 msgid "`%#T' is not a template" msgstr "" -#: cp/friend.c:291 +#: cp/friend.c:287 msgid "`%D' is already a friend of `%T'" msgstr "" -#: cp/friend.c:301 +#: cp/friend.c:297 msgid "`%T' is already a friend of `%T'" msgstr "" -#: cp/friend.c:398 +#: cp/friend.c:394 msgid "member `%D' declared as friend before type `%T' defined" msgstr "" -#: cp/friend.c:453 +#: cp/friend.c:449 msgid "friend declaration `%#D' declares a non-template function" msgstr "" -#: cp/friend.c:456 +#: cp/friend.c:452 msgid "" "(if this is not what you intended, make sure the function template has " "already been declared and add <> after the function name here) -Wno-non-" @@ -15166,27 +15189,27 @@ msgstr "" msgid "call to Java constructor with `%s' undefined" msgstr "" -#: cp/init.c:2143 +#: cp/init.c:2161 msgid "ISO C++ forbids initialization in array new" msgstr "" -#: cp/init.c:2167 +#: cp/init.c:2185 msgid "ISO C++ forbids aggregate initializer to new" msgstr "" -#: cp/init.c:2610 +#: cp/init.c:2628 msgid "initializer ends prematurely" msgstr "" -#: cp/init.c:2667 +#: cp/init.c:2685 msgid "cannot initialize multi-dimensional array with initializer" msgstr "" -#: cp/init.c:2840 +#: cp/init.c:2858 msgid "unknown array size in delete" msgstr "" -#: cp/init.c:3104 +#: cp/init.c:3122 msgid "type to vector delete is neither pointer or array type" msgstr "" @@ -15269,24 +15292,24 @@ msgstr "" msgid "the mangled name of `%D' will change in a future version of GCC" msgstr "" -#: cp/method.c:449 +#: cp/method.c:450 msgid "generic thunk code fails for method `%#D' which uses `...'" msgstr "" -#: cp/method.c:672 +#: cp/method.c:673 msgid "non-static const member `%#D', can't use default assignment operator" msgstr "" -#: cp/method.c:677 +#: cp/method.c:678 msgid "" "non-static reference member `%#D', can't use default assignment operator" msgstr "" -#: cp/name-lookup.c:643 +#: cp/name-lookup.c:646 msgid "`%#D' used prior to declaration" msgstr "" -#: cp/name-lookup.c:674 +#: cp/name-lookup.c:677 msgid "redeclaration of `wchar_t' as `%T'" msgstr "" @@ -15296,212 +15319,220 @@ msgstr "" #. [basic.start.main] #. #. This function shall not be overloaded. -#: cp/name-lookup.c:702 +#: cp/name-lookup.c:709 msgid "invalid redeclaration of `%D'" msgstr "" -#: cp/name-lookup.c:703 +#: cp/name-lookup.c:710 msgid "as `%D'" msgstr "" -#: cp/name-lookup.c:790 +#: cp/name-lookup.c:798 msgid "type mismatch with previous external decl of `%#D'" msgstr "" -#: cp/name-lookup.c:791 +#: cp/name-lookup.c:799 msgid "previous external decl of `%#D'" msgstr "" -#: cp/name-lookup.c:833 +#: cp/name-lookup.c:841 msgid "`%D' was previously implicitly declared to return `int'" msgstr "" -#: cp/name-lookup.c:891 +#: cp/name-lookup.c:899 msgid "extern declaration of `%#D' doesn't match" msgstr "" -#: cp/name-lookup.c:892 +#: cp/name-lookup.c:900 msgid "global declaration `%#D'" msgstr "" -#: cp/name-lookup.c:928 +#: cp/name-lookup.c:936 msgid "declaration of `%#D' shadows a parameter" msgstr "" -#: cp/name-lookup.c:949 +#: cp/name-lookup.c:957 #, c-format msgid "declaration of `%s' shadows a member of `this'" msgstr "" -#: cp/name-lookup.c:1125 +#: cp/name-lookup.c:1133 msgid "name lookup of `%D' changed" msgstr "" -#: cp/name-lookup.c:1127 +#: cp/name-lookup.c:1135 msgid " matches this `%D' under ISO standard rules" msgstr "" -#: cp/name-lookup.c:1129 +#: cp/name-lookup.c:1137 msgid " matches this `%D' under old rules" msgstr "" -#: cp/name-lookup.c:1143 cp/name-lookup.c:1150 +#: cp/name-lookup.c:1151 cp/name-lookup.c:1158 msgid "name lookup of `%D' changed for new ISO `for' scoping" msgstr "" -#: cp/name-lookup.c:1145 +#: cp/name-lookup.c:1153 msgid " cannot use obsolete binding at `%D' because it has a destructor" msgstr "" -#: cp/name-lookup.c:1152 +#: cp/name-lookup.c:1160 msgid " using obsolete binding at `%D'" msgstr "" -#: cp/name-lookup.c:1205 +#: cp/name-lookup.c:1213 #, c-format msgid "%s %s(%E) %p %d\n" msgstr "" -#: cp/name-lookup.c:1208 +#: cp/name-lookup.c:1216 #, c-format msgid "%s %s %p %d\n" msgstr "" -#: cp/name-lookup.c:1327 +#: cp/name-lookup.c:1335 msgid "XXX is_class_level != (current_scope == class_scope)\n" msgstr "" -#: cp/name-lookup.c:1964 +#: cp/name-lookup.c:1972 msgid "`%#D' hides constructor for `%#T'" msgstr "" -#: cp/name-lookup.c:1979 +#: cp/name-lookup.c:1987 msgid "`%#D' conflicts with previous using declaration `%#D'" msgstr "" -#: cp/name-lookup.c:1991 +#: cp/name-lookup.c:1999 msgid "previous non-function declaration `%#D'" msgstr "" -#: cp/name-lookup.c:1992 +#: cp/name-lookup.c:2000 msgid "conflicts with function declaration `%#D'" msgstr "" #. 7.3.3/5 #. A using-declaration shall not name a template-id. -#: cp/name-lookup.c:2069 +#: cp/name-lookup.c:2077 msgid "a using-declaration cannot specify a template-id. Try `using %D'" msgstr "" -#: cp/name-lookup.c:2075 +#: cp/name-lookup.c:2083 msgid "namespace `%D' not allowed in using-declaration" msgstr "" #. It's a nested name with template parameter dependent scope. #. This can only be using-declaration for class member. -#: cp/name-lookup.c:2083 cp/name-lookup.c:2105 cp/name-lookup.c:3275 +#: cp/name-lookup.c:2091 cp/name-lookup.c:2113 cp/name-lookup.c:3283 msgid "`%T' is not a namespace" msgstr "" -#: cp/name-lookup.c:2129 +#: cp/name-lookup.c:2137 msgid "`%D' not declared" msgstr "" #. If the OLD_FN was really declared, the #. declarations don't match. -#: cp/name-lookup.c:2141 cp/name-lookup.c:2183 cp/name-lookup.c:2208 +#: cp/name-lookup.c:2149 cp/name-lookup.c:2191 cp/name-lookup.c:2216 msgid "`%D' is already declared in this scope" msgstr "" -#: cp/name-lookup.c:2214 +#: cp/name-lookup.c:2222 msgid "using declaration `%D' introduced ambiguous type `%T'" msgstr "" #. Definition isn't the kind we were looking for. -#: cp/name-lookup.c:2374 cp/name-lookup.c:2393 +#: cp/name-lookup.c:2382 cp/name-lookup.c:2401 msgid "`%#D' redeclared as %C" msgstr "" -#: cp/name-lookup.c:2803 +#: cp/name-lookup.c:2811 msgid "using-declaration for non-member at class scope" msgstr "" -#: cp/name-lookup.c:2810 +#: cp/name-lookup.c:2818 msgid "using-declaration cannot name destructor" msgstr "" -#: cp/name-lookup.c:2906 +#: cp/name-lookup.c:2914 msgid "declaration of `%D' not in a namespace surrounding `%D'" msgstr "" -#: cp/name-lookup.c:2946 +#: cp/name-lookup.c:2954 msgid "`%D' should have been declared inside `%D'" msgstr "" -#: cp/name-lookup.c:3009 +#: cp/name-lookup.c:3017 msgid "namespace alias `%D' not allowed here, assuming `%D'" msgstr "" #. The parser did not find it, so it's not there. -#: cp/name-lookup.c:3118 +#: cp/name-lookup.c:3126 msgid "unknown namespace `%D'" msgstr "" -#: cp/name-lookup.c:3269 +#: cp/name-lookup.c:3277 msgid "namespace `%T' undeclared" msgstr "" -#: cp/name-lookup.c:3415 +#: cp/name-lookup.c:3310 +msgid "strong using only meaningful at namespace scope" +msgstr "" + +#: cp/name-lookup.c:3317 +msgid "`%D' attribute directive ignored" +msgstr "" + +#: cp/name-lookup.c:3450 msgid "use of `%D' is ambiguous" msgstr "" -#: cp/name-lookup.c:3416 +#: cp/name-lookup.c:3451 msgid " first declared as `%#D' here" msgstr "" -#: cp/name-lookup.c:3419 +#: cp/name-lookup.c:3454 msgid " also declared as `%#D' here" msgstr "" -#: cp/name-lookup.c:3434 +#: cp/name-lookup.c:3469 msgid "`%D' denotes an ambiguous type" msgstr "" -#: cp/name-lookup.c:3435 +#: cp/name-lookup.c:3470 msgid "%J first type here" msgstr "" -#: cp/name-lookup.c:3436 +#: cp/name-lookup.c:3471 msgid "%J other type here" msgstr "" #. This happens for A::B where B is a template, and there are no #. template arguments. -#: cp/name-lookup.c:3501 cp/typeck.c:1742 +#: cp/name-lookup.c:3536 cp/typeck.c:1742 msgid "invalid use of `%D'" msgstr "" -#: cp/name-lookup.c:3542 +#: cp/name-lookup.c:3577 msgid "`%D::%D' is not a template" msgstr "" -#: cp/name-lookup.c:3559 +#: cp/name-lookup.c:3594 msgid "`%D' undeclared in namespace `%D'" msgstr "" -#: cp/name-lookup.c:4002 +#: cp/name-lookup.c:4037 msgid "`%D' is not a function," msgstr "" -#: cp/name-lookup.c:4003 +#: cp/name-lookup.c:4038 msgid " conflict with `%D'" msgstr "" -#: cp/name-lookup.c:4704 +#: cp/name-lookup.c:4773 msgid "XXX entering pop_everything ()\n" msgstr "" -#: cp/name-lookup.c:4713 +#: cp/name-lookup.c:4782 msgid "XXX leaving pop_everything ()\n" msgstr "" @@ -15509,178 +15540,187 @@ msgstr "" msgid "invalid token" msgstr "" -#: cp/parser.c:1790 +#: cp/parser.c:1800 msgid "new types may not be defined in a return type" msgstr "" -#: cp/parser.c:1799 +#: cp/parser.c:1809 #, c-format msgid "%s cannot appear in a constant-expression" msgstr "" #. Issue an error message. -#: cp/parser.c:1826 +#: cp/parser.c:1836 #, c-format msgid "`%s' does not name a type" msgstr "" -#: cp/parser.c:1857 +#: cp/parser.c:1867 msgid "(perhaps `typename %T::%s' was intended)" msgstr "" -#: cp/parser.c:2261 +#: cp/parser.c:2277 msgid "ISO C++ forbids braced-groups within expressions" msgstr "" -#: cp/parser.c:2270 +#: cp/parser.c:2286 msgid "statement-expressions are allowed only inside functions" msgstr "" -#: cp/parser.c:2321 +#: cp/parser.c:2337 msgid "`this' may not be used in this context" msgstr "" -#: cp/parser.c:2448 +#: cp/parser.c:2464 msgid "local variable `%D' may not appear in this context" msgstr "" -#: cp/parser.c:2804 +#: cp/parser.c:2820 msgid "typedef-name `%D' used as destructor declarator" msgstr "" -#: cp/parser.c:2997 +#: cp/parser.c:3013 msgid "`%T::%D' is not a class-name or namespace-name" msgstr "" -#: cp/parser.c:3001 +#: cp/parser.c:3017 msgid "`::%D' is not a class-name or namespace-name" msgstr "" -#: cp/parser.c:3005 +#: cp/parser.c:3021 msgid "`%D::%D' is not a class-name or namespace-name" msgstr "" -#: cp/parser.c:3010 +#: cp/parser.c:3026 msgid "`%D' is not a class-name or namespace-name" msgstr "" -#: cp/parser.c:3438 +#: cp/parser.c:3454 msgid "ISO C++ forbids compound-literals" msgstr "" -#: cp/parser.c:4352 +#: cp/parser.c:4368 msgid "expression in new-declarator must have integral or enumeration type" msgstr "" -#: cp/parser.c:4524 +#: cp/parser.c:4540 msgid "use of old-style cast" msgstr "" -#: cp/parser.c:5762 +#: cp/parser.c:5271 +#, c-format +msgid "case label `%E' not within a switch statement" +msgstr "" + +#: cp/parser.c:5811 msgid "ISO C++ forbids computed gotos" msgstr "" -#: cp/parser.c:5882 +#: cp/parser.c:5931 msgid "extra `;'" msgstr "" -#: cp/parser.c:6177 +#: cp/parser.c:6226 msgid "mixing declarations and function-definitions is forbidden" msgstr "" -#: cp/parser.c:6311 +#: cp/parser.c:6360 msgid "duplicate `friend'" msgstr "" -#: cp/parser.c:6769 +#: cp/parser.c:6818 msgid "only constructors take base initializers" msgstr "" -#: cp/parser.c:6820 +#: cp/parser.c:6869 msgid "anachronistic old-style base class initializer" msgstr "" #. Warn that we do not support `export'. -#: cp/parser.c:7210 +#: cp/parser.c:7259 msgid "keyword `export' not implemented, and will be ignored" msgstr "" -#: cp/parser.c:8493 +#: cp/parser.c:8411 cp/pt.c:3993 +msgid "`%T' is not a template" +msgstr "" + +#: cp/parser.c:8528 msgid "using `typename' outside of template" msgstr "" -#: cp/parser.c:8609 +#: cp/parser.c:8644 msgid "expected type-name" msgstr "" -#: cp/parser.c:8760 +#: cp/parser.c:8795 msgid "comma at end of enumerator list" msgstr "" #. [namespace.udecl] #. #. A using declaration shall not name a template-id. -#: cp/parser.c:9036 +#: cp/parser.c:9071 msgid "a template-id may not appear in a using-declaration" msgstr "" -#: cp/parser.c:9055 +#: cp/parser.c:9090 msgid "`%D::%D' has not been declared" msgstr "" -#: cp/parser.c:9058 cp/semantics.c:2282 +#: cp/parser.c:9093 cp/semantics.c:2291 msgid "`::%D' has not been declared" msgstr "" -#: cp/parser.c:9352 +#: cp/parser.c:9390 msgid "an asm-specification is not allowed on a function-definition" msgstr "" -#: cp/parser.c:9354 +#: cp/parser.c:9392 msgid "attributes are not allowed on a function-definition" msgstr "" -#: cp/parser.c:9469 +#: cp/parser.c:9507 msgid "attributes after parenthesized initializer ignored" msgstr "" -#: cp/parser.c:10587 +#: cp/parser.c:10625 msgid "file ends in default argument" msgstr "" -#: cp/parser.c:10643 +#: cp/parser.c:10681 msgid "deprecated use of default argument for parameter of non-function" msgstr "" -#: cp/parser.c:10646 +#: cp/parser.c:10684 msgid "default arguments are only permitted for function parameters" msgstr "" -#: cp/parser.c:11575 +#: cp/parser.c:11613 msgid "declaration of `%D' in `%D' which does not enclose `%D'" msgstr "" -#: cp/parser.c:11587 +#: cp/parser.c:11625 msgid "extra qualification ignored" msgstr "" -#: cp/parser.c:11807 +#: cp/parser.c:11845 msgid "extra semicolon" msgstr "" -#: cp/parser.c:11825 +#: cp/parser.c:11863 msgid "a class-key must be used when declaring a friend" msgstr "" -#: cp/parser.c:11856 +#: cp/parser.c:11894 msgid "friend declaration does not name a class or function" msgstr "" -#: cp/parser.c:13080 +#: cp/parser.c:13118 msgid "reference to `%D' is ambiguous" msgstr "" -#: cp/parser.c:13252 +#: cp/parser.c:13290 msgid "too few template-parameter-lists" msgstr "" @@ -15688,35 +15728,35 @@ msgstr "" #. something like: #. #. template template void S::f(); -#: cp/parser.c:13267 +#: cp/parser.c:13305 msgid "too many template-parameter-lists" msgstr "" #. If begin_function_definition didn't like the definition, skip #. the entire function. -#: cp/parser.c:13542 +#: cp/parser.c:13580 msgid "invalid function declaration" msgstr "" #. Issue an error message. -#: cp/parser.c:13579 +#: cp/parser.c:13617 msgid "named return values are no longer supported" msgstr "" -#: cp/parser.c:14129 +#: cp/parser.c:14212 #, c-format msgid "expected %s" msgstr "" -#: cp/parser.c:14275 +#: cp/parser.c:14358 msgid "`%s' tag used in naming `%#T'" msgstr "" -#: cp/parser.c:14295 +#: cp/parser.c:14378 msgid "%D redeclared with different access" msgstr "" -#: cp/parser.c:14312 +#: cp/parser.c:14395 msgid "`template' (as a disambiguator) is only allowed within templates" msgstr "" @@ -15736,81 +15776,81 @@ msgstr "" msgid "enclosing class templates are not explicitly specialized" msgstr "" -#: cp/pt.c:737 cp/pt.c:778 +#: cp/pt.c:739 cp/pt.c:780 msgid "specializing `%#T' in different namespace" msgstr "" -#: cp/pt.c:738 cp/pt.c:779 +#: cp/pt.c:740 cp/pt.c:781 msgid " from definition of `%#D'" msgstr "" -#: cp/pt.c:746 +#: cp/pt.c:748 msgid "specialization of `%T' after instantiation" msgstr "" -#: cp/pt.c:793 +#: cp/pt.c:795 msgid "specialization `%T' after instantiation `%T'" msgstr "" -#: cp/pt.c:805 +#: cp/pt.c:807 msgid "explicit specialization of non-template `%T'" msgstr "" -#: cp/pt.c:931 +#: cp/pt.c:933 msgid "specialization of %D after instantiation" msgstr "" -#: cp/pt.c:1056 +#: cp/pt.c:1058 msgid "%s %+#D" msgstr "" -#: cp/pt.c:1105 +#: cp/pt.c:1107 msgid "`%D' is not a function template" msgstr "" -#: cp/pt.c:1244 +#: cp/pt.c:1246 msgid "template-id `%D' for `%+D' does not match any template declaration" msgstr "" -#: cp/pt.c:1252 +#: cp/pt.c:1254 msgid "ambiguous template specialization `%D' for `%+D'" msgstr "" #. This case handles bogus declarations like template <> #. template void f(); -#: cp/pt.c:1475 cp/pt.c:1549 +#: cp/pt.c:1477 cp/pt.c:1551 msgid "template-id `%D' in declaration of primary template" msgstr "" -#: cp/pt.c:1488 +#: cp/pt.c:1490 msgid "template parameter list used in explicit instantiation" msgstr "" -#: cp/pt.c:1494 +#: cp/pt.c:1496 msgid "definition provided for explicit instantiation" msgstr "" -#: cp/pt.c:1500 +#: cp/pt.c:1502 msgid "too many template parameter lists in declaration of `%D'" msgstr "" -#: cp/pt.c:1516 +#: cp/pt.c:1518 msgid "too few template parameter lists in declaration of `%D'" msgstr "" -#: cp/pt.c:1533 +#: cp/pt.c:1535 msgid "explicit specialization not preceded by `template <>'" msgstr "" -#: cp/pt.c:1546 +#: cp/pt.c:1548 msgid "partial specialization `%D' of function template" msgstr "" -#: cp/pt.c:1578 +#: cp/pt.c:1580 msgid "default argument specified in explicit specialization" msgstr "" -#: cp/pt.c:1582 +#: cp/pt.c:1584 msgid "template specialization with C linkage" msgstr "" @@ -15822,106 +15862,106 @@ msgstr "" #. program is ill-formed. #. #. Similar language is found in [temp.explicit]. -#: cp/pt.c:1666 +#: cp/pt.c:1668 msgid "specialization of implicitly-declared special member function" msgstr "" -#: cp/pt.c:1710 +#: cp/pt.c:1712 msgid "no member function `%D' declared in `%T'" msgstr "" #. There are two many template parameter lists. -#: cp/pt.c:1865 +#: cp/pt.c:1867 msgid "too many template parameter lists in declaration of `%T'" msgstr "" -#: cp/pt.c:1958 +#: cp/pt.c:1960 msgid " shadows template parm `%#D'" msgstr "" -#: cp/pt.c:2355 +#: cp/pt.c:2357 msgid "template parameters not used in partial specialization:" msgstr "" -#: cp/pt.c:2359 +#: cp/pt.c:2361 msgid " `%D'" msgstr "" -#: cp/pt.c:2371 +#: cp/pt.c:2373 msgid "partial specialization `%T' does not specialize any template arguments" msgstr "" -#: cp/pt.c:2396 +#: cp/pt.c:2398 #, c-format msgid "template argument `%E' involves template parameter(s)" msgstr "" -#: cp/pt.c:2440 +#: cp/pt.c:2442 msgid "type `%T' of template argument `%E' depends on template parameter(s)" msgstr "" -#: cp/pt.c:2525 +#: cp/pt.c:2527 msgid "no default argument for `%D'" msgstr "" -#: cp/pt.c:2674 +#: cp/pt.c:2676 msgid "template with C linkage" msgstr "" -#: cp/pt.c:2677 +#: cp/pt.c:2679 msgid "template class without a name" msgstr "" #. [temp.mem] #. #. A destructor shall not be a member template. -#: cp/pt.c:2684 +#: cp/pt.c:2686 msgid "destructor `%D' declared as member template" msgstr "" -#: cp/pt.c:2764 +#: cp/pt.c:2766 msgid "`%D' does not declare a template type" msgstr "" -#: cp/pt.c:2770 +#: cp/pt.c:2772 msgid "template definition of non-template `%#D'" msgstr "" -#: cp/pt.c:2811 +#: cp/pt.c:2813 msgid "expected %d levels of template parms for `%#D', got %d" msgstr "" -#: cp/pt.c:2823 +#: cp/pt.c:2825 msgid "got %d template parameters for `%#D'" msgstr "" -#: cp/pt.c:2826 +#: cp/pt.c:2828 msgid "got %d template parameters for `%#T'" msgstr "" -#: cp/pt.c:2828 +#: cp/pt.c:2830 #, c-format msgid " but %d required" msgstr "" -#: cp/pt.c:2908 +#: cp/pt.c:2910 msgid "`%T' is not a template type" msgstr "" -#: cp/pt.c:2924 +#: cp/pt.c:2926 msgid "previous declaration `%D'" msgstr "" -#: cp/pt.c:2925 +#: cp/pt.c:2927 #, c-format msgid "used %d template parameter%s instead of %d" msgstr "" -#: cp/pt.c:2941 +#: cp/pt.c:2943 msgid "template parameter `%#D'" msgstr "" -#: cp/pt.c:2942 +#: cp/pt.c:2944 msgid "redeclared here as `%#D'" msgstr "" @@ -15929,279 +15969,275 @@ msgstr "" #. #. A template-parameter may not be given default arguments #. by two different declarations in the same scope. -#: cp/pt.c:2952 +#: cp/pt.c:2954 msgid "redefinition of default argument for `%#D'" msgstr "" -#: cp/pt.c:2953 +#: cp/pt.c:2955 msgid "%J original definition appeared here" msgstr "" -#: cp/pt.c:3042 +#: cp/pt.c:3044 #, c-format msgid "`%E' is not a valid template argument" msgstr "" -#: cp/pt.c:3046 +#: cp/pt.c:3048 msgid "it must be the address of a function with external linkage" msgstr "" -#: cp/pt.c:3048 +#: cp/pt.c:3050 msgid "it must be the address of an object with external linkage" msgstr "" -#: cp/pt.c:3051 +#: cp/pt.c:3053 msgid "it must be a pointer-to-member of the form `&X::Y'" msgstr "" -#: cp/pt.c:3062 +#: cp/pt.c:3064 #, c-format msgid "" "string literal %E is not a valid template argument because it is the address " "of an object with static linkage" msgstr "" -#: cp/pt.c:3077 +#: cp/pt.c:3079 #, c-format msgid "address of non-extern `%E' cannot be used as template argument" msgstr "" -#: cp/pt.c:3086 +#: cp/pt.c:3088 #, c-format msgid "non-constant `%E' cannot be used as template argument" msgstr "" -#: cp/pt.c:3094 +#: cp/pt.c:3096 msgid "type '%T' cannot be used as a value for a non-type template-parameter" msgstr "" -#: cp/pt.c:3097 +#: cp/pt.c:3099 msgid "invalid use of '%D' as a non-type template-argument" msgstr "" -#: cp/pt.c:3099 +#: cp/pt.c:3101 #, c-format msgid "invalid use of '%E' as a non-type template-argument" msgstr "" -#: cp/pt.c:3463 +#: cp/pt.c:3465 #, c-format msgid "to refer to a type member of a template parameter, use `typename %E'" msgstr "" -#: cp/pt.c:3476 cp/pt.c:3494 cp/pt.c:3533 +#: cp/pt.c:3478 cp/pt.c:3496 cp/pt.c:3535 msgid "type/value mismatch at argument %d in template parameter list for `%D'" msgstr "" -#: cp/pt.c:3479 +#: cp/pt.c:3481 msgid " expected a constant of type `%T', got `%T'" msgstr "" -#: cp/pt.c:3483 +#: cp/pt.c:3485 #, c-format msgid " expected a class template, got `%E'" msgstr "" -#: cp/pt.c:3485 +#: cp/pt.c:3487 #, c-format msgid " expected a type, got `%E'" msgstr "" -#: cp/pt.c:3497 +#: cp/pt.c:3499 msgid " expected a type, got `%T'" msgstr "" -#: cp/pt.c:3499 +#: cp/pt.c:3501 msgid " expected a class template, got `%T'" msgstr "" -#: cp/pt.c:3535 +#: cp/pt.c:3537 msgid " expected a template of type `%D', got `%D'" msgstr "" -#: cp/pt.c:3570 +#: cp/pt.c:3572 msgid "could not convert template argument `%E' to `%T'" msgstr "" -#: cp/pt.c:3610 +#: cp/pt.c:3612 #, c-format msgid "wrong number of template arguments (%d, should be %d)" msgstr "" -#: cp/pt.c:3614 +#: cp/pt.c:3616 msgid "provided for `%D'" msgstr "" -#: cp/pt.c:3642 +#: cp/pt.c:3644 #, c-format msgid "template argument %d is invalid" msgstr "" -#: cp/pt.c:3863 +#: cp/pt.c:3865 msgid "non-template used as template" msgstr "" -#: cp/pt.c:3991 -msgid "`%T' is not a template" -msgstr "" - -#: cp/pt.c:4003 +#: cp/pt.c:4005 msgid "non-template type `%T' used as a template" msgstr "" -#: cp/pt.c:4005 +#: cp/pt.c:4007 msgid "for template declaration `%D'" msgstr "" -#: cp/pt.c:4634 +#: cp/pt.c:4636 msgid "" "template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN " "to increase the maximum) instantiating `%D'" msgstr "" -#: cp/pt.c:5071 +#: cp/pt.c:5073 msgid "ambiguous class template instantiation for `%#T'" msgstr "" -#: cp/pt.c:5077 +#: cp/pt.c:5079 msgid "%s %+#T" msgstr "" -#: cp/pt.c:6088 cp/pt.c:6208 +#: cp/pt.c:6090 cp/pt.c:6210 msgid "instantiation of `%D' as type `%T'" msgstr "" -#: cp/pt.c:6250 +#: cp/pt.c:6252 msgid "invalid parameter type `%T'" msgstr "" -#: cp/pt.c:6252 +#: cp/pt.c:6254 msgid "in declaration `%D'" msgstr "" -#: cp/pt.c:6326 +#: cp/pt.c:6328 msgid "creating pointer to member function of non-class type `%T'" msgstr "" -#: cp/pt.c:6482 +#: cp/pt.c:6484 msgid "creating array with size zero" msgstr "" -#: cp/pt.c:6496 +#: cp/pt.c:6498 #, c-format msgid "creating array with size zero (`%E')" msgstr "" -#: cp/pt.c:6735 +#: cp/pt.c:6737 msgid "forming reference to void" msgstr "" -#: cp/pt.c:6737 +#: cp/pt.c:6739 msgid "forming %s to reference type `%T'" msgstr "" -#: cp/pt.c:6774 +#: cp/pt.c:6776 msgid "creating pointer to member of non-class type `%T'" msgstr "" -#: cp/pt.c:6780 +#: cp/pt.c:6782 msgid "creating pointer to member reference type `%T'" msgstr "" -#: cp/pt.c:6865 +#: cp/pt.c:6867 msgid "creating array of `%T'" msgstr "" -#: cp/pt.c:6908 +#: cp/pt.c:6910 msgid "`%T' is not a class, struct, or union type" msgstr "" -#: cp/pt.c:7021 +#: cp/pt.c:7023 #, c-format msgid "use of `%s' in template" msgstr "" -#: cp/pt.c:7132 +#: cp/pt.c:7134 #, c-format msgid "`%E' names a type, but a non-type is expected" msgstr "" -#: cp/pt.c:8391 +#: cp/pt.c:8393 msgid "`%T' uses anonymous type" msgstr "" -#: cp/pt.c:8393 +#: cp/pt.c:8395 msgid "`%T' uses local type `%T'" msgstr "" -#: cp/pt.c:8401 +#: cp/pt.c:8403 msgid "`%T' is a variably modified type" msgstr "" -#: cp/pt.c:8412 +#: cp/pt.c:8414 #, c-format msgid "integral expression `%E' is not constant" msgstr "" -#: cp/pt.c:8417 +#: cp/pt.c:8419 msgid " trying to instantiate `%D'" msgstr "" -#: cp/pt.c:8936 +#: cp/pt.c:8938 msgid "incomplete type unification" msgstr "" -#: cp/pt.c:9861 +#: cp/pt.c:9885 #, c-format msgid "use of `%s' in template type unification" msgstr "" -#: cp/pt.c:10289 cp/pt.c:10361 +#: cp/pt.c:10313 cp/pt.c:10385 msgid "explicit instantiation of non-template `%#D'" msgstr "" -#: cp/pt.c:10305 cp/pt.c:10356 +#: cp/pt.c:10329 cp/pt.c:10380 msgid "no matching template for `%D' found" msgstr "" -#: cp/pt.c:10311 +#: cp/pt.c:10335 msgid "explicit instantiation of `%#D'" msgstr "" -#: cp/pt.c:10348 +#: cp/pt.c:10372 msgid "duplicate explicit instantiation of `%#D'" msgstr "" -#: cp/pt.c:10373 +#: cp/pt.c:10397 msgid "ISO C++ forbids the use of `extern' on explicit instantiations" msgstr "" -#: cp/pt.c:10377 cp/pt.c:10463 +#: cp/pt.c:10401 cp/pt.c:10487 msgid "storage class `%D' applied to template instantiation" msgstr "" -#: cp/pt.c:10430 +#: cp/pt.c:10454 msgid "explicit instantiation of non-template type `%T'" msgstr "" -#: cp/pt.c:10444 +#: cp/pt.c:10468 msgid "explicit instantiation of `%#T' before definition of template" msgstr "" -#: cp/pt.c:10452 +#: cp/pt.c:10476 #, c-format msgid "ISO C++ forbids the use of `%s' on explicit instantiations" msgstr "" -#: cp/pt.c:10496 +#: cp/pt.c:10520 msgid "duplicate explicit instantiation of `%#T'" msgstr "" -#: cp/pt.c:10898 +#: cp/pt.c:10922 msgid "explicit instantiation of `%D' but no definition available" msgstr "" -#: cp/pt.c:11316 +#: cp/pt.c:11342 msgid "`%#T' is not a valid type for a template constant parameter" msgstr "" @@ -16301,105 +16337,105 @@ msgstr "" msgid "object missing in reference to `%D'" msgstr "" -#: cp/semantics.c:1697 +#: cp/semantics.c:1706 msgid "arguments to destructor are not allowed" msgstr "" -#: cp/semantics.c:1745 +#: cp/semantics.c:1754 msgid "`this' is unavailable for static member functions" msgstr "" -#: cp/semantics.c:1751 +#: cp/semantics.c:1760 msgid "invalid use of `this' in non-member function" msgstr "" -#: cp/semantics.c:1753 +#: cp/semantics.c:1762 msgid "invalid use of `this' at top level" msgstr "" -#: cp/semantics.c:1780 +#: cp/semantics.c:1789 msgid "calling type `%T' like a method" msgstr "" -#: cp/semantics.c:1813 +#: cp/semantics.c:1822 msgid "invalid qualifying scope in pseudo-destructor name" msgstr "" -#: cp/semantics.c:1819 +#: cp/semantics.c:1828 msgid "`%E' is not of type `%T'" msgstr "" -#: cp/semantics.c:1930 +#: cp/semantics.c:1939 msgid "template type parameters must use the keyword `class' or `typename'" msgstr "" -#: cp/semantics.c:1967 +#: cp/semantics.c:1976 msgid "invalid default template argument" msgstr "" -#: cp/semantics.c:2002 +#: cp/semantics.c:2011 msgid "definition of `%#T' inside template parameter list" msgstr "" -#: cp/semantics.c:2013 +#: cp/semantics.c:2022 msgid "invalid definition of qualified type `%T'" msgstr "" -#: cp/semantics.c:2028 +#: cp/semantics.c:2037 msgid "previous definition of `%#T'" msgstr "" -#: cp/semantics.c:2223 +#: cp/semantics.c:2232 msgid "invalid base-class specification" msgstr "" -#: cp/semantics.c:2232 +#: cp/semantics.c:2241 msgid "base class `%T' has cv qualifiers" msgstr "" -#: cp/semantics.c:2264 +#: cp/semantics.c:2273 msgid "multiple declarators in template declaration" msgstr "" -#: cp/semantics.c:2275 +#: cp/semantics.c:2284 msgid "incomplete type `%T' used in nested name specifier" msgstr "" -#: cp/semantics.c:2277 cp/typeck.c:1585 +#: cp/semantics.c:2286 cp/typeck.c:1585 msgid "`%D' is not a member of `%T'" msgstr "" -#: cp/semantics.c:2280 +#: cp/semantics.c:2289 msgid "`%D' is not a member of `%D'" msgstr "" -#: cp/semantics.c:2530 +#: cp/semantics.c:2539 msgid "`%D' cannot appear in a constant-expression" msgstr "" -#: cp/semantics.c:2539 +#: cp/semantics.c:2548 msgid "use of namespace `%D' as expression" msgstr "" -#: cp/semantics.c:2544 +#: cp/semantics.c:2553 msgid "use of class template `%T' as expression" msgstr "" #. Ambiguous reference to base members. -#: cp/semantics.c:2550 +#: cp/semantics.c:2559 msgid "request for member `%D' is ambiguous in multiple inheritance lattice" msgstr "" -#: cp/semantics.c:2610 +#: cp/semantics.c:2619 #, c-format msgid "use of %s from containing function" msgstr "" -#: cp/semantics.c:2613 +#: cp/semantics.c:2622 msgid " `%#D' declared here" msgstr "" -#: cp/semantics.c:2664 +#: cp/semantics.c:2673 #, c-format msgid "type of `%E' is unknown" msgstr "" @@ -16409,50 +16445,50 @@ msgstr "" msgid "non-lvalue in %s" msgstr "" -#: cp/tree.c:526 +#: cp/tree.c:528 msgid "`%V' qualifiers cannot be applied to `%T'" msgstr "" -#: cp/tree.c:1816 +#: cp/tree.c:1818 #, c-format msgid "`%s' attribute can only be applied to Java class definitions" msgstr "" -#: cp/tree.c:1845 +#: cp/tree.c:1847 #, c-format msgid "`%s' attribute can only be applied to class definitions" msgstr "" -#: cp/tree.c:1851 +#: cp/tree.c:1853 #, c-format msgid "`%s' is obsolete; g++ vtables are now COM-compatible by default" msgstr "" -#: cp/tree.c:1875 +#: cp/tree.c:1877 msgid "requested init_priority is not an integer constant" msgstr "" -#: cp/tree.c:1896 +#: cp/tree.c:1898 #, c-format msgid "" "can only use `%s' attribute on file-scope definitions of objects of class " "type" msgstr "" -#: cp/tree.c:1904 +#: cp/tree.c:1906 msgid "requested init_priority is out of range" msgstr "" -#: cp/tree.c:1914 +#: cp/tree.c:1916 msgid "requested init_priority is reserved for internal use" msgstr "" -#: cp/tree.c:1924 +#: cp/tree.c:1926 #, c-format msgid "`%s' attribute is not supported on this platform" msgstr "" -#: cp/tree.c:2450 +#: cp/tree.c:2452 #, c-format msgid "lang_* check: failed in %s, at %s:%d" msgstr "" @@ -17106,7 +17142,7 @@ msgid "call to function which throws incomplete type `%#T'" msgstr "" #. XXX Not i18n clean. -#: cp/cp-tree.h:3747 +#: cp/cp-tree.h:3752 #, c-format msgid "%s is deprecated, please see the documentation for details" msgstr "" @@ -17140,61 +17176,61 @@ msgstr "" msgid "ASSIGN'ed label cannot fit into `%A' at %0 -- using wider sibling" msgstr "" -#: f/com.c:11561 +#: f/com.c:11563 msgid "no INTEGER type can hold a pointer on this configuration" msgstr "" -#: f/com.c:11835 +#: f/com.c:11837 #, c-format msgid "configuration: REAL, INTEGER, and LOGICAL are %d bits wide," msgstr "" -#: f/com.c:11837 +#: f/com.c:11839 #, c-format msgid "and pointers are %d bits wide, but g77 doesn't yet work" msgstr "" -#: f/com.c:11839 +#: f/com.c:11841 msgid "properly unless they all are 32 bits wide" msgstr "" -#: f/com.c:11840 +#: f/com.c:11842 msgid "Please keep this in mind before you report bugs." msgstr "" #. I/O will probably crash. -#: f/com.c:11848 +#: f/com.c:11850 #, c-format msgid "configuration: char * holds %d bits, but ftnlen only %d" msgstr "" #. ASSIGN 10 TO I will crash. -#: f/com.c:11857 +#: f/com.c:11859 #, c-format msgid "" "configuration: char * holds %d bits, but INTEGER only %d --\n" " ASSIGN statement might fail" msgstr "" -#: f/com.c:13673 +#: f/com.c:13675 msgid "In statement function" msgstr "" -#: f/com.c:13683 +#: f/com.c:13685 msgid "Outside of any program unit:\n" msgstr "" -#: f/com.c:15279 +#: f/com.c:15281 #, no-c-format msgid "%A from %B at %0%C" msgstr "" -#: f/com.c:15589 +#: f/com.c:15591 #, no-c-format msgid "At %0, INCLUDE file %A exists, but is not readable" msgstr "" -#: f/com.c:15624 +#: f/com.c:15626 #, no-c-format msgid "At %0, INCLUDE nesting too deep" msgstr "" @@ -18427,129 +18463,129 @@ msgstr "" msgid "%Jnon-static method '%D' overrides static method" msgstr "" -#: java/decl.c:1061 +#: java/decl.c:1058 msgid "%J'%D' used prior to declaration" msgstr "" -#: java/decl.c:1102 +#: java/decl.c:1099 #, c-format msgid "declaration of `%s' shadows a parameter" msgstr "" -#: java/decl.c:1105 +#: java/decl.c:1102 #, c-format msgid "declaration of `%s' shadows a symbol from the parameter list" msgstr "" -#: java/decl.c:1397 +#: java/decl.c:1401 msgid "%Jlabel '%D' used but not defined" msgstr "" -#: java/decl.c:1402 +#: java/decl.c:1406 msgid "%Jlabel '%D' defined but not used" msgstr "" -#: java/decl.c:1530 +#: java/decl.c:1534 msgid "%JIn %D: overlapped variable and exception ranges at %d" msgstr "" -#: java/decl.c:1608 +#: java/decl.c:1612 msgid "bad type in parameter debug info" msgstr "" -#: java/decl.c:1617 +#: java/decl.c:1621 msgid "%Jbad PC range for debug info for local '%D'" msgstr "" -#: java/expr.c:518 +#: java/expr.c:519 msgid "stack underflow - dup* operation" msgstr "" -#: java/expr.c:1468 +#: java/expr.c:1469 #, c-format msgid "" "reference `%s' is ambiguous: appears in interface `%s' and interface `%s'" msgstr "" -#: java/expr.c:1496 +#: java/expr.c:1497 #, c-format msgid "field `%s' not found" msgstr "" -#: java/expr.c:1654 +#: java/expr.c:1655 msgid "ret instruction not implemented" msgstr "" -#: java/expr.c:1809 +#: java/expr.c:1810 #, c-format msgid "method '%s' not found in class" msgstr "" -#: java/expr.c:2009 +#: java/expr.c:2010 #, c-format msgid "failed to find class '%s'" msgstr "" -#: java/expr.c:2019 +#: java/expr.c:2020 #, c-format msgid "class '%s' has no method named '%s' matching signature '%s'" msgstr "" -#: java/expr.c:2029 +#: java/expr.c:2030 msgid "invokestatic on non static method" msgstr "" -#: java/expr.c:2034 +#: java/expr.c:2035 msgid "invokestatic on abstract method" msgstr "" -#: java/expr.c:2042 +#: java/expr.c:2043 msgid "invoke[non-static] on static method" msgstr "" -#: java/expr.c:2341 +#: java/expr.c:2342 #, c-format msgid "missing field '%s' in '%s'" msgstr "" -#: java/expr.c:2347 +#: java/expr.c:2348 #, c-format msgid "mismatching signature for field '%s' in '%s'" msgstr "" -#: java/expr.c:2369 +#: java/expr.c:2370 msgid "%Jassignment to final field '%D' not in field's class" msgstr "" -#: java/expr.c:2374 +#: java/expr.c:2375 msgid "%Jassignment to final static field `%D' not in class initializer" msgstr "" -#: java/expr.c:2382 +#: java/expr.c:2383 msgid "%Jassignment to final field '%D' not in constructor" msgstr "" -#: java/expr.c:2624 +#: java/expr.c:2625 #, c-format msgid "can't expand %s" msgstr "" -#: java/expr.c:2796 +#: java/expr.c:2797 msgid "invalid PC in line number table" msgstr "" -#: java/expr.c:2842 +#: java/expr.c:2843 #, c-format msgid "unreachable bytecode from %d to before %d" msgstr "" -#: java/expr.c:2880 +#: java/expr.c:2881 #, c-format msgid "unreachable bytecode from %d to the end of the method" msgstr "" #. duplicate code from LOAD macro -#: java/expr.c:3194 +#: java/expr.c:3195 msgid "unrecogized wide sub-instruction" msgstr "" @@ -18646,7 +18682,7 @@ msgstr "" msgid "bad zip/jar file %s" msgstr "" -#: java/jcf-parse.c:1256 +#: java/jcf-parse.c:1255 #, c-format msgid "error while reading %s from zip file" msgstr "" @@ -18753,16 +18789,12 @@ msgstr "" msgid "bad pc in exception_table" msgstr "" -#: java/verify.c:477 -msgid "exception handler inside code that is being protected" -msgstr "" - -#: java/verify.c:1387 +#: java/verify.c:1384 #, c-format msgid "unknown opcode %d@pc=%d during verification" msgstr "" -#: java/verify.c:1457 java/verify.c:1470 java/verify.c:1474 +#: java/verify.c:1454 java/verify.c:1467 java/verify.c:1471 #, c-format msgid "verification error at PC=%d" msgstr "" @@ -19325,1412 +19357,1412 @@ msgstr "" msgid "Warn about \"extern\" declarations not at file scope" msgstr "" -#: options.c:261 +#: options.c:258 msgid "" "Warn when non-templatized friend functions are declared within a template" msgstr "" -#: options.c:264 +#: options.c:261 msgid "Warn about non-virtual destructors" msgstr "" -#: options.c:270 +#: options.c:267 msgid "Warn if a C-style cast is used in a program" msgstr "" -#: options.c:273 +#: options.c:270 msgid "Warn if an old-style parameter definition is used" msgstr "" -#: options.c:276 +#: options.c:273 msgid "Warn if .class files are out of date" msgstr "" -#: options.c:279 +#: options.c:276 msgid "Warn about overloaded virtual function names" msgstr "" -#: options.c:282 +#: options.c:279 msgid "Warn when the packed attribute has no effect on struct layout" msgstr "" -#: options.c:285 +#: options.c:282 msgid "Warn when padding is required to align structure members" msgstr "" -#: options.c:288 +#: options.c:285 msgid "Warn about possibly missing parentheses" msgstr "" -#: options.c:291 +#: options.c:288 msgid "Warn when converting the type of pointers to member functions" msgstr "" -#: options.c:294 +#: options.c:291 msgid "Warn about function pointer arithmetic" msgstr "" -#: options.c:297 +#: options.c:294 msgid "Warn if inherited methods are unimplemented" msgstr "" -#: options.c:300 +#: options.c:297 msgid "Warn about multiple declarations of the same object" msgstr "" -#: options.c:303 +#: options.c:300 msgid "Warn if modifiers are specified when not necessary" msgstr "" -#: options.c:306 +#: options.c:303 msgid "Warn when the compiler reorders code" msgstr "" -#: options.c:309 +#: options.c:306 msgid "" "Warn whenever a function's return type defaults to \"int\" (C), or about " "inconsistent return types (C++)" msgstr "" -#: options.c:312 +#: options.c:309 msgid "Warn if a selector has multiple methods" msgstr "" -#: options.c:315 +#: options.c:312 msgid "Warn about possible violations of sequence point rules" msgstr "" -#: options.c:318 +#: options.c:315 msgid "Warn when one local variable shadows another" msgstr "" -#: options.c:321 +#: options.c:318 msgid "Warn about signed-unsigned comparisons" msgstr "" -#: options.c:324 +#: options.c:321 msgid "Warn when overload promotes from unsigned to signed" msgstr "" -#: options.c:327 +#: options.c:324 msgid "Warn about code which might break strict aliasing rules" msgstr "" -#: options.c:330 +#: options.c:327 msgid "Warn about unprototyped function declarations" msgstr "" -#: options.c:333 +#: options.c:330 msgid "Warn about constructs with surprising meanings" msgstr "" -#: options.c:336 +#: options.c:333 msgid "Warn about enumerated switches, with no default, missing a case" msgstr "" -#: options.c:339 +#: options.c:336 msgid "Warn about enumerated switches missing a \"default:\" statement" msgstr "" -#: options.c:342 +#: options.c:339 msgid "Warn about all enumerated switches missing a specific case" msgstr "" -#: options.c:345 +#: options.c:342 msgid "Warn when synthesis behavior differs from Cfront" msgstr "" -#: options.c:348 +#: options.c:345 msgid "Do not suppress warnings from system headers" msgstr "" -#: options.c:351 +#: options.c:348 msgid "Warn about features not present in traditional C" msgstr "" -#: options.c:360 +#: options.c:357 msgid "Warn if an undefined macro is used in an #if directive" msgstr "" -#: options.c:363 +#: options.c:360 msgid "Warn about uninitialized automatic variables" msgstr "" -#: options.c:366 +#: options.c:363 msgid "Warn about unrecognized pragmas" msgstr "" -#: options.c:369 +#: options.c:366 msgid "Warn about code that will never be executed" msgstr "" -#: options.c:372 +#: options.c:369 msgid "Enable all -Wunused- warnings" msgstr "" -#: options.c:375 +#: options.c:372 msgid "Warn when a function is unused" msgstr "" -#: options.c:378 +#: options.c:375 msgid "Warn when a label is unused" msgstr "" -#: options.c:381 +#: options.c:378 msgid "Warn about macros defined in the main file that are not used" msgstr "" -#: options.c:384 +#: options.c:381 msgid "Warn when a function parameter is unused" msgstr "" -#: options.c:387 +#: options.c:384 msgid "Warn when an expression value is unused" msgstr "" -#: options.c:390 +#: options.c:387 msgid "Warn when a variable is unused" msgstr "" -#: options.c:393 +#: options.c:390 msgid "Give strings the type \"array of char\"" msgstr "" -#: options.c:396 +#: options.c:393 msgid "" "A synonym for -std=c89. In a future version of GCC it will become " "synonymous with -std=c99 instead" msgstr "" -#: options.c:399 +#: options.c:396 msgid "-aux-info \tEmit declaration information into " msgstr "" -#: options.c:411 +#: options.c:408 msgid "-d\tEnable dumps from specific passes of the compiler" msgstr "" -#: options.c:414 +#: options.c:411 msgid "-dumpbase \tSet the file basename to be used for dumps" msgstr "" -#: options.c:417 +#: options.c:414 msgid "--CLASSPATH\tDeprecated; use --classpath instead" msgstr "" -#: options.c:432 +#: options.c:429 msgid "Enforce class member access control semantics" msgstr "" -#: options.c:435 +#: options.c:432 msgid "Align the start of functions" msgstr "" -#: options.c:441 +#: options.c:438 msgid "Align labels which are only reached by jumping" msgstr "" -#: options.c:447 +#: options.c:444 msgid "Align all labels" msgstr "" -#: options.c:453 +#: options.c:450 msgid "Align the start of loops" msgstr "" -#: options.c:462 +#: options.c:459 msgid "Change when template instances are emitted" msgstr "" -#: options.c:465 +#: options.c:462 msgid "Specify that arguments may alias each other and globals" msgstr "" -#: options.c:468 +#: options.c:465 msgid "Assume arguments may alias globals but not each other" msgstr "" -#: options.c:471 +#: options.c:468 msgid "Assume arguments alias neither each other nor globals" msgstr "" -#: options.c:474 +#: options.c:471 msgid "Recognize the \"asm\" keyword" msgstr "" -#: options.c:486 +#: options.c:483 msgid "Generate unwind tables that are exact at each instruction boundary" msgstr "" -#: options.c:489 +#: options.c:486 msgid "" "Do not treat local variables and COMMON blocks as if they were named in SAVE " "statements" msgstr "" -#: options.c:492 +#: options.c:489 msgid "" "Backslashes in character and hollerith constants are special (not C-style)" msgstr "" -#: options.c:495 +#: options.c:492 msgid "Delete libU77 intrinsics with bad interfaces" msgstr "" -#: options.c:498 +#: options.c:495 msgid "Disable libU77 intrinsics with bad interfaces" msgstr "" -#: options.c:501 +#: options.c:498 msgid "Enable libU77 intrinsics with bad interfaces" msgstr "" -#: options.c:504 +#: options.c:501 msgid "Hide libU77 intrinsics with bad interfaces" msgstr "" -#: options.c:507 +#: options.c:504 msgid "--bootclasspath=\tReplace system path" msgstr "" -#: options.c:510 +#: options.c:507 msgid "Generate code to check bounds before indexing arrays" msgstr "" -#: options.c:513 +#: options.c:510 msgid "Replace add, compare, branch with branch on count register" msgstr "" -#: options.c:516 +#: options.c:513 msgid "Use profiling information for branch probabilities" msgstr "" -#: options.c:519 +#: options.c:516 msgid "" "Perform branch target load optimization before prologue / epilogue threading" msgstr "" -#: options.c:522 +#: options.c:519 msgid "" "Perform branch target load optimization after prologue / epilogue threading" msgstr "" -#: options.c:525 +#: options.c:522 msgid "Recognize built-in functions" msgstr "" -#: options.c:531 +#: options.c:528 msgid "" "-fcall-saved-\tMark as being preserved across functions" msgstr "" -#: options.c:534 +#: options.c:531 msgid "" "-fcall-used-\tMark as being corrupted by function calls" msgstr "" -#: options.c:537 +#: options.c:534 msgid "Save registers around function calls" msgstr "" -#: options.c:540 +#: options.c:537 msgid "Program written in strict mixed-case" msgstr "" -#: options.c:543 +#: options.c:540 msgid "Compile as if program written in lowercase" msgstr "" -#: options.c:546 +#: options.c:543 msgid "Preserve case used in program" msgstr "" -#: options.c:549 +#: options.c:546 msgid "Program written in lowercase" msgstr "" -#: options.c:552 +#: options.c:549 msgid "Program written in uppercase" msgstr "" -#: options.c:555 +#: options.c:552 msgid "Compile as if program written in uppercase" msgstr "" -#: options.c:558 +#: options.c:555 msgid "Check the return value of new" msgstr "" -#: options.c:564 +#: options.c:561 msgid "--classpath=\tSet class path" msgstr "" -#: options.c:567 +#: options.c:564 msgid "Do not put uninitialized globals in the common section" msgstr "" -#: options.c:573 +#: options.c:570 msgid "Allow the arguments of the '?' operator to have different types" msgstr "" -#: options.c:576 +#: options.c:573 msgid "Reduce the size of object files" msgstr "" -#: options.c:579 +#: options.c:576 msgid "Make string literals \"const char[]\" not \"char[]\"" msgstr "" -#: options.c:582 +#: options.c:579 msgid "-fconst-string-class=\tUse class for constant strings" msgstr "" -#: options.c:585 +#: options.c:582 msgid "Perform a register copy-propagation optimization pass" msgstr "" -#: options.c:588 +#: options.c:585 msgid "Perform cross-jumping optimization" msgstr "" -#: options.c:591 +#: options.c:588 msgid "When running CSE, follow jumps to their targets" msgstr "" -#: options.c:594 +#: options.c:591 msgid "When running CSE, follow conditional jumps" msgstr "" -#: options.c:597 +#: options.c:594 msgid "Place data items into their own section" msgstr "" -#: options.c:600 +#: options.c:597 msgid "" "Emit special debugging information for COMMON and EQUIVALENCE (disabled)" msgstr "" -#: options.c:603 +#: options.c:600 msgid "Inline member functions by default" msgstr "" -#: options.c:606 +#: options.c:603 msgid "Defer popping functions args from stack until later" msgstr "" -#: options.c:609 +#: options.c:606 msgid "Attempt to fill delay slots of branch instructions" msgstr "" -#: options.c:612 +#: options.c:609 msgid "Delete useless null pointer checks" msgstr "" -#: options.c:615 +#: options.c:612 msgid "" "-fdiagnostics-show-location=[once|every-line]\tHow often to emit source " "location at the beginning of line-wrapped diagnostics" msgstr "" -#: options.c:618 +#: options.c:615 msgid "Allow '$' in symbol names" msgstr "" -#: options.c:621 +#: options.c:618 msgid "Permit '$' as an identifier character" msgstr "" -#: options.c:627 +#: options.c:624 msgid "" "Suppress output of instruction numbers and line number notes in debugging " "dumps" msgstr "" -#: options.c:633 +#: options.c:630 msgid "Perform DWARF2 duplicate elimination" msgstr "" +#: options.c:633 #: options.c:636 -#: options.c:639 msgid "Perform unused type elimination in debug info" msgstr "" -#: options.c:648 +#: options.c:645 msgid "Have front end emulate COMPLEX arithmetic to avoid bugs" msgstr "" -#: options.c:651 +#: options.c:648 msgid "" "--encoding=\tChoose input encoding (defaults from your locale)" msgstr "" -#: options.c:654 +#: options.c:651 msgid "Generate code to check exception specifications" msgstr "" -#: options.c:660 +#: options.c:657 msgid "Enable exception handling" msgstr "" -#: options.c:663 +#: options.c:660 msgid "" "-fexec-charset=\tConvert all strings and character constants to " "character set " msgstr "" -#: options.c:666 +#: options.c:663 msgid "Perform a number of minor, expensive optimizations" msgstr "" -#: options.c:675 +#: options.c:672 msgid "f2c-compatible code can be generated" msgstr "" -#: options.c:678 +#: options.c:675 msgid "Delete non-FORTRAN-77 intrinsics f2c supports" msgstr "" -#: options.c:681 +#: options.c:678 msgid "Disable non-FORTRAN-77 intrinsics f2c supports" msgstr "" -#: options.c:684 +#: options.c:681 msgid "Enable non-FORTRAN-77 intrinsics f2c supports" msgstr "" -#: options.c:687 +#: options.c:684 msgid "Hide non-FORTRAN-77 intrinsics f2c supports" msgstr "" -#: options.c:690 +#: options.c:687 msgid "Unsupported; generate libf2c-calling code" msgstr "" -#: options.c:693 +#: options.c:690 msgid "Program is written in typical FORTRAN 66 dialect" msgstr "" -#: options.c:696 +#: options.c:693 msgid "Program is written in typical Unix-f77 dialect" msgstr "" -#: options.c:699 +#: options.c:696 msgid "Program is written in Fortran-90-ish dialect" msgstr "" -#: options.c:702 +#: options.c:699 msgid "Delete non-FORTRAN-77 intrinsics F90 supports" msgstr "" -#: options.c:705 +#: options.c:702 msgid "Disable non-FORTRAN-77 intrinsics F90 supports" msgstr "" -#: options.c:708 +#: options.c:705 msgid "Enable non-FORTRAN-77 intrinsics F90 supports" msgstr "" -#: options.c:711 +#: options.c:708 msgid "Hide non-FORTRAN-77 intrinsics F90 supports" msgstr "" -#: options.c:723 +#: options.c:720 msgid "Assume no NaNs or infinities are generated" msgstr "" -#: options.c:726 +#: options.c:723 msgid "" "-ffixed-\tMark as being unavailable to the compiler" msgstr "" -#: options.c:732 +#: options.c:729 msgid "ffixed-line-length-\tSet the maximum line length to " msgstr "" -#: options.c:735 +#: options.c:732 msgid "Unsupported; affects code generation of arrays" msgstr "" -#: options.c:738 +#: options.c:735 msgid "Do not store floats in registers" msgstr "" -#: options.c:741 +#: options.c:738 msgid "Scope of for-init-statement variables is local to the loop" msgstr "" -#: options.c:744 +#: options.c:741 msgid "Copy memory address constants into registers before use" msgstr "" -#: options.c:747 +#: options.c:744 msgid "Always check for non gcj generated classes archives" msgstr "" -#: options.c:750 +#: options.c:747 msgid "Copy memory operands into registers before use" msgstr "" -#: options.c:753 +#: options.c:750 msgid "Generate code to check subscript and substring bounds" msgstr "" -#: options.c:756 +#: options.c:753 msgid "Program is written in Fortran-90-ish free form" msgstr "" -#: options.c:759 +#: options.c:756 msgid "Do not assume that standard C libraries and \"main\" exist" msgstr "" -#: options.c:762 +#: options.c:759 msgid "Allow function addresses to be held in registers" msgstr "" -#: options.c:765 +#: options.c:762 msgid "Place each function into its own section" msgstr "" -#: options.c:768 +#: options.c:765 msgid "Perform global common subexpression elimination" msgstr "" -#: options.c:771 +#: options.c:768 msgid "" "Perform redundant load after store elimination in global common " "subexpression elimination" msgstr "" -#: options.c:774 +#: options.c:771 msgid "" "Perform enhanced load motion during global common subexpression elimination" msgstr "" -#: options.c:777 +#: options.c:774 msgid "Perform store motion after global common subexpression elimination" msgstr "" -#: options.c:780 +#: options.c:777 msgid "Enable fatal diagnostics about inter-procedural problems" msgstr "" -#: options.c:783 +#: options.c:780 msgid "Delete non-FORTRAN-77 intrinsics g77 supports" msgstr "" -#: options.c:786 +#: options.c:783 msgid "Disable non-FORTRAN 77 intrinsics F90 supports" msgstr "" -#: options.c:789 +#: options.c:786 msgid "Enable non-FORTRAN 77 intrinsics F90 supports" msgstr "" -#: options.c:792 +#: options.c:789 msgid "Hide non-FORTRAN 77 intrinsics F90 supports" msgstr "" -#: options.c:795 +#: options.c:792 msgid "Recognize GNU-defined keywords" msgstr "" -#: options.c:798 +#: options.c:795 msgid "Output GNU ld formatted global initializers" msgstr "" -#: options.c:801 +#: options.c:798 msgid "Generate code for GNU runtime environment" msgstr "" -#: options.c:804 +#: options.c:801 msgid "Enable guessing of branch probabilities" msgstr "" -#: options.c:819 +#: options.c:816 msgid "Assume normal C execution environment" msgstr "" -#: options.c:822 +#: options.c:819 msgid "Enable support for huge objects" msgstr "" -#: options.c:825 +#: options.c:822 msgid "Process #ident directives" msgstr "" -#: options.c:828 +#: options.c:825 msgid "Perform conversion of conditional jumps to branchless equivalents" msgstr "" -#: options.c:831 +#: options.c:828 msgid "Perform conversion of conditional jumps to conditional execution" msgstr "" -#: options.c:834 +#: options.c:831 msgid "Export functions even if they can be inlined" msgstr "" -#: options.c:837 +#: options.c:834 msgid "Emit implicit instantiations of inline templates" msgstr "" -#: options.c:840 +#: options.c:837 msgid "Emit implicit instantiations of templates" msgstr "" -#: options.c:843 +#: options.c:840 msgid "Use offset tables for virtual method calls" msgstr "" -#: options.c:846 +#: options.c:843 msgid "Do not generate .size directives" msgstr "" -#: options.c:849 +#: options.c:846 msgid "Initialize local vars and arrays to zero" msgstr "" -#: options.c:852 +#: options.c:849 msgid "Pay attention to the \"inline\" keyword" msgstr "" -#: options.c:861 +#: options.c:858 msgid "" "-finline-limit=\tLimit the size of inlined functions to " msgstr "" -#: options.c:864 +#: options.c:861 msgid "Instrument function entry and exit with profiling calls" msgstr "" -#: options.c:867 +#: options.c:864 msgid "Intrinsics letters in arbitrary cases" msgstr "" -#: options.c:870 +#: options.c:867 msgid "Intrinsics spelled as e.g. SqRt" msgstr "" -#: options.c:873 +#: options.c:870 msgid "Intrinsics in lowercase" msgstr "" -#: options.c:876 +#: options.c:873 msgid "Intrinsics in uppercase" msgstr "" -#: options.c:879 +#: options.c:876 msgid "Assume native functions are implemented using JNI" msgstr "" -#: options.c:882 +#: options.c:879 msgid "Generate code for functions even if they are fully inlined" msgstr "" -#: options.c:885 +#: options.c:882 msgid "Emit static const variables even if they are not used" msgstr "" -#: options.c:891 +#: options.c:888 msgid "Give external symbols a leading underscore" msgstr "" -#: options.c:894 +#: options.c:891 msgid "Perform loop optimizations" msgstr "" -#: options.c:897 +#: options.c:894 msgid "Language keyword letters in arbitrary cases" msgstr "" -#: options.c:900 +#: options.c:897 msgid "Language keywords spelled as e.g. IOStat" msgstr "" -#: options.c:903 +#: options.c:900 msgid "Language keywords in lowercase" msgstr "" -#: options.c:906 +#: options.c:903 msgid "Language keywords in uppercase" msgstr "" -#: options.c:909 +#: options.c:906 msgid "Set errno after built-in math functions" msgstr "" -#: options.c:912 +#: options.c:909 msgid "Report on permanent memory allocation" msgstr "" -#: options.c:915 +#: options.c:912 msgid "Attempt to merge identical constants and constant variables" msgstr "" -#: options.c:918 +#: options.c:915 msgid "Attempt to merge identical constants across compilation units" msgstr "" -#: options.c:921 +#: options.c:918 msgid "" "-fmessage-length=\tLimit diagnostics to characters per " "line. 0 suppresses line-wrapping" msgstr "" -#: options.c:924 +#: options.c:921 msgid "Delete MIL-STD 1753 intrinsics" msgstr "" -#: options.c:927 +#: options.c:924 msgid "Disable MIL-STD 1753 intrinsics" msgstr "" -#: options.c:930 +#: options.c:927 msgid "Enable MIL-STD 1753 intrinsics" msgstr "" -#: options.c:933 +#: options.c:930 msgid "Hide MIL-STD 1753 intrinsics" msgstr "" -#: options.c:936 +#: options.c:933 msgid "Force all loop invariant computations out of loops" msgstr "" -#: options.c:939 +#: options.c:936 msgid "Don't warn about uses of Microsoft extensions" msgstr "" -#: options.c:948 +#: options.c:945 msgid "Use graph-coloring register allocation" msgstr "" -#: options.c:951 +#: options.c:948 msgid "Generate code for NeXT (Apple Mac OS X) runtime environment" msgstr "" -#: options.c:954 +#: options.c:951 msgid "Assume that receivers of Objective-C messages may be nil" msgstr "" -#: options.c:957 +#: options.c:954 msgid "Support synchronous non-call exceptions" msgstr "" -#: options.c:966 +#: options.c:963 msgid "Enable Objective-C exception and synchronization syntax" msgstr "" -#: options.c:969 -#: options.c:1296 +#: options.c:966 +#: options.c:1293 msgid "Perform loop unrolling for all loops" msgstr "" -#: options.c:972 -#: options.c:1299 +#: options.c:969 +#: options.c:1296 msgid "Perform loop unrolling when iteration count is known" msgstr "" -#: options.c:975 +#: options.c:972 msgid "When possible do not generate stack frames" msgstr "" -#: options.c:978 +#: options.c:975 msgid "Take at least one trip through each iterative DO loop" msgstr "" -#: options.c:981 +#: options.c:978 msgid "Recognize C++ kewords like \"compl\" and \"xor\"" msgstr "" -#: options.c:984 +#: options.c:981 msgid "Do the full register move optimization pass" msgstr "" -#: options.c:987 +#: options.c:984 msgid "Optimize sibling and tail recursive calls" msgstr "" -#: options.c:990 +#: options.c:987 msgid "Enable optimization of static class initialization code" msgstr "" -#: options.c:993 +#: options.c:990 msgid "Enable optional diagnostics" msgstr "" -#: options.c:999 +#: options.c:996 msgid "Pack structure members together without holes" msgstr "" -#: options.c:1002 +#: options.c:999 msgid "Return small aggregates in memory, not registers" msgstr "" -#: options.c:1008 +#: options.c:1005 msgid "Warn about use of (only a few for now) Fortran extensions" msgstr "" -#: options.c:1011 +#: options.c:1008 msgid "Perform loop peeling" msgstr "" -#: options.c:1014 +#: options.c:1011 msgid "Enable machine specific peephole optimizations" msgstr "" -#: options.c:1017 +#: options.c:1014 msgid "Enable an RTL peephole pass before sched2" msgstr "" -#: options.c:1020 +#: options.c:1017 msgid "Downgrade conformance errors to warnings" msgstr "" -#: options.c:1023 +#: options.c:1020 msgid "Generate position-independent code if possible" msgstr "" -#: options.c:1026 +#: options.c:1023 msgid "Generate position-independent code for executables if possible" msgstr "" -#: options.c:1029 +#: options.c:1026 msgid "Generate prefetch instructions, if available, for arrays in loops" msgstr "" -#: options.c:1035 +#: options.c:1032 msgid "Enable basic program profiling code" msgstr "" -#: options.c:1038 +#: options.c:1035 msgid "Insert arc-based program profiling code" msgstr "" -#: options.c:1041 +#: options.c:1038 msgid "Insert code to profile values of expressions" msgstr "" -#: options.c:1047 +#: options.c:1044 msgid "-frandom-seed=\tMake compile reproducible using " msgstr "" -#: options.c:1050 +#: options.c:1047 msgid "Strength reduce all loop general induction variables" msgstr "" -#: options.c:1053 +#: options.c:1050 msgid "Return small aggregates in registers" msgstr "" -#: options.c:1056 +#: options.c:1053 msgid "Enables a register move optimization" msgstr "" -#: options.c:1059 +#: options.c:1056 msgid "Perform a register renaming optimization pass" msgstr "" -#: options.c:1062 +#: options.c:1059 msgid "Reorder basic blocks to improve code placement" msgstr "" -#: options.c:1065 +#: options.c:1062 msgid "Reorder functions to improve code placement" msgstr "" -#: options.c:1068 +#: options.c:1065 msgid "" "Used in Fix-and-Continue mode to indicate that object files may be swapped " "in at runtime" msgstr "" -#: options.c:1071 +#: options.c:1068 msgid "Enable automatic template instantiation" msgstr "" -#: options.c:1074 +#: options.c:1071 msgid "Add a common subexpression elimination pass after loop optimizations" msgstr "" -#: options.c:1077 +#: options.c:1074 msgid "Run the loop optimizer twice" msgstr "" -#: options.c:1080 +#: options.c:1077 msgid "Disable optimizations that assume default FP rounding behavior" msgstr "" -#: options.c:1083 +#: options.c:1080 msgid "Generate run time type descriptor information" msgstr "" -#: options.c:1086 +#: options.c:1083 msgid "Enable scheduling across basic blocks" msgstr "" -#: options.c:1089 +#: options.c:1086 msgid "Allow speculative motion of non-loads" msgstr "" -#: options.c:1092 +#: options.c:1089 msgid "Allow speculative motion of some loads" msgstr "" -#: options.c:1095 +#: options.c:1092 msgid "Allow speculative motion of more loads" msgstr "" -#: options.c:1098 +#: options.c:1095 msgid "Allow premature scheduling of queued insns" msgstr "" -#: options.c:1101 +#: options.c:1098 msgid "" "Set dependence distance checking in premature scheduling of queued insns" msgstr "" -#: options.c:1104 +#: options.c:1101 msgid "" "-fsched-stalled-insns-dep= Set dependence distance checking in " "premature scheduling of queued insns" msgstr "" -#: options.c:1107 +#: options.c:1104 msgid "" "-fsched-stalled-insns= Set number of queued insns that can be " "prematurely scheduled" msgstr "" -#: options.c:1110 +#: options.c:1107 msgid "-fsched-verbose=\tSet the verbosity level of the scheduler" msgstr "" -#: options.c:1113 +#: options.c:1110 msgid "If scheduling post reload, do superblock scheduling" msgstr "" -#: options.c:1116 +#: options.c:1113 msgid "If scheduling post reload, do trace scheduling" msgstr "" -#: options.c:1119 +#: options.c:1116 msgid "Reschedule instructions before register allocation" msgstr "" -#: options.c:1122 +#: options.c:1119 msgid "Reschedule instructions after register allocation" msgstr "" -#: options.c:1125 +#: options.c:1122 msgid "Allow appending a second underscore to externals" msgstr "" -#: options.c:1128 +#: options.c:1125 msgid "Mark data as shared rather than private" msgstr "" -#: options.c:1131 +#: options.c:1128 msgid "Use the same size for double as for float" msgstr "" -#: options.c:1134 +#: options.c:1131 msgid "Use the narrowest integer type possible for enumeration types" msgstr "" -#: options.c:1137 +#: options.c:1134 msgid "Force the underlying type for \"wchar_t\" to be \"unsigned short\"" msgstr "" -#: options.c:1143 +#: options.c:1140 msgid "Disable optimizations observable by IEEE signaling NaNs" msgstr "" -#: options.c:1146 +#: options.c:1143 msgid "When \"signed\" or \"unsigned\" is not given make the bitfield signed" msgstr "" -#: options.c:1149 +#: options.c:1146 msgid "Make \"char\" signed by default" msgstr "" -#: options.c:1152 +#: options.c:1149 msgid "Do not print names of program units as they are compiled" msgstr "" -#: options.c:1155 +#: options.c:1152 msgid "Convert floating point constants to single precision constants" msgstr "" -#: options.c:1158 +#: options.c:1155 msgid "Internally convert most source to lowercase" msgstr "" -#: options.c:1161 +#: options.c:1158 msgid "Internally preserve source case" msgstr "" -#: options.c:1164 +#: options.c:1161 msgid "Internally convert most source to uppercase" msgstr "" -#: options.c:1170 +#: options.c:1167 msgid "Enable static single assignment optimizations" msgstr "" -#: options.c:1173 +#: options.c:1170 msgid "Enable SSA conditional constant propagation" msgstr "" -#: options.c:1176 +#: options.c:1173 msgid "Enable aggressive SSA dead code elimination" msgstr "" -#: options.c:1179 +#: options.c:1176 msgid "Insert stack checking code into the program" msgstr "" -#: options.c:1185 +#: options.c:1182 msgid "" "-fstack-limit-register=\tTrap if the stack goes past " msgstr "" -#: options.c:1188 +#: options.c:1185 msgid "-fstack-limit-symbol=\tTrap if the stack goes past symbol " msgstr "" -#: options.c:1191 +#: options.c:1188 msgid "Display statistics accumulated during compilation" msgstr "" -#: options.c:1194 +#: options.c:1191 msgid "Enable assignability checks for stores into object arrays" msgstr "" -#: options.c:1197 +#: options.c:1194 msgid "Perform strength reduction optimizations" msgstr "" -#: options.c:1200 +#: options.c:1197 msgid "Assume strict aliasing rules apply" msgstr "" -#: options.c:1209 +#: options.c:1206 msgid "Symbol names spelled in mixed case" msgstr "" -#: options.c:1212 +#: options.c:1209 msgid "Symbol names in lowercase" msgstr "" -#: options.c:1215 +#: options.c:1212 msgid "Symbol names in uppercase" msgstr "" -#: options.c:1218 +#: options.c:1215 msgid "Check for syntax errors, then stop" msgstr "" -#: options.c:1221 +#: options.c:1218 msgid "-ftabstop=\tDistance between tab stops for column reporting" msgstr "" -#: options.c:1224 +#: options.c:1221 msgid "-ftemplate-depth-\tSpecify maximum template instantiation depth" msgstr "" -#: options.c:1227 +#: options.c:1224 msgid "Create data files needed by \"gcov\"" msgstr "" -#: options.c:1233 +#: options.c:1230 msgid "Perform jump threading optimizations" msgstr "" -#: options.c:1236 +#: options.c:1233 msgid "Report the time taken by each compiler pass" msgstr "" -#: options.c:1239 +#: options.c:1236 msgid "" "-ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec]\tSet the " "default thread-local storage code generation model" msgstr "" -#: options.c:1242 +#: options.c:1239 msgid "Perform superblock formation via tail duplication" msgstr "" -#: options.c:1245 +#: options.c:1242 msgid "Assume floating-point operations can trap" msgstr "" -#: options.c:1248 +#: options.c:1245 msgid "Trap for signed overflow in addition, subtraction and multiplication" msgstr "" -#: options.c:1251 +#: options.c:1248 msgid "Make prefix-radix non-decimal constants be typeless" msgstr "" -#: options.c:1254 +#: options.c:1251 msgid "Allow all ugly features" msgstr "" -#: options.c:1257 +#: options.c:1254 msgid "Hollerith and typeless can be passed as arguments" msgstr "" -#: options.c:1260 +#: options.c:1257 msgid "Allow ordinary copying of ASSIGN'ed vars" msgstr "" -#: options.c:1263 +#: options.c:1260 msgid "Dummy array dimensioned to (1) is assumed-size" msgstr "" -#: options.c:1266 +#: options.c:1263 msgid "Trailing comma in procedure call denotes null argument" msgstr "" -#: options.c:1269 +#: options.c:1266 msgid "Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z" msgstr "" -#: options.c:1272 +#: options.c:1269 msgid "Initialization via DATA and PARAMETER is not type-compatible" msgstr "" -#: options.c:1275 +#: options.c:1272 msgid "Allow INTEGER and LOGICAL interchangeability" msgstr "" -#: options.c:1278 +#: options.c:1275 msgid "Append underscores to externals" msgstr "" -#: options.c:1281 +#: options.c:1278 msgid "Compile whole compilation unit at a time" msgstr "" -#: options.c:1284 +#: options.c:1281 msgid "Delete libU77 intrinsics" msgstr "" -#: options.c:1287 +#: options.c:1284 msgid "Disable libU77 intrinsics" msgstr "" -#: options.c:1290 +#: options.c:1287 msgid "Enable libU77 intrinsics" msgstr "" -#: options.c:1293 +#: options.c:1290 msgid "Hide libU77 intrinsics" msgstr "" -#: options.c:1302 +#: options.c:1299 msgid "Allow math optimizations that may violate IEEE or ISO standards" msgstr "" -#: options.c:1305 +#: options.c:1302 msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned" msgstr "" -#: options.c:1308 +#: options.c:1305 msgid "Make \"char\" unsigned by default" msgstr "" -#: options.c:1311 +#: options.c:1308 msgid "Perform loop unswitching" msgstr "" -#: options.c:1314 +#: options.c:1311 msgid "Just generate unwind tables for exception handling" msgstr "" -#: options.c:1320 +#: options.c:1317 msgid "Use __cxa_atexit to register destructors" msgstr "" -#: options.c:1326 +#: options.c:1323 msgid "Add extra commentary to assembler output" msgstr "" -#: options.c:1329 +#: options.c:1326 msgid "Print g77-specific version information and run internal tests" msgstr "" -#: options.c:1332 +#: options.c:1329 msgid "Use expression value profiles in optimizations" msgstr "" -#: options.c:1335 +#: options.c:1332 msgid "Discard unused virtual functions" msgstr "" -#: options.c:1338 +#: options.c:1335 msgid "Implement vtables using thunks" msgstr "" -#: options.c:1341 +#: options.c:1338 msgid "Program is written in VXT (Digital-like) FORTRAN" msgstr "" -#: options.c:1344 +#: options.c:1341 msgid "Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports" msgstr "" -#: options.c:1347 +#: options.c:1344 msgid "Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports" msgstr "" -#: options.c:1350 +#: options.c:1347 msgid "Enable non-FORTRAN-77 intrinsics VXT FORTRAN supports" msgstr "" -#: options.c:1353 +#: options.c:1350 msgid "Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports" msgstr "" -#: options.c:1359 +#: options.c:1356 msgid "Emit common-like symbols as weak symbols" msgstr "" -#: options.c:1362 +#: options.c:1359 msgid "Construct webs and split unrelated uses of single variable" msgstr "" -#: options.c:1365 +#: options.c:1362 msgid "" "-fwide-exec-charset=\tConvert all wide strings and character constants " "to character set " msgstr "" -#: options.c:1368 +#: options.c:1365 msgid "Generate a #line directive pointing at the current working directory" msgstr "" -#: options.c:1371 +#: options.c:1368 msgid "Assume signed arithmetic overflow wraps around" msgstr "" -#: options.c:1374 +#: options.c:1371 msgid "Store strings in writable data section" msgstr "" -#: options.c:1377 +#: options.c:1374 msgid "Emit cross referencing information" msgstr "" -#: options.c:1380 +#: options.c:1377 msgid "Print internal debugging-related information" msgstr "" -#: options.c:1383 +#: options.c:1380 msgid "Put zero initialized data in the bss section" msgstr "" -#: options.c:1386 +#: options.c:1383 msgid "" "Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode" msgstr "" -#: options.c:1389 +#: options.c:1386 msgid "Treat initial values of 0 like non-zero values" msgstr "" -#: options.c:1392 +#: options.c:1389 msgid "Generate debug information in default format" msgstr "" -#: options.c:1398 +#: options.c:1395 msgid "Generate debug information in COFF format" msgstr "" -#: options.c:1401 +#: options.c:1398 msgid "Generate debug information in DWARF v1 format" msgstr "" -#: options.c:1404 +#: options.c:1401 msgid "Generate debug information in extended DWARF v1 format" msgstr "" -#: options.c:1407 +#: options.c:1404 msgid "Generate debug information in DWARF v2 format" msgstr "" -#: options.c:1410 +#: options.c:1407 msgid "Dump declarations to a .decl file" msgstr "" -#: options.c:1413 +#: options.c:1410 msgid "Generate debug information in default extended format" msgstr "" -#: options.c:1416 +#: options.c:1413 msgid "-gnat\tSpecify options to GNAT" msgstr "" -#: options.c:1419 +#: options.c:1416 msgid "Generate debug information in STABS format" msgstr "" -#: options.c:1422 +#: options.c:1419 msgid "Generate debug information in extended STABS format" msgstr "" -#: options.c:1425 +#: options.c:1422 msgid "Generate debug information in VMS format" msgstr "" -#: options.c:1428 +#: options.c:1425 msgid "Generate debug information in XCOFF format" msgstr "" -#: options.c:1431 +#: options.c:1428 msgid "Generate debug information in extended XCOFF format" msgstr "" -#: options.c:1434 +#: options.c:1431 msgid "-idirafter \tAdd to the end of the system include path" msgstr "" -#: options.c:1437 +#: options.c:1434 msgid "-imacros \tAccept definition of macros in " msgstr "" -#: options.c:1440 +#: options.c:1437 msgid "-include \tInclude the contents of before other files" msgstr "" -#: options.c:1443 +#: options.c:1440 msgid "-iprefix \tSpecify as a prefix for next two options" msgstr "" -#: options.c:1446 +#: options.c:1443 msgid "-isysroot \tSet to be the system root directory" msgstr "" -#: options.c:1449 +#: options.c:1446 msgid "-isystem \tAdd to the start of the system include path" msgstr "" -#: options.c:1452 +#: options.c:1449 msgid "-iwithprefix \tAdd to the end of the system include path" msgstr "" -#: options.c:1455 +#: options.c:1452 msgid "-iwithprefixbefore \tAdd to the end of the main include path" msgstr "" -#: options.c:1467 +#: options.c:1464 msgid "" "Do not search standard system include directories (those specified with -" "isystem will still be used)" msgstr "" -#: options.c:1470 +#: options.c:1467 msgid "Do not search standard system include directories for C++" msgstr "" @@ -20824,42 +20856,52 @@ msgstr "" msgid "Suppress warnings" msgstr "" -#: config/i386/cygwin.h:29 -msgid "mno-cygwin and mno-win32 are not compatible" +#: config/rs6000/darwin.h:98 +msgid " conflicting code gen style switches are used" msgstr "" -#: config/i386/cygwin.h:70 config/i386/mingw32.h:58 -msgid "shared and mdll are not compatible" +#: gcc.c:742 +msgid "GCC does not support -C or -CC without -E" msgstr "" -#: config/rs6000/sysv4.h:1054 config/i386/freebsd-aout.h:215 -msgid "`-p' not supported; use `-pg' and gprof(1)" +#: gcc.c:766 java/jvspec.c:80 ada/lang-specs.h:34 +msgid "-pg and -fomit-frame-pointer are incompatible" msgstr "" -#: f/lang-specs.h:38 -msgid "GCC does not support -C without using -E" +#: gcc.c:915 +msgid "-E required when input is from standard input" msgstr "" -#: f/lang-specs.h:39 -msgid "GCC does not support -CC without using -E" +#: config/arm/arm.h:197 +msgid "-mapcs-26 and -mapcs-32 may not be used together" msgstr "" -#: config/sparc/linux64.h:207 config/sparc/linux64.h:218 -#: config/sparc/netbsd-elf.h:140 config/sparc/netbsd-elf.h:159 -#: config/sparc/sol2-bi.h:166 config/sparc/sol2-bi.h:176 -msgid "may not use both -m32 and -m64" +#: config/arm/arm.h:199 +msgid "-msoft-float and -mhard_float may not be used together" msgstr "" -#: config/i386/sco5.h:192 -msgid "-pg not supported on this platform" +#: config/arm/arm.h:201 +msgid "-mbig-endian and -mlittle-endian may not be used together" msgstr "" -#: config/i386/sco5.h:193 -msgid "-p and -pp specified - pick one" +#: java/lang-specs.h:34 +msgid "-fjni and -femit-class-files are incompatible" msgstr "" -#: config/i386/sco5.h:267 -msgid "-G and -static are mutually exclusive" +#: java/lang-specs.h:35 +msgid "-fjni and -femit-class-file are incompatible" +msgstr "" + +#: java/lang-specs.h:36 java/lang-specs.h:37 +msgid "-femit-class-file should used along with -fsyntax-only" +msgstr "" + +#: config/mips/mips.h:975 +msgid "-pipe is not supported" +msgstr "" + +#: config/mips/mips.h:1129 config/arc/arc.h:63 +msgid "may not use both -EB and -EL" msgstr "" #: config/darwin.h:215 @@ -20898,78 +20940,68 @@ msgstr "" msgid "-private_bundle not allowed with -dynamiclib" msgstr "" -#: config/vax/netbsd-elf.h:42 -msgid "The -shared option is not currently supported for VAX ELF." -msgstr "" - -#: config/vax/vax.h:50 config/vax/vax.h:51 -msgid "profiling not supported with -mg\n" -msgstr "" - -#: config/arc/arc.h:63 config/mips/mips.h:1129 -msgid "may not use both -EB and -EL" -msgstr "" - -#: config/mcore/mcore.h:65 -msgid "the m210 does not have little endian support" -msgstr "" - -#: config/mips/mips.h:975 -msgid "-pipe is not supported" +#: config/i386/mingw32.h:58 config/i386/cygwin.h:70 +msgid "shared and mdll are not compatible" msgstr "" #: treelang/lang-specs.h:52 msgid "-pg or -p and -fomit-frame-pointer are incompatible" msgstr "" -#: config/arm/arm.h:197 -msgid "-mapcs-26 and -mapcs-32 may not be used together" +#: config/mips/r3900.h:35 +msgid "-mhard-float not supported" msgstr "" -#: config/arm/arm.h:199 -msgid "-msoft-float and -mhard_float may not be used together" +#: config/mips/r3900.h:37 +msgid "-msingle-float and -msoft-float can not both be specified" msgstr "" -#: config/arm/arm.h:201 -msgid "-mbig-endian and -mlittle-endian may not be used together" +#: f/lang-specs.h:38 +msgid "GCC does not support -C without using -E" msgstr "" -#: ada/lang-specs.h:34 java/jvspec.c:80 gcc.c:766 -msgid "-pg and -fomit-frame-pointer are incompatible" +#: f/lang-specs.h:39 +msgid "GCC does not support -CC without using -E" msgstr "" -#: ada/lang-specs.h:36 -msgid "one of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada" +#: config/rs6000/sysv4.h:1080 config/i386/freebsd-aout.h:215 +msgid "`-p' not supported; use `-pg' and gprof(1)" msgstr "" -#: config/mips/r3900.h:35 -msgid "-mhard-float not supported" +#: config/vax/netbsd-elf.h:42 +msgid "The -shared option is not currently supported for VAX ELF." msgstr "" -#: config/mips/r3900.h:37 -msgid "-msingle-float and -msoft-float can not both be specified" +#: config/sparc/linux64.h:207 config/sparc/linux64.h:218 +#: config/sparc/netbsd-elf.h:140 config/sparc/netbsd-elf.h:159 +#: config/sparc/sol2-bi.h:166 config/sparc/sol2-bi.h:176 +msgid "may not use both -m32 and -m64" msgstr "" -#: java/lang-specs.h:34 -msgid "-fjni and -femit-class-files are incompatible" +#: config/vax/vax.h:50 config/vax/vax.h:51 +msgid "profiling not supported with -mg\n" msgstr "" -#: java/lang-specs.h:35 -msgid "-fjni and -femit-class-file are incompatible" +#: config/i386/sco5.h:192 +msgid "-pg not supported on this platform" msgstr "" -#: java/lang-specs.h:36 java/lang-specs.h:37 -msgid "-femit-class-file should used along with -fsyntax-only" +#: config/i386/sco5.h:193 +msgid "-p and -pp specified - pick one" msgstr "" -#: config/rs6000/darwin.h:97 -msgid " conflicting code gen style switches are used" +#: config/i386/sco5.h:267 +msgid "-G and -static are mutually exclusive" msgstr "" -#: gcc.c:742 -msgid "GCC does not support -C or -CC without -E" +#: config/i386/cygwin.h:29 +msgid "mno-cygwin and mno-win32 are not compatible" msgstr "" -#: gcc.c:915 -msgid "-E required when input is from standard input" +#: ada/lang-specs.h:36 +msgid "one of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada" +msgstr "" + +#: config/mcore/mcore.h:65 +msgid "the m210 does not have little endian support" msgstr "" diff --git a/gcc/postreload.c b/gcc/postreload.c index f5a987a7f0d..835a7218b36 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -664,7 +664,7 @@ reload_combine (void) FOR_EACH_BB_REVERSE (bb) { - insn = bb->head; + insn = BB_HEAD (bb); if (GET_CODE (insn) == CODE_LABEL) { HARD_REG_SET live; @@ -718,7 +718,9 @@ reload_combine (void) ... (MEM (PLUS (REGZ) (REGY)))... . First, check that we have (set (REGX) (PLUS (REGX) (REGY))) - and that we know all uses of REGX before it dies. */ + and that we know all uses of REGX before it dies. + Also, explicitly check that REGX != REGY; our life information + does not yet show whether REGY changes in this insn. */ set = single_set (insn); if (set != NULL_RTX && GET_CODE (SET_DEST (set)) == REG @@ -728,6 +730,7 @@ reload_combine (void) && GET_CODE (SET_SRC (set)) == PLUS && GET_CODE (XEXP (SET_SRC (set), 1)) == REG && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set)) + && !rtx_equal_p (XEXP (SET_SRC (set), 1), SET_DEST (set)) && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid) { rtx reg = SET_DEST (set); @@ -1196,14 +1199,12 @@ reload_cse_move2add (rtx first) else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET) && have_add2_insn (reg, new_src)) { - rtx newpat = gen_add2_insn (reg, new_src); - if (INSN_P (newpat) && NEXT_INSN (newpat) == NULL_RTX) - newpat = PATTERN (newpat); - /* If it was the first insn of a sequence or - some other emitted insn, validate_change will - reject it. */ - validate_change (insn, &PATTERN (insn), - newpat, 0); + rtx newpat = gen_rtx_SET (VOIDmode, + reg, + gen_rtx_PLUS (GET_MODE (reg), + reg, + new_src)); + validate_change (insn, &PATTERN (insn), newpat, 0); } else { @@ -1285,10 +1286,11 @@ reload_cse_move2add (rtx first) < COSTS_N_INSNS (1) + rtx_cost (src3, SET)) && have_add2_insn (reg, new_src)) { - rtx newpat = gen_add2_insn (reg, new_src); - if (INSN_P (newpat) - && NEXT_INSN (newpat) == NULL_RTX) - newpat = PATTERN (newpat); + rtx newpat = gen_rtx_SET (VOIDmode, + reg, + gen_rtx_PLUS (GET_MODE (reg), + reg, + new_src)); success = validate_change (next, &PATTERN (next), newpat, 0); diff --git a/gcc/predict.c b/gcc/predict.c index 243c814775d..74a1f24c3ad 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -72,10 +72,8 @@ static void estimate_loops_at_level (struct loop *loop); static void propagate_freq (struct loop *); static void estimate_bb_frequencies (struct loops *); static void counts_to_freqs (void); -static void process_note_predictions (basic_block, int *, dominance_info, - dominance_info); -static void process_note_prediction (basic_block, int *, dominance_info, - dominance_info, int, int); +static void process_note_predictions (basic_block, int *); +static void process_note_prediction (basic_block, int *, int, int); static bool last_basic_block_p (basic_block); static void compute_function_frequency (void); static void choose_function_section (void); @@ -154,9 +152,9 @@ static bool predicted_by_p (basic_block bb, enum br_predictor predictor) { rtx note; - if (!INSN_P (bb->end)) + if (!INSN_P (BB_END (bb))) return false; - for (note = REG_NOTES (bb->end); note; note = XEXP (note, 1)) + for (note = REG_NOTES (BB_END (bb)); note; note = XEXP (note, 1)) if (REG_NOTE_KIND (note) == REG_BR_PRED && INTVAL (XEXP (XEXP (note, 0), 0)) == (int)predictor) return true; @@ -199,7 +197,7 @@ void predict_edge (edge e, enum br_predictor predictor, int probability) { rtx last_insn; - last_insn = e->src->end; + last_insn = BB_END (e->src); /* We can store the branch prediction information only about conditional jumps. */ @@ -393,13 +391,12 @@ combine_predictions_for_insn (rtx insn, basic_block bb) void estimate_probability (struct loops *loops_info) { - dominance_info dominators, post_dominators; basic_block bb; unsigned i; connect_infinite_loops_to_exit (); - dominators = calculate_dominance_info (CDI_DOMINATORS); - post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_POST_DOMINATORS); /* Try to predict out blocks in a loop that are not part of a natural loop. */ @@ -412,11 +409,10 @@ estimate_probability (struct loops *loops_info) struct loop_desc desc; unsigned HOST_WIDE_INT niter; - flow_loop_scan (loops_info, loop, LOOP_EXIT_EDGES); + flow_loop_scan (loop, LOOP_EXIT_EDGES); exits = loop->num_exits; - if (simple_loop_p (loops_info, loop, &desc) - && desc.const_iter) + if (simple_loop_p (loop, &desc) && desc.const_iter) { int prob; niter = desc.niter + 1; @@ -445,7 +441,7 @@ estimate_probability (struct loops *loops_info) statements construct loops via "non-loop" constructs in the source language and are better to be handled separately. */ - if (!can_predict_insn_p (bb->end) + if (!can_predict_insn_p (BB_END (bb)) || predicted_by_p (bb, PRED_CONTINUE)) continue; @@ -476,7 +472,7 @@ estimate_probability (struct loops *loops_info) /* Attempt to predict conditional jumps using a number of heuristics. */ FOR_EACH_BB (bb) { - rtx last_insn = bb->end; + rtx last_insn = BB_END (bb); rtx cond, earliest; edge e; @@ -500,8 +496,8 @@ estimate_probability (struct loops *loops_info) /* Look for block we are guarding (ie we dominate it, but it doesn't postdominate us). */ if (e->dest != EXIT_BLOCK_PTR && e->dest != bb - && dominated_by_p (dominators, e->dest, e->src) - && !dominated_by_p (post_dominators, e->src, e->dest)) + && dominated_by_p (CDI_DOMINATORS, e->dest, e->src) + && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest)) { rtx insn; @@ -509,7 +505,7 @@ estimate_probability (struct loops *loops_info) is improbable. This is because such calls are often used to signal exceptional situations such as printing error messages. */ - for (insn = e->dest->head; insn != NEXT_INSN (e->dest->end); + for (insn = BB_HEAD (e->dest); insn != NEXT_INSN (BB_END (e->dest)); insn = NEXT_INSN (insn)) if (GET_CODE (insn) == CALL_INSN /* Constant and pure calls are hardly used to signalize @@ -613,13 +609,12 @@ estimate_probability (struct loops *loops_info) /* Attach the combined probability to each conditional jump. */ FOR_EACH_BB (bb) - if (GET_CODE (bb->end) == JUMP_INSN - && any_condjump_p (bb->end) + if (GET_CODE (BB_END (bb)) == JUMP_INSN + && any_condjump_p (BB_END (bb)) && bb->succ->succ_next != NULL) - combine_predictions_for_insn (bb->end, bb); + combine_predictions_for_insn (BB_END (bb), bb); - free_dominance_info (post_dominators); - free_dominance_info (dominators); + free_dominance_info (CDI_POST_DOMINATORS); remove_fake_edges (); estimate_bb_frequencies (loops_info); @@ -719,10 +714,7 @@ last_basic_block_p (basic_block bb) on demand, so -1 may be there in case this was not needed yet). */ static void -process_note_prediction (basic_block bb, int *heads, - dominance_info dominators, - dominance_info post_dominators, int pred, - int flags) +process_note_prediction (basic_block bb, int *heads, int pred, int flags) { edge e; int y; @@ -736,18 +728,18 @@ process_note_prediction (basic_block bb, int *heads, find first dominator that we do not post-dominate (we are using already known members of heads array). */ basic_block ai = bb; - basic_block next_ai = get_immediate_dominator (dominators, bb); + basic_block next_ai = get_immediate_dominator (CDI_DOMINATORS, bb); int head; while (heads[next_ai->index] < 0) { - if (!dominated_by_p (post_dominators, next_ai, bb)) + if (!dominated_by_p (CDI_POST_DOMINATORS, next_ai, bb)) break; heads[next_ai->index] = ai->index; ai = next_ai; - next_ai = get_immediate_dominator (dominators, next_ai); + next_ai = get_immediate_dominator (CDI_DOMINATORS, next_ai); } - if (!dominated_by_p (post_dominators, next_ai, bb)) + if (!dominated_by_p (CDI_POST_DOMINATORS, next_ai, bb)) head = next_ai->index; else head = heads[next_ai->index]; @@ -765,11 +757,11 @@ process_note_prediction (basic_block bb, int *heads, /* Now find the edge that leads to our branch and aply the prediction. */ - if (y == last_basic_block || !can_predict_insn_p (BASIC_BLOCK (y)->end)) + if (y == last_basic_block || !can_predict_insn_p (BB_END (BASIC_BLOCK (y)))) return; for (e = BASIC_BLOCK (y)->succ; e; e = e->succ_next) if (e->dest->index >= 0 - && dominated_by_p (post_dominators, e->dest, bb)) + && dominated_by_p (CDI_POST_DOMINATORS, e->dest, bb)) predict_edge_def (e, pred, taken); } @@ -778,9 +770,7 @@ process_note_prediction (basic_block bb, int *heads, process_note_prediction. */ static void -process_note_predictions (basic_block bb, int *heads, - dominance_info dominators, - dominance_info post_dominators) +process_note_predictions (basic_block bb, int *heads) { rtx insn; edge e; @@ -790,8 +780,8 @@ process_note_predictions (basic_block bb, int *heads, int was_bb_head = 0; int noreturn_block = 1; - for (insn = bb->end; insn; - was_bb_head |= (insn == bb->head), insn = PREV_INSN (insn)) + for (insn = BB_END (bb); insn; + was_bb_head |= (insn == BB_HEAD (bb)), insn = PREV_INSN (insn)) { if (GET_CODE (insn) != NOTE) { @@ -813,8 +803,6 @@ process_note_predictions (basic_block bb, int *heads, /* Process single prediction note. */ process_note_prediction (bb, heads, - dominators, - post_dominators, alg, (int) NOTE_PREDICTION_FLAGS (insn)); delete_insn (insn); } @@ -827,10 +815,7 @@ process_note_predictions (basic_block bb, int *heads, /* This block ended from other reasons than because of return. If it is because of noreturn call, this should certainly not be taken. Otherwise it is probably some error recovery. */ - process_note_prediction (bb, - heads, - dominators, - post_dominators, PRED_NORETURN, NOT_TAKEN); + process_note_prediction (bb, heads, PRED_NORETURN, NOT_TAKEN); } } @@ -841,15 +826,14 @@ void note_prediction_to_br_prob (void) { basic_block bb; - dominance_info post_dominators, dominators; int *heads; /* To enable handling of noreturn blocks. */ add_noreturn_fake_exit_edges (); connect_infinite_loops_to_exit (); - post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS); - dominators = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_POST_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); heads = xmalloc (sizeof (int) * last_basic_block); memset (heads, -1, sizeof (int) * last_basic_block); @@ -858,10 +842,10 @@ note_prediction_to_br_prob (void) /* Process all prediction notes. */ FOR_EACH_BB (bb) - process_note_predictions (bb, heads, dominators, post_dominators); + process_note_predictions (bb, heads); - free_dominance_info (post_dominators); - free_dominance_info (dominators); + free_dominance_info (CDI_POST_DOMINATORS); + free_dominance_info (CDI_DOMINATORS); free (heads); remove_fake_edges (); @@ -878,8 +862,8 @@ typedef struct block_info_def /* To keep queue of basic blocks to process. */ basic_block next; - /* True if block needs to be visited in prop_freqency. */ - int tovisit:1; + /* True if block needs to be visited in propagate_freq. */ + unsigned int tovisit:1; /* Number of predecessors we need to visit first. */ int npredecessors; @@ -893,7 +877,7 @@ typedef struct edge_info_def then computed as 1 / (1 - back_edge_prob). */ sreal back_edge_prob; /* True if the edge is an loopback edge in the natural loop. */ - int back_edge:1; + unsigned int back_edge:1; } *edge_info; #define BLOCK_INFO(B) ((block_info) (B)->aux) @@ -1105,7 +1089,7 @@ expensive_function_p (int threshold) { rtx insn; - for (insn = bb->head; insn != NEXT_INSN (bb->end); + for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn)) if (active_insn_p (insn)) { @@ -1149,7 +1133,7 @@ estimate_bb_frequencies (struct loops *loops) notes. */ FOR_EACH_BB (bb) { - rtx last_insn = bb->end; + rtx last_insn = BB_END (bb); if (!can_predict_insn_p (last_insn)) { diff --git a/gcc/predict.def b/gcc/predict.def index 238e0f262fc..25c51025e31 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -1,6 +1,5 @@ -/* This file contains the definitions and documentation for the - builtins used in the GNU compiler. - Copyright (C) 2001 Free Software Foundation, Inc. +/* Definitions for the branch prediction routines in the GNU compiler. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/predict.h b/gcc/predict.h index 6ac7d7f28b8..d0741dc704d 100644 --- a/gcc/predict.h +++ b/gcc/predict.h @@ -1,5 +1,4 @@ -/* This file contains the definitions and documentation for the - builtins used in the GNU compiler. +/* Definitions for branch prediction routines in the GNU compiler. Copyright (C) 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -40,7 +39,7 @@ enum prediction extern void predict_insn_def (rtx, enum br_predictor, enum prediction); extern void predict_insn (rtx, enum br_predictor, int); -/* Avoid unneeded dependency on basic_block.h */ +/* Avoid unneeded dependency on basic_block.h. */ #ifdef BASIC_BLOCK extern void predict_edge (edge, enum br_predictor, int); extern void predict_edge_def (edge, enum br_predictor, enum prediction); diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index 43e440979c0..993fde7a6d6 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -343,6 +343,7 @@ pp_base_flush (pretty_printer *pp) pp_clear_state (pp); fputc ('\n', pp->buffer->stream); fflush (pp->buffer->stream); + pp_needs_newline (pp) = false; } /* Sets the number of maximum characters per line PRETTY-PRINTER can @@ -472,7 +473,7 @@ pp_base_last_position_in_text (const pretty_printer *pp) } /* Return the amount of characters PRETTY-PRINTER can accept to - make a full line. Meaningfull only in line-wrapping mode. */ + make a full line. Meaningful only in line-wrapping mode. */ int pp_base_remaining_character_count_for_line (pretty_printer *pp) { diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 80affe83e6f..1691aec274a 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -234,7 +234,7 @@ struct pretty_print_info #define pp_buffer(PP) pp_base (PP)->buffer /* Clients that directly derive from pretty_printer need to override - this macro to return a pointer to the base pretty_printer structrure. */ + this macro to return a pointer to the base pretty_printer structure. */ #define pp_base(PP) (PP) extern void pp_construct (pretty_printer *, const char *, int); diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 4d05136cf3f..5c3b8d4443e 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -386,7 +386,7 @@ print_rtx (rtx in_rtx) if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER) { fputc (' ', outfile); - PRINT_REG (in_rtx, 0, outfile); + PRINT_REG (in_rtx, -1, outfile); } else if (GET_CODE (in_rtx) == REG && value <= LAST_VIRTUAL_REGISTER) diff --git a/gcc/profile.c b/gcc/profile.c index 625a904a428..b7b39a2f5a8 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -502,7 +502,7 @@ compute_branch_probabilities (void) } for (e = bb->succ; e; e = e->succ_next) { - /* Function may return twice in the cased the called fucntion is + /* Function may return twice in the cased the called function is setjmp or calls fork, but we can't represent this by extra edge from the entry, since extra edge from the exit is already present. We get negative frequency from the entry @@ -512,10 +512,10 @@ compute_branch_probabilities (void) || (e->count > bb->count && e->dest != EXIT_BLOCK_PTR)) { - rtx insn = bb->end; + rtx insn = BB_END (bb); while (GET_CODE (insn) != CALL_INSN - && insn != bb->head + && insn != BB_HEAD (bb) && keep_with_call_p (insn)) insn = PREV_INSN (insn); if (GET_CODE (insn) == CALL_INSN) @@ -534,7 +534,7 @@ compute_branch_probabilities (void) for (e = bb->succ; e; e = e->succ_next) e->probability = (e->count * REG_BR_PROB_BASE + bb->count / 2) / bb->count; if (bb->index >= 0 - && any_condjump_p (bb->end) + && any_condjump_p (BB_END (bb)) && bb->succ->succ_next) { int prob; @@ -554,15 +554,15 @@ compute_branch_probabilities (void) index = 19; hist_br_prob[index]++; - note = find_reg_note (bb->end, REG_BR_PROB, 0); + note = find_reg_note (BB_END (bb), REG_BR_PROB, 0); /* There may be already note put by some other pass, such as builtin_expect expander. */ if (note) XEXP (note, 0) = GEN_INT (prob); else - REG_NOTES (bb->end) + REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob), - REG_NOTES (bb->end)); + REG_NOTES (BB_END (bb))); num_branches++; } } @@ -594,7 +594,7 @@ compute_branch_probabilities (void) e->probability = REG_BR_PROB_BASE / total; } if (bb->index >= 0 - && any_condjump_p (bb->end) + && any_condjump_p (BB_END (bb)) && bb->succ->succ_next) num_branches++, num_never_executed; } @@ -892,7 +892,7 @@ branch_prob (void) FOR_EACH_BB (bb) { - rtx insn = bb->head; + rtx insn = BB_HEAD (bb); int ignore_next_note = 0; offset = 0; @@ -905,7 +905,7 @@ branch_prob (void) else insn = NEXT_INSN (insn); - while (insn != bb->end) + while (insn != BB_END (bb)) { if (GET_CODE (insn) == NOTE) { diff --git a/gcc/ra-build.c b/gcc/ra-build.c index 896570ebf91..a305921c250 100644 --- a/gcc/ra-build.c +++ b/gcc/ra-build.c @@ -884,7 +884,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e) use->live_over_abnormal = 1; bitmap_set_bit (live_at_end[e->src->index], DF_REF_ID (use->wp->ref)); info_pred = (struct ra_bb_info *) e->src->aux; - next_insn = e->src->end; + next_insn = BB_END (e->src); /* If the last insn of the pred. block doesn't completely define the current use, we need to check the block. */ @@ -899,7 +899,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e) creation to later. */ bitmap_set_bit (info_pred->live_throughout, DF_REF_ID (use->wp->ref)); - next_insn = e->src->head; + next_insn = BB_HEAD (e->src); } return next_insn; } @@ -1033,7 +1033,7 @@ livethrough_conflicts_bb (basic_block bb) /* First collect the IDs of all defs, count the number of death containing insns, and if there's some call_insn here. */ all_defs = BITMAP_XMALLOC (); - for (insn = bb->head; insn; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) { @@ -1048,7 +1048,7 @@ livethrough_conflicts_bb (basic_block bb) if (GET_CODE (insn) == CALL_INSN) contains_call = 1; } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } @@ -2674,10 +2674,10 @@ detect_webs_set_in_cond_jump (void) { basic_block bb; FOR_EACH_BB (bb) - if (GET_CODE (bb->end) == JUMP_INSN) + if (GET_CODE (BB_END (bb)) == JUMP_INSN) { struct df_link *link; - for (link = DF_INSN_DEFS (df, bb->end); link; link = link->next) + for (link = DF_INSN_DEFS (df, BB_END (bb)); link; link = link->next) if (link->ref && DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER) { struct web *web = def2web[DF_REF_ID (link->ref)]; diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c index f0d028118d7..fd4660ab9e0 100644 --- a/gcc/ra-colorize.c +++ b/gcc/ra-colorize.c @@ -618,7 +618,7 @@ ok (struct web *target, struct web *source) { /* The main webs do _not_ conflict, only some parts of both. This means, that 4 is possibly true, so we need to check this too. - For this we go thru all sub conflicts between T and C, and see if + For this we go through all sub conflicts between T and C, and see if the target part of C already conflicts with S. When this is not the case we disallow coalescing. */ struct sub_conflict *sl; @@ -1214,7 +1214,7 @@ calculate_dont_begin (struct web *web, HARD_REG_SET *result) } } /* The next if() only gets true, if there was no wl->sub at all, in - which case we are only making one go thru this loop with W being + which case we are only making one go through this loop with W being a whole web. */ if (!sl) break; @@ -1433,7 +1433,7 @@ colorize_one_web (struct web *web, int hard) even if we spill this one here, the situation won't become better in the next iteration. It probably will have the same conflicts, those will have the same colors, and we would come here again, for - all parts, in which this one gets splitted by the spill. This + all parts, in which this one gets split by the spill. This can result in endless iteration spilling the same register again and again. That's why we try to find a neighbor, which spans more instructions that ourself, and got a color, and try to spill _that_. @@ -1826,7 +1826,7 @@ try_recolor_web (struct web *web) else if (web2->type == SELECT) /* This means, that WEB2 once was a part of a coalesced web, which got spilled in the above colorize_one_web() - call, and whose parts then got splitted and put back + call, and whose parts then got split and put back onto the SELECT stack. As the cause for that splitting (the coloring of WEB) was worthless, we should again coalesce the parts, as they were before. For now we diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c index acddbe128cd..26aac12df0e 100644 --- a/gcc/ra-debug.c +++ b/gcc/ra-debug.c @@ -528,11 +528,12 @@ ra_debug_bbi (int bbi) { basic_block bb = BASIC_BLOCK (bbi); rtx insn; - for (insn = bb->head; insn; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn)) { - ra_print_rtx_top (stderr, insn, (insn == bb->head || insn == bb->end)); + ra_print_rtx_top (stderr, insn, + (insn == BB_HEAD (bb) || insn == BB_END (bb))); fprintf (stderr, "\n"); - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } @@ -911,7 +912,7 @@ dump_static_insn_cost (FILE *file, const char *message, const char *prefix) { unsigned HOST_WIDE_INT block_cost = bb->frequency; rtx insn, set; - for (insn = bb->head; insn; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn)) { /* Yes, yes. We don't calculate the costs precisely. Only for "simple enough" insns. Those containing single @@ -950,7 +951,7 @@ dump_static_insn_cost (FILE *file, const char *message, const char *prefix) pcost->count++; } } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c index e958f1794ba..44fde7ddd2f 100644 --- a/gcc/ra-rewrite.c +++ b/gcc/ra-rewrite.c @@ -444,8 +444,8 @@ rewrite_program (bitmap new_deaths) end_sequence (); emit_insn_before (insns, insn); - if (bb->head == insn) - bb->head = NEXT_INSN (prev); + if (BB_HEAD (bb) == insn) + BB_HEAD (bb) = NEXT_INSN (prev); for (insn = PREV_INSN (insn); insn != prev; insn = PREV_INSN (insn)) { @@ -492,8 +492,8 @@ rewrite_program (bitmap new_deaths) if (insns) { emit_insn_after (insns, insn); - if (bb->end == insn) - bb->end = PREV_INSN (following); + if (BB_END (bb) == insn) + BB_END (bb) = PREV_INSN (following); for (insn = insns; insn != following; insn = NEXT_INSN (insn)) { set_block_for_insn (insn, bb); @@ -685,8 +685,8 @@ insert_stores (bitmap new_deaths) if (insns) { emit_insn_after (insns, insn); - if (bb->end == insn) - bb->end = PREV_INSN (following); + if (BB_END (bb) == insn) + BB_END (bb) = PREV_INSN (following); for (ni = insns; ni != following; ni = NEXT_INSN (ni)) { set_block_for_insn (ni, bb); @@ -941,8 +941,8 @@ emit_loads (struct rewrite_info *ri, int nl_first_reload, rtx last_block_insn) rtx foll = NEXT_INSN (after); bb = BLOCK_FOR_INSN (after); emit_insn_after (ni, after); - if (bb->end == after) - bb->end = PREV_INSN (foll); + if (BB_END (bb) == after) + BB_END (bb) = PREV_INSN (foll); for (ni = NEXT_INSN (after); ni != foll; ni = NEXT_INSN (ni)) { set_block_for_insn (ni, bb); @@ -954,8 +954,8 @@ emit_loads (struct rewrite_info *ri, int nl_first_reload, rtx last_block_insn) rtx prev = PREV_INSN (before); bb = BLOCK_FOR_INSN (before); emit_insn_before (ni, before); - if (bb->head == before) - bb->head = NEXT_INSN (prev); + if (BB_HEAD (bb) == before) + BB_HEAD (bb) = NEXT_INSN (prev); for (; ni != before; ni = NEXT_INSN (ni)) { set_block_for_insn (ni, bb); diff --git a/gcc/ra.c b/gcc/ra.c index 01ce6dc067f..5884197dca2 100644 --- a/gcc/ra.c +++ b/gcc/ra.c @@ -455,9 +455,7 @@ init_ra (void) #endif int need_fp = (! flag_omit_frame_pointer -#ifdef EXIT_IGNORE_STACK || (current_function_calls_alloca && EXIT_IGNORE_STACK) -#endif || FRAME_POINTER_REQUIRED); ra_colorize_init (); @@ -665,7 +663,7 @@ reg_alloc (void) for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) { basic_block bb = e->src; - last = bb->end; + last = BB_END (bb); if (!INSN_P (last) || GET_CODE (PATTERN (last)) != USE) { rtx insns; diff --git a/gcc/real.c b/gcc/real.c index 7609d996152..f7af346db60 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -858,6 +858,8 @@ do_divide (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a, else rr = r; + /* Make sure all fields in the result are initialized. */ + get_zero (rr, 0); rr->class = rvc_normal; rr->sign = sign; @@ -2534,9 +2536,10 @@ encode_ieee_single (const struct real_format *fmt, long *buf, const REAL_VALUE_TYPE *r) { unsigned long image, sig, exp; + unsigned long sign = r->sign; bool denormal = (r->sig[SIGSZ-1] & SIG_MSB) == 0; - image = r->sign << 31; + image = sign << 31; sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 24)) & 0x7fffff; switch (r->class) diff --git a/gcc/recog.c b/gcc/recog.c index 02ae71d5d53..7df8d3300fe 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1746,6 +1746,7 @@ asm_operand_ok (rtx op, const char *constraint) case 'X': result = 1; + break; case 'g': if (general_operand (op, VOIDmode)) @@ -1764,20 +1765,16 @@ asm_operand_ok (rtx op, const char *constraint) result = 1; } #ifdef EXTRA_CONSTRAINT_STR - if (EXTRA_CONSTRAINT_STR (op, c, constraint)) + else if (EXTRA_CONSTRAINT_STR (op, c, constraint)) + result = 1; + else if (EXTRA_MEMORY_CONSTRAINT (c, constraint) + /* Every memory operand can be reloaded to fit. */ + && memory_operand (op, VOIDmode)) + result = 1; + else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint) + /* Every address operand can be reloaded to fit. */ + && address_operand (op, VOIDmode)) result = 1; - if (EXTRA_MEMORY_CONSTRAINT (c, constraint)) - { - /* Every memory operand can be reloaded to fit. */ - if (memory_operand (op, VOIDmode)) - result = 1; - } - if (EXTRA_ADDRESS_CONSTRAINT (c, constraint)) - { - /* Every address operand can be reloaded to fit. */ - if (address_operand (op, VOIDmode)) - result = 1; - } #endif break; } @@ -1970,7 +1967,7 @@ extract_insn_cached (rtx insn) extract_insn (insn); recog_data.insn = insn; } -/* Do cached extract_insn, constrain_operand and complain about failures. +/* Do cached extract_insn, constrain_operands and complain about failures. Used by insn_attrtab. */ void extract_constrain_insn_cached (rtx insn) @@ -1980,7 +1977,7 @@ extract_constrain_insn_cached (rtx insn) && !constrain_operands (reload_completed)) fatal_insn_not_found (insn); } -/* Do cached constrain_operand and complain about failures. */ +/* Do cached constrain_operands and complain about failures. */ int constrain_operands_cached (int strict) { @@ -2096,7 +2093,10 @@ preprocess_constraints (void) { int i; - memset (recog_op_alt, 0, sizeof recog_op_alt); + for (i = 0; i < recog_data.n_operands; i++) + memset (recog_op_alt[i], 0, (recog_data.n_alternatives + * sizeof (struct operand_alternative))); + for (i = 0; i < recog_data.n_operands; i++) { int j; @@ -2535,27 +2535,20 @@ constrain_operands (int strict) else if (EXTRA_CONSTRAINT_STR (op, c, p)) win = 1; - if (EXTRA_MEMORY_CONSTRAINT (c, p)) - { - /* Every memory operand can be reloaded to fit. */ - if (strict < 0 && GET_CODE (op) == MEM) - win = 1; - - /* Before reload, accept what reload can turn into mem. */ - if (strict < 0 && CONSTANT_P (op)) - win = 1; - - /* During reload, accept a pseudo */ - if (reload_in_progress && GET_CODE (op) == REG - && REGNO (op) >= FIRST_PSEUDO_REGISTER) - win = 1; - } - if (EXTRA_ADDRESS_CONSTRAINT (c, p)) - { - /* Every address operand can be reloaded to fit. */ - if (strict < 0) - win = 1; - } + else if (EXTRA_MEMORY_CONSTRAINT (c, p) + /* Every memory operand can be reloaded to fit. */ + && ((strict < 0 && GET_CODE (op) == MEM) + /* Before reload, accept what reload can turn + into mem. */ + || (strict < 0 && CONSTANT_P (op)) + /* During reload, accept a pseudo */ + || (reload_in_progress && GET_CODE (op) == REG + && REGNO (op) >= FIRST_PSEUDO_REGISTER))) + win = 1; + else if (EXTRA_ADDRESS_CONSTRAINT (c, p) + /* Every address operand can be reloaded to fit. */ + && strict < 0) + win = 1; #endif break; } @@ -2649,61 +2642,42 @@ reg_fits_class_p (rtx operand, enum reg_class class, int offset, return 0; } -/* Split single instruction. Helper function for split_all_insns. - Return last insn in the sequence if successful, or NULL if unsuccessful. */ +/* Split single instruction. Helper function for split_all_insns and + split_all_insns_noflow. Return last insn in the sequence if successful, + or NULL if unsuccessful. */ + static rtx split_insn (rtx insn) { - rtx set; - if (!INSN_P (insn)) - ; - /* Don't split no-op move insns. These should silently - disappear later in final. Splitting such insns would - break the code that handles REG_NO_CONFLICT blocks. */ + /* Split insns here to get max fine-grain parallelism. */ + rtx first = PREV_INSN (insn); + rtx last = try_split (PATTERN (insn), insn, 1); - else if ((set = single_set (insn)) != NULL && set_noop_p (set)) - { - /* Nops get in the way while scheduling, so delete them - now if register allocation has already been done. It - is too risky to try to do this before register - allocation, and there are unlikely to be very many - nops then anyways. */ - if (reload_completed) - delete_insn_and_edges (insn); - } - else - { - /* Split insns here to get max fine-grain parallelism. */ - rtx first = PREV_INSN (insn); - rtx last = try_split (PATTERN (insn), insn, 1); + if (last == insn) + return NULL_RTX; + + /* try_split returns the NOTE that INSN became. */ + PUT_CODE (insn, NOTE); + NOTE_SOURCE_FILE (insn) = 0; + NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - if (last != insn) + /* ??? Coddle to md files that generate subregs in post-reload + splitters instead of computing the proper hard register. */ + if (reload_completed && first != last) + { + first = NEXT_INSN (first); + for (;;) { - /* try_split returns the NOTE that INSN became. */ - PUT_CODE (insn, NOTE); - NOTE_SOURCE_FILE (insn) = 0; - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - - /* ??? Coddle to md files that generate subregs in post- - reload splitters instead of computing the proper - hard register. */ - if (reload_completed && first != last) - { - first = NEXT_INSN (first); - while (1) - { - if (INSN_P (first)) - cleanup_subreg_operands (first); - if (first == last) - break; - first = NEXT_INSN (first); - } - } - return last; + if (INSN_P (first)) + cleanup_subreg_operands (first); + if (first == last) + break; + first = NEXT_INSN (first); } } - return NULL_RTX; + return last; } + /* Split all insns in the function. If UPD_LIFE, update life info after. */ void @@ -2722,26 +2696,54 @@ split_all_insns (int upd_life) rtx insn, next; bool finish = false; - for (insn = bb->head; !finish ; insn = next) + for (insn = BB_HEAD (bb); !finish ; insn = next) { - rtx last; - /* Can't use `next_real_insn' because that might go across CODE_LABELS and short-out basic blocks. */ next = NEXT_INSN (insn); - finish = (insn == bb->end); - last = split_insn (insn); - if (last) + finish = (insn == BB_END (bb)); + if (INSN_P (insn)) { - /* The split sequence may include barrier, but the - BB boundary we are interested in will be set to previous - one. */ - - while (GET_CODE (last) == BARRIER) - last = PREV_INSN (last); - SET_BIT (blocks, bb->index); - changed = true; - insn = last; + rtx set = single_set (insn); + + /* Don't split no-op move insns. These should silently + disappear later in final. Splitting such insns would + break the code that handles REG_NO_CONFLICT blocks. */ + if (set && set_noop_p (set)) + { + /* Nops get in the way while scheduling, so delete them + now if register allocation has already been done. It + is too risky to try to do this before register + allocation, and there are unlikely to be very many + nops then anyways. */ + if (reload_completed) + { + /* If the no-op set has a REG_UNUSED note, we need + to update liveness information. */ + if (find_reg_note (insn, REG_UNUSED, NULL_RTX)) + { + SET_BIT (blocks, bb->index); + changed = true; + } + /* ??? Is life info affected by deleting edges? */ + delete_insn_and_edges (insn); + } + } + else + { + rtx last = split_insn (insn); + if (last) + { + /* The split sequence may include barrier, but the + BB boundary we are interested in will be set to + previous one. */ + + while (GET_CODE (last) == BARRIER) + last = PREV_INSN (last); + SET_BIT (blocks, bb->index); + changed = true; + } + } } } } @@ -2778,9 +2780,28 @@ split_all_insns_noflow (void) for (insn = get_insns (); insn; insn = next) { next = NEXT_INSN (insn); - split_insn (insn); + if (INSN_P (insn)) + { + /* Don't split no-op move insns. These should silently + disappear later in final. Splitting such insns would + break the code that handles REG_NO_CONFLICT blocks. */ + rtx set = single_set (insn); + if (set && set_noop_p (set)) + { + /* Nops get in the way while scheduling, so delete them + now if register allocation has already been done. It + is too risky to try to do this before register + allocation, and there are unlikely to be very many + nops then anyways. + + ??? Should we use delete_insn when the CFG isn't valid? */ + if (reload_completed) + delete_insn_and_edges (insn); + } + else + split_insn (insn); + } } - return; } #ifdef HAVE_peephole2 @@ -3021,7 +3042,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED) pbi = init_propagate_block_info (bb, live, NULL, NULL, PROP_DEATH_NOTES); #endif - for (insn = bb->end; ; insn = prev) + for (insn = BB_END (bb); ; insn = prev) { prev = PREV_INSN (insn); if (INSN_P (insn)) @@ -3137,7 +3158,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED) XEXP (note, 0), REG_NOTES (x)); - if (x != bb->end && eh_edge) + if (x != BB_END (bb) && eh_edge) { edge nfte, nehe; int flags; @@ -3221,7 +3242,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED) } } - if (insn == bb->head) + if (insn == BB_HEAD (bb)) break; } diff --git a/gcc/recog.h b/gcc/recog.h index b4f47430bed..749c64b4d90 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -221,7 +221,7 @@ struct insn_operand_data const char *const constraint; - const ENUM_BITFIELD(machine_mode) mode : 16; + ENUM_BITFIELD(machine_mode) const mode : 16; const char strict_low; diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 50bc63fcb0c..228723b8ac5 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -249,13 +249,13 @@ static void remove_regno_note (rtx, enum reg_note, unsigned int); static int get_hard_regnum (stack, rtx); static rtx emit_pop_insn (rtx, stack, rtx, enum emit_where); static void emit_swap_insn (rtx, stack, rtx); -static void move_for_stack_reg (rtx, stack, rtx); +static bool move_for_stack_reg (rtx, stack, rtx); static int swap_rtx_condition_1 (rtx); static int swap_rtx_condition (rtx); static void compare_for_stack_reg (rtx, stack, rtx); -static void subst_stack_regs_pat (rtx, stack, rtx); +static bool subst_stack_regs_pat (rtx, stack, rtx); static void subst_asm_stack_regs (rtx, stack); -static void subst_stack_regs (rtx, stack); +static bool subst_stack_regs (rtx, stack); static void change_stack (rtx, stack, stack, enum emit_where); static int convert_regs_entry (void); static void convert_regs_exit (void); @@ -336,7 +336,7 @@ next_flags_user (rtx insn) /* Search forward looking for the first use of this value. Stop at block boundaries. */ - while (insn != current_block->end) + while (insn != BB_END (current_block)) { insn = NEXT_INSN (insn); @@ -973,10 +973,10 @@ emit_swap_insn (rtx insn, stack regstack, rtx reg) /* Find the previous insn involving stack regs, but don't pass a block boundary. */ i1 = NULL; - if (current_block && insn != current_block->head) + if (current_block && insn != BB_HEAD (current_block)) { rtx tmp = PREV_INSN (insn); - rtx limit = PREV_INSN (current_block->head); + rtx limit = PREV_INSN (BB_HEAD (current_block)); while (tmp != limit) { if (GET_CODE (tmp) == CODE_LABEL @@ -1022,21 +1022,23 @@ emit_swap_insn (rtx insn, stack regstack, rtx reg) if (i1) emit_insn_after (swap_rtx, i1); else if (current_block) - emit_insn_before (swap_rtx, current_block->head); + emit_insn_before (swap_rtx, BB_HEAD (current_block)); else emit_insn_before (swap_rtx, insn); } /* Handle a move to or from a stack register in PAT, which is in INSN. - REGSTACK is the current stack. */ + REGSTACK is the current stack. Return whether a control flow insn + was deleted in the process. */ -static void +static bool move_for_stack_reg (rtx insn, stack regstack, rtx pat) { rtx *psrc = get_true_reg (&SET_SRC (pat)); rtx *pdest = get_true_reg (&SET_DEST (pat)); rtx src, dest; rtx note; + bool control_flow_insn_deleted = false; src = *psrc; dest = *pdest; @@ -1066,21 +1068,17 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat) If so, just pop the src. */ if (find_regno_note (insn, REG_UNUSED, REGNO (dest))) + emit_pop_insn (insn, regstack, src, EMIT_AFTER); + else { - emit_pop_insn (insn, regstack, src, EMIT_AFTER); - - delete_insn (insn); - return; + regstack->reg[i] = REGNO (dest); + SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest)); + CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src)); } - regstack->reg[i] = REGNO (dest); - - SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest)); - CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src)); - + control_flow_insn_deleted |= control_flow_insn_p (insn); delete_insn (insn); - - return; + return control_flow_insn_deleted; } /* The source reg does not die. */ @@ -1095,8 +1093,9 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat) if (find_regno_note (insn, REG_UNUSED, REGNO (dest))) emit_pop_insn (insn, regstack, dest, EMIT_AFTER); + control_flow_insn_deleted |= control_flow_insn_p (insn); delete_insn (insn); - return; + return control_flow_insn_deleted; } /* The destination ought to be dead. */ @@ -1124,7 +1123,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat) regstack->top--; CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src)); } - else if ((GET_MODE (src) == XFmode || GET_MODE (src) == TFmode) + else if ((GET_MODE (src) == XFmode) && regstack->top < REG_STACK_SIZE - 1) { /* A 387 cannot write an XFmode value to a MEM without @@ -1137,10 +1136,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat) rtx push_rtx, push_insn; rtx top_stack_reg = FP_MODE_REG (FIRST_STACK_REG, GET_MODE (src)); - if (GET_MODE (src) == TFmode) - push_rtx = gen_movtf (top_stack_reg, top_stack_reg); - else - push_rtx = gen_movxf (top_stack_reg, top_stack_reg); + push_rtx = gen_movxf (top_stack_reg, top_stack_reg); push_insn = emit_insn_before (push_rtx, insn); REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD, top_stack_reg, REG_NOTES (insn)); @@ -1168,6 +1164,8 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat) } else abort (); + + return control_flow_insn_deleted; } /* Swap the condition on a branch, if there is one. Return true if we @@ -1234,7 +1232,7 @@ swap_rtx_condition (rtx insn) /* Search forward looking for the first use of this value. Stop at block boundaries. */ - while (insn != current_block->end) + while (insn != BB_END (current_block)) { insn = NEXT_INSN (insn); if (INSN_P (insn) && reg_mentioned_p (dest, insn)) @@ -1379,12 +1377,14 @@ compare_for_stack_reg (rtx insn, stack regstack, rtx pat_src) } /* Substitute new registers in PAT, which is part of INSN. REGSTACK - is the current register layout. */ + is the current register layout. Return whether a control flow insn + was deleted in the process. */ -static void +static bool subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) { rtx *dest, *src; + bool control_flow_insn_deleted = false; switch (GET_CODE (pat)) { @@ -1396,7 +1396,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) && find_regno_note (insn, REG_DEAD, REGNO (*src))) { emit_pop_insn (insn, regstack, *src, EMIT_AFTER); - return; + return control_flow_insn_deleted; } /* ??? Uninitialized USE should not happen. */ else if (get_hard_regnum (regstack, *src) == -1) @@ -1446,7 +1446,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) FP_MODE_REG (REGNO (*dest), SFmode), nan); PATTERN (insn) = pat; - move_for_stack_reg (insn, regstack, pat); + control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat); } if (! note && COMPLEX_MODE_P (GET_MODE (*dest)) && get_hard_regnum (regstack, FP_MODE_REG (REGNO (*dest), DFmode)) == -1) @@ -1455,7 +1455,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) FP_MODE_REG (REGNO (*dest) + 1, SFmode), nan); PATTERN (insn) = pat; - move_for_stack_reg (insn, regstack, pat); + control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat); } } } @@ -1478,7 +1478,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) && (GET_CODE (*src) == REG || GET_CODE (*src) == MEM || GET_CODE (*src) == CONST_DOUBLE))) { - move_for_stack_reg (insn, regstack, pat); + control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat); break; } @@ -1882,6 +1882,8 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) default: break; } + + return control_flow_insn_deleted; } /* Substitute hard regnums for any stack regs in INSN, which has @@ -2179,12 +2181,14 @@ subst_asm_stack_regs (rtx insn, stack regstack) /* Substitute stack hard reg numbers for stack virtual registers in INSN. Non-stack register numbers are not changed. REGSTACK is the current stack content. Insns may be emitted as needed to arrange the - stack for the 387 based on the contents of the insn. */ + stack for the 387 based on the contents of the insn. Return whether + a control flow insn was deleted in the process. */ -static void +static bool subst_stack_regs (rtx insn, stack regstack) { rtx *note_link, note; + bool control_flow_insn_deleted = false; int i; if (GET_CODE (insn) == CALL_INSN) @@ -2225,25 +2229,27 @@ subst_stack_regs (rtx insn, stack regstack) Any REG_UNUSED notes will be handled by subst_asm_stack_regs. */ subst_asm_stack_regs (insn, regstack); - return; + return control_flow_insn_deleted; } if (GET_CODE (PATTERN (insn)) == PARALLEL) for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) { if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i))) - subst_stack_regs_pat (insn, regstack, - XVECEXP (PATTERN (insn), 0, i)); + control_flow_insn_deleted + |= subst_stack_regs_pat (insn, regstack, + XVECEXP (PATTERN (insn), 0, i)); } else - subst_stack_regs_pat (insn, regstack, PATTERN (insn)); + control_flow_insn_deleted + |= subst_stack_regs_pat (insn, regstack, PATTERN (insn)); } /* subst_stack_regs_pat may have deleted a no-op insn. If so, any REG_UNUSED will already have been dealt with, so just return. */ if (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn)) - return; + return control_flow_insn_deleted; /* If there is a REG_UNUSED note on a stack register on this insn, the indicated reg must be popped. The REG_UNUSED note is removed, @@ -2259,6 +2265,8 @@ subst_stack_regs (rtx insn, stack regstack) } else note_link = &XEXP (note, 1); + + return control_flow_insn_deleted; } /* Change the organization of the stack so that it fits a new basic @@ -2284,7 +2292,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) if (where == EMIT_AFTER) { - if (current_block && current_block->end == insn) + if (current_block && BB_END (current_block) == insn) update_end = 1; insn = NEXT_INSN (insn); } @@ -2367,7 +2375,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) } if (update_end) - current_block->end = PREV_INSN (insn); + BB_END (current_block) = PREV_INSN (insn); } /* Print stack configuration. */ @@ -2528,7 +2536,7 @@ compensate_edge (edge e, FILE *file) /* change_stack kills values in regstack. */ tmpstack = regstack; - change_stack (block->end, &tmpstack, target_stack, EMIT_AFTER); + change_stack (BB_END (block), &tmpstack, target_stack, EMIT_AFTER); return false; } @@ -2599,8 +2607,8 @@ compensate_edge (edge e, FILE *file) /* change_stack kills values in regstack. */ tmpstack = regstack; - change_stack (block->end, &tmpstack, target_stack, - (GET_CODE (block->end) == JUMP_INSN + change_stack (BB_END (block), &tmpstack, target_stack, + (GET_CODE (BB_END (block)) == JUMP_INSN ? EMIT_BEFORE : EMIT_AFTER)); } else @@ -2641,6 +2649,7 @@ convert_regs_1 (FILE *file, basic_block block) int deleted, inserted, reg; rtx insn, next; edge e, beste = NULL; + bool control_flow_insn_deleted = false; inserted = 0; deleted = 0; @@ -2705,7 +2714,7 @@ convert_regs_1 (FILE *file, basic_block block) /* Process all insns in this block. Keep track of NEXT so that we don't process insns emitted while substituting in INSN. */ - next = block->head; + next = BB_HEAD (block); regstack = bi->stack_in; do { @@ -2715,7 +2724,7 @@ convert_regs_1 (FILE *file, basic_block block) /* Ensure we have not missed a block boundary. */ if (next == NULL) abort (); - if (insn == block->end) + if (insn == BB_END (block)) next = NULL; /* Don't bother processing unless there is a stack reg @@ -2729,8 +2738,7 @@ convert_regs_1 (FILE *file, basic_block block) INSN_UID (insn)); print_stack (file, ®stack); } - subst_stack_regs (insn, ®stack); - deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn)); + control_flow_insn_deleted |= subst_stack_regs (insn, ®stack); } } while (next); @@ -2745,7 +2753,7 @@ convert_regs_1 (FILE *file, basic_block block) print_stack (file, ®stack); } - insn = block->end; + insn = BB_END (block); if (GET_CODE (insn) == JUMP_INSN) insn = PREV_INSN (insn); @@ -2769,8 +2777,7 @@ convert_regs_1 (FILE *file, basic_block block) set = gen_rtx_SET (VOIDmode, FP_MODE_REG (reg, SFmode), nan); insn = emit_insn_after (set, insn); - subst_stack_regs (insn, ®stack); - deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn)); + control_flow_insn_deleted |= subst_stack_regs (insn, ®stack); } } @@ -2780,12 +2787,18 @@ convert_regs_1 (FILE *file, basic_block block) called at the end of convert_regs. The order in which we process the blocks ensures that we never delete an already processed edge. + Note that, at this point, the CFG may have been damaged by the emission + of instructions after an abnormal call, which moves the basic block end + (and is the reason why we call fixup_abnormal_edges later). So we must + be sure that the trapping insn has been deleted before trying to purge + dead edges, otherwise we risk purging valid edges. + ??? We are normally supposed not to delete trapping insns, so we pretend that the insns deleted above don't actually trap. It would have been better to detect this earlier and avoid creating the EH edge in the first place, still, but we don't have enough information at that time. */ - if (deleted) + if (control_flow_insn_deleted) purge_dead_edges (block); /* Something failed if the stack lives don't match. If we had malformed diff --git a/gcc/regclass.c b/gcc/regclass.c index f16f03aa1b6..2e4dc61be32 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -321,10 +321,7 @@ init_reg_sets_1 (void) { for (j = 0; j < N_REG_CLASSES; j++) { -#ifdef HARD_REG_SET - register /* Declare it register if it's a scalar. */ -#endif - HARD_REG_SET c; + HARD_REG_SET c; int k; COPY_HARD_REG_SET (c, reg_class_contents[i]); @@ -355,10 +352,7 @@ init_reg_sets_1 (void) { for (j = 0; j < N_REG_CLASSES; j++) { -#ifdef HARD_REG_SET - register /* Declare it register if it's a scalar. */ -#endif - HARD_REG_SET c; + HARD_REG_SET c; int k; COPY_HARD_REG_SET (c, reg_class_contents[i]); @@ -1085,8 +1079,8 @@ scan_one_insn (rtx insn, int pass) { basic_block b; FOR_EACH_BB (b) - if (insn == b->head) - b->head = newinsn; + if (insn == BB_HEAD (b)) + BB_HEAD (b) = newinsn; } /* This makes one more setting of new insns's dest. */ @@ -1240,10 +1234,10 @@ regclass (rtx f, int nregs, FILE *dump) aggressive than the assumptions made elsewhere and is being tried as an experiment. */ frequency = REG_FREQ_FROM_BB (bb); - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { insn = scan_one_insn (insn, pass); - if (insn == bb->end) + if (insn == BB_END (bb)) break; } } @@ -2293,21 +2287,20 @@ reg_scan (rtx f, unsigned int nregs, int repeat ATTRIBUTE_UNUSED) { rtx insn; + timevar_push (TV_REG_SCAN); + allocate_reg_info (nregs, TRUE, FALSE); max_parallel = 3; max_set_parallel = 0; - timevar_push (TV_REG_SCAN); - for (insn = f; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == INSN - || GET_CODE (insn) == CALL_INSN - || GET_CODE (insn) == JUMP_INSN) + if (INSN_P (insn)) { - if (GET_CODE (PATTERN (insn)) == PARALLEL - && XVECLEN (PATTERN (insn), 0) > max_parallel) - max_parallel = XVECLEN (PATTERN (insn), 0); - reg_scan_mark_refs (PATTERN (insn), insn, 0, 0); + rtx pat = PATTERN (insn); + if (GET_CODE (pat) == PARALLEL + && XVECLEN (pat, 0) > max_parallel) + max_parallel = XVECLEN (pat, 0); + reg_scan_mark_refs (pat, insn, 0, 0); if (REG_NOTES (insn)) reg_scan_mark_refs (REG_NOTES (insn), insn, 1, 0); @@ -2331,14 +2324,13 @@ reg_scan_update (rtx first, rtx last, unsigned int old_max_regno) allocate_reg_info (max_reg_num (), FALSE, FALSE); for (insn = first; insn != last; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == INSN - || GET_CODE (insn) == CALL_INSN - || GET_CODE (insn) == JUMP_INSN) + if (INSN_P (insn)) { - if (GET_CODE (PATTERN (insn)) == PARALLEL - && XVECLEN (PATTERN (insn), 0) > max_parallel) - max_parallel = XVECLEN (PATTERN (insn), 0); - reg_scan_mark_refs (PATTERN (insn), insn, 0, old_max_regno); + rtx pat = PATTERN (insn); + if (GET_CODE (pat) == PARALLEL + && XVECLEN (pat, 0) > max_parallel) + max_parallel = XVECLEN (pat, 0); + reg_scan_mark_refs (pat, insn, 0, old_max_regno); if (REG_NOTES (insn)) reg_scan_mark_refs (REG_NOTES (insn), insn, 1, old_max_regno); @@ -2414,6 +2406,8 @@ reg_scan_mark_refs (rtx x, rtx insn, int note_flag, unsigned int min_regno) REG_N_SETS (REGNO (reg))++; REG_N_REFS (REGNO (reg))++; } + else if (GET_CODE (reg) == MEM) + reg_scan_mark_refs (XEXP (reg, 0), insn, note_flag, min_regno); } break; @@ -2546,10 +2540,7 @@ reg_class_subset_p (enum reg_class c1, enum reg_class c2) int reg_classes_intersect_p (enum reg_class c1, enum reg_class c2) { -#ifdef HARD_REG_SET - register -#endif - HARD_REG_SET c; + HARD_REG_SET c; if (c1 == c2) return 1; diff --git a/gcc/regmove.c b/gcc/regmove.c index 8696d3a5ed1..c6c30d10706 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -256,8 +256,8 @@ mark_flags_life_zones (rtx flags) rtx insn, end; int live; - insn = block->head; - end = block->end; + insn = BB_HEAD (block); + end = BB_END (block); /* Look out for the (unlikely) case of flags being live across basic block boundaries. */ @@ -810,7 +810,7 @@ copy_src_to_dest (rtx insn, rtx src, rtx dest, int old_max_uid) bb = regmove_bb_head[insn_uid]; if (bb >= 0) { - BLOCK_HEAD (bb) = move_insn; + BB_HEAD (BASIC_BLOCK (bb)) = move_insn; regmove_bb_head[insn_uid] = -1; } } @@ -1061,7 +1061,7 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file) regmove_bb_head = xmalloc (sizeof (int) * (old_max_uid + 1)); for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1; FOR_EACH_BB (bb) - regmove_bb_head[INSN_UID (bb->head)] = bb->index; + regmove_bb_head[INSN_UID (BB_HEAD (bb))] = bb->index; /* A forward/backward pass. Replace output operands with input operands. */ @@ -1491,13 +1491,13 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file) ends. Fix that here. */ FOR_EACH_BB (bb) { - rtx end = bb->end; + rtx end = BB_END (bb); rtx new = end; rtx next = NEXT_INSN (new); while (next != 0 && INSN_UID (next) >= old_max_uid - && (bb->next_bb == EXIT_BLOCK_PTR || bb->next_bb->head != next)) + && (bb->next_bb == EXIT_BLOCK_PTR || BB_HEAD (bb->next_bb) != next)) new = next, next = NEXT_INSN (new); - bb->end = new; + BB_END (bb) = new; } done: @@ -2304,9 +2304,9 @@ combine_stack_adjustments_for_block (basic_block bb) struct record_stack_memrefs_data data; bool end_of_block = false; - for (insn = bb->head; !end_of_block ; insn = next) + for (insn = BB_HEAD (bb); !end_of_block ; insn = next) { - end_of_block = insn == bb->end; + end_of_block = insn == BB_END (bb); next = NEXT_INSN (insn); if (! INSN_P (insn)) diff --git a/gcc/regrename.c b/gcc/regrename.c index 4e93fab796b..1c6ad8d9614 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -149,7 +149,7 @@ merge_overlapping_regs (basic_block b, HARD_REG_SET *pset, HARD_REG_SET live; REG_SET_TO_HARD_REG_SET (live, b->global_live_at_start); - insn = b->head; + insn = BB_HEAD (b); while (t) { /* Search forward until the next reference to the register to be @@ -729,7 +729,7 @@ build_def_use (basic_block bb) open_chains = closed_chains = NULL; - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) { @@ -954,7 +954,7 @@ build_def_use (basic_block bb) scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead, OP_IN, 0); } - if (insn == bb->end) + if (insn == BB_END (bb)) break; } @@ -1339,15 +1339,20 @@ find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd) { enum machine_mode oldmode = vd->e[i].mode; rtx new; - - if (TEST_HARD_REG_BIT (reg_class_contents[class], i) - && (new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, - regno))) - { - ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); - REG_ATTRS (new) = REG_ATTRS (reg); - return new; - } + int j; + + for (j = 0; j < HARD_REGNO_NREGS (regno, mode); ++j) + if (!TEST_HARD_REG_BIT (reg_class_contents[class], i + j)) + return NULL_RTX; + + new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, + regno); + if (new) + { + ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); + REG_ATTRS (new) = REG_ATTRS (reg); + return new; + } } return NULL_RTX; @@ -1525,7 +1530,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) bool changed = false; rtx insn; - for (insn = bb->head; ; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { int n_ops, i, alt, predicated; bool is_asm; @@ -1533,7 +1538,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) if (! INSN_P (insn)) { - if (insn == bb->end) + if (insn == BB_END (bb)) break; else continue; @@ -1709,7 +1714,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set))) copy_value (SET_DEST (set), SET_SRC (set), vd); - if (insn == bb->end) + if (insn == BB_END (bb)) break; } @@ -1734,7 +1739,7 @@ copyprop_hardreg_forward (void) /* If a block has a single predecessor, that we've already processed, begin with the value data that was live at the end of the predecessor block. */ - /* ??? Ought to use more intelligent queueing of blocks. */ + /* ??? Ought to use more intelligent queuing of blocks. */ if (bb->pred) for (bbp = bb; bbp && bbp != bb->pred->src; bbp = bbp->prev_bb); if (bb->pred diff --git a/gcc/regs.h b/gcc/regs.h index b2aeb5fb02c..9c9edccb26b 100644 --- a/gcc/regs.h +++ b/gcc/regs.h @@ -153,11 +153,14 @@ extern bitmap_head subregs_of_mode; extern short *reg_renumber; -/* Vector indexed by hardware reg - saying whether that reg is ever used. */ +/* Vector indexed by hardware reg saying whether that reg is ever used. */ extern char regs_ever_live[FIRST_PSEUDO_REGISTER]; +/* Like regs_ever_live, but saying whether reg is set by asm statements. */ + +extern char regs_asm_clobbered[FIRST_PSEUDO_REGISTER]; + /* For each hard register, the widest mode object that it can contain. This will be a MODE_INT mode if the register can hold integers. Otherwise it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the diff --git a/gcc/reload.c b/gcc/reload.c index 59852ba2b5e..13f6900ce3d 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -3264,17 +3264,18 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, win = 1; /* If the address was already reloaded, we win as well. */ - if (GET_CODE (operand) == MEM && address_reloaded[i]) + else if (GET_CODE (operand) == MEM + && address_reloaded[i]) win = 1; /* Likewise if the address will be reloaded because reg_equiv_address is nonzero. For reg_equiv_mem we have to check. */ - if (GET_CODE (operand) == REG - && REGNO (operand) >= FIRST_PSEUDO_REGISTER - && reg_renumber[REGNO (operand)] < 0 - && ((reg_equiv_mem[REGNO (operand)] != 0 - && EXTRA_CONSTRAINT_STR (reg_equiv_mem[REGNO (operand)], c, p)) - || (reg_equiv_address[REGNO (operand)] != 0))) + else if (GET_CODE (operand) == REG + && REGNO (operand) >= FIRST_PSEUDO_REGISTER + && reg_renumber[REGNO (operand)] < 0 + && ((reg_equiv_mem[REGNO (operand)] != 0 + && EXTRA_CONSTRAINT_STR (reg_equiv_mem[REGNO (operand)], c, p)) + || (reg_equiv_address[REGNO (operand)] != 0))) win = 1; /* If we didn't already win, we can reload @@ -4883,7 +4884,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, && GET_CODE (XEXP (ad, 0)) == PLUS && GET_CODE (XEXP (XEXP (ad, 0), 0)) == REG && REGNO (XEXP (XEXP (ad, 0), 0)) < FIRST_PSEUDO_REGISTER - && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode) + && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode) + || XEXP (XEXP (ad, 0), 0) == frame_pointer_rtx +#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM + || XEXP (XEXP (ad, 0), 0) == hard_frame_pointer_rtx +#endif +#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM + || XEXP (XEXP (ad, 0), 0) == arg_pointer_rtx +#endif + || XEXP (XEXP (ad, 0), 0) == stack_pointer_rtx) && ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 1))) { *loc = ad = gen_rtx_PLUS (GET_MODE (ad), @@ -4903,7 +4912,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, && GET_CODE (XEXP (ad, 0)) == PLUS && GET_CODE (XEXP (XEXP (ad, 0), 1)) == REG && REGNO (XEXP (XEXP (ad, 0), 1)) < FIRST_PSEUDO_REGISTER - && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode) + && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode) + || XEXP (XEXP (ad, 0), 1) == frame_pointer_rtx +#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM + || XEXP (XEXP (ad, 0), 1) == hard_frame_pointer_rtx +#endif +#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM + || XEXP (XEXP (ad, 0), 1) == arg_pointer_rtx +#endif + || XEXP (XEXP (ad, 0), 1) == stack_pointer_rtx) && ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 0))) { *loc = ad = gen_rtx_PLUS (GET_MODE (ad), @@ -6273,8 +6290,22 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in) || GET_CODE (x) == CC0) return reg_mentioned_p (x, in); else if (GET_CODE (x) == PLUS) - return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in) - || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in)); + { + /* We actually want to know if X is mentioned somewhere inside IN. + We must not say that (plus (sp) (const_int 124)) is in + (plus (sp) (const_int 64)), since that can lead to incorrect reload + allocation when spuriously changing a RELOAD_FOR_OUTPUT_ADDRESS + into a RELOAD_OTHER on behalf of another RELOAD_OTHER. */ + while (GET_CODE (in) == MEM) + in = XEXP (in, 0); + if (GET_CODE (in) == REG) + return 0; + else if (GET_CODE (in) == PLUS) + return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0)) + || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1))); + else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in) + || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in)); + } else abort (); diff --git a/gcc/reload1.c b/gcc/reload1.c index ecab52b68ee..9a0ad894746 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -77,10 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA reload needs, spilling, assigning reload registers to use for fixing up each insn, and generating the new insns to copy values into the reload registers. */ - -#ifndef LOCAL_REGNO -#define LOCAL_REGNO(REGNO) 0 -#endif /* During reload_as_needed, element N contains a REG rtx for the hard reg into which reg N has been reloaded (perhaps for a previous insn). */ @@ -142,6 +138,11 @@ static HARD_REG_SET reg_reloaded_valid; This is only valid if reg_reloaded_contents is set and valid. */ static HARD_REG_SET reg_reloaded_dead; +/* Indicate whether the register's current value is one that is not + safe to retain across a call, even for registers that are normally + call-saved. */ +static HARD_REG_SET reg_reloaded_call_part_clobbered; + /* Number of spill-regs so far; number of valid elements of spill_regs. */ static int n_spills; @@ -293,12 +294,12 @@ struct elim_table { int from; /* Register number to be eliminated. */ int to; /* Register number used as replacement. */ - int initial_offset; /* Initial difference between values. */ + HOST_WIDE_INT initial_offset; /* Initial difference between values. */ int can_eliminate; /* Nonzero if this elimination can be done. */ int can_eliminate_previous; /* Value of CAN_ELIMINATE in previous scan over insns made by reload. */ - int offset; /* Current offset between the two regs. */ - int previous_offset; /* Offset at end of previous insn. */ + HOST_WIDE_INT offset; /* Current offset between the two regs. */ + HOST_WIDE_INT previous_offset;/* Offset at end of previous insn. */ int ref_outside_mem; /* "to" has been referenced outside a MEM. */ rtx from_rtx; /* REG rtx for the register to be eliminated. We cannot simply compare the number since @@ -352,7 +353,7 @@ static int num_eliminable_invariants; static int first_label_num; static char *offsets_known_at; -static int (*offsets_at)[NUM_ELIMINABLE_REGS]; +static HOST_WIDE_INT (*offsets_at)[NUM_ELIMINABLE_REGS]; /* Number of labels in the current function. */ @@ -673,6 +674,17 @@ reload (rtx first, int global) if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i)) regs_ever_live[i] = 1; +#ifdef NON_SAVING_SETJMP + /* A function that calls setjmp should save and restore all the + call-saved registers on a system where longjmp clobbers them. */ + if (NON_SAVING_SETJMP && current_function_calls_setjmp) + { + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (! call_used_regs[i]) + regs_ever_live[i] = 1; + } +#endif + /* Find all the pseudo registers that didn't get hard regs but do have known equivalent constants or memory slots. These include parameters (known equivalent to parameter slots) @@ -698,9 +710,7 @@ reload (rtx first, int global) /* Look for REG_EQUIV notes; record what each pseudo is equivalent to. Also find all paradoxical subregs and find largest such for each pseudo. On machines with small register classes, record hard registers that - are used for user variables. These can never be used for spills. - Also look for a "constant" REG_SETJMP. This means that all - caller-saved registers must be marked live. */ + are used for user variables. These can never be used for spills. */ num_eliminable_invariants = 0; for (insn = first; insn; insn = NEXT_INSN (insn)) @@ -714,12 +724,6 @@ reload (rtx first, int global) && GET_MODE (insn) != VOIDmode) PUT_MODE (insn, VOIDmode); - if (GET_CODE (insn) == CALL_INSN - && find_reg_note (insn, REG_SETJMP, NULL)) - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (! call_used_regs[i]) - regs_ever_live[i] = 1; - if (set != 0 && GET_CODE (SET_DEST (set)) == REG) { rtx note = find_reg_note (insn, REG_EQUIV, NULL_RTX); @@ -816,7 +820,7 @@ reload (rtx first, int global) allocate would occasionally cause it to exceed the stack limit and cause a core dump. */ offsets_known_at = xmalloc (num_labels); - offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int)); + offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (HOST_WIDE_INT)); /* Alter each pseudo-reg rtx to contain its hard reg number. Assign stack slots to the pseudos that lack hard regs or equivalents. @@ -1249,6 +1253,14 @@ reload (rtx first, int global) by this, so unshare everything here. */ unshare_all_rtl_again (first); +#ifdef STACK_BOUNDARY + /* init_emit has set the alignment of the hard frame pointer + to STACK_BOUNDARY. It is very likely no longer valid if + the hard frame pointer was used for register allocation. */ + if (!frame_pointer_needed) + REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT; +#endif + return failure; } @@ -2897,7 +2909,7 @@ eliminate_regs_in_insn (rtx insn, int replace) { rtx base = SET_SRC (old_set); rtx base_insn = insn; - int offset = 0; + HOST_WIDE_INT offset = 0; while (base != ep->to_rtx) { @@ -2980,7 +2992,7 @@ eliminate_regs_in_insn (rtx insn, int replace) && REGNO (XEXP (SET_SRC (old_set), 0)) < FIRST_PSEUDO_REGISTER) { rtx reg = XEXP (SET_SRC (old_set), 0); - int offset = INTVAL (XEXP (SET_SRC (old_set), 1)); + HOST_WIDE_INT offset = INTVAL (XEXP (SET_SRC (old_set), 1)); for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == reg && ep->can_eliminate) @@ -3263,7 +3275,7 @@ mark_not_eliminable (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED) static void verify_initial_elim_offsets (void) { - int t; + HOST_WIDE_INT t; #ifdef ELIMINABLE_REGS struct elim_table *ep; @@ -3436,7 +3448,6 @@ init_elim_table (void) /* Does this function require a frame pointer? */ frame_pointer_needed = (! flag_omit_frame_pointer -#ifdef EXIT_IGNORE_STACK /* ?? If EXIT_IGNORE_STACK is set, we will not save and restore sp for alloca. So we can't eliminate the frame pointer in that case. At some point, @@ -3444,7 +3455,6 @@ init_elim_table (void) sp-adjusting insns for this case. */ || (current_function_calls_alloca && EXIT_IGNORE_STACK) -#endif || FRAME_POINTER_REQUIRED); num_eliminable = 0; @@ -3752,6 +3762,7 @@ reload_as_needed (int live_known) reg_last_reload_reg = xcalloc (max_regno, sizeof (rtx)); reg_has_output_reload = xmalloc (max_regno); CLEAR_HARD_REG_SET (reg_reloaded_valid); + CLEAR_HARD_REG_SET (reg_reloaded_call_part_clobbered); set_initial_elim_offsets (); @@ -3999,9 +4010,13 @@ reload_as_needed (int live_known) CLEAR_HARD_REG_SET (reg_reloaded_valid); /* Don't assume a reload reg is still good after a call insn - if it is a call-used reg. */ + if it is a call-used reg, or if it contains a value that will + be partially clobbered by the call. */ else if (GET_CODE (insn) == CALL_INSN) + { AND_COMPL_HARD_REG_SET (reg_reloaded_valid, call_used_reg_set); + AND_COMPL_HARD_REG_SET (reg_reloaded_valid, reg_reloaded_call_part_clobbered); + } } /* Clean up. */ @@ -4056,6 +4071,7 @@ forget_old_reloads_1 (rtx x, rtx ignored ATTRIBUTE_UNUSED, || ! TEST_HARD_REG_BIT (reg_is_output_reload, regno + i)) { CLEAR_HARD_REG_BIT (reg_reloaded_valid, regno + i); + CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, regno + i); spill_reg_store[regno + i] = 0; } } @@ -7038,7 +7054,10 @@ emit_reload_insns (struct insn_chain *chain) If consecutive registers are used, clear them all. */ for (k = 0; k < nr; k++) + { CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); + CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); + } /* Maybe the spill reg contains a copy of reload_out. */ if (rld[r].out != 0 @@ -7085,6 +7104,8 @@ emit_reload_insns (struct insn_chain *chain) : nregno + k); reg_reloaded_insn[i + k] = insn; SET_HARD_REG_BIT (reg_reloaded_valid, i + k); + if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (out))) + SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); } } @@ -7102,14 +7123,16 @@ emit_reload_insns (struct insn_chain *chain) { int nregno; int nnr; + rtx in; if (GET_CODE (rld[r].in) == REG && REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER) - nregno = REGNO (rld[r].in); + in = rld[r].in; else if (GET_CODE (rld[r].in_reg) == REG) - nregno = REGNO (rld[r].in_reg); + in = rld[r].in_reg; else - nregno = REGNO (XEXP (rld[r].in_reg, 0)); + in = XEXP (rld[r].in_reg, 0); + nregno = REGNO (in); nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 : HARD_REGNO_NREGS (nregno, @@ -7141,6 +7164,8 @@ emit_reload_insns (struct insn_chain *chain) : nregno + k); reg_reloaded_insn[i + k] = insn; SET_HARD_REG_BIT (reg_reloaded_valid, i + k); + if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (in))) + SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); } } } @@ -7227,6 +7252,10 @@ emit_reload_insns (struct insn_chain *chain) reg_reloaded_insn[src_regno + nr] = store_insn; CLEAR_HARD_REG_BIT (reg_reloaded_dead, src_regno + nr); SET_HARD_REG_BIT (reg_reloaded_valid, src_regno + nr); + if (HARD_REGNO_CALL_PART_CLOBBERED (src_regno + nr, + GET_MODE (src_reg))) + SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + src_regno + nr); SET_HARD_REG_BIT (reg_is_output_reload, src_regno + nr); if (note) SET_HARD_REG_BIT (reg_reloaded_died, src_regno); @@ -7956,9 +7985,10 @@ fixup_abnormal_edges (void) == (EDGE_ABNORMAL | EDGE_EH)) break; } - if (e && GET_CODE (bb->end) != CALL_INSN && !can_throw_internal (bb->end)) + if (e && GET_CODE (BB_END (bb)) != CALL_INSN + && !can_throw_internal (BB_END (bb))) { - rtx insn = bb->end, stop = NEXT_INSN (bb->end); + rtx insn = BB_END (bb), stop = NEXT_INSN (BB_END (bb)); rtx next; for (e = bb->succ; e; e = e->succ_next) if (e->flags & EDGE_FALLTHRU) @@ -7967,11 +7997,11 @@ fixup_abnormal_edges (void) be already deleted. */ while ((GET_CODE (insn) == INSN || GET_CODE (insn) == NOTE) && !can_throw_internal (insn) - && insn != bb->head) + && insn != BB_HEAD (bb)) insn = PREV_INSN (insn); if (GET_CODE (insn) != CALL_INSN && !can_throw_internal (insn)) abort (); - bb->end = insn; + BB_END (bb) = insn; inserted = true; insn = NEXT_INSN (insn); while (insn && insn != stop) diff --git a/gcc/reorg.c b/gcc/reorg.c index 6a13fe0634b..46b66577980 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -2427,10 +2427,8 @@ fill_simple_delay_slots (int non_jumps_p) #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM SET_HARD_REG_BIT (needed.regs, HARD_FRAME_POINTER_REGNUM); #endif -#ifdef EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK || current_function_sp_is_unchanging) -#endif SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM); } else diff --git a/gcc/resource.c b/gcc/resource.c index 2aab94c525d..240cf232334 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -155,7 +155,7 @@ find_basic_block (rtx insn, int search_limit) insn = next_nonnote_insn (insn)) { FOR_EACH_BB (bb) - if (insn == bb->head) + if (insn == BB_HEAD (bb)) return bb->index; } @@ -616,7 +616,7 @@ find_dead_or_set_registers (rtx target, struct resources *res, /* Given X, a part of an insn, and a pointer to a `struct resource', RES, indicate which resources are modified by the insn. If MARK_TYPE is MARK_SRC_DEST_CALL, also mark resources potentially - set by the called routine. If MARK_TYPE is MARK_DEST, only mark SET_DESTs + set by the called routine. If IN_DEST is nonzero, it means we are inside a SET. Otherwise, objects are being referenced instead of set. @@ -716,8 +716,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, || GET_CODE (SET_SRC (x)) != CALL), mark_type); - if (mark_type != MARK_DEST) - mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST); + mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST); return; case CLOBBER: @@ -747,12 +746,9 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, case SIGN_EXTRACT: case ZERO_EXTRACT: - if (! (mark_type == MARK_DEST && in_dest)) - { - mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST); - mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST); - mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST); - } + mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST); + mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST); + mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST); return; case MEM: @@ -799,13 +795,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, } return; - case STRICT_LOW_PART: - if (! (mark_type == MARK_DEST && in_dest)) - { - mark_set_resources (XEXP (x, 0), res, 0, MARK_SRC_DEST); - return; - } - case UNSPEC_VOLATILE: case ASM_INPUT: /* Traditional asm's are always volatile. */ @@ -924,7 +913,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) information, we can get it from there unless the insn at the start of the basic block has been deleted. */ if (tinfo && tinfo->block != -1 - && ! INSN_DELETED_P (BLOCK_HEAD (tinfo->block))) + && ! INSN_DELETED_P (BB_HEAD (BASIC_BLOCK (tinfo->block)))) b = tinfo->block; } @@ -990,7 +979,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) /* Get starting and ending insn, handling the case where each might be a SEQUENCE. */ - start_insn = (b == 0 ? insns : BLOCK_HEAD (b)); + start_insn = (b == 0 ? insns : BB_HEAD (BASIC_BLOCK (b))); stop_insn = target; if (GET_CODE (start_insn) == INSN @@ -1178,10 +1167,8 @@ init_resource_info (rtx epilogue_insn) #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM); #endif -#ifdef EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK || current_function_sp_is_unchanging) -#endif SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM); } else diff --git a/gcc/resource.h b/gcc/resource.h index b738a0c504f..96eff6ed1ff 100644 --- a/gcc/resource.h +++ b/gcc/resource.h @@ -37,8 +37,7 @@ struct resources enum mark_resource_type { MARK_SRC_DEST = 0, - MARK_SRC_DEST_CALL = 1, - MARK_DEST = 2 + MARK_SRC_DEST_CALL = 1 }; extern void mark_target_live_regs (rtx, rtx, struct resources *); diff --git a/gcc/rtl.c b/gcc/rtl.c index 72ff89f6ace..313e2cb2b5c 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -138,6 +138,14 @@ const char * const reg_note_name[] = "REG_VTABLE_REF" }; + +#ifdef GATHER_STATISTICS +static int rtx_alloc_counts[(int) LAST_AND_UNUSED_RTX_CODE]; +static int rtx_alloc_sizes[(int) LAST_AND_UNUSED_RTX_CODE]; +static int rtvec_alloc_counts; +static int rtvec_alloc_sizes; +#endif + /* Allocate an rtx vector of N elements. Store the length, and initialize all elements to zero. */ @@ -152,6 +160,12 @@ rtvec_alloc (int n) memset (&rt->elem[0], 0, n * sizeof (rtx)); PUT_NUM_ELEM (rt, n); + +#ifdef GATHER_STATISTICS + rtvec_alloc_counts++; + rtvec_alloc_sizes += n * sizeof (rtx); +#endif + return rt; } @@ -171,6 +185,12 @@ rtx_alloc (RTX_CODE code) memset (rt, 0, RTX_HDR_SIZE); PUT_CODE (rt, code); + +#ifdef GATHER_STATISTICS + rtx_alloc_counts[code]++; + rtx_alloc_sizes[code] += RTX_SIZE (code); +#endif + return rt; } @@ -357,7 +377,7 @@ rtx_equal_p (rtx x, rtx y) } /* Compare the elements. If any pair of corresponding elements - fail to match, return 0 for the whole things. */ + fail to match, return 0 for the whole thing. */ fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) @@ -417,6 +437,36 @@ rtx_equal_p (rtx x, rtx y) } return 1; } + +void dump_rtx_statistics (void) +{ +#ifdef GATHER_STATISTICS + int i; + int total_counts = 0; + int total_sizes = 0; + fprintf (stderr, "\nRTX Kind Count Bytes\n"); + fprintf (stderr, "---------------------------------------\n"); + for (i = 0; i < LAST_AND_UNUSED_RTX_CODE; i++) + if (rtx_alloc_counts[i]) + { + fprintf (stderr, "%-20s %7d %10d\n", GET_RTX_NAME (i), + rtx_alloc_counts[i], rtx_alloc_sizes[i]); + total_counts += rtx_alloc_counts[i]; + total_sizes += rtx_alloc_sizes[i]; + } + if (rtvec_alloc_counts) + { + fprintf (stderr, "%-20s %7d %10d\n", "rtvec", + rtvec_alloc_counts, rtvec_alloc_sizes); + total_counts += rtvec_alloc_counts; + total_sizes += rtvec_alloc_sizes; + } + fprintf (stderr, "---------------------------------------\n"); + fprintf (stderr, "%-20s %7d %10d\n", + "Total", total_counts, total_sizes); + fprintf (stderr, "---------------------------------------\n"); +#endif +} #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007) void diff --git a/gcc/rtl.def b/gcc/rtl.def index a7de17beea5..f97f8e98c8a 100644 --- a/gcc/rtl.def +++ b/gcc/rtl.def @@ -582,6 +582,10 @@ DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", 'x') attribute name and the second is the comparison value. */ DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", 'x') +/* A special case of the above representing a set of alternatives. The first + operand is bitmap of the set, the second one is the default value. */ +DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ii", 'x') + /* A conditional expression which is true if the specified flag is true for the insn being scheduled in reorg. @@ -621,17 +625,17 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", 'x') /* Holds a label that is followed by instructions. Operand: - 5: is used in jump.c for the use-count of the label. - 6: is used in flow.c to point to the chain of label_ref's to this label. - 7: is a number that is unique in the entire compilation. - 8: is the user-given name of the label, if any. */ + 4: is used in jump.c for the use-count of the label. + 5: is used in flow.c to point to the chain of label_ref's to this label. + 6: is a number that is unique in the entire compilation. + 7: is the user-given name of the label, if any. */ DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", 'x') /* Say where in the code a source line starts, for symbol table's sake. Operand: - 5: filename, if line number > 0, note-specific data otherwise. - 6: line number if > 0, enum note_insn otherwise. - 7: unique number if line number == note_insn_deleted_label. */ + 4: filename, if line number > 0, note-specific data otherwise. + 5: line number if > 0, enum note_insn otherwise. + 6: unique number if line number == note_insn_deleted_label. */ DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", 'x') /* ---------------------------------------------------------------------- @@ -1208,20 +1212,6 @@ DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", '1') /* Unsigned saturating truncate. */ DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", '1') -/* The SSA phi operator. - - The argument is a vector of 2N rtxes. Element 2N+1 is a CONST_INT - containing the block number of the predecessor through which control - has passed when the register at element 2N is used. - - Note that PHI may only appear at the beginning of a basic block. - - ??? There may be multiple PHI insns, but they are all evaluated - in parallel. This probably ought to be changed to use a real - PARALLEL, as that would be less confusing and more in the spirit - of canonical RTL. It is, however, easier to manipulate this way. */ -DEF_RTL_EXPR(PHI, "phi", "E", 'x') - /* Local variables: diff --git a/gcc/rtl.h b/gcc/rtl.h index 8967193d51f..12c70509923 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -249,10 +249,10 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), /* Define macros to access the `code' field of the rtx. */ #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code) -#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE)) +#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE)) #define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode) -#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE)) +#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE)) /* RTL vector. These appear inside RTX's when there is a need for a variable number of things. The principle use is inside @@ -1457,6 +1457,7 @@ extern void set_reg_attrs_for_parm (rtx, rtx); extern rtx rtx_alloc (RTX_CODE); extern rtvec rtvec_alloc (int); extern rtx copy_rtx (rtx); +extern void dump_rtx_statistics (void); /* In emit-rtl.c */ extern rtx copy_rtx_if_shared (rtx); @@ -1742,7 +1743,7 @@ rtx alloc_EXPR_LIST (int, rtx, rtx); /* regclass.c */ /* Maximum number of parallel sets and clobbers in any insn in this fn. - Always at least 3, since the combiner could put that many togetherm + Always at least 3, since the combiner could put that many together and we want this to remain correct for all the remaining passes. */ extern int max_parallel; @@ -2036,6 +2037,7 @@ extern void delete_insns_since (rtx); extern void mark_reg_pointer (rtx, int); extern void mark_user_reg (rtx); extern void reset_used_flags (rtx); +extern void set_used_flags (rtx); extern void reorder_insns (rtx, rtx, rtx); extern void reorder_insns_nobb (rtx, rtx, rtx); extern int get_max_uid (void); @@ -2048,9 +2050,10 @@ extern void pop_topmost_sequence (void); extern int subreg_realpart_p (rtx); extern void reverse_comparison (rtx); extern void set_new_first_and_last_insn (rtx, rtx); -extern void set_new_first_and_last_label_num (int, int); extern void set_new_last_label_num (int); extern void unshare_all_rtl_again (rtx); +extern void unshare_all_rtl_in_chain (rtx); +extern void verify_rtl_sharing (void); extern void set_first_insn (rtx); extern void set_last_insn (rtx); extern void link_cc0_insns (rtx); @@ -2084,7 +2087,7 @@ extern void dump_combine_stats (FILE *); extern void dump_combine_total_stats (FILE *); #endif /* In web.c */ -extern void web_main PARAMS ((void)); +extern void web_main (void); /* In sched.c. */ #ifdef BUFSIZ @@ -2130,6 +2133,7 @@ extern void purge_hard_subreg_sets (rtx); /* In stmt.c */ extern void set_file_and_line_for_stmt (location_t); extern void expand_null_return (void); +extern void expand_naked_return (void); extern void emit_jump (rtx); extern int preserve_subexpressions_p (void); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 0a0d4d4a51a..6268305c904 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -133,10 +133,14 @@ rtx_unstable_p (rtx x) int rtx_varies_p (rtx x, int for_alias) { - RTX_CODE code = GET_CODE (x); + RTX_CODE code; int i; const char *fmt; + if (!x) + return 0; + + code = GET_CODE (x); switch (code) { case MEM: diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 3cec45de627..1d27a871097 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -250,9 +250,16 @@ sbitmap_not (sbitmap dst, sbitmap src) unsigned int i, n = dst->size; sbitmap_ptr dstp = dst->elms; sbitmap_ptr srcp = src->elms; + unsigned int last_bit; for (i = 0; i < n; i++) *dstp++ = ~*srcp++; + + /* Zero all bits past n_bits, by ANDing dst with sbitmap_ones. */ + last_bit = src->n_bits % SBITMAP_ELT_BITS; + if (last_bit) + dst->elms[n-1] = dst->elms[n-1] + & ((SBITMAP_ELT_TYPE)-1 >> (SBITMAP_ELT_BITS - last_bit)); } /* Set the bits in DST to be the difference between the bits @@ -298,7 +305,7 @@ sbitmap_a_and_b_cg (sbitmap dst, sbitmap a, sbitmap b) for (i = 0; i < n; i++) { SBITMAP_ELT_TYPE tmp = *ap++ & *bp++; - changed = *dstp ^ tmp; + changed |= *dstp ^ tmp; *dstp++ = tmp; } @@ -332,7 +339,7 @@ sbitmap_a_xor_b_cg (sbitmap dst, sbitmap a, sbitmap b) for (i = 0; i < n; i++) { SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++; - changed = *dstp ^ tmp; + changed |= *dstp ^ tmp; *dstp++ = tmp; } @@ -366,7 +373,7 @@ sbitmap_a_or_b_cg (sbitmap dst, sbitmap a, sbitmap b) for (i = 0; i < n; i++) { SBITMAP_ELT_TYPE tmp = *ap++ | *bp++; - changed = *dstp ^ tmp; + changed |= *dstp ^ tmp; *dstp++ = tmp; } diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c index e005f74160a..2d4f125e62f 100644 --- a/gcc/sched-ebb.c +++ b/gcc/sched-ebb.c @@ -218,8 +218,8 @@ add_missing_bbs (rtx before, basic_block first, basic_block last) { before = emit_note_before (NOTE_INSN_BASIC_BLOCK, before); NOTE_BASIC_BLOCK (before) = last; - last->head = before; - last->end = before; + BB_HEAD (last) = before; + BB_END (last) = before; update_bb_for_insn (last); } } @@ -233,10 +233,10 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head, rtx tail) { rtx insn = head; - rtx last_inside = bb->head; + rtx last_inside = BB_HEAD (bb); rtx aftertail = NEXT_INSN (tail); - head = bb->head; + head = BB_HEAD (bb); for (; insn != aftertail; insn = NEXT_INSN (insn)) { @@ -299,9 +299,9 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head, if (f) { last = curr_bb = split_edge (f); - h = curr_bb->head; - curr_bb->head = head; - curr_bb->end = insn; + h = BB_HEAD (curr_bb); + BB_HEAD (curr_bb) = head; + BB_END (curr_bb) = insn; /* Edge splitting created misplaced BASIC_BLOCK note, kill it. */ delete_insn (h); @@ -324,9 +324,9 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head, } else { - curr_bb->head = head; - curr_bb->end = insn; - add_missing_bbs (curr_bb->head, bb, curr_bb->prev_bb); + BB_HEAD (curr_bb) = head; + BB_END (curr_bb) = insn; + add_missing_bbs (BB_HEAD (curr_bb), bb, curr_bb->prev_bb); } note = GET_CODE (head) == CODE_LABEL ? NEXT_INSN (head) : head; NOTE_BASIC_BLOCK (note) = curr_bb; @@ -337,7 +337,7 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head, break; } } - add_missing_bbs (last->next_bb->head, bb, last); + add_missing_bbs (BB_HEAD (last->next_bb), bb, last); return bb->prev_bb; } @@ -442,7 +442,7 @@ add_deps_for_risky_insns (rtx head, rtx tail) bb = bb->aux; if (!bb) break; - prev = bb->end; + prev = BB_END (bb); } } /* FALLTHRU */ @@ -585,15 +585,15 @@ schedule_ebbs (FILE *dump_file) /* Schedule every region in the subroutine. */ FOR_EACH_BB (bb) { - rtx head = bb->head; + rtx head = BB_HEAD (bb); rtx tail; for (;;) { edge e; - tail = bb->end; + tail = BB_END (bb); if (bb->next_bb == EXIT_BLOCK_PTR - || GET_CODE (bb->next_bb->head) == CODE_LABEL) + || GET_CODE (BB_HEAD (bb->next_bb)) == CODE_LABEL) break; for (e = bb->succ; e; e = e->succ_next) if ((e->flags & EDGE_FALLTHRU) != 0) diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 0b89e35ee3e..b8e474d0b44 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -155,7 +155,7 @@ static int *containing_rgn; void debug_regions (void); static void find_single_block_region (void); -static void find_rgns (struct edge_list *, dominance_info); +static void find_rgns (struct edge_list *); static int too_large (int, int *, int *); extern void debug_live (int, int); @@ -343,7 +343,7 @@ is_cfg_nonregular (void) the cfg not well structured. */ /* Check for labels referred to other thn by jumps. */ FOR_EACH_BB (b) - for (insn = b->head;; insn = NEXT_INSN (insn)) + for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn)) { code = GET_CODE (insn); if (GET_RTX_CLASS (code) == 'i' && code != JUMP_INSN) @@ -357,7 +357,7 @@ is_cfg_nonregular (void) return 1; } - if (insn == b->end) + if (insn == BB_END (b)) break; } @@ -558,8 +558,8 @@ static int too_large (int block, int *num_bbs, int *num_insns) { (*num_bbs)++; - (*num_insns) += (INSN_LUID (BLOCK_END (block)) - - INSN_LUID (BLOCK_HEAD (block))); + (*num_insns) += (INSN_LUID (BB_END (BASIC_BLOCK (block))) - + INSN_LUID (BB_HEAD (BASIC_BLOCK (block)))); if ((*num_bbs > MAX_RGN_BLOCKS) || (*num_insns > MAX_RGN_INSNS)) return 1; else @@ -613,7 +613,7 @@ too_large (int block, int *num_bbs, int *num_insns) of edge tables. That would simplify it somewhat. */ static void -find_rgns (struct edge_list *edge_list, dominance_info dom) +find_rgns (struct edge_list *edge_list) { int *max_hdr, *dfs_nr, *stack, *degree; char no_loops = 1; @@ -827,7 +827,7 @@ find_rgns (struct edge_list *edge_list, dominance_info dom) { /* Now verify that the block is dominated by the loop header. */ - if (!dominated_by_p (dom, jbb, bb)) + if (!dominated_by_p (CDI_DOMINATORS, jbb, bb)) break; } } @@ -852,8 +852,8 @@ find_rgns (struct edge_list *edge_list, dominance_info dom) /* Estimate # insns, and count # blocks in the region. */ num_bbs = 1; - num_insns = (INSN_LUID (bb->end) - - INSN_LUID (bb->head)); + num_insns = (INSN_LUID (BB_END (bb)) + - INSN_LUID (BB_HEAD (bb))); /* Find all loop latches (blocks with back edges to the loop header) or all the leaf blocks in the cfg has no loops. @@ -1839,28 +1839,28 @@ can_schedule_ready_p (rtx insn) /* Update source block boundaries. */ b1 = BLOCK_FOR_INSN (insn); - if (insn == b1->head && insn == b1->end) + if (insn == BB_HEAD (b1) && insn == BB_END (b1)) { /* We moved all the insns in the basic block. Emit a note after the last insn and update the begin/end boundaries to point to the note. */ rtx note = emit_note_after (NOTE_INSN_DELETED, insn); - b1->head = note; - b1->end = note; + BB_HEAD (b1) = note; + BB_END (b1) = note; } - else if (insn == b1->end) + else if (insn == BB_END (b1)) { /* We took insns from the end of the basic block, so update the end of block boundary so that it points to the first insn we did not move. */ - b1->end = PREV_INSN (insn); + BB_END (b1) = PREV_INSN (insn); } - else if (insn == b1->head) + else if (insn == BB_HEAD (b1)) { /* We took insns from the start of the basic block, so update the start of block boundary so that it points to the first insn we did not move. */ - b1->head = NEXT_INSN (insn); + BB_HEAD (b1) = NEXT_INSN (insn); } } else @@ -2036,7 +2036,7 @@ add_branch_dependences (rtx head, rtx tail) end since moving them results in worse register allocation. Uses remain at the end to ensure proper register allocation. - cc0 setters remaim at the end because they can't be moved away from + cc0 setters remain at the end because they can't be moved away from their cc0 user. Insns setting CLASS_LIKELY_SPILLED_P registers (usually return values) @@ -2516,10 +2516,10 @@ schedule_region (int rgn) sched_rgn_n_insns += sched_n_insns; /* Update target block boundaries. */ - if (head == BLOCK_HEAD (b)) - BLOCK_HEAD (b) = current_sched_info->head; - if (tail == BLOCK_END (b)) - BLOCK_END (b) = current_sched_info->tail; + if (head == BB_HEAD (BASIC_BLOCK (b))) + BB_HEAD (BASIC_BLOCK (b)) = current_sched_info->head; + if (tail == BB_END (BASIC_BLOCK (b))) + BB_END (BASIC_BLOCK (b)) = current_sched_info->tail; /* Clean up. */ if (current_nr_blocks > 1) @@ -2597,7 +2597,6 @@ init_regions (void) } else { - dominance_info dom; struct edge_list *edge_list; /* The scheduler runs after estimate_probabilities; therefore, we @@ -2607,7 +2606,7 @@ init_regions (void) edge_list = create_edge_list (); /* Compute the dominators and post dominators. */ - dom = calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); /* build_control_flow will return nonzero if it detects unreachable blocks or any other irregularity with the cfg which prevents @@ -2615,7 +2614,7 @@ init_regions (void) if (build_control_flow (edge_list) != 0) find_single_block_region (); else - find_rgns (edge_list, dom); + find_rgns (edge_list); if (sched_verbose >= 3) debug_regions (); @@ -2625,7 +2624,7 @@ init_regions (void) /* For now. This will move as more and more of haifa is converted to using the cfg code in flow.c. */ - free_dominance_info (dom); + free_dominance_info (CDI_DOMINATORS); } } diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index 55741d14c0b..9174c8bf2ff 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -80,7 +80,7 @@ insn_print_units (rtx insn) } /* MAX_VISUAL_LINES is the maximum number of lines in visualization table - of a basic block. If more lines are needed, table is splitted to two. + of a basic block. If more lines are needed, table is split to two. n_visual_lines is the number of lines printed so far for a block. visual_tbl contains the block visualization info. vis_no_unit holds insns in a cycle that are not mapped to any unit. */ diff --git a/gcc/sibcall.c b/gcc/sibcall.c index ec85cb23786..81509ee9b56 100644 --- a/gcc/sibcall.c +++ b/gcc/sibcall.c @@ -597,7 +597,7 @@ optimize_sibling_and_tail_recursive_calls (void) /* Walk forwards through the last normal block and see if it does nothing except fall into the exit block. */ - for (insn = EXIT_BLOCK_PTR->prev_bb->head; + for (insn = BB_HEAD (EXIT_BLOCK_PTR->prev_bb); insn; insn = NEXT_INSN (insn)) { @@ -685,7 +685,7 @@ optimize_sibling_and_tail_recursive_calls (void) && call_block->succ->dest != alternate_exit) /* If this call doesn't end the block, there are operations at the end of the block which we must execute after returning. */ - || ! call_ends_block_p (insn, call_block->end)) + || ! call_ends_block_p (insn, BB_END (call_block))) sibcall = 0, tailrecursion = 0; /* Select a set of insns to implement the call and emit them. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index ee75e3497ca..ffa87cd785f 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1031,6 +1031,15 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode, && GET_CODE (XEXP (XEXP (op, 0), 1)) == LABEL_REF) return XEXP (op, 0); + /* Check for a sign extension of a subreg of a promoted + variable, where the promotion is sign-extended, and the + target mode is the same as the variable's promotion. */ + if (GET_CODE (op) == SUBREG + && SUBREG_PROMOTED_VAR_P (op) + && ! SUBREG_PROMOTED_UNSIGNED_P (op) + && GET_MODE (XEXP (op, 0)) == mode) + return XEXP (op, 0); + #if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) if (! POINTERS_EXTEND_UNSIGNED && mode == Pmode && GET_MODE (op) == ptr_mode @@ -1043,8 +1052,17 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode, #endif break; -#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) case ZERO_EXTEND: + /* Check for a zero extension of a subreg of a promoted + variable, where the promotion is zero-extended, and the + target mode is the same as the variable's promotion. */ + if (GET_CODE (op) == SUBREG + && SUBREG_PROMOTED_VAR_P (op) + && SUBREG_PROMOTED_UNSIGNED_P (op) + && GET_MODE (XEXP (op, 0)) == mode) + return XEXP (op, 0); + +#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) if (POINTERS_EXTEND_UNSIGNED > 0 && mode == Pmode && GET_MODE (op) == ptr_mode && (CONSTANT_P (op) @@ -1053,8 +1071,8 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode, && REG_POINTER (SUBREG_REG (op)) && GET_MODE (SUBREG_REG (op)) == Pmode))) return convert_memory_address (Pmode, op); - break; #endif + break; default: break; @@ -2821,18 +2839,33 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode, if (GET_CODE (op0) == CONST_INT) return op0 != const0_rtx ? op1 : op2; - /* Convert a == b ? b : a to "a". */ - if (GET_CODE (op0) == NE && ! side_effects_p (op0) - && !HONOR_NANS (mode) - && rtx_equal_p (XEXP (op0, 0), op1) - && rtx_equal_p (XEXP (op0, 1), op2)) + /* Convert c ? a : a into "a". */ + if (rtx_equal_p (op1, op2) && ! side_effects_p (op0)) + return op1; + + /* Convert a != b ? a : b into "a". */ + if (GET_CODE (op0) == NE + && ! side_effects_p (op0) + && ! HONOR_NANS (mode) + && ! HONOR_SIGNED_ZEROS (mode) + && ((rtx_equal_p (XEXP (op0, 0), op1) + && rtx_equal_p (XEXP (op0, 1), op2)) + || (rtx_equal_p (XEXP (op0, 0), op2) + && rtx_equal_p (XEXP (op0, 1), op1)))) return op1; - else if (GET_CODE (op0) == EQ && ! side_effects_p (op0) - && !HONOR_NANS (mode) - && rtx_equal_p (XEXP (op0, 1), op1) - && rtx_equal_p (XEXP (op0, 0), op2)) + + /* Convert a == b ? a : b into "b". */ + if (GET_CODE (op0) == EQ + && ! side_effects_p (op0) + && ! HONOR_NANS (mode) + && ! HONOR_SIGNED_ZEROS (mode) + && ((rtx_equal_p (XEXP (op0, 0), op1) + && rtx_equal_p (XEXP (op0, 1), op2)) + || (rtx_equal_p (XEXP (op0, 0), op2) + && rtx_equal_p (XEXP (op0, 1), op1)))) return op2; - else if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0)) + + if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0)) { enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode ? GET_MODE (XEXP (op0, 1)) @@ -2874,6 +2907,7 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode, } } break; + case VEC_MERGE: if (GET_MODE (op0) != mode || GET_MODE (op1) != mode @@ -3286,7 +3320,7 @@ simplify_subreg (enum machine_mode outermode, rtx op, of real and imaginary part. */ if (GET_CODE (op) == CONCAT) { - int is_realpart = byte < GET_MODE_UNIT_SIZE (innermode); + int is_realpart = byte < (unsigned int) GET_MODE_UNIT_SIZE (innermode); rtx part = is_realpart ? XEXP (op, 0) : XEXP (op, 1); unsigned int final_offset; rtx res; diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c deleted file mode 100644 index 7ff305a9d3d..00000000000 --- a/gcc/ssa-ccp.c +++ /dev/null @@ -1,1206 +0,0 @@ -/* Conditional constant propagation pass for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - Original framework by Daniel Berlin - Fleshed out and major cleanups by Jeff Law - -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 2, 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 COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* Conditional constant propagation. - - References: - - Constant propagation with conditional branches, - Wegman and Zadeck, ACM TOPLAS 13(2):181-210. - - Building an Optimizing Compiler, - Robert Morgan, Butterworth-Heinemann, 1998, Section 8.9. - - Advanced Compiler Design and Implementation, - Steven Muchnick, Morgan Kaufmann, 1997, Section 12.6 - - The overall structure is as follows: - - 1. Run a simple SSA based DCE pass to remove any dead code. - 2. Run CCP to compute what registers are known constants - and what edges are not executable. Remove unexecutable - edges from the CFG and simplify PHI nodes. - 3. Replace registers with constants where possible. - 4. Remove unreachable blocks computed in step #2. - 5. Another simple SSA DCE pass to remove dead code exposed - by CCP. - - When we exit, we are still in SSA form. - - - Potential further enhancements: - - 1. Handle SUBREGs, STRICT_LOW_PART, etc in destinations more - gracefully. - - 2. Handle insns with multiple outputs more gracefully. - - 3. Handle CONST_DOUBLE and symbolic constants. - - 4. Fold expressions after performing constant substitutions. */ - - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "hard-reg-set.h" -#include "basic-block.h" -#include "ssa.h" -#include "insn-config.h" -#include "recog.h" -#include "output.h" -#include "errors.h" -#include "ggc.h" -#include "df.h" -#include "function.h" - -/* Possible lattice values. */ - -typedef enum -{ - UNDEFINED, - CONSTANT, - VARYING -} latticevalue; - -/* Main structure for CCP. - - Contains the lattice value and, if it's a constant, the constant - value. */ -typedef struct -{ - latticevalue lattice_val; - rtx const_value; -} value; - -/* Array of values indexed by register number. */ -static value *values; - -/* A bitmap to keep track of executable blocks in the CFG. */ -static sbitmap executable_blocks; - -/* A bitmap for all executable edges in the CFG. */ -static sbitmap executable_edges; - -/* Array of edges on the work list. */ -static edge *edge_info; - -/* We need an edge list to be able to get indexes easily. */ -static struct edge_list *edges; - -/* For building/following use-def and def-use chains. */ -static struct df *df_analyzer; - -/* Current edge we are operating on, from the worklist */ -static edge flow_edges; - -/* Bitmap of SSA edges which will need reexamination as their definition - has changed. */ -static sbitmap ssa_edges; - -/* Simple macros to simplify code */ -#define SSA_NAME(x) REGNO (SET_DEST (x)) -#define EIE(x,y) EDGE_INDEX (edges, x, y) - -static void visit_phi_node (rtx, basic_block); -static void visit_expression (rtx, basic_block); -static void defs_to_undefined (rtx); -static void defs_to_varying (rtx); -static void examine_flow_edges (void); -static int mark_references (rtx *, void *); -static void follow_def_use_chains (void); -static void optimize_unexecutable_edges (struct edge_list *, sbitmap); -static void ssa_ccp_substitute_constants (void); -static void ssa_ccp_df_delete_unreachable_insns (void); -static void ssa_fast_dce (struct df *); - -/* Loop through the PHI_NODE's parameters for BLOCK and compare their - lattice values to determine PHI_NODE's lattice value. */ -static void -visit_phi_node (rtx phi_node, basic_block block) -{ - unsigned int i; - rtx phi_node_expr = NULL; - unsigned int phi_node_name = SSA_NAME (PATTERN (phi_node)); - latticevalue phi_node_lattice_val = UNDEFINED; - rtx pat = PATTERN (phi_node); - rtvec phi_vec = XVEC (SET_SRC (pat), 0); - unsigned int num_elem = GET_NUM_ELEM (phi_vec); - - for (i = 0; i < num_elem; i += 2) - { - if (TEST_BIT (executable_edges, - EIE (BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, i + 1))), - block))) - { - unsigned int current_parm - = REGNO (RTVEC_ELT (phi_vec, i)); - - latticevalue current_parm_lattice_val - = values[current_parm].lattice_val; - - /* If any node is VARYING, then new value of PHI_NODE - is VARYING. */ - if (current_parm_lattice_val == VARYING) - { - phi_node_lattice_val = VARYING; - phi_node_expr = NULL; - break; - } - - /* If we have more than one distinct constant, then the new - value of PHI_NODE is VARYING. */ - if (current_parm_lattice_val == CONSTANT - && phi_node_lattice_val == CONSTANT - && values[current_parm].const_value != phi_node_expr) - { - phi_node_lattice_val = VARYING; - phi_node_expr = NULL; - break; - } - - /* If the current value of PHI_NODE is UNDEFINED and one - node in PHI_NODE is CONSTANT, then the new value of the - PHI is that CONSTANT. Note this can turn into VARYING - if we find another distinct constant later. */ - if (phi_node_lattice_val == UNDEFINED - && phi_node_expr == NULL - && current_parm_lattice_val == CONSTANT) - { - phi_node_expr = values[current_parm].const_value; - phi_node_lattice_val = CONSTANT; - continue; - } - } - } - - /* If the value of PHI_NODE changed, then we will need to - re-execute uses of the output of PHI_NODE. */ - if (phi_node_lattice_val != values[phi_node_name].lattice_val) - { - values[phi_node_name].lattice_val = phi_node_lattice_val; - values[phi_node_name].const_value = phi_node_expr; - SET_BIT (ssa_edges, phi_node_name); - } -} - -/* Sets all defs in an insn to UNDEFINED. */ -static void -defs_to_undefined (rtx insn) -{ - struct df_link *currdef; - for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; - currdef = currdef->next) - { - if (values[DF_REF_REGNO (currdef->ref)].lattice_val != UNDEFINED) - SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref)); - values[DF_REF_REGNO (currdef->ref)].lattice_val = UNDEFINED; - } -} - -/* Sets all defs in an insn to VARYING. */ -static void -defs_to_varying (rtx insn) -{ - struct df_link *currdef; - for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; - currdef = currdef->next) - { - if (values[DF_REF_REGNO (currdef->ref)].lattice_val != VARYING) - SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref)); - values[DF_REF_REGNO (currdef->ref)].lattice_val = VARYING; - } -} - -/* Go through the expression, call the appropriate evaluation routines - to attempt cprop */ -static void -visit_expression (rtx insn, basic_block block) -{ - rtx src, dest, set; - - - /* Ugh. CALL_INSNs may end a basic block and have multiple edges - leading out from them. - - Mark all the outgoing edges as executable, then fall into the - normal processing below. */ - if (GET_CODE (insn) == CALL_INSN && block->end == insn) - { - edge curredge; - - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - - set = single_set (insn); - if (! set) - { - defs_to_varying (insn); - return; - } - - src = SET_SRC (set); - dest = SET_DEST (set); - - /* We may want to refine this some day. */ - if (GET_CODE (dest) != REG && dest != pc_rtx) - { - defs_to_varying (insn); - return; - } - - /* Hard registers are not put in SSA form and thus we must consider - them varying. All the more reason to avoid hard registers in - RTL until as late as possible in the compilation. */ - if (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER) - { - defs_to_varying (insn); - return; - } - - /* If this is assigning DEST to a constant, record that fact. */ - if (GET_CODE (src) == CONST_INT && GET_CODE (insn) == INSN) - { - unsigned int resultreg = REGNO (dest); - - values[resultreg].lattice_val = CONSTANT; - values[resultreg].const_value = SET_SRC (PATTERN (insn)); - SET_BIT (ssa_edges, resultreg); - } - - /* If this is a copy operation, then we can copy the lattice values. */ - else if (GET_CODE (src) == REG && GET_CODE (dest) == REG) - { - unsigned int old_value = REGNO (src); - latticevalue old_lattice_value = values[old_value].lattice_val; - unsigned int new_value = REGNO (dest); - - /* Unless the lattice value is going to change, don't bother - adding the "new value" into the worklist. */ - if (values[new_value].lattice_val != old_lattice_value - || values[new_value].const_value != values[old_value].const_value) - SET_BIT (ssa_edges, new_value); - - /* Copy the old lattice node info into the new value lattice node. */ - values[new_value].lattice_val = old_lattice_value; - values[new_value].const_value = values[old_value].const_value; - } - - /* Handle jumps. */ - else if (GET_CODE (insn) == JUMP_INSN) - { - rtx x = pc_set (insn); - if (GET_CODE (src) != IF_THEN_ELSE) - { - edge curredge; - - /* This is a computed jump, table jump, or an unconditional - jump. For all these cases we want to mark all successor - blocks as executable if they have not already been - marked. - - One day we may try do better with switch tables and - other computed jumps. */ - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - else - { - edge curredge; - enum rtx_code comparison_code; - rtx comparison_src0; - rtx comparison_src1; - - comparison_code = GET_CODE (XEXP (src, 0)); - comparison_src0 = XEXP (XEXP (src, 0), 0); - comparison_src1 = XEXP (XEXP (src, 0), 1); - - /* If either operand is undefined, then there is nothing to - do right now. If/when operands are later defined we will - revaluate the condition and take the appropriate action. */ - if ((GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == UNDEFINED) - || (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == UNDEFINED)) - return; - - /* If either operand is varying, then we must consider all - paths as executable. */ - if ((GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == VARYING) - || (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == VARYING)) - { - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - return; - } - - /* Try to simplify the comparison. */ - if (GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == CONSTANT) - comparison_src0 = values[REGNO (comparison_src0)].const_value; - - if (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == CONSTANT) - comparison_src1 = values[REGNO (comparison_src1)].const_value; - - x = simplify_ternary_operation (IF_THEN_ELSE, - VOIDmode, - GET_MODE (XEXP (src, 0)), - gen_rtx (comparison_code, - GET_MODE (XEXP (src, 0)), - comparison_src0, - comparison_src1), - XEXP (src, 1), - XEXP (src, 2)); - - /* Walk through all the outgoing edges from this block and see - which (if any) we should mark as executable. */ - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - /* If we were unable to simplify the expression at this - point, it's highly unlikely we'll be able to simplify - it later. So consider all edges as executable if the - expression did not simplify. - - If the expression simplified to (pc), then we know we - will take the fall-thru edge, so mark it. Similarly, - if the expression simplified to (label_ref ...), then - we know the branch will be taken and we mark that - edge as taken. */ - if (!x - || (x == pc_rtx - && (curredge->flags & EDGE_FALLTHRU)) - || (GET_CODE (x) == LABEL_REF - && ! (curredge->flags & EDGE_FALLTHRU))) - { - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - } - } - else if (!PHI_NODE_P (insn)) - { - rtx simplified = NULL; - - /* We've got some kind of INSN. If it's simple, try to evaluate - it and record the results. - - We already know this insn is a single_set and that it sets - a pseudo register. So we just need to extract the source - arguments, simplify them to constants if possible, then - simplify the expression as a whole if possible. */ - switch (GET_RTX_CLASS (GET_CODE (src))) - { - case '<': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - enum machine_mode mode; - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Determine the mode for the operation before we simplify - our arguments to constants. */ - mode = GET_MODE (src0); - if (mode == VOIDmode) - mode = GET_MODE (src1); - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_relational_operation (GET_CODE (src), - mode, src0, src1); - break; - - } - - case '1': - { - rtx src0 = XEXP (src, 0); - enum machine_mode mode0 = GET_MODE (src0); - - /* If the operand is undefined, then the result is undefined. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_unary_operation (GET_CODE (src), - GET_MODE (src), - src0, - mode0); - break; - } - - case '2': - case 'c': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_binary_operation (GET_CODE (src), - GET_MODE (src), - src0, src1); - break; - } - - case '3': - case 'b': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - rtx src2 = XEXP (src, 2); - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED) - || (GET_CODE (src2) == REG - && values[REGNO (src2)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - if (GET_CODE (src2) == REG - && values[REGNO (src2)].lattice_val == CONSTANT) - src2 = values[REGNO (src2)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_ternary_operation (GET_CODE (src), - GET_MODE (src), - GET_MODE (src), - src0, src1, src2); - break; - } - - default: - defs_to_varying (insn); - } - - if (simplified && GET_CODE (simplified) == CONST_INT) - { - if (values[REGNO (dest)].lattice_val != CONSTANT - || values[REGNO (dest)].const_value != simplified) - SET_BIT (ssa_edges, REGNO (dest)); - - values[REGNO (dest)].lattice_val = CONSTANT; - values[REGNO (dest)].const_value = simplified; - } - else - defs_to_varying (insn); - } -} - -/* Iterate over the FLOW_EDGES work list. Simulate the target block - for each edge. */ -static void -examine_flow_edges (void) -{ - while (flow_edges != NULL) - { - basic_block succ_block; - rtx curr_phi_node; - - /* Pull the next block to simulate off the worklist. */ - succ_block = flow_edges->dest; - flow_edges = edge_info[EIE (flow_edges->src, flow_edges->dest)]; - - /* There is nothing to do for the exit block. */ - if (succ_block == EXIT_BLOCK_PTR) - continue; - - /* Always simulate PHI nodes, even if we have simulated this block - before. Note that all PHI nodes are consecutive within a block. */ - for (curr_phi_node = first_insn_after_basic_block_note (succ_block); - PHI_NODE_P (curr_phi_node); - curr_phi_node = NEXT_INSN (curr_phi_node)) - visit_phi_node (curr_phi_node, succ_block); - - /* If this is the first time we've simulated this block, then we - must simulate each of its insns. */ - if (!TEST_BIT (executable_blocks, succ_block->index)) - { - rtx currinsn; - edge succ_edge = succ_block->succ; - - /* Note that we have simulated this block. */ - SET_BIT (executable_blocks, succ_block->index); - - /* Simulate each insn within the block. */ - currinsn = succ_block->head; - while (currinsn != succ_block->end) - { - if (INSN_P (currinsn)) - visit_expression (currinsn, succ_block); - - currinsn = NEXT_INSN (currinsn); - } - - /* Don't forget the last insn in the block. */ - if (INSN_P (currinsn)) - visit_expression (currinsn, succ_block); - - /* If we haven't looked at the next block, and it has a - single successor, add it onto the worklist. This is because - if we only have one successor, we know it gets executed, - so we don't have to wait for cprop to tell us. */ - if (succ_edge != NULL - && succ_edge->succ_next == NULL - && !TEST_BIT (executable_edges, - EIE (succ_edge->src, succ_edge->dest))) - { - SET_BIT (executable_edges, - EIE (succ_edge->src, succ_edge->dest)); - edge_info[EIE (succ_edge->src, succ_edge->dest)] = flow_edges; - flow_edges = succ_edge; - } - } - } -} - -/* Follow the def-use chains for each definition on the worklist and - simulate the uses of the definition. */ - -static void -follow_def_use_chains (void) -{ - /* Iterate over all the entries on the SSA_EDGES worklist. */ - while (sbitmap_first_set_bit (ssa_edges) >= 0) - { - int member; - struct df_link *curruse; - - /* Pick an entry off the worklist (it does not matter which - entry we pick). */ - member = sbitmap_first_set_bit (ssa_edges); - RESET_BIT (ssa_edges, member); - - /* Iterate through all the uses of this entry. */ - for (curruse = df_analyzer->regs[member].uses; curruse; - curruse = curruse->next) - { - rtx useinsn; - - useinsn = DF_REF_INSN (curruse->ref); - if (PHI_NODE_P (useinsn)) - { - if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) - visit_phi_node (useinsn, BLOCK_FOR_INSN (useinsn)); - } - else - { - if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) - visit_expression (useinsn, BLOCK_FOR_INSN (useinsn)); - } - } - } -} - -/* Examine each edge to see if we were able to prove any were - not executable. - - If an edge is not executable, then we can remove its alternative - in PHI nodes as the destination of the edge, we can simplify the - conditional branch at the source of the edge, and we can remove - the edge from the CFG. Note we do not delete unreachable blocks - yet as the DF analyzer can not deal with that yet. */ -static void -optimize_unexecutable_edges (struct edge_list *edges, - sbitmap executable_edges) -{ - int i; - basic_block bb; - - for (i = 0; i < NUM_EDGES (edges); i++) - { - if (!TEST_BIT (executable_edges, i)) - { - edge edge = INDEX_EDGE (edges, i); - - if (edge->flags & EDGE_ABNORMAL) - continue; - - /* We found an edge that is not executable. First simplify - the PHI nodes in the target block. */ - if (edge->dest != EXIT_BLOCK_PTR) - { - rtx insn = first_insn_after_basic_block_note (edge->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), edge->src); - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Removing alternative for bb %d of phi %d\n", - edge->src->index, SSA_NAME (PATTERN (insn))); - insn = NEXT_INSN (insn); - } - } - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Removing unexecutable edge from %d to %d\n", - edge->src->index, edge->dest->index); - /* Since the edge was not executable, remove it from the CFG. */ - remove_edge (edge); - } - } - - /* We have removed all the unexecutable edges from the CFG. Fix up - the conditional jumps at the end of any affected block. - - We have three cases to deal with: - - a. Both outgoing edges are not executable. This happens if the - source block is not reachable. We will deal with this by - deleting all the insns in the block later. - - b. The fall-thru edge is not executable. In this case we - change the conditional jump into an unconditional jump and - add a BARRIER after the unconditional jump. Note that since - we are working on generic RTL we can change the jump in-place - instead of dealing with the headache of reemitting the jump. - - c. The branch taken edge is not executable. In this case - we turn the jump into (set (pc) (pc)) which is a nop-jump - and we will remove the unrecognizable insn later. - - In cases B & C we are removing uses of registers, so make sure - to note those changes for the DF analyzer. */ - - FOR_EACH_BB (bb) - { - rtx insn = bb->end; - edge edge = bb->succ; - - /* If we have no predecessors, then this block is unreachable and - will be cleaned up when we remove unreachable blocks. */ - if (bb->pred == NULL || GET_CODE (insn) != JUMP_INSN) - continue; - - /* If this block ends in a conditional jump, but only has one - successor, then the jump needs adjustment. */ - if (condjump_p (insn) && ! simplejump_p (insn) - && bb->succ && bb->succ->succ_next == NULL) - { - /* If the fallthru edge is the executable edge, then turn - this jump into a nop jump, otherwise make it an unconditional - jump to its target. */ - if (edge->flags & EDGE_FALLTHRU) - { - PUT_CODE (insn, NOTE); - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - } - else - { - SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (Pmode, - JUMP_LABEL (insn)); - emit_barrier_after (insn); - INSN_CODE (insn) = -1; - } - - /* Inform the DF analyzer that this insn changed. */ - df_insn_modify (df_analyzer, BLOCK_FOR_INSN (insn), insn); - } - } -} - -/* Perform substitution of known values for pseudo registers. - - ??? Note we do not do simplifications or constant folding here, it - is unlikely that any significant simplifications can be done here - anyway. Consider that if the simplification would result in an - expression that produces a constant value that the value would - have been discovered and recorded already. - - We perform two transformations. First, we initialize pseudos to their - known constant values at their definition point. Second, we try to - replace uses with the known constant value. */ - -static void -ssa_ccp_substitute_constants (void) -{ - unsigned int i; - - for (i = FIRST_PSEUDO_REGISTER; i < VARRAY_SIZE (ssa_definition); i++) - { - if (values[i].lattice_val == CONSTANT) - { - rtx def = VARRAY_RTX (ssa_definition, i); - rtx set = single_set (def); - struct df_link *curruse; - - if (! set) - continue; - - /* Do not try to simplify PHI nodes down to a constant load. - That will be done later as we translate out of SSA. Also, - doing that here could violate the rule that all PHI nodes - are consecutive at the start of the basic block. - - Don't do anything to nodes that were already sets to - constants. */ - if (! PHI_NODE_P (def) - && ! ((GET_CODE (def) == INSN - && GET_CODE (SET_SRC (set)) == CONST_INT))) - { - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Register %d is now set to a constant\n", - SSA_NAME (PATTERN (def))); - SET_SRC (set) = values[i].const_value; - INSN_CODE (def) = -1; - df_insn_modify (df_analyzer, BLOCK_FOR_INSN (def), def); - } - - /* Iterate through all the uses of this entry and try replacements - there too. Note it is not particularly profitable to try - and fold/simplify expressions here as most of the common - cases were handled above. */ - for (curruse = df_analyzer->regs[i].uses; - curruse; - curruse = curruse->next) - { - rtx useinsn; - - useinsn = DF_REF_INSN (curruse->ref); - - if (!INSN_DELETED_P (useinsn) - && ! (GET_CODE (useinsn) == NOTE - && NOTE_LINE_NUMBER (useinsn) == NOTE_INSN_DELETED) - && (GET_CODE (useinsn) == INSN - || GET_CODE (useinsn) == JUMP_INSN)) - { - - if (validate_replace_src (regno_reg_rtx [i], - values[i].const_value, - useinsn)) - { - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Register %d in insn %d replaced with constant\n", - i, INSN_UID (useinsn)); - INSN_CODE (useinsn) = -1; - df_insn_modify (df_analyzer, - BLOCK_FOR_INSN (useinsn), - useinsn); - } - - } - } - } - } -} - -/* Now find all unreachable basic blocks. All the insns in those - blocks are unreachable, so delete them and mark any necessary - updates for the DF analyzer. */ - -static void -ssa_ccp_df_delete_unreachable_insns (void) -{ - basic_block b; - - /* Use the CFG to find all the reachable blocks. */ - find_unreachable_blocks (); - - /* Now we know what blocks are not reachable. Mark all the insns - in those blocks as deleted for the DF analyzer. We'll let the - normal flow code actually remove the unreachable blocks. */ - FOR_EACH_BB_REVERSE (b) - { - if (!(b->flags & BB_REACHABLE)) - { - rtx start = b->head; - rtx end = b->end; - rtx tmp; - - /* Include any jump table following the basic block. */ - end = b->end; - if (tablejump_p (end, NULL, &tmp)) - end = tmp; - - while (1) - { - rtx next = NEXT_INSN (start); - - if (GET_CODE (start) == INSN - || GET_CODE (start) == CALL_INSN - || GET_CODE (start) == JUMP_INSN) - df_insn_delete (df_analyzer, BLOCK_FOR_INSN (start), start); - - if (start == end) - break; - start = next; - } - } - } -} - - -/* Main entry point for SSA Conditional Constant Propagation. - - Long term it should accept as input the specific flow graph to - operate on so that it can be called for sub-graphs. */ - -void -ssa_const_prop (void) -{ - unsigned int i; - edge curredge; - - /* We need alias analysis (for what?) */ - init_alias_analysis (); - - df_analyzer = df_init (); - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); - - /* Perform a quick and dirty dead code elimination pass. This is not - as aggressive as it could be, but it's good enough to clean up a - lot of unwanted junk and it is fast. */ - ssa_fast_dce (df_analyzer); - - /* Build an edge list from the CFG. */ - edges = create_edge_list (); - - /* Initialize the values array with everything as undefined. */ - values = xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value)); - for (i = 0; i < VARRAY_SIZE (ssa_definition); i++) - { - if (i < FIRST_PSEUDO_REGISTER) - values[i].lattice_val = VARYING; - else - values[i].lattice_val = UNDEFINED; - values[i].const_value = NULL; - } - - ssa_edges = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); - sbitmap_zero (ssa_edges); - - executable_blocks = sbitmap_alloc (last_basic_block); - sbitmap_zero (executable_blocks); - - executable_edges = sbitmap_alloc (NUM_EDGES (edges)); - sbitmap_zero (executable_edges); - - edge_info = xmalloc (NUM_EDGES (edges) * sizeof (edge)); - flow_edges = ENTRY_BLOCK_PTR->succ; - - /* Add the successors of the entry block to the edge worklist. That - is enough of a seed to get SSA-CCP started. */ - for (curredge = ENTRY_BLOCK_PTR->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - SET_BIT (executable_edges, index); - edge_info[index] = curredge->succ_next; - } - - /* Iterate until until the worklists are empty. */ - do - { - examine_flow_edges (); - follow_def_use_chains (); - } - while (flow_edges != NULL); - - /* Now perform substitutions based on the known constant values. */ - ssa_ccp_substitute_constants (); - - /* Remove unexecutable edges from the CFG and make appropriate - adjustments to PHI nodes. */ - optimize_unexecutable_edges (edges, executable_edges); - - /* Now remove all unreachable insns and update the DF information. - as appropriate. */ - ssa_ccp_df_delete_unreachable_insns (); - -#if 0 - /* The DF analyzer expects the number of blocks to remain constant, - so we can't remove unreachable blocks. - - Code the DF analyzer calls expects there to be no unreachable - blocks in the CFG. So we can't leave unreachable blocks in the - CFG. - - So, there is no way to do an incremental update of the DF data - at this point. */ - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); -#endif - - /* Clean up any dead code exposed by SSA-CCP, do this after updating - the dataflow information! */ - ssa_fast_dce (df_analyzer); - - free (values); - values = NULL; - - free (edge_info); - edge_info = NULL; - - sbitmap_free (executable_blocks); - executable_blocks = NULL; - - sbitmap_free (ssa_edges); - ssa_edges = NULL; - - free_edge_list (edges); - edges = NULL; - - sbitmap_free (executable_edges); - executable_edges = NULL; - - df_finish (df_analyzer); - end_alias_analysis (); -} - -static int -mark_references (rtx *current_rtx, void *data) -{ - rtx x = *current_rtx; - sbitmap worklist = (sbitmap) data; - - if (x == NULL_RTX) - return 0; - - if (GET_CODE (x) == SET) - { - rtx dest = SET_DEST (x); - - if (GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == SUBREG - || GET_CODE (dest) == SIGN_EXTRACT - || GET_CODE (dest) == ZERO_EXTRACT) - { - rtx reg; - - reg = dest; - - while (GET_CODE (reg) == STRICT_LOW_PART - || GET_CODE (reg) == SUBREG - || GET_CODE (reg) == SIGN_EXTRACT - || GET_CODE (reg) == ZERO_EXTRACT) - reg = XEXP (reg, 0); - - if (GET_CODE (reg) == REG) - SET_BIT (worklist, REGNO (reg)); - } - - if (GET_CODE (dest) == REG) - { - for_each_rtx (&SET_SRC (x), mark_references, data); - return -1; - } - - return 0; - } - else if (GET_CODE (x) == REG) - { - SET_BIT (worklist, REGNO (x)); - return -1; - } - else if (GET_CODE (x) == CLOBBER) - return -1; - else - return 0; -} - -static void -ssa_fast_dce (struct df *df) -{ - sbitmap worklist = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); - sbitmap_ones (worklist); - - /* Iterate on the worklist until there's no definitions left to - examine. */ - while (sbitmap_first_set_bit (worklist) >= 0) - { - struct df_link *curruse; - int reg, found_use; - - /* Remove an item from the worklist. */ - reg = sbitmap_first_set_bit (worklist); - RESET_BIT (worklist, reg); - - /* We never consider deleting assignments to hard regs or things - which do not have SSA definitions, or things we have already - deleted, or things with unusual side effects. */ - if (reg < FIRST_PSEUDO_REGISTER - || ! VARRAY_RTX (ssa_definition, reg) - || INSN_DELETED_P (VARRAY_RTX (ssa_definition, reg)) - || (GET_CODE (VARRAY_RTX (ssa_definition, reg)) == NOTE - && (NOTE_LINE_NUMBER (VARRAY_RTX (ssa_definition, reg)) - == NOTE_INSN_DELETED)) - || side_effects_p (PATTERN (VARRAY_RTX (ssa_definition, reg)))) - continue; - - /* Iterate over the uses of this register. If we can not find - any uses that have not been deleted, then the definition of - this register is dead. */ - found_use = 0; - for (curruse = df->regs[reg].uses; curruse; curruse = curruse->next) - { - if (curruse->ref - && DF_REF_INSN (curruse->ref) - && ! INSN_DELETED_P (DF_REF_INSN (curruse->ref)) - && ! (GET_CODE (DF_REF_INSN (curruse->ref)) == NOTE - && (NOTE_LINE_NUMBER (DF_REF_INSN (curruse->ref)) - == NOTE_INSN_DELETED)) - && DF_REF_INSN (curruse->ref) != VARRAY_RTX (ssa_definition, reg)) - { - found_use = 1; - break; - } - } - - /* If we did not find a use of this register, then the definition - of this register is dead. */ - - if (! found_use) - { - rtx def = VARRAY_RTX (ssa_definition, reg); - - /* Add all registers referenced by INSN to the work - list. */ - for_each_rtx (&PATTERN (def), mark_references, worklist); - - /* Inform the analyzer that this insn is going to be - deleted. */ - df_insn_delete (df, BLOCK_FOR_INSN (def), def); - - VARRAY_RTX (ssa_definition, reg) = NULL; - } - } - - sbitmap_free (worklist); - - /* Update the use-def chains in the df_analyzer as needed. */ - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); -} diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c deleted file mode 100644 index c308c7793b6..00000000000 --- a/gcc/ssa-dce.c +++ /dev/null @@ -1,713 +0,0 @@ -/* Dead-code elimination pass for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - Written by Jeffrey D. Oldham . - -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 2, 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 COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* Dead-code elimination is the removal of instructions which have no - impact on the program's output. "Dead instructions" have no impact - on the program's output, while "necessary instructions" may have - impact on the output. - - The algorithm consists of three phases: - 1) marking as necessary all instructions known to be necessary, - e.g., writing a value to memory, - 2) propagating necessary instructions, e.g., the instructions - giving values to operands in necessary instructions, and - 3) removing dead instructions (except replacing dead conditionals - with unconditional jumps). - - Side Effects: - The last step can require adding labels, deleting insns, and - modifying basic block structures. Some conditional jumps may be - converted to unconditional jumps so the control-flow graph may be - out-of-date. - - Edges from some infinite loops to the exit block can be added to - the control-flow graph, but will be removed after this pass is - complete. - - It Does Not Perform: - We decided to not simultaneously perform jump optimization and dead - loop removal during dead-code elimination. Thus, all jump - instructions originally present remain after dead-code elimination - but 1) unnecessary conditional jump instructions are changed to - unconditional jump instructions and 2) all unconditional jump - instructions remain. - - Assumptions: - 1) SSA has been performed. - 2) The basic block and control-flow graph structures are accurate. - 3) The flow graph permits constructing an edge_list. - 4) note rtxes should be saved. - - Unfinished: - When replacing unnecessary conditional jumps with unconditional - jumps, the control-flow graph is not updated. It should be. - - References: - Building an Optimizing Compiler - Robert Morgan - Butterworth-Heinemann, 1998 - Section 8.9 -*/ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "hard-reg-set.h" -#include "basic-block.h" -#include "ssa.h" -#include "insn-config.h" -#include "recog.h" -#include "output.h" - - -/* A map from blocks to the edges on which they are control dependent. */ -typedef struct { - /* A dynamically allocated array. The Nth element corresponds to - the block with index N + 2. The Ith bit in the bitmap is set if - that block is dependent on the Ith edge. */ - bitmap *data; - /* The number of elements in the array. */ - int length; -} control_dependent_block_to_edge_map_s, *control_dependent_block_to_edge_map; - -/* Local function prototypes. */ -static control_dependent_block_to_edge_map control_dependent_block_to_edge_map_create - (size_t num_basic_blocks); -static void set_control_dependent_block_to_edge_map_bit - (control_dependent_block_to_edge_map c, basic_block bb, int edge_index); -static void control_dependent_block_to_edge_map_free - (control_dependent_block_to_edge_map c); -static void find_all_control_dependences - (struct edge_list *el, dominance_info pdom, - control_dependent_block_to_edge_map cdbte); -static void find_control_dependence - (struct edge_list *el, int edge_index, dominance_info pdom, - control_dependent_block_to_edge_map cdbte); -static basic_block find_pdom (dominance_info pdom, basic_block block); -static int inherently_necessary_register_1 (rtx *current_rtx, void *data); -static int inherently_necessary_register (rtx current_rtx); -static int find_inherently_necessary (rtx current_rtx); -static int propagate_necessity_through_operand (rtx *current_rtx, void *data); -static void note_inherently_necessary_set (rtx, rtx, void *); - -/* Unnecessary insns are indicated using insns' in_struct bit. */ - -/* Indicate INSN is dead-code; returns nothing. */ -#define KILL_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 1 -/* Indicate INSN is necessary, i.e., not dead-code; returns nothing. */ -#define RESURRECT_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 0 -/* Return nonzero if INSN is unnecessary. */ -#define UNNECESSARY_P(INSN) INSN_DEAD_CODE_P(INSN) -static void mark_all_insn_unnecessary (void); -/* Execute CODE with free variable INSN for all unnecessary insns in - an unspecified order, producing no output. */ -#define EXECUTE_IF_UNNECESSARY(INSN, CODE) \ -{ \ - rtx INSN; \ - \ - for (INSN = get_insns (); INSN != NULL_RTX; INSN = NEXT_INSN (INSN)) \ - if (INSN_P (insn) && INSN_DEAD_CODE_P (INSN)) \ - { \ - CODE; \ - } \ -} - -/* Find the label beginning block BB. */ -static rtx find_block_label (basic_block bb); -/* Remove INSN, updating its basic block structure. */ -static void delete_insn_bb (rtx insn); - -/* Recording which blocks are control dependent on which edges. We - expect each block to be control dependent on very few edges so we - use a bitmap for each block recording its edges. An array holds - the bitmap. Its position 0 entry holds the bitmap for block - INVALID_BLOCK+1 so that all blocks, including the entry and exit - blocks can participate in the data structure. */ - -/* Create a control_dependent_block_to_edge_map, given the number - NUM_BASIC_BLOCKS of non-entry, non-exit basic blocks, e.g., - n_basic_blocks. This memory must be released using - control_dependent_block_to_edge_map_free (). */ - -static control_dependent_block_to_edge_map -control_dependent_block_to_edge_map_create (size_t num_basic_blocks) -{ - int i; - control_dependent_block_to_edge_map c - = xmalloc (sizeof (control_dependent_block_to_edge_map_s)); - c->length = num_basic_blocks - (INVALID_BLOCK+1); - c->data = xmalloc ((size_t) c->length*sizeof (bitmap)); - for (i = 0; i < c->length; ++i) - c->data[i] = BITMAP_XMALLOC (); - - return c; -} - -/* Indicate block BB is control dependent on an edge with index - EDGE_INDEX in the mapping C of blocks to edges on which they are - control-dependent. */ - -static void -set_control_dependent_block_to_edge_map_bit (control_dependent_block_to_edge_map c, - basic_block bb, int edge_index) -{ - if (bb->index - (INVALID_BLOCK+1) >= c->length) - abort (); - - bitmap_set_bit (c->data[bb->index - (INVALID_BLOCK+1)], - edge_index); -} - -/* Execute CODE for each edge (given number EDGE_NUMBER within the - CODE) for which the block containing INSN is control dependent, - returning no output. CDBTE is the mapping of blocks to edges on - which they are control-dependent. */ - -#define EXECUTE_IF_CONTROL_DEPENDENT(CDBTE, INSN, EDGE_NUMBER, CODE) \ - EXECUTE_IF_SET_IN_BITMAP \ - (CDBTE->data[BLOCK_NUM (INSN) - (INVALID_BLOCK+1)], 0, \ - EDGE_NUMBER, CODE) - -/* Destroy a control_dependent_block_to_edge_map C. */ - -static void -control_dependent_block_to_edge_map_free (control_dependent_block_to_edge_map c) -{ - int i; - for (i = 0; i < c->length; ++i) - BITMAP_XFREE (c->data[i]); - free (c); -} - -/* Record all blocks' control dependences on all edges in the edge - list EL, ala Morgan, Section 3.6. The mapping PDOM of blocks to - their postdominators are used, and results are stored in CDBTE, - which should be empty. */ - -static void -find_all_control_dependences (struct edge_list *el, dominance_info pdom, - control_dependent_block_to_edge_map cdbte) -{ - int i; - - for (i = 0; i < NUM_EDGES (el); ++i) - find_control_dependence (el, i, pdom, cdbte); -} - -/* Determine all blocks' control dependences on the given edge with - edge_list EL index EDGE_INDEX, ala Morgan, Section 3.6. The - mapping PDOM of blocks to their postdominators are used, and - results are stored in CDBTE, which is assumed to be initialized - with zeros in each (block b', edge) position. */ - -static void -find_control_dependence (struct edge_list *el, int edge_index, - dominance_info pdom, - control_dependent_block_to_edge_map cdbte) -{ - basic_block current_block; - basic_block ending_block; - - if (INDEX_EDGE_PRED_BB (el, edge_index) == EXIT_BLOCK_PTR) - abort (); - ending_block = - (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR) - ? ENTRY_BLOCK_PTR->next_bb - : find_pdom (pdom, INDEX_EDGE_PRED_BB (el, edge_index)); - - for (current_block = INDEX_EDGE_SUCC_BB (el, edge_index); - current_block != ending_block && current_block != EXIT_BLOCK_PTR; - current_block = find_pdom (pdom, current_block)) - { - set_control_dependent_block_to_edge_map_bit (cdbte, - current_block, - edge_index); - } -} - -/* Find the immediate postdominator PDOM of the specified basic block - BLOCK. This function is necessary because some blocks have - negative numbers. */ - -static basic_block -find_pdom (dominance_info pdom, basic_block block) -{ - if (!block) - abort (); - if (block->index == INVALID_BLOCK) - abort (); - - if (block == ENTRY_BLOCK_PTR) - return ENTRY_BLOCK_PTR->next_bb; - else if (block == EXIT_BLOCK_PTR) - return EXIT_BLOCK_PTR; - else - { - basic_block bb = get_immediate_dominator (pdom, block); - if (!bb) - return EXIT_BLOCK_PTR; - return bb; - } -} - -/* Determine if the given CURRENT_RTX uses a hard register not - converted to SSA. Returns nonzero only if it uses such a hard - register. DATA is not used. - - The program counter (PC) is not considered inherently necessary - since code should be position-independent and thus not depend on - particular PC values. */ - -static int -inherently_necessary_register_1 (rtx *current_rtx, - void *data ATTRIBUTE_UNUSED) -{ - rtx x = *current_rtx; - - if (x == NULL_RTX) - return 0; - switch (GET_CODE (x)) - { - case CLOBBER: - /* Do not traverse the rest of the clobber. */ - return -1; - break; - case PC: - return 0; - break; - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)) || x == pc_rtx) - return 0; - else - return !0; - break; - default: - return 0; - break; - } -} - -/* Return nonzero if the insn CURRENT_RTX is inherently necessary. */ - -static int -inherently_necessary_register (rtx current_rtx) -{ - return for_each_rtx (¤t_rtx, - &inherently_necessary_register_1, NULL); -} - - -/* Called via note_stores for each store in an insn. Note whether - or not a particular store is inherently necessary. Store a - nonzero value in inherently_necessary_p if such a store is found. */ - -static void -note_inherently_necessary_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data) -{ - int *inherently_necessary_set_p = (int *) data; - - while (GET_CODE (dest) == SUBREG - || GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == ZERO_EXTRACT - || GET_CODE (dest) == SIGN_EXTRACT) - dest = XEXP (dest, 0); - - if (GET_CODE (dest) == MEM - || GET_CODE (dest) == UNSPEC - || GET_CODE (dest) == UNSPEC_VOLATILE) - *inherently_necessary_set_p = 1; -} - -/* Mark X as inherently necessary if appropriate. For example, - function calls and storing values into memory are inherently - necessary. This function is to be used with for_each_rtx (). - Return nonzero iff inherently necessary. */ - -static int -find_inherently_necessary (rtx x) -{ - if (x == NULL_RTX) - return 0; - else if (inherently_necessary_register (x)) - return !0; - else - switch (GET_CODE (x)) - { - case CALL_INSN: - case BARRIER: - case PREFETCH: - return !0; - case CODE_LABEL: - case NOTE: - return 0; - case JUMP_INSN: - return JUMP_TABLE_DATA_P (x) || computed_jump_p (x) != 0; - case INSN: - { - int inherently_necessary_set = 0; - note_stores (PATTERN (x), - note_inherently_necessary_set, - &inherently_necessary_set); - - /* If we found an inherently necessary set or an asm - instruction, then we consider this insn inherently - necessary. */ - return (inherently_necessary_set - || GET_CODE (PATTERN (x)) == ASM_INPUT - || asm_noperands (PATTERN (x)) >= 0); - } - default: - /* Found an impossible insn type. */ - abort (); - break; - } -} - -/* Propagate necessity through REG and SUBREG operands of CURRENT_RTX. - This function is called with for_each_rtx () on necessary - instructions. The DATA must be a varray of unprocessed - instructions. */ - -static int -propagate_necessity_through_operand (rtx *current_rtx, void *data) -{ - rtx x = *current_rtx; - varray_type *unprocessed_instructions = (varray_type *) data; - - if (x == NULL_RTX) - return 0; - switch ( GET_CODE (x)) - { - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x))) - { - rtx insn = VARRAY_RTX (ssa_definition, REGNO (x)); - if (insn != NULL_RTX && UNNECESSARY_P (insn)) - { - RESURRECT_INSN (insn); - VARRAY_PUSH_RTX (*unprocessed_instructions, insn); - } - } - return 0; - - default: - return 0; - } -} - -/* Indicate all insns initially assumed to be unnecessary. */ - -static void -mark_all_insn_unnecessary (void) -{ - rtx insn; - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) { - if (INSN_P (insn)) - KILL_INSN (insn); - } - -} - -/* Find the label beginning block BB, adding one if necessary. */ - -static rtx -find_block_label (basic_block bb) -{ - rtx insn = bb->head; - if (LABEL_P (insn)) - return insn; - else - { - rtx new_label = emit_label_before (gen_label_rtx (), insn); - if (insn == bb->head) - bb->head = new_label; - return new_label; - } -} - -/* Remove INSN, updating its basic block structure. */ - -static void -delete_insn_bb (rtx insn) -{ - if (!insn) - abort (); - - /* Do not actually delete anything that is not an INSN. - - We can get here because we only consider INSNs as - potentially necessary. We leave it to later passes - to remove unnecessary notes, unused labels, etc. */ - if (! INSN_P (insn)) - return; - - delete_insn (insn); -} - -/* Perform the dead-code elimination. */ - -void -ssa_eliminate_dead_code (void) -{ - rtx insn; - basic_block bb; - /* Necessary instructions with operands to explore. */ - varray_type unprocessed_instructions; - /* Map element (b,e) is nonzero if the block is control dependent on - edge. "cdbte" abbreviates control dependent block to edge. */ - control_dependent_block_to_edge_map cdbte; - /* Element I is the immediate postdominator of block I. */ - dominance_info pdom; - struct edge_list *el; - - /* Initialize the data structures. */ - mark_all_insn_unnecessary (); - VARRAY_RTX_INIT (unprocessed_instructions, 64, - "unprocessed instructions"); - cdbte = control_dependent_block_to_edge_map_create (last_basic_block); - - /* Prepare for use of BLOCK_NUM (). */ - connect_infinite_loops_to_exit (); - - /* Compute control dependence. */ - pdom = calculate_dominance_info (CDI_POST_DOMINATORS); - el = create_edge_list (); - find_all_control_dependences (el, pdom, cdbte); - - /* Find inherently necessary instructions. */ - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) - if (find_inherently_necessary (insn) && INSN_P (insn)) - { - RESURRECT_INSN (insn); - VARRAY_PUSH_RTX (unprocessed_instructions, insn); - } - - /* Propagate necessity using the operands of necessary instructions. */ - while (VARRAY_ACTIVE_SIZE (unprocessed_instructions) > 0) - { - rtx current_instruction; - int edge_number; - - current_instruction = VARRAY_TOP_RTX (unprocessed_instructions); - VARRAY_POP (unprocessed_instructions); - - /* Make corresponding control dependent edges necessary. */ - /* Assume the only JUMP_INSN is the block's last insn. It appears - that the last instruction of the program need not be a - JUMP_INSN. */ - - if (INSN_P (current_instruction) - && !JUMP_TABLE_DATA_P (current_instruction)) - { - /* Notes and labels contain no interesting operands. */ - EXECUTE_IF_CONTROL_DEPENDENT - (cdbte, current_instruction, edge_number, - { - rtx jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end; - if (GET_CODE (jump_insn) == JUMP_INSN - && UNNECESSARY_P (jump_insn)) - { - RESURRECT_INSN (jump_insn); - VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn); - } - }); - - /* Propagate through the operands. */ - for_each_rtx (¤t_instruction, - &propagate_necessity_through_operand, - &unprocessed_instructions); - - /* PHI nodes are somewhat special in that each PHI alternative - has data and control dependencies. The data dependencies - are handled via propagate_necessity_through_operand. We - handle the control dependency here. - - We consider the control dependent edges leading to the - predecessor block associated with each PHI alternative - as necessary. */ - if (PHI_NODE_P (current_instruction)) - { - rtvec phi_vec = XVEC (SET_SRC (PATTERN (current_instruction)), 0); - int num_elem = GET_NUM_ELEM (phi_vec); - int v; - - for (v = num_elem - 2; v >= 0; v -= 2) - { - basic_block bb; - - bb = BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, v + 1))); - EXECUTE_IF_CONTROL_DEPENDENT - (cdbte, bb->end, edge_number, - { - rtx jump_insn; - - jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end; - if (((GET_CODE (jump_insn) == JUMP_INSN)) - && UNNECESSARY_P (jump_insn)) - { - RESURRECT_INSN (jump_insn); - VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn); - } - }); - - } - } - } - } - - /* Remove the unnecessary instructions. */ - EXECUTE_IF_UNNECESSARY (insn, - { - if (any_condjump_p (insn)) - { - basic_block bb = BLOCK_FOR_INSN (insn); - basic_block pdom_bb = find_pdom (pdom, bb); - rtx lbl; - edge e; - - /* Egad. The immediate post dominator is the exit block. We - would like to optimize this conditional jump to jump directly - to the exit block. That can be difficult as we may not have - a suitable CODE_LABEL that allows us to fall unmolested into - the exit block. - - So, we just delete the conditional branch by turning it into - a deleted note. That is safe, but just not as optimal as - it could be. */ - if (pdom_bb == EXIT_BLOCK_PTR) - { - /* Since we're going to just delete the branch, we need - look at all the edges and remove all those which are not - a fallthru edge. */ - e = bb->succ; - while (e) - { - edge temp = e; - - e = e->succ_next; - if ((temp->flags & EDGE_FALLTHRU) == 0) - { - /* We've found a non-fallthru edge, find any PHI nodes - at the target and clean them up. */ - if (temp->dest != EXIT_BLOCK_PTR) - { - rtx insn - = first_insn_after_basic_block_note (temp->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), temp->src); - insn = NEXT_INSN (insn); - } - } - - remove_edge (temp); - } - } - - /* Now "delete" the conditional jump. */ - PUT_CODE (insn, NOTE); - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - continue; - } - - /* We've found a conditional branch that is unnecessary. - - First, remove all outgoing edges from this block, updating - PHI nodes as appropriate. */ - e = bb->succ; - while (e) - { - edge temp = e; - - e = e->succ_next; - - if (temp->flags & EDGE_ABNORMAL) - continue; - - /* We found an edge that is not executable. First simplify - the PHI nodes in the target block. */ - if (temp->dest != EXIT_BLOCK_PTR) - { - rtx insn = first_insn_after_basic_block_note (temp->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), temp->src); - insn = NEXT_INSN (insn); - } - } - - remove_edge (temp); - } - - /* Create an edge from this block to the post dominator. - What about the PHI nodes at the target? */ - make_edge (bb, pdom_bb, 0); - - /* Third, transform this insn into an unconditional - jump to the label for the immediate postdominator. */ - lbl = find_block_label (pdom_bb); - SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (VOIDmode, lbl); - INSN_CODE (insn) = -1; - JUMP_LABEL (insn) = lbl; - LABEL_NUSES (lbl)++; - - /* A barrier must follow any unconditional jump. Barriers - are not in basic blocks so this must occur after - deleting the conditional jump. */ - emit_barrier_after (insn); - } - else if (!JUMP_P (insn)) - delete_insn_bb (insn); - }); - - /* Remove fake edges from the CFG. */ - remove_fake_edges (); - - /* Find any blocks with no successors and ensure they are followed - by a BARRIER. delete_insn has the nasty habit of deleting barriers - when deleting insns. */ - FOR_EACH_BB (bb) - { - if (bb->succ == NULL) - { - rtx next = NEXT_INSN (bb->end); - - if (!next || GET_CODE (next) != BARRIER) - emit_barrier_after (bb->end); - } - } - /* Release allocated memory. */ - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) { - if (INSN_P (insn)) - RESURRECT_INSN (insn); - } - - if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0) - abort (); - control_dependent_block_to_edge_map_free (cdbte); - free (pdom); - free_edge_list (el); -} diff --git a/gcc/ssa.c b/gcc/ssa.c deleted file mode 100644 index c12cdbe7afb..00000000000 --- a/gcc/ssa.c +++ /dev/null @@ -1,2214 +0,0 @@ -/* Static Single Assignment conversion routines for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 - 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 2, 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 COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* References: - - Building an Optimizing Compiler - Robert Morgan - Butterworth-Heinemann, 1998 - - Static Single Assignment Construction - Preston Briggs, Tim Harvey, Taylor Simpson - Technical Report, Rice University, 1995 - ftp://ftp.cs.rice.edu/public/preston/optimizer/SSA.ps.gz. */ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "expr.h" -#include "varray.h" -#include "partition.h" -#include "sbitmap.h" -#include "hashtab.h" -#include "regs.h" -#include "hard-reg-set.h" -#include "flags.h" -#include "function.h" -#include "real.h" -#include "insn-config.h" -#include "recog.h" -#include "basic-block.h" -#include "output.h" -#include "ssa.h" - -/* TODO: - - Handle subregs better, maybe. For now, if a reg that's set in a - subreg expression is duplicated going into SSA form, an extra copy - is inserted first that copies the entire reg into the duplicate, so - that the other bits are preserved. This isn't strictly SSA, since - at least part of the reg is assigned in more than one place (though - they are adjacent). - - ??? What to do about strict_low_part. Probably I'll have to split - them out of their current instructions first thing. - - Actually the best solution may be to have a kind of "mid-level rtl" - in which the RTL encodes exactly what we want, without exposing a - lot of niggling processor details. At some later point we lower - the representation, calling back into optabs to finish any necessary - expansion. */ - -/* All pseudo-registers and select hard registers are converted to SSA - form. When converting out of SSA, these select hard registers are - guaranteed to be mapped to their original register number. Each - machine's .h file should define CONVERT_HARD_REGISTER_TO_SSA_P - indicating which hard registers should be converted. - - When converting out of SSA, temporaries for all registers are - partitioned. The partition is checked to ensure that all uses of - the same hard register in the same machine mode are in the same - class. */ - -/* If conservative_reg_partition is nonzero, use a conservative - register partitioning algorithm (which leaves more regs after - emerging from SSA) instead of the coalescing one. This is being - left in for a limited time only, as a debugging tool until the - coalescing algorithm is validated. */ - -static int conservative_reg_partition; - -/* This flag is set when the CFG is in SSA form. */ -int in_ssa_form = 0; - -/* Element I is the single instruction that sets register I. */ -varray_type ssa_definition; - -/* Element I-PSEUDO is the normal register that originated the ssa - register in question. */ -varray_type ssa_rename_from; - -/* Element I is the normal register that originated the ssa - register in question. - - A hash table stores the (register, rtl) pairs. These are each - xmalloc'ed and deleted when the hash table is destroyed. */ -htab_t ssa_rename_from_ht; - -/* The running target ssa register for a given pseudo register. - (Pseudo registers appear in only one mode.) */ -static rtx *ssa_rename_to_pseudo; -/* Similar, but for hard registers. A hard register can appear in - many modes, so we store an equivalent pseudo for each of the - modes. */ -static rtx ssa_rename_to_hard[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; - -/* ssa_rename_from maps pseudo registers to the original corresponding - RTL. It is implemented as using a hash table. */ - -typedef struct { - unsigned int reg; - rtx original; -} ssa_rename_from_pair; - -struct ssa_rename_from_hash_table_data { - sbitmap canonical_elements; - partition reg_partition; -}; - -static rtx gen_sequence (void); -static void ssa_rename_from_initialize (void); -static rtx ssa_rename_from_lookup (int reg); -static unsigned int original_register (unsigned int regno); -static void ssa_rename_from_insert (unsigned int reg, rtx r); -static void ssa_rename_from_free (void); -typedef int (*srf_trav) (int regno, rtx r, sbitmap canonical_elements, - partition reg_partition); -static void ssa_rename_from_traverse (htab_trav callback_function, - sbitmap canonical_elements, partition reg_partition); -/*static Avoid warning message. */ void ssa_rename_from_print (void); -static int ssa_rename_from_print_1 (void **slot, void *data); -static hashval_t ssa_rename_from_hash_function (const void * srfp); -static int ssa_rename_from_equal (const void *srfp1, const void *srfp2); -static void ssa_rename_from_delete (void *srfp); - -static rtx ssa_rename_to_lookup (rtx reg); -static void ssa_rename_to_insert (rtx reg, rtx r); - -/* The number of registers that were live on entry to the SSA routines. */ -static unsigned int ssa_max_reg_num; - -/* Local function prototypes. */ - -struct rename_context; - -static inline rtx * phi_alternative (rtx, int); -static void compute_dominance_frontiers_1 (sbitmap *frontiers, - dominance_info idom, int bb, - sbitmap done); -static void find_evaluations_1 (rtx dest, rtx set, void *data); -static void find_evaluations (sbitmap *evals, int nregs); -static void compute_iterated_dominance_frontiers (sbitmap *idfs, - sbitmap *frontiers, - sbitmap *evals, int nregs); -static void insert_phi_node (int regno, int b); -static void insert_phi_nodes (sbitmap *idfs, sbitmap *evals, int nregs); -static void create_delayed_rename (struct rename_context *, rtx *); -static void apply_delayed_renames (struct rename_context *); -static int rename_insn_1 (rtx *ptr, void *data); -static void rename_block (int b, dominance_info dom); -static void rename_registers (int nregs, dominance_info idom); - -static inline int ephi_add_node (rtx reg, rtx *nodes, int *n_nodes); -static int * ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack); -static void ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes); -static void ephi_create (int t, sbitmap visited, sbitmap *pred, - sbitmap *succ, rtx *nodes); -static void eliminate_phi (edge e, partition reg_partition); -static int make_regs_equivalent_over_bad_edges (int bb, - partition reg_partition); - -/* These are used only in the conservative register partitioning - algorithms. */ -static int make_equivalent_phi_alternatives_equivalent - (int bb, partition reg_partition); -static partition compute_conservative_reg_partition (void); -static int record_canonical_element_1 (void **srfp, void *data); -static int check_hard_regs_in_partition (partition reg_partition); - -/* These are used in the register coalescing algorithm. */ -static int coalesce_if_unconflicting (partition p, conflict_graph conflicts, - int reg1, int reg2); -static int coalesce_regs_in_copies (basic_block bb, partition p, - conflict_graph conflicts); -static int coalesce_reg_in_phi (rtx, int dest_regno, int src_regno, - void *data); -static int coalesce_regs_in_successor_phi_nodes (basic_block bb, - partition p, - conflict_graph conflicts); -static partition compute_coalesced_reg_partition (void); -static int mark_reg_in_phi (rtx *ptr, void *data); -static void mark_phi_and_copy_regs (regset phi_set); - -static int rename_equivalent_regs_in_insn (rtx *ptr, void *data); -static void rename_equivalent_regs (partition reg_partition); - -/* Deal with hard registers. */ -static int conflicting_hard_regs_p (int reg1, int reg2); - -/* ssa_rename_to maps registers and machine modes to SSA pseudo registers. */ - -/* Find the register associated with REG in the indicated mode. */ - -static rtx -ssa_rename_to_lookup (rtx reg) -{ - if (!HARD_REGISTER_P (reg)) - return ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER]; - else - return ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)]; -} - -/* Store a new value mapping REG to R in ssa_rename_to. */ - -static void -ssa_rename_to_insert (rtx reg, rtx r) -{ - if (!HARD_REGISTER_P (reg)) - ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER] = r; - else - ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)] = r; -} - -/* Prepare ssa_rename_from for use. */ - -static void -ssa_rename_from_initialize (void) -{ - /* We use an arbitrary initial hash table size of 64. */ - ssa_rename_from_ht = htab_create (64, - &ssa_rename_from_hash_function, - &ssa_rename_from_equal, - &ssa_rename_from_delete); -} - -/* Find the REG entry in ssa_rename_from. Return NULL_RTX if no entry is - found. */ - -static rtx -ssa_rename_from_lookup (int reg) -{ - ssa_rename_from_pair srfp; - ssa_rename_from_pair *answer; - srfp.reg = reg; - srfp.original = NULL_RTX; - answer = htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg); - return (answer == 0 ? NULL_RTX : answer->original); -} - -/* Find the number of the original register specified by REGNO. If - the register is a pseudo, return the original register's number. - Otherwise, return this register number REGNO. */ - -static unsigned int -original_register (unsigned int regno) -{ - rtx original_rtx = ssa_rename_from_lookup (regno); - return original_rtx != NULL_RTX ? REGNO (original_rtx) : regno; -} - -/* Add mapping from R to REG to ssa_rename_from even if already present. */ - -static void -ssa_rename_from_insert (unsigned int reg, rtx r) -{ - void **slot; - ssa_rename_from_pair *srfp = xmalloc (sizeof (ssa_rename_from_pair)); - srfp->reg = reg; - srfp->original = r; - slot = htab_find_slot_with_hash (ssa_rename_from_ht, (const void *) srfp, - reg, INSERT); - if (*slot != 0) - free ((void *) *slot); - *slot = srfp; -} - -/* Apply the CALLBACK_FUNCTION to each element in ssa_rename_from. - CANONICAL_ELEMENTS and REG_PARTITION pass data needed by the only - current use of this function. */ - -static void -ssa_rename_from_traverse (htab_trav callback_function, - sbitmap canonical_elements, partition reg_partition) -{ - struct ssa_rename_from_hash_table_data srfhd; - srfhd.canonical_elements = canonical_elements; - srfhd.reg_partition = reg_partition; - htab_traverse (ssa_rename_from_ht, callback_function, (void *) &srfhd); -} - -/* Destroy ssa_rename_from. */ - -static void -ssa_rename_from_free (void) -{ - htab_delete (ssa_rename_from_ht); -} - -/* Print the contents of ssa_rename_from. */ - -/* static Avoid erroneous error message. */ -void -ssa_rename_from_print (void) -{ - printf ("ssa_rename_from's hash table contents:\n"); - htab_traverse (ssa_rename_from_ht, &ssa_rename_from_print_1, NULL); -} - -/* Print the contents of the hash table entry SLOT, passing the unused - attribute DATA. Used as a callback function with htab_traverse (). */ - -static int -ssa_rename_from_print_1 (void **slot, void *data ATTRIBUTE_UNUSED) -{ - ssa_rename_from_pair * p = *slot; - printf ("ssa_rename_from maps pseudo %i to original %i.\n", - p->reg, REGNO (p->original)); - return 1; -} - -/* Given a hash entry SRFP, yield a hash value. */ - -static hashval_t -ssa_rename_from_hash_function (const void *srfp) -{ - return ((const ssa_rename_from_pair *) srfp)->reg; -} - -/* Test whether two hash table entries SRFP1 and SRFP2 are equal. */ - -static int -ssa_rename_from_equal (const void *srfp1, const void *srfp2) -{ - return ssa_rename_from_hash_function (srfp1) == - ssa_rename_from_hash_function (srfp2); -} - -/* Delete the hash table entry SRFP. */ - -static void -ssa_rename_from_delete (void *srfp) -{ - free (srfp); -} - -/* Given the SET of a PHI node, return the address of the alternative - for predecessor block C. */ - -static inline rtx * -phi_alternative (rtx set, int c) -{ - rtvec phi_vec = XVEC (SET_SRC (set), 0); - int v; - - for (v = GET_NUM_ELEM (phi_vec) - 2; v >= 0; v -= 2) - if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c) - return &RTVEC_ELT (phi_vec, v); - - return NULL; -} - -/* Given the SET of a phi node, remove the alternative for predecessor - block C. Return nonzero on success, or zero if no alternative is - found for C. */ - -int -remove_phi_alternative (rtx set, basic_block block) -{ - rtvec phi_vec = XVEC (SET_SRC (set), 0); - int num_elem = GET_NUM_ELEM (phi_vec); - int v, c; - - c = block->index; - for (v = num_elem - 2; v >= 0; v -= 2) - if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c) - { - if (v < num_elem - 2) - { - RTVEC_ELT (phi_vec, v) = RTVEC_ELT (phi_vec, num_elem - 2); - RTVEC_ELT (phi_vec, v + 1) = RTVEC_ELT (phi_vec, num_elem - 1); - } - PUT_NUM_ELEM (phi_vec, num_elem - 2); - return 1; - } - - return 0; -} - -/* For all registers, find all blocks in which they are set. - - This is the transform of what would be local kill information that - we ought to be getting from flow. */ - -static sbitmap *fe_evals; -static int fe_current_bb; - -static void -find_evaluations_1 (rtx dest, rtx set ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) -{ - if (GET_CODE (dest) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (dest))) - SET_BIT (fe_evals[REGNO (dest)], fe_current_bb); -} - -static void -find_evaluations (sbitmap *evals, int nregs) -{ - basic_block bb; - - sbitmap_vector_zero (evals, nregs); - fe_evals = evals; - - FOR_EACH_BB_REVERSE (bb) - { - rtx p, last; - - fe_current_bb = bb->index; - p = bb->head; - last = bb->end; - while (1) - { - if (INSN_P (p)) - note_stores (PATTERN (p), find_evaluations_1, NULL); - - if (p == last) - break; - p = NEXT_INSN (p); - } - } -} - -/* Computing the Dominance Frontier: - - As described in Morgan, section 3.5, this may be done simply by - walking the dominator tree bottom-up, computing the frontier for - the children before the parent. When considering a block B, - there are two cases: - - (1) A flow graph edge leaving B that does not lead to a child - of B in the dominator tree must be a block that is either equal - to B or not dominated by B. Such blocks belong in the frontier - of B. - - (2) Consider a block X in the frontier of one of the children C - of B. If X is not equal to B and is not dominated by B, it - is in the frontier of B. -*/ - -static void -compute_dominance_frontiers_1 (sbitmap *frontiers, dominance_info idom, - int bb, sbitmap done) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - basic_block c; - - SET_BIT (done, bb); - sbitmap_zero (frontiers[bb]); - - /* Do the frontier of the children first. Not all children in the - dominator tree (blocks dominated by this one) are children in the - CFG, so check all blocks. */ - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb - && ! TEST_BIT (done, c->index)) - compute_dominance_frontiers_1 (frontiers, idom, c->index, done); - - /* Find blocks conforming to rule (1) above. */ - for (e = b->succ; e; e = e->succ_next) - { - if (e->dest == EXIT_BLOCK_PTR) - continue; - if (get_immediate_dominator (idom, e->dest)->index != bb) - SET_BIT (frontiers[bb], e->dest->index); - } - - /* Find blocks conforming to rule (2). */ - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb) - { - int x; - EXECUTE_IF_SET_IN_SBITMAP (frontiers[c->index], 0, x, - { - if (get_immediate_dominator (idom, BASIC_BLOCK (x))->index != bb) - SET_BIT (frontiers[bb], x); - }); - } -} - -void -compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom) -{ - sbitmap done = sbitmap_alloc (last_basic_block); - sbitmap_zero (done); - - compute_dominance_frontiers_1 (frontiers, idom, 0, done); - - sbitmap_free (done); -} - -/* Computing the Iterated Dominance Frontier: - - This is the set of merge points for a given register. - - This is not particularly intuitive. See section 7.1 of Morgan, in - particular figures 7.3 and 7.4 and the immediately surrounding text. -*/ - -static void -compute_iterated_dominance_frontiers (sbitmap *idfs, sbitmap *frontiers, - sbitmap *evals, int nregs) -{ - sbitmap worklist; - int reg, passes = 0; - - worklist = sbitmap_alloc (last_basic_block); - - for (reg = 0; reg < nregs; ++reg) - { - sbitmap idf = idfs[reg]; - int b, changed; - - /* Start the iterative process by considering those blocks that - evaluate REG. We'll add their dominance frontiers to the - IDF, and then consider the blocks we just added. */ - sbitmap_copy (worklist, evals[reg]); - - /* Morgan's algorithm is incorrect here. Blocks that evaluate - REG aren't necessarily in REG's IDF. Start with an empty IDF. */ - sbitmap_zero (idf); - - /* Iterate until the worklist is empty. */ - do - { - changed = 0; - passes++; - EXECUTE_IF_SET_IN_SBITMAP (worklist, 0, b, - { - RESET_BIT (worklist, b); - /* For each block on the worklist, add to the IDF all - blocks on its dominance frontier that aren't already - on the IDF. Every block that's added is also added - to the worklist. */ - sbitmap_union_of_diff (worklist, worklist, frontiers[b], idf); - sbitmap_a_or_b (idf, idf, frontiers[b]); - changed = 1; - }); - } - while (changed); - } - - sbitmap_free (worklist); - - if (rtl_dump_file) - { - fprintf (rtl_dump_file, - "Iterated dominance frontier: %d passes on %d regs.\n", - passes, nregs); - } -} - -/* Insert the phi nodes. */ - -static void -insert_phi_node (int regno, int bb) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - int npred, i; - rtvec vec; - rtx phi, reg; - rtx insn; - int end_p; - - /* Find out how many predecessors there are. */ - for (e = b->pred, npred = 0; e; e = e->pred_next) - if (e->src != ENTRY_BLOCK_PTR) - npred++; - - /* If this block has no "interesting" preds, then there is nothing to - do. Consider a block that only has the entry block as a pred. */ - if (npred == 0) - return; - - /* This is the register to which the phi function will be assigned. */ - reg = regno_reg_rtx[regno]; - - /* Construct the arguments to the PHI node. The use of pc_rtx is just - a placeholder; we'll insert the proper value in rename_registers. */ - vec = rtvec_alloc (npred * 2); - for (e = b->pred, i = 0; e ; e = e->pred_next, i += 2) - if (e->src != ENTRY_BLOCK_PTR) - { - RTVEC_ELT (vec, i + 0) = pc_rtx; - RTVEC_ELT (vec, i + 1) = GEN_INT (e->src->index); - } - - phi = gen_rtx_PHI (VOIDmode, vec); - phi = gen_rtx_SET (VOIDmode, reg, phi); - - insn = first_insn_after_basic_block_note (b); - end_p = PREV_INSN (insn) == b->end; - emit_insn_before (phi, insn); - if (end_p) - b->end = PREV_INSN (insn); -} - -static void -insert_phi_nodes (sbitmap *idfs, sbitmap *evals ATTRIBUTE_UNUSED, int nregs) -{ - int reg; - - for (reg = 0; reg < nregs; ++reg) - if (CONVERT_REGISTER_TO_SSA_P (reg)) - { - int b; - EXECUTE_IF_SET_IN_SBITMAP (idfs[reg], 0, b, - { - if (REGNO_REG_SET_P (BASIC_BLOCK (b)->global_live_at_start, reg)) - insert_phi_node (reg, b); - }); - } -} - -/* Rename the registers to conform to SSA. - - This is essentially the algorithm presented in Figure 7.8 of Morgan, - with a few changes to reduce pattern search time in favor of a bit - more memory usage. */ - -/* One of these is created for each set. It will live in a list local - to its basic block for the duration of that block's processing. */ -struct rename_set_data -{ - struct rename_set_data *next; - /* This is the SET_DEST of the (first) SET that sets the REG. */ - rtx *reg_loc; - /* This is what used to be at *REG_LOC. */ - rtx old_reg; - /* This is the REG that will replace OLD_REG. It's set only - when the rename data is moved onto the DONE_RENAMES queue. */ - rtx new_reg; - /* This is what to restore ssa_rename_to_lookup (old_reg) to. It is - usually the previous contents of ssa_rename_to_lookup (old_reg). */ - rtx prev_reg; - /* This is the insn that contains all the SETs of the REG. */ - rtx set_insn; -}; - -/* This struct is used to pass information to callback functions while - renaming registers. */ -struct rename_context -{ - struct rename_set_data *new_renames; - struct rename_set_data *done_renames; - rtx current_insn; -}; - -/* Queue the rename of *REG_LOC. */ -static void -create_delayed_rename (struct rename_context *c, rtx *reg_loc) -{ - struct rename_set_data *r; - r = xmalloc (sizeof(*r)); - - if (GET_CODE (*reg_loc) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*reg_loc))) - abort (); - - r->reg_loc = reg_loc; - r->old_reg = *reg_loc; - r->prev_reg = ssa_rename_to_lookup(r->old_reg); - r->set_insn = c->current_insn; - r->next = c->new_renames; - c->new_renames = r; -} - -/* This is part of a rather ugly hack to allow the pre-ssa regno to be - reused. If, during processing, a register has not yet been touched, - ssa_rename_to[regno][machno] will be NULL. Now, in the course of pushing - and popping values from ssa_rename_to, when we would ordinarily - pop NULL back in, we pop RENAME_NO_RTX. We treat this exactly the - same as NULL, except that it signals that the original regno has - already been reused. */ -#define RENAME_NO_RTX pc_rtx - -/* Move all the entries from NEW_RENAMES onto DONE_RENAMES by - applying all the renames on NEW_RENAMES. */ - -static void -apply_delayed_renames (struct rename_context *c) -{ - struct rename_set_data *r; - struct rename_set_data *last_r = NULL; - - for (r = c->new_renames; r != NULL; r = r->next) - { - int new_regno; - - /* Failure here means that someone has a PARALLEL that sets - a register twice (bad!). */ - if (ssa_rename_to_lookup (r->old_reg) != r->prev_reg) - abort (); - /* Failure here means we have changed REG_LOC before applying - the rename. */ - /* For the first set we come across, reuse the original regno. */ - if (r->prev_reg == NULL_RTX && !HARD_REGISTER_P (r->old_reg)) - { - r->new_reg = r->old_reg; - /* We want to restore RENAME_NO_RTX rather than NULL_RTX. */ - r->prev_reg = RENAME_NO_RTX; - } - else - r->new_reg = gen_reg_rtx (GET_MODE (r->old_reg)); - new_regno = REGNO (r->new_reg); - ssa_rename_to_insert (r->old_reg, r->new_reg); - - if (new_regno >= (int) ssa_definition->num_elements) - { - int new_limit = new_regno * 5 / 4; - VARRAY_GROW (ssa_definition, new_limit); - } - - VARRAY_RTX (ssa_definition, new_regno) = r->set_insn; - ssa_rename_from_insert (new_regno, r->old_reg); - last_r = r; - } - if (last_r != NULL) - { - last_r->next = c->done_renames; - c->done_renames = c->new_renames; - c->new_renames = NULL; - } -} - -/* Part one of the first step of rename_block, called through for_each_rtx. - Mark pseudos that are set for later update. Transform uses of pseudos. */ - -static int -rename_insn_1 (rtx *ptr, void *data) -{ - rtx x = *ptr; - struct rename_context *context = data; - - if (x == NULL_RTX) - return 0; - - switch (GET_CODE (x)) - { - case SET: - { - rtx *destp = &SET_DEST (x); - rtx dest = SET_DEST (x); - - /* An assignment to a paradoxical SUBREG does not read from - the destination operand, and thus does not need to be - wrapped into a SEQUENCE when translating into SSA form. - We merely strip off the SUBREG and proceed normally for - this case. */ - if (GET_CODE (dest) == SUBREG - && (GET_MODE_SIZE (GET_MODE (dest)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest)))) - && GET_CODE (SUBREG_REG (dest)) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (SUBREG_REG (dest)))) - { - destp = &XEXP (dest, 0); - dest = XEXP (dest, 0); - } - - /* Some SETs also use the REG specified in their LHS. - These can be detected by the presence of - STRICT_LOW_PART, SUBREG, SIGN_EXTRACT, and ZERO_EXTRACT - in the LHS. Handle these by changing - (set (subreg (reg foo)) ...) - into - (sequence [(set (reg foo_1) (reg foo)) - (set (subreg (reg foo_1)) ...)]) - - FIXME: Much of the time this is too much. For some constructs - we know that the output register is strictly an output - (paradoxical SUBREGs and some libcalls for example). - - For those cases we are better off not making the false - dependency. */ - if (GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == SUBREG - || GET_CODE (dest) == SIGN_EXTRACT - || GET_CODE (dest) == ZERO_EXTRACT) - { - rtx i, reg; - reg = dest; - - while (GET_CODE (reg) == STRICT_LOW_PART - || GET_CODE (reg) == SUBREG - || GET_CODE (reg) == SIGN_EXTRACT - || GET_CODE (reg) == ZERO_EXTRACT) - reg = XEXP (reg, 0); - - if (GET_CODE (reg) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (reg))) - { - /* Generate (set reg reg), and do renaming on it so - that it becomes (set reg_1 reg_0), and we will - replace reg with reg_1 in the SUBREG. */ - - struct rename_set_data *saved_new_renames; - saved_new_renames = context->new_renames; - context->new_renames = NULL; - i = emit_insn (gen_rtx_SET (VOIDmode, reg, reg)); - for_each_rtx (&i, rename_insn_1, data); - apply_delayed_renames (context); - context->new_renames = saved_new_renames; - } - } - else if (GET_CODE (dest) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (dest))) - { - /* We found a genuine set of an interesting register. Tag - it so that we can create a new name for it after we finish - processing this insn. */ - - create_delayed_rename (context, destp); - - /* Since we do not wish to (directly) traverse the - SET_DEST, recurse through for_each_rtx for the SET_SRC - and return. */ - if (GET_CODE (x) == SET) - for_each_rtx (&SET_SRC (x), rename_insn_1, data); - return -1; - } - - /* Otherwise, this was not an interesting destination. Continue - on, marking uses as normal. */ - return 0; - } - - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)) - && REGNO (x) < ssa_max_reg_num) - { - rtx new_reg = ssa_rename_to_lookup (x); - - if (new_reg != RENAME_NO_RTX && new_reg != NULL_RTX) - { - if (GET_MODE (x) != GET_MODE (new_reg)) - abort (); - *ptr = new_reg; - } - else - { - /* Undefined value used, rename it to a new pseudo register so - that it cannot conflict with an existing register. */ - *ptr = gen_reg_rtx (GET_MODE (x)); - } - } - return -1; - - case CLOBBER: - /* There is considerable debate on how CLOBBERs ought to be - handled in SSA. For now, we're keeping the CLOBBERs, which - means that we don't really have SSA form. There are a couple - of proposals for how to fix this problem, but neither is - implemented yet. */ - { - rtx dest = XCEXP (x, 0, CLOBBER); - if (REG_P (dest)) - { - if (CONVERT_REGISTER_TO_SSA_P (REGNO (dest)) - && REGNO (dest) < ssa_max_reg_num) - { - rtx new_reg = ssa_rename_to_lookup (dest); - if (new_reg != NULL_RTX && new_reg != RENAME_NO_RTX) - XCEXP (x, 0, CLOBBER) = new_reg; - } - /* Stop traversing. */ - return -1; - } - else - /* Continue traversing. */ - return 0; - } - - case PHI: - /* Never muck with the phi. We do that elsewhere, special-like. */ - return -1; - - default: - /* Anything else, continue traversing. */ - return 0; - } -} - -static rtx -gen_sequence (void) -{ - rtx first_insn = get_insns (); - rtx result; - rtx tem; - int i; - int len; - - /* Count the insns in the chain. */ - len = 0; - for (tem = first_insn; tem; tem = NEXT_INSN (tem)) - len++; - - result = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (len)); - - for (i = 0, tem = first_insn; tem; tem = NEXT_INSN (tem), i++) - XVECEXP (result, 0, i) = tem; - - return result; -} - -static void -rename_block (int bb, dominance_info idom) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - rtx insn, next, last; - struct rename_set_data *set_data = NULL; - basic_block c; - - /* Step One: Walk the basic block, adding new names for sets and - replacing uses. */ - - next = b->head; - last = b->end; - do - { - insn = next; - if (INSN_P (insn)) - { - struct rename_context context; - context.done_renames = set_data; - context.new_renames = NULL; - context.current_insn = insn; - - start_sequence (); - for_each_rtx (&PATTERN (insn), rename_insn_1, &context); - for_each_rtx (®_NOTES (insn), rename_insn_1, &context); - - /* Sometimes, we end up with a sequence of insns that - SSA needs to treat as a single insn. Wrap these in a - SEQUENCE. (Any notes now get attached to the SEQUENCE, - not to the old version inner insn.) */ - if (get_insns () != NULL_RTX) - { - rtx seq; - int i; - - emit (PATTERN (insn)); - seq = gen_sequence (); - /* We really want a SEQUENCE of SETs, not a SEQUENCE - of INSNs. */ - for (i = 0; i < XVECLEN (seq, 0); i++) - XVECEXP (seq, 0, i) = PATTERN (XVECEXP (seq, 0, i)); - PATTERN (insn) = seq; - } - end_sequence (); - - apply_delayed_renames (&context); - set_data = context.done_renames; - } - - next = NEXT_INSN (insn); - } - while (insn != last); - - /* Step Two: Update the phi nodes of this block's successors. */ - - for (e = b->succ; e; e = e->succ_next) - { - if (e->dest == EXIT_BLOCK_PTR) - continue; - - insn = first_insn_after_basic_block_note (e->dest); - - while (PHI_NODE_P (insn)) - { - rtx phi = PATTERN (insn); - rtx reg; - - /* Find out which of our outgoing registers this node is - intended to replace. Note that if this is not the first PHI - node to have been created for this register, we have to - jump through rename links to figure out which register - we're talking about. This can easily be recognized by - noting that the regno is new to this pass. */ - reg = SET_DEST (phi); - if (REGNO (reg) >= ssa_max_reg_num) - reg = ssa_rename_from_lookup (REGNO (reg)); - if (reg == NULL_RTX) - abort (); - reg = ssa_rename_to_lookup (reg); - - /* It is possible for the variable to be uninitialized on - edges in. Reduce the arity of the PHI so that we don't - consider those edges. */ - if (reg == NULL || reg == RENAME_NO_RTX) - { - if (! remove_phi_alternative (phi, b)) - abort (); - } - else - { - /* When we created the PHI nodes, we did not know what mode - the register should be. Now that we've found an original, - we can fill that in. */ - if (GET_MODE (SET_DEST (phi)) == VOIDmode) - PUT_MODE (SET_DEST (phi), GET_MODE (reg)); - else if (GET_MODE (SET_DEST (phi)) != GET_MODE (reg)) - abort (); - - *phi_alternative (phi, bb) = reg; - } - - insn = NEXT_INSN (insn); - } - } - - /* Step Three: Do the same to the children of this block in - dominator order. */ - - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb) - rename_block (c->index, idom); - - /* Step Four: Update the sets to refer to their new register, - and restore ssa_rename_to to its previous state. */ - - while (set_data) - { - struct rename_set_data *next; - rtx old_reg = *set_data->reg_loc; - - if (*set_data->reg_loc != set_data->old_reg) - abort (); - *set_data->reg_loc = set_data->new_reg; - - ssa_rename_to_insert (old_reg, set_data->prev_reg); - - next = set_data->next; - free (set_data); - set_data = next; - } -} - -static void -rename_registers (int nregs, dominance_info idom) -{ - VARRAY_RTX_INIT (ssa_definition, nregs * 3, "ssa_definition"); - ssa_rename_from_initialize (); - - ssa_rename_to_pseudo = alloca (nregs * sizeof(rtx)); - memset (ssa_rename_to_pseudo, 0, nregs * sizeof(rtx)); - memset (ssa_rename_to_hard, 0, - FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx)); - - rename_block (0, idom); - - /* ??? Update basic_block_live_at_start, and other flow info - as needed. */ - - ssa_rename_to_pseudo = NULL; -} - -/* The main entry point for moving to SSA. */ - -void -convert_to_ssa (void) -{ - /* Element I is the set of blocks that set register I. */ - sbitmap *evals; - - /* Dominator bitmaps. */ - sbitmap *dfs; - sbitmap *idfs; - - /* Element I is the immediate dominator of block I. */ - dominance_info idom; - - int nregs; - - basic_block bb; - - /* Don't do it twice. */ - if (in_ssa_form) - abort (); - - /* Need global_live_at_{start,end} up to date. Do not remove any - dead code. We'll let the SSA optimizers do that. */ - life_analysis (get_insns (), NULL, 0); - - idom = calculate_dominance_info (CDI_DOMINATORS); - - if (rtl_dump_file) - { - fputs (";; Immediate Dominators:\n", rtl_dump_file); - FOR_EACH_BB (bb) - fprintf (rtl_dump_file, ";\t%3d = %3d\n", bb->index, - get_immediate_dominator (idom, bb)->index); - fflush (rtl_dump_file); - } - - /* Compute dominance frontiers. */ - - dfs = sbitmap_vector_alloc (last_basic_block, last_basic_block); - compute_dominance_frontiers (dfs, idom); - - if (rtl_dump_file) - { - dump_sbitmap_vector (rtl_dump_file, ";; Dominance Frontiers:", - "; Basic Block", dfs, last_basic_block); - fflush (rtl_dump_file); - } - - /* Compute register evaluations. */ - - ssa_max_reg_num = max_reg_num (); - nregs = ssa_max_reg_num; - evals = sbitmap_vector_alloc (nregs, last_basic_block); - find_evaluations (evals, nregs); - - /* Compute the iterated dominance frontier for each register. */ - - idfs = sbitmap_vector_alloc (nregs, last_basic_block); - compute_iterated_dominance_frontiers (idfs, dfs, evals, nregs); - - if (rtl_dump_file) - { - dump_sbitmap_vector (rtl_dump_file, ";; Iterated Dominance Frontiers:", - "; Register", idfs, nregs); - fflush (rtl_dump_file); - } - - /* Insert the phi nodes. */ - - insert_phi_nodes (idfs, evals, nregs); - - /* Rename the registers to satisfy SSA. */ - - rename_registers (nregs, idom); - - /* All done! Clean up and go home. */ - - sbitmap_vector_free (dfs); - sbitmap_vector_free (evals); - sbitmap_vector_free (idfs); - in_ssa_form = 1; - - reg_scan (get_insns (), max_reg_num (), 1); - free_dominance_info (idom); -} - -/* REG is the representative temporary of its partition. Add it to the - set of nodes to be processed, if it hasn't been already. Return the - index of this register in the node set. */ - -static inline int -ephi_add_node (rtx reg, rtx *nodes, int *n_nodes) -{ - int i; - for (i = *n_nodes - 1; i >= 0; --i) - if (REGNO (reg) == REGNO (nodes[i])) - return i; - - nodes[i = (*n_nodes)++] = reg; - return i; -} - -/* Part one of the topological sort. This is a forward (downward) search - through the graph collecting a stack of nodes to process. Assuming no - cycles, the nodes at top of the stack when we are finished will have - no other dependencies. */ - -static int * -ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack) -{ - int s; - - SET_BIT (visited, t); - - EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s, - { - if (! TEST_BIT (visited, s)) - tstack = ephi_forward (s, visited, succ, tstack); - }); - - *tstack++ = t; - return tstack; -} - -/* Part two of the topological sort. The is a backward search through - a cycle in the graph, copying the data forward as we go. */ - -static void -ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes) -{ - int p; - - SET_BIT (visited, t); - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - { - ephi_backward (p, visited, pred, nodes); - emit_move_insn (nodes[p], nodes[t]); - } - }); -} - -/* Part two of the topological sort. Create the copy for a register - and any cycle of which it is a member. */ - -static void -ephi_create (int t, sbitmap visited, sbitmap *pred, sbitmap *succ, rtx *nodes) -{ - rtx reg_u = NULL_RTX; - int unvisited_predecessors = 0; - int p; - - /* Iterate through the predecessor list looking for unvisited nodes. - If there are any, we have a cycle, and must deal with that. At - the same time, look for a visited predecessor. If there is one, - we won't need to create a temporary. */ - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - unvisited_predecessors = 1; - else if (!reg_u) - reg_u = nodes[p]; - }); - - if (unvisited_predecessors) - { - /* We found a cycle. Copy out one element of the ring (if necessary), - then traverse the ring copying as we go. */ - - if (!reg_u) - { - reg_u = gen_reg_rtx (GET_MODE (nodes[t])); - emit_move_insn (reg_u, nodes[t]); - } - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - { - ephi_backward (p, visited, pred, nodes); - emit_move_insn (nodes[p], reg_u); - } - }); - } - else - { - /* No cycle. Just copy the value from a successor. */ - - int s; - EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s, - { - SET_BIT (visited, t); - emit_move_insn (nodes[t], nodes[s]); - return; - }); - } -} - -/* Convert the edge to normal form. */ - -static void -eliminate_phi (edge e, partition reg_partition) -{ - int n_nodes; - sbitmap *pred, *succ; - sbitmap visited; - rtx *nodes; - int *stack, *tstack; - rtx insn; - int i; - - /* Collect an upper bound on the number of registers needing processing. */ - - insn = first_insn_after_basic_block_note (e->dest); - - n_nodes = 0; - while (PHI_NODE_P (insn)) - { - insn = next_nonnote_insn (insn); - n_nodes += 2; - } - - if (n_nodes == 0) - return; - - /* Build the auxiliary graph R(B). - - The nodes of the graph are the members of the register partition - present in Phi(B). There is an edge from FIND(T0)->FIND(T1) for - each T0 = PHI(...,T1,...), where T1 is for the edge from block C. */ - - nodes = alloca (n_nodes * sizeof(rtx)); - pred = sbitmap_vector_alloc (n_nodes, n_nodes); - succ = sbitmap_vector_alloc (n_nodes, n_nodes); - sbitmap_vector_zero (pred, n_nodes); - sbitmap_vector_zero (succ, n_nodes); - - insn = first_insn_after_basic_block_note (e->dest); - - n_nodes = 0; - for (; PHI_NODE_P (insn); insn = next_nonnote_insn (insn)) - { - rtx* preg = phi_alternative (PATTERN (insn), e->src->index); - rtx tgt = SET_DEST (PATTERN (insn)); - rtx reg; - - /* There may be no phi alternative corresponding to this edge. - This indicates that the phi variable is undefined along this - edge. */ - if (preg == NULL) - continue; - reg = *preg; - - if (GET_CODE (reg) != REG || GET_CODE (tgt) != REG) - abort (); - - reg = regno_reg_rtx[partition_find (reg_partition, REGNO (reg))]; - tgt = regno_reg_rtx[partition_find (reg_partition, REGNO (tgt))]; - /* If the two registers are already in the same partition, - nothing will need to be done. */ - if (reg != tgt) - { - int ireg, itgt; - - ireg = ephi_add_node (reg, nodes, &n_nodes); - itgt = ephi_add_node (tgt, nodes, &n_nodes); - - SET_BIT (pred[ireg], itgt); - SET_BIT (succ[itgt], ireg); - } - } - - if (n_nodes == 0) - goto out; - - /* Begin a topological sort of the graph. */ - - visited = sbitmap_alloc (n_nodes); - sbitmap_zero (visited); - - tstack = stack = alloca (n_nodes * sizeof (int)); - - for (i = 0; i < n_nodes; ++i) - if (! TEST_BIT (visited, i)) - tstack = ephi_forward (i, visited, succ, tstack); - - sbitmap_zero (visited); - - /* As we find a solution to the tsort, collect the implementation - insns in a sequence. */ - start_sequence (); - - while (tstack != stack) - { - i = *--tstack; - if (! TEST_BIT (visited, i)) - ephi_create (i, visited, pred, succ, nodes); - } - - insn = get_insns (); - end_sequence (); - insert_insn_on_edge (insn, e); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Emitting copy on edge (%d,%d)\n", - e->src->index, e->dest->index); - - sbitmap_free (visited); -out: - sbitmap_vector_free (pred); - sbitmap_vector_free (succ); -} - -/* For basic block B, consider all phi insns which provide an - alternative corresponding to an incoming abnormal critical edge. - Place the phi alternative corresponding to that abnormal critical - edge in the same register class as the destination of the set. - - From Morgan, p. 178: - - For each abnormal critical edge (C, B), - if T0 = phi (T1, ..., Ti, ..., Tm) is a phi node in B, - and C is the ith predecessor of B, - then T0 and Ti must be equivalent. - - Return nonzero iff any such cases were found for which the two - regs were not already in the same class. */ - -static int -make_regs_equivalent_over_bad_edges (int bb, partition reg_partition) -{ - int changed = 0; - basic_block b = BASIC_BLOCK (bb); - rtx phi; - - /* Advance to the first phi node. */ - phi = first_insn_after_basic_block_note (b); - - /* Scan all the phi nodes. */ - for (; - PHI_NODE_P (phi); - phi = next_nonnote_insn (phi)) - { - edge e; - int tgt_regno; - rtx set = PATTERN (phi); - rtx tgt = SET_DEST (set); - - /* The set target is expected to be an SSA register. */ - if (GET_CODE (tgt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (tgt))) - abort (); - tgt_regno = REGNO (tgt); - - /* Scan incoming abnormal critical edges. */ - for (e = b->pred; e; e = e->pred_next) - if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)) - { - rtx *alt = phi_alternative (set, e->src->index); - int alt_regno; - - /* If there is no alternative corresponding to this edge, - the value is undefined along the edge, so just go on. */ - if (alt == 0) - continue; - - /* The phi alternative is expected to be an SSA register. */ - if (GET_CODE (*alt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt))) - abort (); - alt_regno = REGNO (*alt); - - /* If the set destination and the phi alternative aren't - already in the same class... */ - if (partition_find (reg_partition, tgt_regno) - != partition_find (reg_partition, alt_regno)) - { - /* ... make them such. */ - if (conflicting_hard_regs_p (tgt_regno, alt_regno)) - /* It is illegal to unify a hard register with a - different register. */ - abort (); - - partition_union (reg_partition, - tgt_regno, alt_regno); - ++changed; - } - } - } - - return changed; -} - -/* Consider phi insns in basic block BB pairwise. If the set target - of both insns are equivalent pseudos, make the corresponding phi - alternatives in each phi corresponding equivalent. - - Return nonzero if any new register classes were unioned. */ - -static int -make_equivalent_phi_alternatives_equivalent (int bb, partition reg_partition) -{ - int changed = 0; - basic_block b = BASIC_BLOCK (bb); - rtx phi; - - /* Advance to the first phi node. */ - phi = first_insn_after_basic_block_note (b); - - /* Scan all the phi nodes. */ - for (; - PHI_NODE_P (phi); - phi = next_nonnote_insn (phi)) - { - rtx set = PATTERN (phi); - /* The regno of the destination of the set. */ - int tgt_regno = REGNO (SET_DEST (PATTERN (phi))); - - rtx phi2 = next_nonnote_insn (phi); - - /* Scan all phi nodes following this one. */ - for (; - PHI_NODE_P (phi2); - phi2 = next_nonnote_insn (phi2)) - { - rtx set2 = PATTERN (phi2); - /* The regno of the destination of the set. */ - int tgt2_regno = REGNO (SET_DEST (set2)); - - /* Are the set destinations equivalent regs? */ - if (partition_find (reg_partition, tgt_regno) == - partition_find (reg_partition, tgt2_regno)) - { - edge e; - /* Scan over edges. */ - for (e = b->pred; e; e = e->pred_next) - { - int pred_block = e->src->index; - /* Identify the phi alternatives from both phi - nodes corresponding to this edge. */ - rtx *alt = phi_alternative (set, pred_block); - rtx *alt2 = phi_alternative (set2, pred_block); - - /* If one of the phi nodes doesn't have a - corresponding alternative, just skip it. */ - if (alt == 0 || alt2 == 0) - continue; - - /* Both alternatives should be SSA registers. */ - if (GET_CODE (*alt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt))) - abort (); - if (GET_CODE (*alt2) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt2))) - abort (); - - /* If the alternatives aren't already in the same - class ... */ - if (partition_find (reg_partition, REGNO (*alt)) - != partition_find (reg_partition, REGNO (*alt2))) - { - /* ... make them so. */ - if (conflicting_hard_regs_p (REGNO (*alt), REGNO (*alt2))) - /* It is illegal to unify a hard register with - a different register. */ - abort (); - - partition_union (reg_partition, - REGNO (*alt), REGNO (*alt2)); - ++changed; - } - } - } - } - } - - return changed; -} - -/* Compute a conservative partition of outstanding pseudo registers. - See Morgan 7.3.1. */ - -static partition -compute_conservative_reg_partition (void) -{ - basic_block bb; - int changed = 0; - - /* We don't actually work with hard registers, but it's easier to - carry them around anyway rather than constantly doing register - number arithmetic. */ - partition p = - partition_new (ssa_definition->num_elements); - - /* The first priority is to make sure registers that might have to - be copied on abnormal critical edges are placed in the same - partition. This saves us from having to split abnormal critical - edges. */ - FOR_EACH_BB_REVERSE (bb) - changed += make_regs_equivalent_over_bad_edges (bb->index, p); - - /* Now we have to insure that corresponding arguments of phi nodes - assigning to corresponding regs are equivalent. Iterate until - nothing changes. */ - while (changed > 0) - { - changed = 0; - FOR_EACH_BB_REVERSE (bb) - changed += make_equivalent_phi_alternatives_equivalent (bb->index, p); - } - - return p; -} - -/* The following functions compute a register partition that attempts - to eliminate as many reg copies and phi node copies as possible by - coalescing registers. This is the strategy: - - 1. As in the conservative case, the top priority is to coalesce - registers that otherwise would cause copies to be placed on - abnormal critical edges (which isn't possible). - - 2. Figure out which regs are involved (in the LHS or RHS) of - copies and phi nodes. Compute conflicts among these regs. - - 3. Walk around the instruction stream, placing two regs in the - same class of the partition if one appears on the LHS and the - other on the RHS of a copy or phi node and the two regs don't - conflict. The conflict information of course needs to be - updated. - - 4. If anything has changed, there may be new opportunities to - coalesce regs, so go back to 2. -*/ - -/* If REG1 and REG2 don't conflict in CONFLICTS, place them in the - same class of partition P, if they aren't already. Update - CONFLICTS appropriately. - - Returns one if REG1 and REG2 were placed in the same class but were - not previously; zero otherwise. - - See Morgan figure 11.15. */ - -static int -coalesce_if_unconflicting (partition p, conflict_graph conflicts, - int reg1, int reg2) -{ - int reg; - - /* Work only on SSA registers. */ - if (!CONVERT_REGISTER_TO_SSA_P (reg1) || !CONVERT_REGISTER_TO_SSA_P (reg2)) - return 0; - - /* Find the canonical regs for the classes containing REG1 and - REG2. */ - reg1 = partition_find (p, reg1); - reg2 = partition_find (p, reg2); - - /* If they're already in the same class, there's nothing to do. */ - if (reg1 == reg2) - return 0; - - /* If the regs conflict, our hands are tied. */ - if (conflicting_hard_regs_p (reg1, reg2) || - conflict_graph_conflict_p (conflicts, reg1, reg2)) - return 0; - - /* We're good to go. Put the regs in the same partition. */ - partition_union (p, reg1, reg2); - - /* Find the new canonical reg for the merged class. */ - reg = partition_find (p, reg1); - - /* Merge conflicts from the two previous classes. */ - conflict_graph_merge_regs (conflicts, reg, reg1); - conflict_graph_merge_regs (conflicts, reg, reg2); - - return 1; -} - -/* For each register copy insn in basic block BB, place the LHS and - RHS regs in the same class in partition P if they do not conflict - according to CONFLICTS. - - Returns the number of changes that were made to P. - - See Morgan figure 11.14. */ - -static int -coalesce_regs_in_copies (basic_block bb, partition p, conflict_graph conflicts) -{ - int changed = 0; - rtx insn; - rtx end = bb->end; - - /* Scan the instruction stream of the block. */ - for (insn = bb->head; insn != end; insn = NEXT_INSN (insn)) - { - rtx pattern; - rtx src; - rtx dest; - - /* If this isn't a set insn, go to the next insn. */ - if (GET_CODE (insn) != INSN) - continue; - pattern = PATTERN (insn); - if (GET_CODE (pattern) != SET) - continue; - - src = SET_SRC (pattern); - dest = SET_DEST (pattern); - - /* We're only looking for copies. */ - if (GET_CODE (src) != REG || GET_CODE (dest) != REG) - continue; - - /* Coalesce only if the reg modes are the same. As long as - each reg's rtx is unique, it can have only one mode, so two - pseudos of different modes can't be coalesced into one. - - FIXME: We can probably get around this by inserting SUBREGs - where appropriate, but for now we don't bother. */ - if (GET_MODE (src) != GET_MODE (dest)) - continue; - - /* Found a copy; see if we can use the same reg for both the - source and destination (and thus eliminate the copy, - ultimately). */ - changed += coalesce_if_unconflicting (p, conflicts, - REGNO (src), REGNO (dest)); - } - - return changed; -} - -struct phi_coalesce_context -{ - partition p; - conflict_graph conflicts; - int changed; -}; - -/* Callback function for for_each_successor_phi. If the set - destination and the phi alternative regs do not conflict, place - them in the same partition class. DATA is a pointer to a - phi_coalesce_context struct. */ - -static int -coalesce_reg_in_phi (rtx insn ATTRIBUTE_UNUSED, int dest_regno, - int src_regno, void *data) -{ - struct phi_coalesce_context *context = - (struct phi_coalesce_context *) data; - - /* Attempt to use the same reg, if they don't conflict. */ - context->changed - += coalesce_if_unconflicting (context->p, context->conflicts, - dest_regno, src_regno); - return 0; -} - -/* For each alternative in a phi function corresponding to basic block - BB (in phi nodes in successor block to BB), place the reg in the - phi alternative and the reg to which the phi value is set into the - same class in partition P, if allowed by CONFLICTS. - - Return the number of changes that were made to P. - - See Morgan figure 11.14. */ - -static int -coalesce_regs_in_successor_phi_nodes (basic_block bb, partition p, - conflict_graph conflicts) -{ - struct phi_coalesce_context context; - context.p = p; - context.conflicts = conflicts; - context.changed = 0; - - for_each_successor_phi (bb, &coalesce_reg_in_phi, &context); - - return context.changed; -} - -/* Compute and return a partition of pseudos. Where possible, - non-conflicting pseudos are placed in the same class. - - The caller is responsible for deallocating the returned partition. */ - -static partition -compute_coalesced_reg_partition (void) -{ - basic_block bb; - int changed = 0; - regset_head phi_set_head; - regset phi_set = &phi_set_head; - - partition p = - partition_new (ssa_definition->num_elements); - - /* The first priority is to make sure registers that might have to - be copied on abnormal critical edges are placed in the same - partition. This saves us from having to split abnormal critical - edges (which can't be done). */ - FOR_EACH_BB_REVERSE (bb) - make_regs_equivalent_over_bad_edges (bb->index, p); - - INIT_REG_SET (phi_set); - - do - { - conflict_graph conflicts; - - changed = 0; - - /* Build the set of registers involved in phi nodes, either as - arguments to the phi function or as the target of a set. */ - CLEAR_REG_SET (phi_set); - mark_phi_and_copy_regs (phi_set); - - /* Compute conflicts. */ - conflicts = conflict_graph_compute (phi_set, p); - - /* FIXME: Better would be to process most frequently executed - blocks first, so that most frequently executed copies would - be more likely to be removed by register coalescing. But any - order will generate correct, if non-optimal, results. */ - FOR_EACH_BB_REVERSE (bb) - { - changed += coalesce_regs_in_copies (bb, p, conflicts); - changed += - coalesce_regs_in_successor_phi_nodes (bb, p, conflicts); - } - - conflict_graph_delete (conflicts); - } - while (changed > 0); - - FREE_REG_SET (phi_set); - - return p; -} - -/* Mark the regs in a phi node. PTR is a phi expression or one of its - components (a REG or a CONST_INT). DATA is a reg set in which to - set all regs. Called from for_each_rtx. */ - -static int -mark_reg_in_phi (rtx *ptr, void *data) -{ - rtx expr = *ptr; - regset set = (regset) data; - - switch (GET_CODE (expr)) - { - case REG: - SET_REGNO_REG_SET (set, REGNO (expr)); - /* Fall through. */ - case CONST_INT: - case PHI: - return 0; - default: - abort (); - } -} - -/* Mark in PHI_SET all pseudos that are used in a phi node -- either - set from a phi expression, or used as an argument in one. Also - mark regs that are the source or target of a reg copy. Uses - ssa_definition. */ - -static void -mark_phi_and_copy_regs (regset phi_set) -{ - unsigned int reg; - - /* Scan the definitions of all regs. */ - for (reg = 0; reg < VARRAY_SIZE (ssa_definition); ++reg) - if (CONVERT_REGISTER_TO_SSA_P (reg)) - { - rtx insn = VARRAY_RTX (ssa_definition, reg); - rtx pattern; - rtx src; - - if (insn == NULL - || (GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)) - continue; - pattern = PATTERN (insn); - /* Sometimes we get PARALLEL insns. These aren't phi nodes or - copies. */ - if (GET_CODE (pattern) != SET) - continue; - src = SET_SRC (pattern); - - if (GET_CODE (src) == REG) - { - /* It's a reg copy. */ - SET_REGNO_REG_SET (phi_set, reg); - SET_REGNO_REG_SET (phi_set, REGNO (src)); - } - else if (GET_CODE (src) == PHI) - { - /* It's a phi node. Mark the reg being set. */ - SET_REGNO_REG_SET (phi_set, reg); - /* Mark the regs used in the phi function. */ - for_each_rtx (&src, mark_reg_in_phi, phi_set); - } - /* ... else nothing to do. */ - } -} - -/* Rename regs in insn PTR that are equivalent. DATA is the register - partition which specifies equivalences. */ - -static int -rename_equivalent_regs_in_insn (rtx *ptr, void* data) -{ - rtx x = *ptr; - partition reg_partition = (partition) data; - - if (x == NULL_RTX) - return 0; - - switch (GET_CODE (x)) - { - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x))) - { - unsigned int regno = REGNO (x); - unsigned int new_regno = partition_find (reg_partition, regno); - rtx canonical_element_rtx = ssa_rename_from_lookup (new_regno); - - if (canonical_element_rtx != NULL_RTX && - HARD_REGISTER_P (canonical_element_rtx)) - { - if (REGNO (canonical_element_rtx) != regno) - *ptr = canonical_element_rtx; - } - else if (regno != new_regno) - { - rtx new_reg = regno_reg_rtx[new_regno]; - if (GET_MODE (x) != GET_MODE (new_reg)) - abort (); - *ptr = new_reg; - } - } - return -1; - - case PHI: - /* No need to rename the phi nodes. We'll check equivalence - when inserting copies. */ - return -1; - - default: - /* Anything else, continue traversing. */ - return 0; - } -} - -/* Record the register's canonical element stored in SRFP in the - canonical_elements sbitmap packaged in DATA. This function is used - as a callback function for traversing ssa_rename_from. */ - -static int -record_canonical_element_1 (void **srfp, void *data) -{ - unsigned int reg = ((ssa_rename_from_pair *) *srfp)->reg; - sbitmap canonical_elements = - ((struct ssa_rename_from_hash_table_data *) data)->canonical_elements; - partition reg_partition = - ((struct ssa_rename_from_hash_table_data *) data)->reg_partition; - - SET_BIT (canonical_elements, partition_find (reg_partition, reg)); - return 1; -} - -/* For each class in the REG_PARTITION corresponding to a particular - hard register and machine mode, check that there are no other - classes with the same hard register and machine mode. Returns - nonzero if this is the case, i.e., the partition is acceptable. */ - -static int -check_hard_regs_in_partition (partition reg_partition) -{ - /* CANONICAL_ELEMENTS has a nonzero bit if a class with the given register - number and machine mode has already been seen. This is a - problem with the partition. */ - sbitmap canonical_elements; - int element_index; - int already_seen[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; - int reg; - int mach_mode; - - /* Collect a list of canonical elements. */ - canonical_elements = sbitmap_alloc (max_reg_num ()); - sbitmap_zero (canonical_elements); - ssa_rename_from_traverse (&record_canonical_element_1, - canonical_elements, reg_partition); - - /* We have not seen any hard register uses. */ - for (reg = 0; reg < FIRST_PSEUDO_REGISTER; ++reg) - for (mach_mode = 0; mach_mode < NUM_MACHINE_MODES; ++mach_mode) - already_seen[reg][mach_mode] = 0; - - /* Check for classes with the same hard register and machine mode. */ - EXECUTE_IF_SET_IN_SBITMAP (canonical_elements, 0, element_index, - { - rtx hard_reg_rtx = ssa_rename_from_lookup (element_index); - if (hard_reg_rtx != NULL_RTX && - HARD_REGISTER_P (hard_reg_rtx) && - already_seen[REGNO (hard_reg_rtx)][GET_MODE (hard_reg_rtx)] != 0) - /* Two distinct partition classes should be mapped to the same - hard register. */ - return 0; - }); - - sbitmap_free (canonical_elements); - - return 1; -} - -/* Rename regs that are equivalent in REG_PARTITION. Also collapse - any SEQUENCE insns. */ - -static void -rename_equivalent_regs (partition reg_partition) -{ - basic_block b; - - FOR_EACH_BB_REVERSE (b) - { - rtx next = b->head; - rtx last = b->end; - rtx insn; - - do - { - insn = next; - if (INSN_P (insn)) - { - for_each_rtx (&PATTERN (insn), - rename_equivalent_regs_in_insn, - reg_partition); - for_each_rtx (®_NOTES (insn), - rename_equivalent_regs_in_insn, - reg_partition); - - if (GET_CODE (PATTERN (insn)) == SEQUENCE) - { - rtx s = PATTERN (insn); - int slen = XVECLEN (s, 0); - int i; - - if (slen <= 1) - abort (); - - PATTERN (insn) = XVECEXP (s, 0, slen-1); - for (i = 0; i < slen - 1; i++) - emit_insn_before (XVECEXP (s, 0, i), insn); - } - } - - next = NEXT_INSN (insn); - } - while (insn != last); - } -} - -/* The main entry point for moving from SSA. */ - -void -convert_from_ssa (void) -{ - basic_block b, bb; - partition reg_partition; - rtx insns = get_insns (); - - /* Need global_live_at_{start,end} up to date. There should not be - any significant dead code at this point, except perhaps dead - stores. So do not take the time to perform dead code elimination. - - Register coalescing needs death notes, so generate them. */ - life_analysis (insns, NULL, PROP_DEATH_NOTES); - - /* Figure out which regs in copies and phi nodes don't conflict and - therefore can be coalesced. */ - if (conservative_reg_partition) - reg_partition = compute_conservative_reg_partition (); - else - reg_partition = compute_coalesced_reg_partition (); - - if (!check_hard_regs_in_partition (reg_partition)) - /* Two separate partitions should correspond to the same hard - register but do not. */ - abort (); - - rename_equivalent_regs (reg_partition); - - /* Eliminate the PHI nodes. */ - FOR_EACH_BB_REVERSE (b) - { - edge e; - - for (e = b->pred; e; e = e->pred_next) - if (e->src != ENTRY_BLOCK_PTR) - eliminate_phi (e, reg_partition); - } - - partition_delete (reg_partition); - - /* Actually delete the PHI nodes. */ - FOR_EACH_BB_REVERSE (bb) - { - rtx insn = bb->head; - - while (1) - { - /* If this is a PHI node delete it. */ - if (PHI_NODE_P (insn)) - { - if (insn == bb->end) - bb->end = PREV_INSN (insn); - insn = delete_insn (insn); - } - /* Since all the phi nodes come at the beginning of the - block, if we find an ordinary insn, we can stop looking - for more phi nodes. */ - else if (INSN_P (insn)) - break; - /* If we've reached the end of the block, stop. */ - else if (insn == bb->end) - break; - else - insn = NEXT_INSN (insn); - } - } - - /* Commit all the copy nodes needed to convert out of SSA form. */ - commit_edge_insertions (); - - in_ssa_form = 0; - - count_or_remove_death_notes (NULL, 1); - - /* Deallocate the data structures. */ - ssa_definition = 0; - ssa_rename_from_free (); -} - -/* Scan phi nodes in successors to BB. For each such phi node that - has a phi alternative value corresponding to BB, invoke FN. FN - is passed the entire phi node insn, the regno of the set - destination, the regno of the phi argument corresponding to BB, - and DATA. - - If FN ever returns nonzero, stops immediately and returns this - value. Otherwise, returns zero. */ - -int -for_each_successor_phi (basic_block bb, successor_phi_fn fn, void *data) -{ - edge e; - - if (bb == EXIT_BLOCK_PTR) - return 0; - - /* Scan outgoing edges. */ - for (e = bb->succ; e != NULL; e = e->succ_next) - { - rtx insn; - - basic_block successor = e->dest; - if (successor == ENTRY_BLOCK_PTR - || successor == EXIT_BLOCK_PTR) - continue; - - /* Advance to the first non-label insn of the successor block. */ - insn = first_insn_after_basic_block_note (successor); - - if (insn == NULL) - continue; - - /* Scan phi nodes in the successor. */ - for ( ; PHI_NODE_P (insn); insn = NEXT_INSN (insn)) - { - int result; - rtx phi_set = PATTERN (insn); - rtx *alternative = phi_alternative (phi_set, bb->index); - rtx phi_src; - - /* This phi function may not have an alternative - corresponding to the incoming edge, indicating the - assigned variable is not defined along the edge. */ - if (alternative == NULL) - continue; - phi_src = *alternative; - - /* Invoke the callback. */ - result = (*fn) (insn, REGNO (SET_DEST (phi_set)), - REGNO (phi_src), data); - - /* Terminate if requested. */ - if (result != 0) - return result; - } - } - - return 0; -} - -/* Assuming the ssa_rename_from mapping has been established, yields - nonzero if 1) only one SSA register of REG1 and REG2 comes from a - hard register or 2) both SSA registers REG1 and REG2 come from - different hard registers. */ - -static int -conflicting_hard_regs_p (int reg1, int reg2) -{ - int orig_reg1 = original_register (reg1); - int orig_reg2 = original_register (reg2); - if (HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2) - && orig_reg1 != orig_reg2) - return 1; - if (HARD_REGISTER_NUM_P (orig_reg1) && !HARD_REGISTER_NUM_P (orig_reg2)) - return 1; - if (!HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2)) - return 1; - - return 0; -} diff --git a/gcc/ssa.h b/gcc/ssa.h deleted file mode 100644 index ab3cdf1a789..00000000000 --- a/gcc/ssa.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Static Single Assignment (SSA) definitions for GCC - Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. - Written by Jeffrey D. Oldham . - -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 2, 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 COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - - -/* Main SSA routines. */ -extern void convert_to_ssa (void); -extern void convert_from_ssa (void); -typedef int (*successor_phi_fn) (rtx, int, int, void *); -extern int for_each_successor_phi (basic_block bb, successor_phi_fn, - void *); -void compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom); -extern int remove_phi_alternative (rtx, basic_block); - - -/* Optimizations. */ -/* In ssa-dce.c */ -extern void ssa_eliminate_dead_code (void); - -/* In ssa-ccp.c */ -extern void ssa_const_prop (void); - - -/* SSA definitions and uses. */ -/* This flag is set when the CFG is in SSA form. */ -extern int in_ssa_form; - -/* Element I is the single instruction that sets register I. */ -extern GTY(()) varray_type ssa_definition; - -/* Element I is an INSN_LIST of instructions that use register I. */ -extern varray_type ssa_uses; - - -/* Specify which hard registers should be converted. */ - -/* All pseudo-registers (having register number >= - FIRST_PSEUDO_REGISTER) and hard registers satisfying - CONVERT_HARD_REGISTER_TO_SSA_P are converted to SSA form. */ - -/* Given a hard register number REG_NO, return nonzero if and only if - the register should be converted to SSA. */ - -#ifndef CONVERT_HARD_REGISTER_TO_SSA_P -#define CONVERT_HARD_REGISTER_TO_SSA_P(REG_NO) (0) /* default of no hard registers */ -#endif /* CONVERT_HARD_REGISTER_TO_SSA_P */ - -/* Given a register number REG_NO, return nonzero if and only if the - register should be converted to SSA. */ - -#define CONVERT_REGISTER_TO_SSA_P(REG_NO) \ - ((!HARD_REGISTER_NUM_P (REG_NO)) || \ - (CONVERT_HARD_REGISTER_TO_SSA_P (REG_NO))) diff --git a/gcc/stmt.c b/gcc/stmt.c index 718f2558e7d..7b388dd6c1d 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -403,6 +403,7 @@ static bool check_unique_operand_names (tree, tree); static char *resolve_operand_name_1 (char *, tree, tree); static void expand_null_return_1 (rtx); static enum br_predictor return_prediction (rtx); +static rtx shift_return_value (rtx); static void expand_value_return (rtx); static int tail_recursion_args (tree, tree); static void expand_cleanups (tree, int, int); @@ -646,6 +647,13 @@ expand_goto (tree label) else #endif { + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + gen_rtx_SCRATCH (VOIDmode)))); + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + hard_frame_pointer_rtx))); + /* Restore frame pointer for containing function. This sets the actual hard register used for the frame pointer to the location of the function's incoming static chain info. @@ -1246,6 +1254,9 @@ parse_output_constraint (const char **constraint_p, int operand_num, break; } + if (*is_inout && !*allows_reg) + warning ("read-write constraint does not allow a register"); + return true; } @@ -1261,6 +1272,7 @@ parse_input_constraint (const char **constraint_p, int input_num, const char *orig_constraint = constraint; size_t c_len = strlen (constraint); size_t j; + bool saw_match = false; /* Assume the constraint doesn't allow the use of either a register or memory. */ @@ -1312,6 +1324,8 @@ parse_input_constraint (const char **constraint_p, int input_num, char *end; unsigned long match; + saw_match = true; + match = strtoul (constraint + j, &end, 10); if (match >= (unsigned long) noutputs) { @@ -1376,6 +1390,9 @@ parse_input_constraint (const char **constraint_p, int input_num, break; } + if (saw_match && !*allows_reg) + warning ("matching constraint does not allow a register"); + return true; } @@ -1704,13 +1721,16 @@ expand_asm_operands (tree string, tree outputs, tree inputs, if (CONSTANT_P (op)) { - op = force_const_mem (TYPE_MODE (type), op); - op = validize_mem (op); + rtx mem = force_const_mem (TYPE_MODE (type), op); + if (mem) + op = validize_mem (mem); + else + op = force_reg (TYPE_MODE (type), op); } - else if (GET_CODE (op) == REG - || GET_CODE (op) == SUBREG - || GET_CODE (op) == ADDRESSOF - || GET_CODE (op) == CONCAT) + if (GET_CODE (op) == REG + || GET_CODE (op) == SUBREG + || GET_CODE (op) == ADDRESSOF + || GET_CODE (op) == CONCAT) { tree qual_type = build_qualified_type (type, (TYPE_QUALS (type) @@ -2874,6 +2894,26 @@ expand_null_return (void) expand_null_return_1 (last_insn); } +/* Generate RTL to return directly from the current function. + (That is, we bypass any return value.) */ + +void +expand_naked_return (void) +{ + rtx last_insn, end_label; + + last_insn = get_last_insn (); + end_label = naked_return_label; + + clear_pending_stack_adjust (); + do_pending_stack_adjust (); + clear_last_expr (); + + if (end_label == 0) + end_label = naked_return_label = gen_label_rtx (); + expand_goto_internal (NULL_TREE, end_label, last_insn); +} + /* Try to guess whether the value of return means error code. */ static enum br_predictor return_prediction (rtx val) @@ -2902,6 +2942,34 @@ return_prediction (rtx val) return PRED_NO_PREDICTION; } + +/* If the current function returns values in the most significant part + of a register, shift return value VAL appropriately. The mode of + the function's return type is known not to be BLKmode. */ + +static rtx +shift_return_value (rtx val) +{ + tree type; + + type = TREE_TYPE (DECL_RESULT (current_function_decl)); + if (targetm.calls.return_in_msb (type)) + { + rtx target; + HOST_WIDE_INT shift; + + target = DECL_RTL (DECL_RESULT (current_function_decl)); + shift = (GET_MODE_BITSIZE (GET_MODE (target)) + - BITS_PER_UNIT * int_size_in_bytes (type)); + if (shift > 0) + val = expand_binop (GET_MODE (target), ashl_optab, + gen_lowpart (GET_MODE (target), val), + GEN_INT (shift), target, 1, OPTAB_WIDEN); + } + return val; +} + + /* Generate RTL to return from the current function, with value VAL. */ static void @@ -3066,7 +3134,7 @@ expand_return (tree retval) { int i; unsigned HOST_WIDE_INT bitpos, xbitpos; - unsigned HOST_WIDE_INT big_endian_correction = 0; + unsigned HOST_WIDE_INT padding_correction = 0; unsigned HOST_WIDE_INT bytes = int_size_in_bytes (TREE_TYPE (retval_rhs)); int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; @@ -3083,25 +3151,33 @@ expand_return (tree retval) return; } - /* Structures whose size is not a multiple of a word are aligned - to the least significant byte (to the right). On a BYTES_BIG_ENDIAN - machine, this means we must skip the empty high order bytes when - calculating the bit offset. */ - if (BYTES_BIG_ENDIAN - && bytes % UNITS_PER_WORD) - big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) - * BITS_PER_UNIT)); + /* If the structure doesn't take up a whole number of words, see + whether the register value should be padded on the left or on + the right. Set PADDING_CORRECTION to the number of padding + bits needed on the left side. + + In most ABIs, the structure will be returned at the least end of + the register, which translates to right padding on little-endian + targets and left padding on big-endian targets. The opposite + holds if the structure is returned at the most significant + end of the register. */ + if (bytes % UNITS_PER_WORD != 0 + && (targetm.calls.return_in_msb (TREE_TYPE (retval_rhs)) + ? !BYTES_BIG_ENDIAN + : BYTES_BIG_ENDIAN)) + padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) + * BITS_PER_UNIT)); /* Copy the structure BITSIZE bits at a time. */ - for (bitpos = 0, xbitpos = big_endian_correction; + for (bitpos = 0, xbitpos = padding_correction; bitpos < bytes * BITS_PER_UNIT; bitpos += bitsize, xbitpos += bitsize) { /* We need a new destination pseudo each time xbitpos is - on a word boundary and when xbitpos == big_endian_correction + on a word boundary and when xbitpos == padding_correction (the first time through). */ if (xbitpos % BITS_PER_WORD == 0 - || xbitpos == big_endian_correction) + || xbitpos == padding_correction) { /* Generate an appropriate register. */ dst = gen_reg_rtx (word_mode); @@ -3128,21 +3204,25 @@ expand_return (tree retval) BITS_PER_WORD); } - /* Find the smallest integer mode large enough to hold the - entire structure and use that mode instead of BLKmode - on the USE insn for the return register. */ - for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); - tmpmode != VOIDmode; - tmpmode = GET_MODE_WIDER_MODE (tmpmode)) - /* Have we found a large enough mode? */ - if (GET_MODE_SIZE (tmpmode) >= bytes) - break; + tmpmode = GET_MODE (result_rtl); + if (tmpmode == BLKmode) + { + /* Find the smallest integer mode large enough to hold the + entire structure and use that mode instead of BLKmode + on the USE insn for the return register. */ + for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); + tmpmode != VOIDmode; + tmpmode = GET_MODE_WIDER_MODE (tmpmode)) + /* Have we found a large enough mode? */ + if (GET_MODE_SIZE (tmpmode) >= bytes) + break; - /* No suitable mode found. */ - if (tmpmode == VOIDmode) - abort (); + /* No suitable mode found. */ + if (tmpmode == VOIDmode) + abort (); - PUT_MODE (result_rtl, tmpmode); + PUT_MODE (result_rtl, tmpmode); + } if (GET_MODE_SIZE (tmpmode) < GET_MODE_SIZE (word_mode)) result_reg_mode = word_mode; @@ -3175,7 +3255,7 @@ expand_return (tree retval) val = force_not_mem (val); emit_queue (); /* Return the calculated value, doing cleanups first. */ - expand_value_return (val); + expand_value_return (shift_return_value (val)); } else { @@ -3487,6 +3567,14 @@ expand_nl_handler_label (rtx slot, rtx before_insn) static void expand_nl_goto_receiver (void) { + /* Clobber the FP when we get here, so we have to make sure it's + marked as used by this function. */ + emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + + /* Mark the static chain as clobbered here so life information + doesn't get messed up for it. */ + emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx)); + #ifdef HAVE_nonlocal_goto if (! HAVE_nonlocal_goto) #endif @@ -3535,6 +3623,13 @@ expand_nl_goto_receiver (void) if (HAVE_nonlocal_goto_receiver) emit_insn (gen_nonlocal_goto_receiver ()); #endif + + /* @@@ This is a kludge. Not all machine descriptions define a blockage + insn, but we must not allow the code we just generated to be reordered + by scheduling. Specifically, the update of the frame pointer must + happen immediately, not later. So emit an ASM_INPUT to act as blockage + insn. */ + emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "")); } /* Make handlers for nonlocal gotos taking place in the function calls in diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 6e128e3560d..1272a0cbbcc 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -203,10 +203,10 @@ variable_size (tree size) #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode) #endif -/* Return the machine mode to use for a nonscalar of SIZE bits. - The mode must be in class CLASS, and have exactly that many bits. - If LIMIT is nonzero, modes of wider than MAX_FIXED_MODE_SIZE will not - be used. */ +/* Return the machine mode to use for a nonscalar of SIZE bits. The + mode must be in class CLASS, and have exactly that many value bits; + it may have padding as well. If LIMIT is nonzero, modes of wider + than MAX_FIXED_MODE_SIZE will not be used. */ enum machine_mode mode_for_size (unsigned int size, enum mode_class class, int limit) @@ -219,7 +219,7 @@ mode_for_size (unsigned int size, enum mode_class class, int limit) /* Get the first mode which has this size, in the specified class. */ for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if (GET_MODE_BITSIZE (mode) == size) + if (GET_MODE_PRECISION (mode) == size) return mode; return BLKmode; @@ -242,7 +242,7 @@ mode_for_size_tree (tree size, enum mode_class class, int limit) } /* Similar, but never return BLKmode; return the narrowest mode that - contains at least the requested number of bits. */ + contains at least the requested number of value bits. */ enum machine_mode smallest_mode_for_size (unsigned int size, enum mode_class class) @@ -253,7 +253,7 @@ smallest_mode_for_size (unsigned int size, enum mode_class class) specified class. */ for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if (GET_MODE_BITSIZE (mode) >= size) + if (GET_MODE_PRECISION (mode) >= size) return mode; abort (); @@ -435,7 +435,9 @@ layout_decl (tree decl, unsigned int known_align) enum machine_mode xmode = mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1); - if (xmode != BLKmode && known_align >= GET_MODE_ALIGNMENT (xmode)) + if (xmode != BLKmode + && (known_align == 0 + || known_align >= GET_MODE_ALIGNMENT (xmode))) { DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode), DECL_ALIGN (decl)); @@ -453,7 +455,7 @@ layout_decl (tree decl, unsigned int known_align) else if (DECL_PACKED (decl) && DECL_USER_ALIGN (decl)) /* Don't touch DECL_ALIGN. For other packed fields, go ahead and round up; we'll reduce it again below. We want packing to - supercede USER_ALIGN inherited from the type, but defer to + supersede USER_ALIGN inherited from the type, but defer to alignment explicitly specified on the field decl. */; else do_type_align (type, decl); diff --git a/gcc/system.h b/gcc/system.h index d0a9eab00db..a62e2a68faa 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -251,28 +251,6 @@ extern int errno; #include #endif -#ifndef WIFSIGNALED -#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f) -#endif -#ifndef WTERMSIG -#define WTERMSIG(S) ((S) & 0x7f) -#endif -#ifndef WIFEXITED -#define WIFEXITED(S) (((S) & 0xff) == 0) -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(S) (((S) & 0xff00) >> 8) -#endif -#ifndef WSTOPSIG -#define WSTOPSIG WEXITSTATUS -#endif -#ifndef WCOREDUMP -#define WCOREDUMP(S) ((S) & WCOREFLG) -#endif -#ifndef WCOREFLG -#define WCOREFLG 0200 -#endif - /* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they are defined to 0 then we must provide the relevant declaration here. These checks will be in the undefined state while configure @@ -490,8 +468,8 @@ extern int snprintf (char *, size_t, const char *, ...); FIXME: provide a complete autoconf test for buggy enum bitfields. */ #if (GCC_VERSION > 2000) -#define ENUM_BITFIELD(TYPE) enum TYPE -#define CHAR_BITFIELD unsigned char +#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE +#define CHAR_BITFIELD __extension__ unsigned char #else #define ENUM_BITFIELD(TYPE) unsigned int #define CHAR_BITFIELD unsigned int @@ -594,7 +572,8 @@ typedef char _Bool; ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \ INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \ DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \ - MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL + MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \ + PRETEND_OUTGOING_VARARGS_NAMED /* Other obsolete target macros, or macros that used to be in target headers and were not used, and may be obsolete or may never have @@ -618,7 +597,9 @@ typedef char _Bool; DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE \ INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT \ EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS MAP_CHARACTER \ - LIBGCC_NEEDS_DOUBLE + LIBGCC_NEEDS_DOUBLE FINAL_PRESCAN_LABEL DEFAULT_CALLER_SAVES \ + LOAD_ARGS_REVERSED MAX_INTEGER_COMPUTATION_MODE \ + CONVERT_HARD_REGISTER_TO_SSA_P /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ diff --git a/gcc/target-def.h b/gcc/target-def.h index 5c7fcb0b9df..9ff668d3f14 100644 --- a/gcc/target-def.h +++ b/gcc/target-def.h @@ -316,6 +316,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TARGET_MACHINE_DEPENDENT_REORG 0 +#define TARGET_BUILD_BUILTIN_VA_LIST std_build_builtin_va_list + #define TARGET_GET_PCH_VALIDITY default_get_pch_validity #define TARGET_PCH_VALID_P default_pch_valid_p @@ -325,6 +327,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TARGET_STRUCT_VALUE_RTX default_struct_value_rtx #define TARGET_RETURN_IN_MEMORY default_return_in_memory +#define TARGET_RETURN_IN_MSB hook_bool_tree_false #define TARGET_EXPAND_BUILTIN_SAVEREGS default_expand_builtin_saveregs #define TARGET_SETUP_INCOMING_VARARGS default_setup_incoming_varargs @@ -337,6 +340,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. TARGET_PROMOTE_PROTOTYPES, \ TARGET_STRUCT_VALUE_RTX, \ TARGET_RETURN_IN_MEMORY, \ + TARGET_RETURN_IN_MSB, \ TARGET_EXPAND_BUILTIN_SAVEREGS, \ TARGET_SETUP_INCOMING_VARARGS, \ TARGET_STRICT_ARGUMENT_NAMING, \ @@ -377,6 +381,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. TARGET_ADDRESS_COST, \ TARGET_DWARF_REGISTER_SPAN, \ TARGET_MACHINE_DEPENDENT_REORG, \ + TARGET_BUILD_BUILTIN_VA_LIST, \ TARGET_GET_PCH_VALIDITY, \ TARGET_PCH_VALID_P, \ TARGET_HAVE_NAMED_SECTIONS, \ diff --git a/gcc/target.h b/gcc/target.h index 0b19445456a..93935374c15 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -207,7 +207,7 @@ struct gcc_target correspondingly starts and finishes. The function defined by init_dfa_pre_cycle_insn and init_dfa_post_cycle_insn are used to initialize the corresponding insns. The default values of - the memebers result in not changing the automaton state when + the members result in not changing the automaton state when the new simulated processor cycle correspondingly starts and finishes. */ void (* init_dfa_pre_cycle_insn) (void); @@ -262,9 +262,8 @@ struct gcc_target fourth argument is the cost of the dependence as estimated by the scheduler. The last argument is the distance in cycles between the already scheduled insn (first parameter) and the - the second insn (second parameter). - */ - bool (* is_costly_dependence) PARAMS ((rtx, rtx, rtx, int, int)); + the second insn (second parameter). */ + bool (* is_costly_dependence) (rtx, rtx, rtx, int, int); } sched; /* Given two decls, merge their attributes and return the result. */ @@ -382,6 +381,9 @@ struct gcc_target delayed-branch scheduling. */ void (* machine_dependent_reorg) (void); + /* Create the __builtin_va_list type. */ + tree (* build_builtin_va_list) (void); + /* Validity-checking routines for PCH files, target-specific. get_pch_validity returns a pointer to the data to be stored, and stores the size in its argument. pch_valid_p gets the same @@ -424,6 +426,7 @@ struct gcc_target bool (*promote_prototypes) (tree fntype); rtx (*struct_value_rtx) (tree fndecl, int incoming); bool (*return_in_memory) (tree type, tree fndecl); + bool (*return_in_msb) (tree type); rtx (*expand_builtin_saveregs) (void); /* Returns pretend_argument_size. */ void (*setup_incoming_varargs) (CUMULATIVE_ARGS *ca, enum machine_mode mode, diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 1000abb5d24..18d3be3ad0c 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -185,20 +185,25 @@ default_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) bool default_pretend_outgoing_varargs_named(CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) { -#ifdef PRETEND_OUTGOING_VARARGS_NAMED - return PRETEND_OUTGOING_VARARGS_NAMED; -#else #ifdef SETUP_INCOMING_VARARGS return 1; #else return (targetm.calls.setup_incoming_varargs != default_setup_incoming_varargs); #endif -#endif } /* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */ + bool hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS * a ATTRIBUTE_UNUSED) { return true; } + +/* Generic hook that takes a machine mode and returns true. */ + +bool +hook_bool_machine_mode_true (enum machine_mode a ATTRIBUTE_UNUSED) +{ + return true; +} diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 724abe82ab4..e5c5a2a5596 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -33,3 +33,4 @@ extern bool default_strict_argument_naming (CUMULATIVE_ARGS *); extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *); extern bool hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS *); +extern bool hook_bool_machine_mode_true (enum machine_mode); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 47a7512c64f..f8697027d00 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,1020 @@ +2004-02-18 Paul Brook + + * gcc.c-torture/compile/libcall-1.c: New test. + +2004-02-18 Paul Brook + + PR debug/12934 + * gcc.dg/debug/debug-7.c: New test. + +2004-01-07 Richard Earnshaw + Mark Mitchell + + * g++.dg/abi/vbase10.C: Use -mstructure-size-boundary=8 on ARM. + +2003-12-29 Mark Mitchell + + * g++.old-deja/g++.pt/static11.C: Correct XFAIL syntax. + + * gcc.dg/builtins-config.h: Include , not . + +2003-12-28 Mark Mitchell + + * gcc.dg/const-elim-1.c: XFAIL on arm-*-*. + +2003-12-23 Mark Mitchell + + * g++.dg/bprob/bprob.exp: Load target-supports.exp + * g77.dg/bprob/bprob.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise. + * gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float + variants on systems where the library does not provide that + functionality. + * gcc.dg/builtins-20.c: Use builtins-config.h. + * gcc.dg/builtins-config.h: New file. + + * lib/gcc-dg.exp (dg-require-profiling): New function. + * lib/target-supports.exp (check_profiling_available): Likewise. + * g++.dg/bprob/bprob.exp: Use check_profiling_available. + * g77.dg/bprob/bprob.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise. + * g++.old-deja/g++.law/profile1.C: Use dg-require-profiling. + * gcc.dg/20021014-1.c: Likewise. + * gcc.dg/nest.c: Likewise. + + * g++.dg/lookup/java1.C: Use -fdollars-in-identifiers when + compiling. + * g++.dg/lookup/java2.C: Likewise. + * gcc.dg/cpp/lexident.c: Likewise. + +2003-12-30 Mark Mitchell + + * g++.dg/abi/vbase10.C: XFAIL on arm*-*-*. + +2003-12-30 Kazu Hirata + + * g++.old-deja/g++.jason/thunk2.C: Remove traces of dead + ports. + * g++.old-deja/g++.jason/thunk3.C: Likewise. + * g++.old-deja/g++.law/profile1.C: Likewise. + * gcc.c-torture/compile/981006-1.c: Likewise. + * gcc.c-torture/execute/loop-2e.x: Likewise. + * gcc.c-torture/execute/loop-2f.x: Remove. + * gcc.c-torture/execute/loop-2g.x: Likewise. + * gcc.c-torture/execute/strct-varg-1.x: Likewise. + * gcc.dg/20020312-2.c: Remove traces of dead ports. + +2003-12-30 Nathan Sidwell + + PR c++/13507 + * g++.dg/ext/attrib11.C: New test. + + PR c++/13494 + * g++.dg/template/array2-1.C: New test. + * g++.dg/template/array2-2.C: New test. + +2003-12-29 Mark Mitchell + + * g++.old-deja/g++.pt/static11.C: Correct XFAIL syntax. + +2003-12-29 Nathan Sidwell + + PR c++/12774 + * g++.dg/template/array1-1.C: New test. + * g++.dg/template/array1-2.C: New test. + +2003-12-29 Roger Sayle + + PR fortran/12632 + * g77.dg/12632.f: New test case. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/13289 + * g++.dg/parse/nontype1.C: New test. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/12403 + * g++.dg/parse/explicit1.C: New test. + * g++.old-deja/g++.pt/explicit71.C: Adjust expected error. + +2003-12-28 Mark Mitchell + + PR c++/13081 + * g++.dg/opt/inline6.C: New test. + + PR c++/12613 + * g++.dg/parse/error9.C: New test. + + * gcc.dg/const-elim-1.c: XFAIL on arm-*-*. + +2003-12-28 Mark Mitchell + + PR c++/13009 + * g++.dg/init/assign1.C: New test. + +2003-12-28 Roger Sayle + + PR c++/13070 + * g++.dg/warn/format3.C: New test case. + +2003-12-27 Zdenek Dvorak + + * gcc.c-torture/compile/20031227-1.c: New test. + +2003-12-23 Mark Mitchell + + * g++.dg/bprob/bprob.exp: Load target-supports.exp + * g77.dg/bprob/bprob.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise. + * gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float + variants on systems where the library does not provide that + functionality. + * gcc.dg/builtins-20.c: Use builtins-config.h. + * gcc.dg/builtins-config.h: New file. + +2003-12-23 Mark Mitchell + + * lib/gcc-dg.exp (dg-require-profiling): New function. + * lib/target-supports.exp (check_profiling_available): Likewise. + * g++.dg/bprob/bprob.exp: Use check_profiling_available. + * g77.dg/bprob/bprob.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise. + * g++.old-deja/g++.law/profile1.C: Use dg-require-profiling. + * gcc.dg/20021014-1.c: Likewise. + * gcc.dg/nest.c: Likewise. + +2003-12-23 Mark Mitchell + + * g++.dg/lookup/java1.C: Use -fdollars-in-identifiers when + compiling. + * g++.dg/lookup/java2.C: Likewise. + * gcc.dg/cpp/lexident.c: Likewise. + +2003-12-23 Kazu Hirata + + * gcc.c-torture/compile/20020604-1.c: XFAIL on H8 if -mn is + given. + * gcc.c-torture/compile/961203-1.c: Likewise. + * gcc.c-torture/compile/980506-1.c: Likewise. + +2003-12-23 Zack Weinberg + + * lib/gcc-dg.exp (dg-prune-output): New annotation. + (additional_prunes): New global. + (gcc-dg-prune): Handle additional per-test pruning. + (dg-test): Clear additional_prunes between tests. + + * gcc.c-torture/compile/920625-1.c: Remove xfail. Use + dg-prune-output to avoid spurious failures from assembler + complaining about nonexistent WAW violations. + * gcc.c-torture/compile/981223-1.c: Remove dg-options line. + Use dg-prune-output to avoid spurious failures from assembler + warning about Itanium B-step errata. + +2003-12-23 Mark Mitchell + + * g++.dg/abi/macro0.C: New test. + * g++.dg/abi/macro1.C: Likewise. + * g++.dg/abi/macro2.C: Likewise. + + * g++.dg/abi/bitfield5.C: Add explicit -fabi-version=1 option. + * g++.dg/abi/bitfield7.C: Likewise. + * g++.dg/abi/dtor2.C: Likewise. + * g++.dg/abi/mangle11.C: Likewise. + * g++.dg/abi/mangle12.C: Likewise. + * g++.dg/abi/mangle14.C: Likewise. + * g++.dg/abi/mangle17.C: Likewise. + * g++.dg/abi/vbase10.C: Likewise. + * g++.dg/abi/vbase14.C: Likewise. + * g++.dg/template/qualttp17.C: Likewise. + +2003-12-21 Andrew Pinski + + PR c/11995 + * gcc.dg/20031223-1.c: New test. + +2003-12-23 Eric Botcazou + + * gcc.dg/noreturn-7.c: New test. + +2003-12-23 Eric Botcazou + + * gcc.dg/null-pointer-1.c: New test. + +2003-12-22 Mark Mitchell + + * g++.old-deja/g++.jason/template18.C: Remove. + * g++.old-deja/g++.jason/template37.C: Likewise. + + PR c++/12862 + * g++.dg/lookup/ns1.C: New test. + + PR c++/12397 + * g++.dg/template/lookup3.C: New test. + +2003-12-22 Andrew Pinski + + * g++.dg/template/recurse1.C: New test + +2003-12-22 Mark Mitchell + + PR c++/12479 + * g++.dg/parse/semicolon1.C: New test. + * g++.dg/parse/semicolon1.h: Likewise. + +2003-12-22 Fariborz Jahanian + + * gcc.dg/darwin-misaligned.c: New test. + +2003-12-22 Andrew Pinski + + PR c/9163 + * gcc.dg/20031222-1.c: New test. + +2003-12-21 Mark Mitchell + + PR c++/13438 + * g++.dg/parse/error8.C: New test. + + PR c++/11554 + * testsuite/g++.dg/warn/ctor-init-1.C: New test. + +2003-12-21 Kazu Hirata + + * gcc.c-torture/compile/20020910-1.c: Disable if __INT_MAX is + too small. + * gcc.c-torture/compile/930217-1.c: Likewise. + * gcc.c-torture/compile/930513-1.c: Likewise. + * gcc.c-torture/execute/920908-2.c: Likewise. + * gcc.c-torture/execute/921204-1.c: Likewise. + * gcc.c-torture/execute/930621-1.c: Likewise. + * gcc.c-torture/execute/930630-1.c: Likewise. + * gcc.c-torture/execute/931031-1.c: Likewise. + * gcc.c-torture/execute/980602-2.c: Likewise. + * gcc.c-torture/execute/comp-goto-1.c: Likewise. + * gcc.c-torture/execute/compndlit-1.c: Likewise. + * gcc.c-torture/execute/extzvsi.c: Likewise. + * gcc.c-torture/unsorted/ext.c: Likewise. + +2003-12-20 Andrew Pinski + + PR target/12749 + * gcc.c-torture/compile/20031220-2.c: New test case. + +2003-12-20 Roger Sayle + + PR optimization/13031 + * gcc.c-torture/compile/20031220-1.c: New test case. + +2003-12-20 Eric Botcazou + + * gcc.dg/cast-function-1.c: New test. + +2003-12-19 Joseph S. Myers + + * gcc.dg/format/ext-1.c: Allow 'I' flag on floating point decimal + formats. + +2003-12-19 Mark Mitchell + + PR c++/12795 + * g++.dg/ext/attrib10.C: New test. + +2003-12-19 Jakub Jelinek + + * gcc.dg/cleanup-10.c: New test. + * gcc.dg/cleanup-11.c: New test. + +2003-12-19 Jakub Jelinek + + PR c++/13239 + * g++.dg/opt/expect1.C: New test. + +2003-12-19 Hartmut Penner + + * gcc.dg/altivec-varargs-1.c: Enable testcase on ppc linux. + +2003-12-18 Andrew Pinski + + PR debug/12923 + * gcc.dg/20031218-1.c: New test. + + PR debug/12389 + * gcc.dg/20031218-2.c: New test. + * gcc.dg/20031218-3.c: New test. + + * g++.dg/abi/mangle18-1.C: Modify regexp to test for `[: \t\n]' at end + of label name and allow for USER_LABEL_PREFIX == "_" names. + * g++.dg/abi/mangle18-2.C: Likewise. + * g++.dg/abi/mangle19-1.C: Likewise. + * g++.dg/abi/mangle19-2.C: Likewise. + * g++.dg/abi/mangle20-1.C: Likewise. + * g++.dg/abi/mangle20-2.C: Likewise. + +2003-12-18 Richard Henderson + + * gcc.dg/bitfld-1.c: Expect warnings for enum bitfields. + +2003-12-18 Steven Bosscher + Dan Kegel + + PR other/12009 + * g++.dg/compat/compat.exp: Do not set LD_LIBRARY_PATH when + testing a cross compiler, it causes spurious compile failures. + * lib/g++.exp: Likewise. + +2003-12-18 Kriang Lerdsuwanakij + + PR c++/13262 + * g++.dg/template/access13.C: New test. + +2003-12-18 Ulrich Weigand + + * gcc.dg/20031216-1.c: New test. + +2003-12-18 Giovanni Bajo + + PR c++/9154 + * g++.dg/template/error10.C: New test. + +2003-12-18 Eric Botcazou + + * g++.dg/eh/simd-1.C: XFAIL on SPARC. + * g++.dg/eh/simd-2.C: Likewise. + +2003-12-17 James E Wilson + Roger Sayle + + * gcc.c-torture/execute/ieee/mzero5.c: New. + +2003-12-17 Mark Mitchell + + PR c++/10603 + * g++.dg/parse/error6.C: New test. + + PR c++/12827 + * g++.dg/parse/error7.C: New test. + +2003-12-17 Eric Botcazou + + * lib/gcc-dg.exp (gcc-dg-debug-runtest): Do not run debug-[12].c + at -O with stabs debugging formats. + * gcc.dg/debug/debug-1.c: Turn 'p' into a global variable. + * gcc.dg/debug/debug-2.c: Likewise. + +2003-12-16 Mark Mitchell + + PR c++/12696 + * g++.dg/init/error1.C: New test. + + PR c++/12218 + * g++.dg/init/pm3.C: New test. + +2003-12-17 Joseph S. Myers + + PR c/3347 + * gcc.dg/bitfld-8.c: New test. + +2003-12-16 James Lemke + + * gcc.dg/arm-scd42-[123].c: New tests. + +2003-12-16 Nathan Sidwell + + PR c++/9043 + * g++.dg/abi/mangle20-1.C: New test. + * g++.dg/abi/mangle20-2.C: New test. + +2003-12-16 Mark Mitchell + + PR c++/13275 + * g++.dg/other/offsetof2.C: Remove XFAIL. + * g++.dg/parse/offsetof1.C: New test. + * g++.gd/parse/offsetof2.C: Likewise. + +2003-12-16 Giovanni Bajo + + * g++.dg/template/nontype3.C: New test. + * g++.dg/template/static2.C: Tweaked the dg-error clause. + +2003-12-16 Kriang Lerdsuwanakij + + * g++.dg/warn/noreturn-3.C: Also test instantiation. + +2003-12-16 Nathan Sidwell + + PR c++/13387 + * g++.dg/expr/assign1.C: New test. + + PR c++/13242 + * g++.dg/abi/mangle19-1.C: New test. + * g++.dg/abi/mangle19-2.C: New test. + +2003-12-16 Hartmut Penner + + * testsuite/gcc.dg/altivec-10.c: Test vec_cmple and vec_all_numeric. + +2003-12-16 Eric Botcazou + + * gcc.c-torture/execute/20031216-1.c: New test. + +2003-12-16 Giovanni Bajo + + * g++.dg/template/ptrmem7.C: Simplified the test case to not hit + an ICE regression. + +2003-12-15 Mark Mitchell + + PR c++/10926 + * g++.dg/template/error9.C: New test. + + PR c++/11116 + * g++.dg/template/error8.C: New test. + +2003-12-15 Roger Sayle + + PR middle-end/13400 + * gcc.c-torture/execute/20031215-1.c: New test case. + +2003-12-15 Mark Mitchell + + PR c++/13269 + * g++.dg/parse/error5.C: New test. + + PR c++/12989 + * g++.dg/expr/sizeof1.C: New test. + + PR c++/13310 + * g++.dg/template/crash15.C: New test. + +2003-12-15 Geoffrey Keating + + * g++.old-deja/g++.pt/vaarg3.C: Don't expect an error for passing + a non-POD type as the last named parameter of a varargs function. + +2003-12-15 Mark Mitchell + + PR c++/13243 + PR c++/12573 + * g++.dg/template/crash14.C: New test. + * g++.dg/template/dependent-expr3.C: Add dg-error markers. + +2003-12-15 Nathan Sidwell + + * g++.dg/other/java1.C: New test. + + PR c++/13241 + * g++.dg/abi/mangle18-1.C: New test. + * g++.dg/abi/mangle18-2.C: New test. + +2003-12-15 Zdenek Dvorak + + PR optimization/10312 + * gcc.c-torture/execute/20031214-1.c: New. + +2003-12-14 Mark Mitchell + + PR c++/10779 + PR c++/12160 + * g++.dg/parse/error3.C: New test. + * g++.dg/parse/error4.C: Likewise. + * g++.dg/abi/mangle4.C: Tweak error messages. + * g++.dg/lookup/using5.C: Likewise. + * g++.dg/other/error2.C: Likewise. + * g++.dg/parse/typename5.C: Likewise. + * g++.dg/parse/undefined1.C: Likewise. + * g++.dg/template/arg2.C: Likewise. + * g++.dg/template/ttp3.C: Likewise. + * g++.dg/template/type1.C: Likewise. + * g++.old-deja/g++.other/crash32.C: Likewise. + * g++.old-djea/g++.pt/defarg8.C: Likewise. + +2003-12-14 Kriang Lerdsuwanakij + + PR c++/13106 + * g++.dg/warn/noreturn-3.C: New test. + +2003-12-12 Nathan Sidwell + + PR c++/13118 + * g++.dg/abi/covariant3.C: New. + +2003-12-12 Jakub Jelinek + + * g++.dg/eh/ia64-1.C: New test. + +2003-12-12 Roger Sayle + + PR optimization/13037 + * g77.f-torture/execute/13037.f: New test case. + +2003-12-12 Nathan Sidwell + + PR c++/12881 + * g++.dg/abi/covariant2.C: New. + +2003-12-12 Neil Booth + + * testsuite/gcc.dg/cpp/trad/macro.c: New tests. + +2003-12-11 Zack Weinberg + + * gcc.c-torture/execute/wchar_t-1.x: Delete. + +2003-12-10 Robert Schiele + + PR other/10819 + * lib/gcc.exp (default_gcc_version): Do not match NL/CR characters + to fix Bug 10819. + * lib/g++.exp (g++_version): Likewise. + * lib/g77.exp (g77_version): Likewise. + * lib/objc.exp (default_objc_version): Likewise. + +2003-12-10 Richard Henderson + + * gcc.c-torture/execute/wchar_t-1.c: Convert to utf-8. + + * gcc.dg/intermod-1.c: Adjust assembler scan pattern for alpha. + +2003-12-08 Matt Austern + + PR c/13134 + * lib/gcc-dg.exp (dg-require-visibility): Define. + * lib/target-supports (check_visibility_available): Define. + * gcc.dg/visibility-1.c: New test. + * gcc.dg/visibility-2.c: Likewise. + * gcc.dg/visibility-3.c: Likewise. + * gcc.dg/visibility-4.c: Likewise. + * gcc.dg/visibility-5.c: Likewise. + * gcc.dg/visibility-6.c: Likewise. + * g++.dg/ext/visibility-1.C: Likewise. + * g++.dg/ext/visibility-2.C: Likewise. + * g++.dg/ext/visibility-3.C: Likewise. + * g++.dg/ext/visibility-4.C: Likewise. + * g++.dg/ext/visibility-5.C: Likewise. + * g++.dg/ext/visibility-6.C: Likewise. + +2003-12-07 Giovanni Bajo + + * g++.dg/lookup/java1.C: New test. + * g++.dg/lookup/java2.C: New test. + +2003-12-07 Falk Hueffner + + * g++.dg/opt/noreturn-1.C: New test. + +2003-12-07 Wolfgang Bangerth + + * gcc.dg/overflow-1.c: New test. + +2003-12-07 Eric Botcazou + + * g77.f-torture/compile/13060.f: New test. + +2003-12-06 Mark Mitchell + + PR c++/13323 + * g++.dg/inherit/operator2.C: New test. + +2003-12-05 Mark Mitchell + + PR c++/13305 + * g++.dg/ext/attrib9.C: New test. + +2003-12-05 Mark Mitchell + + PR c++/13314 + * g++.dg/template/error7.C: New test. + +2003-12-05 Stuart Menefy + J"orn Rennecke + + PR target/13302 + * g++.dg/other/struct-va_list.C: New test. + +2003-12-05 Kriang Lerdsuwanakij + + PR c++/13166 + * g++.dg/parse/defarg6.C: New test. + +2003-12-05 Hans-Peter Nilsson + + PR target/13256 + * gcc.c-torture/execute/20031201-1.c: New test. + +2003-12-05 Arnaud Charlet + + * ada/acats/run_acats: Add checks against missing gnatlib/gnattools. + +2003-12-05 Eric Botcazou + + * gcc.dg/builtin-return-1.c: New test. + +2003-12-04 Stuart Menefy + J"orn Rennecke + + PR optimization/13260 + * gcc.c-torture/execute/20031204-1.c: New test. + +2003-12-03 Mark Mitchell + + PR c++/9127 + * g++.dg/template/error6.C: New test. + +2003-12-03 Jakub Jelinek + + * gcc.dg/20031202-1.c: New test. + +2003-12-03 Mark Mitchell + + PR c++/13179 + * g++.dg/template/eh1.C: New test. + + PR c++/10771 + * g++.dg/template/error5.C: New test. + +2003-12-02 David Ung + + * gcc.dg/compat/vector-check.h: Corrected type for var + g_##TMODE + +2003-12-02 Giovanni Bajo + + PR c++/10126 + * g++.dg/template/ptrmem8.C: New test. + +2003-12-02 Giovanni Bajo + + PR c++/12573 + * g++.dg/template/dependent-expr3.C: New test. + +2003-12-01 James Lemke + + * gcc.dg/arm-g2.c: New test. + +2003-12-01 Roger Sayle + + PR optimization/11634 + * gcc.dg/20031201-2.c: New test case. + +2003-12-01 Zack Weinberg + + PR 11433 + * objc.dg/proto-lossage-3.m: New test. + +2003-12-01 Roger Sayle + + PR optimization/12628 + * gcc.dg/20031201-1.c: New test case. + +2003-12-01 Eric Botcazou + + * gcc.dg/unaligned-1.c: New test. + +2003-11-30 Mark Mitchell + + PR c++/9849 + * g++.dg/template/error4.C: New test. + * g++.dg/template/nested3.C: Adjust error markers. + +2003-11-30 Kaveh R. Ghazi + + * gcc.dg/cpp/assert4.c: Check more #system assertions. + +2003-11-29 Joseph S. Myers + + PR c/10333 + * gcc.dg/bitfld-7.c: New test. + +2003-11-29 Richard Sandiford + + * gcc.dg/tls/asm-1.C: New test. + +2003-11-28 Kaveh R. Ghazi + + * gcc.dg/cpp/assert4.c: Update. + +2003-11-28 Eric Botcazou + + * gcc.dg/builtin-apply2.c: Set size of stack argument data to 64. + * gcc.dg/builtin-apply3.c: New test. + +2003-11-27 Eric Botcazou + + * lib/compat.exp (compat-obj): New xfaildata parameter. + Use it to set compiler_conditional_xfail_data before compiling. + (compat-get-options): Handle dg-xfail-if. + (compat-execute): Retrieve XFAIL data and pass them to compat-obj. + * gcc.dg/compat/vector-1_x.c: XFAIL on SPARC. + * gcc.dg/compat/vector-1_y.c: Likewise. + * gcc.dg/compat/vector-2_x.c: Likewise. + * gcc.dg/compat/vector-2_y.c: Likewise. + +2003-11-27 Eric Botcazou + + * g++.dg/opt/reg-stack4.C: New test. + +2003-11-27 Eric Botcazou + + * gcc.dg/builtin-apply2.c: New test. + +2003-11-26 Eric Botcazou + + * gcc.c-torture/compile/20031023-4.c: Don't XFAIL on SPARC64. + +2003-11-23 Kriang Lerdsuwanakij + + PR c++/12924 + * g++.dg/template/template-id-2.C: New test. + +2003-11-22 Kriang Lerdsuwanakij + + PR c++/5369 + * g++.dg/template/memfriend1.C: New test. + * g++.dg/template/memfriend2.C: Likewise. + * g++.dg/template/memfriend3.C: Likewise. + * g++.dg/template/memfriend4.C: Likewise. + * g++.dg/template/memfriend5.C: Likewise. + * g++.dg/template/memfriend6.C: Likewise. + * g++.dg/template/memfriend7.C: Likewise. + * g++.dg/template/memfriend8.C: Likewise. + * g++.old-deja/g++.pt/friend44.C: Remove a bogus error. + +2003-11-21 Mark Mitchell + + PR c++/12515 + * g++.dg/ext/cond1.C: New test. + +2003-11-20 Richard Henderson + + * gcc.dg/20020201-2.c: Remove. + * gcc.dg/20020201-4.c: Remove. + * gcc.dg/20020304-1.c: Remove. + +2003-11-19 Nathanael Nerode + + * gcc.dg/cpp/trad/xwin1.c: New test case. + +2003-11-19 Andreas Tobler + + * g++.dg/compat/compat.exp: Add DYLD_LIBRARY_PATH for darwin. + * lib/g77.exp: Likewise. + * lib/objc.exp: Likewise. + * lib/g++.exp: Likewise, add -multiply_defined suppress flag + for darwin. + +2003-11-18 Kriang Lerdsuwanakij + + PR c++/12932 + * g++.dg/template/static5.C: New test. + +2003-11-18 Joseph S. Myers + + * gcc.dg/nested-func-1.c: New test. + +2003-11-16 Kaveh R. Ghazi + + * gcc.dg/cpp/assert4.c: New test. + +2003-11-14 Giovanni Bajo + + PR c++/2294 + * g++.dg/lookup/using9.c: New test. + +2003-11-14 Mark Mitchell + + PR c++/12762 + * g++.dg/template/error3.C: New test. + +2003-11-14 Arnaud Charlet + + PR ada/13035 + * ada/acats/run_acats, run_all.sh: Fix syntax error. + No longer use a wrapper for gcc, since this does not work under + Windows. + +2003-11-14 Giovanni Bajo + + PR c++/2094 + * g++.dg/template/ptrmem7.C: New test. + +2003-11-13 Andrew Pinski + + * gcc.c-torture/compile/20031113-1.c: New test. + +2003-11-13 Mark Mitchell + Kean Johnston + + PR c/13029 + * gcc.dg/unused-4.c: Update. + +2003-11-13 Eric Botcazou + + * g++.dg/opt/const3.C: New test. + +2003-11-13 Jan Hubicka + + * gcc.c-torture/compile/20031112-1.c: New test. + +2003-11-12 Mark Mitchell + + * g++.dg/parse/crash10.C: Remove bogus error marker. + +2003-11-12 Rainer Orth + + * ada/acats/run_acats (host_gnatmake): Use type in a /bin/sh script. + (host_gcc): Likewise. + (ROOT): Honor $PWDCMD. + (BASE): Likewise. + * ada/acats/run_all.sh (dir): Honor $PWDCMD. + +2003-11-12 Catherine Moore + + * gcc.c-torture/execute/20020720-1.x: Add xfail for frv-*-*. + +2003-11-12 Andreas Jaeger + Jakub Jelinek + Andrew Pinski + Richard Henderson + + * gcc.dg/c90-const-expr-2.c (foo): Avoid extra warning on 64-bit + systems. + * gcc.dg/c99-const-expr-2.c (foo): Likewise. + + * gcc.dg/20030926-1.c: Make it work on x86_64 systems. + * gcc.dg/i386-pentium4-not-mull.c: Likewise. + +2003-11-11 Andreas Jaeger + + * gcc.c-torture/execute/20020720-1.x: Test passes also on x86_64. + + * gcc.c-torture/execute/20020227-1.x: Test passes also on x86_64. + +2003-11-10 Arnaud Charlet + + * ada/acats/run_all.sh: Add handling of unsupported (tasking) tests. + Clean ups. + +2003-11-10 Waldek Hebisch + + * gcc.dg/trampoline-1.c: New test. + +2003-11-09 Andrew Pinski + + * gcc.c-torture/compile/200031109-1.c: New test. + +2003-11-08 Joseph S. Myers + + PR c/3190 + PR c/8714 + * gcc.dg/format/c90-strftime-1.c, gcc.dg/format/c90-strftime-2.c, + gcc.dg/format/c99-strftime-1.c, gcc.dg/format/ext3.c, + gcc.dg/format/no-y2k-1.c: Update. + +2003-11-08 Roger Sayle + + PR optimization/10467 + * gcc.dg/20031108-1.c: New test case. + +2003-11-07 Geoffrey Keating + + * gcc.dg/pch/warn-1.c: Allow for more helpful error message. + +2003-11-08 Joseph S. Myers + + * gcc.dg/compound-lvalue-1.c: New test. + * gcc.dg/c90-const-expr-2.c, gcc.dg/c99-const-expr-2.c: Remove + some XFAILs. + +2003-11-06 Geoffrey Keating + + * gcc.dg/altivec-varargs-1.c: New test. + +2003-11-05 Eric Botcazou + + * gcc.c-torture/compile/20031023-4.c: XFAIL on SPARC64 + * gcc.c-torture/compile/simd-5.c: XFAIL on SPARC64 at -O0 and -O1. + * gcc.c-torture/execute/simd-4.x: New file. XFAIL on SPARC at -O0. + * gcc.c-torture/execute/va-arg-25.x: New file. XFAIL on SPARC. + * gcc.dg/uninit-C.c: XFAIL on non 64-bit Solaris versions. + +2003-11-05 Joseph S. Myers + + * gcc.dg/cond-lvalue-1.c: New test. + +2003-11-05 Gernot Hillier + + * g++.old-deja/g++.pt/asm1.C: Enable for e.g. x86_64-*-linux-gnu. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/11616 + * g++.dg/template/instantiate5.C: New test. + +2003-11-03 Volker Reichelt + + PR c++/12726 + * g++.dg/ext/complit2.C: Replace test with self-contained version. + * ChangeLog: Add missing first entry for above test. + +2003-11-02 Kriang Lerdsuwanakij + + PR c++/9810 + * g++.dg/template/using8.C: New test. + * g++.old-deja/g++.other/access11.C: Adjust expected error location. + +2003-11-02 Roger Sayle + + PR optimization/10817 + * gcc.c-torture/compile/20031102-1.c: New test case. + +2003-11-02 Kazu Hirata + + * gcc.c-torture/execute/va-arg-25.c: Enable only if INT_MAX == + 2147483647. + +2003-11-02 Eric Botcazou + + * gcc.dg/20031102-1.c: New test. + +2003-11-02 Eric Botcazou + + * gcc.dg/complex-1.c: New test. + +2003-11-01 Kriang Lerdsuwanakij + + PR c++/12796 + * g++.dg/template/crash13.C: Adjust expected error location. + * g++.old-deja/g++.brendan/ns1.C: Likewise. + +2003-10-31 Richard Earnshaw + + * g++.dg/bprob/bprob.exp: Disable test on arm-elf configs. + +2003-10-31 Josef Zlomek + + PR/10239 + * gcc.c-torture/compile/20031031-2.c: New test. + +2003-10-31 Josef Zlomek + + PR/11640 + * gcc.c-torture/compile/20031031-1.c: New test. + +2003-10-31 Richard Earnshaw + + * g77.dg/bprob/bprob.exp: Disable test on arm-elf configs. + * gcc.misc-tests/bprob.exp: Likewise. + * g77.dg/execute/20001201.x, 6367.x, io0.x, io1.x, u77-test.x: XFAIL + the execution test on arm-elf configs. + * g77.dg/execute/10197.x: New file. XFAIL the execution test on + configs that don't support scratch files. + * g77.dg/execute/u77-test.x: XFAIL compilation on arm-elf configs. + +2003-10-30 Arnaud Charlet + + * ada/acats/run_all.sh: Do not print PASS messages to stdout, as + done by dejagnu. + +2003-10-29 Arnaud Charlet + + * ada/acats/run_all.sh: Redirect mv output to /dev/null + Avoid non pure sh syntax. Add more logging. + + * ada/acats/norun.lst: Disable cdd2a03, since it is expected to + fail. + +2003-10-28 Franz Sirl + + PR libgcj/10610 + * gcc.dg/ppc-stackalign-1.c: New test. + +2003-10-28 Arnaud Charlet + + * ada/acats/run_all.sh: Change output to be more compliant with + dejagnu framework. + Create acats.sum and acats.log files under testsuite/ada/acats + Only run [a-z]* directories, to filter out e.g. CVS. + Redirect build output to log file. + +2003-10-27 Arnaud Charlet + + * README.ada: Removed, integrated in ../doc/sourcebuild.texi + +2003-10-27 Arnaud Charlet + + PR ada/5909: + * README.ada, ada/acats: Import ACATS 2.5 for GCC Ada test suite. + +2003-10-27 Jakub Jelinek + + * gcc.c-torture/compile/20031023-1.c: New test. + * gcc.c-torture/compile/20031023-2.c: New test. + * gcc.c-torture/compile/20031023-3.c: New test. + * gcc.c-torture/compile/20031023-4.c: New test. + 2003-10-26 Kriang Lerdsuwanakij PR c++/10371 @@ -27,6 +1044,16 @@ * g++.dg/inherit/covariant10.C: New test. * g++.dg/inherit/covariant11.C: New test. +2003-10-23 Jason Merrill + + PR c++/12726 + * g++.dg/ext/complit2.C: New test. + +2003-10-20 Falk Hueffner + + PR target/12654 + * gcc.c-torture/execute/20031020-1.c: New test. + 2003-10-20 Zdenek Dvorak * gcc.dg/old-style-asm-1.c: Also check for (set (pc) on lines @@ -126,7 +1153,7 @@ objc.dg/try-catch-4.m: Run on non-Darwin targets. * objc.dg/zero-link-2.m: Remove blank line. * objc.dg/zero-link-3.m: New test case. - + 2003-10-13 Geoffrey Keating * g77.f-torture/execute/980520-1.x: XFAIL at -O0. @@ -220,10 +1247,10 @@ PR c++/10147 * g++.dg/other/error4.C: Update error messages. * g++.dg/template/ptrmem4.C: Likewise. - + PR c++/12337 * g++.dg/init/new9.C: New test. - + PR c++/12334, c++/12236, c++/8656 * g++.dg/ext/attrib8.C: New test. @@ -231,7 +1258,7 @@ * gcc.dg/debug/dwarf2-3.h: New test. * gcc.dg/debug/dwarf2-3.c: New test case for -feliminate-dwarf2-dups. - + 2003-10-06 Wolfgang Bangerth * g++.dg/opt/cfg2.C: New test. @@ -289,7 +1316,7 @@ 2003-09-29 Richard Henderson - * g++.dg/init/array10.C: Add dg-options. + * g++.dg/init/array10.C: Add dg-options. 2003-09-29 Eric Botcazou @@ -352,7 +1379,7 @@ objc.dg/method-{1-2}.m, objc.dg/proto-hier-1.m, objc.dg/proto-lossage-1.m: Adjust for message wording changes. * objc.dg/const-str-1.m: Fix constant string layout. - + 2003-09-24 Alexandre Oliva * gcc.dg/cpp/Wunknown-pragmas-1.c: New test. @@ -503,7 +1530,7 @@ 2003-09-09 Devang Patel * gcc.dg/darwin-ld-6.c: New test. - + 2003-09-09 Kaveh R. Ghazi * gcc.dg/torture/builtin-explog-1.c: New testcase. @@ -566,7 +1593,7 @@ PR c++/11507 * g++.dg/lookup/scoped7.C: New test. - + PR c++/9574 * g++.dg/other/static1.C: New test. @@ -575,10 +1602,10 @@ PR c++/11432 * g++.dg/template/crash10.C: New test. - + PR c++/2478 * g++.dg/overload/VLA.C: New test. - + PR c++/10804 * g++.dg/template/call1.C: New test. @@ -615,7 +1642,7 @@ 2003-09-05 Andrew Pinski - * g++.old-deja/g++.ext/pretty2.C: Update for change + * g++.old-deja/g++.ext/pretty2.C: Update for change in __FUNCTION__. * g++.old-deja/g++.ext/pretty3.C: Likewise. @@ -623,7 +1650,7 @@ PR c++/11922 * g++/dg/template/qualified-id1.C: New test. - + PR c++/12037 * g++.dg/warn/noeffect4.C: New test. @@ -632,7 +1659,7 @@ * g++.dg/ext/fnname1.C: New test. (__func__ for C++.) * g++.dg/ext/fnname2.C: Likewise. * g++.dg/ext/fnname3.C: Likewise. - + 2003-09-04 Mark Mitchell * g++.dg/expr/lval1.C: New test. @@ -652,7 +1679,7 @@ PR c++/11553 * g++.dg/parse/friend3.C: New test. - + 2003-09-02 Mark Mitchell PR c++/11847 @@ -961,7 +1988,7 @@ PR c++/11670 * g++.dg/expr/cast2.C: New test. - + PR c++/10530 * g++.dg/template/dependent-name2.C: New test. @@ -1026,7 +2053,7 @@ * gcc.dg/torture/builtin-math-1.c: New test taken from bits of gcc.dg/builtins-3.c, gcc.dg/builtins-5.c and also some additional cases. - + * gcc.dg/builtins-3.c, gcc.dg/builtins-4.c, gcc.dg/builtins-5.c: Delete. @@ -1091,7 +2118,7 @@ * gcc.dg/tls/opt-7.c: New test. 2003-07-31 Andrew Pinski - + * g++.old-deja/g++.other/crash18.C: Remove. 2003-07-31 Nathan Sidwell @@ -2463,7 +3490,7 @@ 2003-06-03 Glen Nakamura - * gcc.dg/20020525-1.c: Replace 0x5a5a5a5a with -1. + * gcc.dg/20020525-1.c: Replace 0x5a5a5a5a with -1. 2003-06-03 J"orn Rennecke @@ -5764,7 +6791,7 @@ 2002-10-21 Mark Mitchell - * g++.dg/init/array6.C: Add additional tests. + * g++.dg/init/array6.C: Add additional tests. 2002-10-21 Ulrich Weigand diff --git a/gcc/testsuite/g++.dg/abi/bitfield5.C b/gcc/testsuite/g++.dg/abi/bitfield5.C index eed76e649e6..e754f0ddf22 100644 --- a/gcc/testsuite/g++.dg/abi/bitfield5.C +++ b/gcc/testsuite/g++.dg/abi/bitfield5.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-Wabi" } +// { dg-options "-Wabi -fabi-version=1" } struct A { virtual void f(); diff --git a/gcc/testsuite/g++.dg/abi/bitfield7.C b/gcc/testsuite/g++.dg/abi/bitfield7.C index 9868cfce198..b5b656ffa47 100644 --- a/gcc/testsuite/g++.dg/abi/bitfield7.C +++ b/gcc/testsuite/g++.dg/abi/bitfield7.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-Wabi" } +// { dg-options "-Wabi -fabi-version=1" } union U { // { dg-warning "ABI" } int i: 4096; // { dg-warning "exceeds" } diff --git a/gcc/testsuite/g++.dg/abi/covariant2.C b/gcc/testsuite/g++.dg/abi/covariant2.C new file mode 100644 index 00000000000..87eb2a2708c --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/covariant2.C @@ -0,0 +1,32 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 12 Dec 2003 +// Origin: grigory@stl.sarov.ru + +// PR c++/12881. ICE in thunk generation + +struct c1 {}; + +struct c3 : virtual c1 +{ + virtual c1* f6() {}; + int i; +}; + +struct c6 : virtual c3 { }; + +struct c7 : c3 +{ + virtual c3* f6() {}; +}; + +struct c24 : virtual c7 +{ + virtual c6* f6(); +}; + +c6* c24::f6() { return 0; } + +struct c31 : c24 {}; + diff --git a/gcc/testsuite/g++.dg/abi/covariant3.C b/gcc/testsuite/g++.dg/abi/covariant3.C new file mode 100644 index 00000000000..178157c58b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/covariant3.C @@ -0,0 +1,85 @@ +// { dg-do run } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 12 Dec 2003 +// Origin: grigory@stl.sarov.ru + +// PR c++/13118. Missing covariant thunk. + +struct c0 {}; +struct c1 : virtual c0 { + virtual c0* f6(); +}; + +struct c5 { + virtual void foo(); +}; + +struct c10 : virtual c1 { + virtual void foo(); +}; + +struct c1a : c1 {}; // disambiguation + +struct c11 : virtual c10, c1a { + int i; + virtual c1* f6 () = 0; +}; + +struct c18 : c5, virtual c1 { + virtual void bar(); +}; + +struct c28 : virtual c0, virtual c11 { + virtual c18* f6(); +}; + +c0 *c1::f6 () {} +void c5::foo () {} +void c10::foo () {} +void c18::bar () {} + +c18 ret; + +c18 *c28::f6 () +{ + return &ret; +} + +bool check_c1 (c1 *ptr) +{ + c0 *r = ptr->f6 (); + return r != &ret; +} +bool check_c10 (c10 *ptr) +{ + c0 *r = ptr->f6 (); + return r != &ret; +} +bool check_c11 (c11 *ptr) +{ + c1 *r = ptr->f6 (); + return r != &ret; +} +bool check_c28 (c28 *ptr) +{ + c18 *r = ptr->f6 (); + return r != &ret; +} + +int main () +{ + c28 obj; + + if (check_c1 (static_cast (&obj))) + return 1; + if (check_c1 (static_cast (&obj))) + return 2; + if (check_c10 (&obj)) + return 3; + if (check_c11 (&obj)) + return 4; + if (check_c28 (&obj)) + return 5; + return 0; +} diff --git a/gcc/testsuite/g++.dg/abi/dtor2.C b/gcc/testsuite/g++.dg/abi/dtor2.C index f4a1336fefa..6b89cc8eae0 100644 --- a/gcc/testsuite/g++.dg/abi/dtor2.C +++ b/gcc/testsuite/g++.dg/abi/dtor2.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-Wabi" } +// { dg-options "-Wabi -fabi-version=1" } struct A { virtual void a (); diff --git a/gcc/testsuite/g++.dg/abi/macro0.C b/gcc/testsuite/g++.dg/abi/macro0.C new file mode 100644 index 00000000000..6c391e6891b --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/macro0.C @@ -0,0 +1,5 @@ +// { dg-options "-fabi-version=0" } + +#if __GXX_ABI_VERSION != 999999 +#error "Incorrect value of __GXX_ABI_VERSION" +#endif diff --git a/gcc/testsuite/g++.dg/abi/macro1.C b/gcc/testsuite/g++.dg/abi/macro1.C new file mode 100644 index 00000000000..871208da3ad --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/macro1.C @@ -0,0 +1,5 @@ +// { dg-options "-fabi-version=1" } + +#if __GXX_ABI_VERSION != 102 +#error "Incorrect value of __GXX_ABI_VERSION" +#endif diff --git a/gcc/testsuite/g++.dg/abi/macro2.C b/gcc/testsuite/g++.dg/abi/macro2.C new file mode 100644 index 00000000000..9f0af9cff34 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/macro2.C @@ -0,0 +1,5 @@ +// { dg-options "-fabi-version=2" } + +#if __GXX_ABI_VERSION != 1002 +#error "Incorrect value of __GXX_ABI_VERSION" +#endif diff --git a/gcc/testsuite/g++.dg/abi/mangle11.C b/gcc/testsuite/g++.dg/abi/mangle11.C index f7151171d30..a049a956671 100644 --- a/gcc/testsuite/g++.dg/abi/mangle11.C +++ b/gcc/testsuite/g++.dg/abi/mangle11.C @@ -1,4 +1,4 @@ -// { dg-options "-Wabi" } +// { dg-options "-Wabi -fabi-version=1" } template void f (typename Q::X) {} diff --git a/gcc/testsuite/g++.dg/abi/mangle12.C b/gcc/testsuite/g++.dg/abi/mangle12.C index 772b58b7a39..406a13b3f79 100644 --- a/gcc/testsuite/g++.dg/abi/mangle12.C +++ b/gcc/testsuite/g++.dg/abi/mangle12.C @@ -1,4 +1,4 @@ -// { dg-options "-Wabi" } +// { dg-options "-Wabi -fabi-version=1" } template